Skip to content

Commit

Permalink
chore: replace base fee constants with native const (#9437)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jul 11, 2024
1 parent 805673c commit f29fefb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ pub(crate) const MAINNET_DEPOSIT_CONTRACT: DepositContract = DepositContract::ne
11052984,
b256!("649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5"),
);

#[cfg(feature = "optimism")]
pub(crate) mod optimism;
46 changes: 0 additions & 46 deletions crates/chainspec/src/constants/optimism.rs

This file was deleted.

21 changes: 8 additions & 13 deletions crates/chainspec/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ use reth_trie_common::root::state_root_ref_unhashed;
#[cfg(feature = "std")]
use std::sync::Arc;

#[cfg(feature = "optimism")]
use crate::constants::optimism::{
BASE_SEPOLIA_BASE_FEE_PARAMS, BASE_SEPOLIA_CANYON_BASE_FEE_PARAMS, OP_BASE_FEE_PARAMS,
OP_CANYON_BASE_FEE_PARAMS, OP_SEPOLIA_BASE_FEE_PARAMS, OP_SEPOLIA_CANYON_BASE_FEE_PARAMS,
};
pub use alloy_eips::eip1559::BaseFeeParams;
#[cfg(feature = "optimism")]
use reth_ethereum_forks::OptimismHardfork;
Expand Down Expand Up @@ -138,8 +133,8 @@ pub static OP_MAINNET: Lazy<Arc<ChainSpec>> = Lazy::new(|| {
hardforks: OptimismHardfork::op_mainnet(),
base_fee_params: BaseFeeParamsKind::Variable(
vec![
(EthereumHardfork::London.boxed(), OP_BASE_FEE_PARAMS),
(OptimismHardfork::Canyon.boxed(), OP_CANYON_BASE_FEE_PARAMS),
(EthereumHardfork::London.boxed(), BaseFeeParams::optimism()),
(OptimismHardfork::Canyon.boxed(), BaseFeeParams::optimism_canyon()),
]
.into(),
),
Expand All @@ -163,8 +158,8 @@ pub static OP_SEPOLIA: Lazy<Arc<ChainSpec>> = Lazy::new(|| {
hardforks: OptimismHardfork::op_sepolia(),
base_fee_params: BaseFeeParamsKind::Variable(
vec![
(EthereumHardfork::London.boxed(), OP_SEPOLIA_BASE_FEE_PARAMS),
(OptimismHardfork::Canyon.boxed(), OP_SEPOLIA_CANYON_BASE_FEE_PARAMS),
(EthereumHardfork::London.boxed(), BaseFeeParams::optimism_sepolia()),
(OptimismHardfork::Canyon.boxed(), BaseFeeParams::optimism_sepolia_canyon()),
]
.into(),
),
Expand All @@ -188,8 +183,8 @@ pub static BASE_SEPOLIA: Lazy<Arc<ChainSpec>> = Lazy::new(|| {
hardforks: OptimismHardfork::base_sepolia(),
base_fee_params: BaseFeeParamsKind::Variable(
vec![
(EthereumHardfork::London.boxed(), BASE_SEPOLIA_BASE_FEE_PARAMS),
(OptimismHardfork::Canyon.boxed(), BASE_SEPOLIA_CANYON_BASE_FEE_PARAMS),
(EthereumHardfork::London.boxed(), BaseFeeParams::base_sepolia()),
(OptimismHardfork::Canyon.boxed(), BaseFeeParams::base_sepolia_canyon()),
]
.into(),
),
Expand All @@ -213,8 +208,8 @@ pub static BASE_MAINNET: Lazy<Arc<ChainSpec>> = Lazy::new(|| {
hardforks: OptimismHardfork::base_mainnet(),
base_fee_params: BaseFeeParamsKind::Variable(
vec![
(EthereumHardfork::London.boxed(), OP_BASE_FEE_PARAMS),
(OptimismHardfork::Canyon.boxed(), OP_CANYON_BASE_FEE_PARAMS),
(EthereumHardfork::London.boxed(), BaseFeeParams::optimism()),
(OptimismHardfork::Canyon.boxed(), BaseFeeParams::optimism()),
]
.into(),
),
Expand Down

0 comments on commit f29fefb

Please sign in to comment.