primitive-traits: use alloy INITIAL_BASE_FEE constant (#12022)

This commit is contained in:
Thomas Coratger
2024-10-24 11:53:15 +02:00
committed by GitHub
parent 0df3148357
commit 84a30b0404
8 changed files with 16 additions and 18 deletions

View File

@ -3,7 +3,7 @@ pub use alloy_eips::eip1559::BaseFeeParams;
use alloc::{boxed::Box, sync::Arc, vec::Vec};
use alloy_chains::{Chain, NamedChain};
use alloy_consensus::constants::EMPTY_WITHDRAWALS;
use alloy_eips::eip7685::EMPTY_REQUESTS_HASH;
use alloy_eips::{eip1559::INITIAL_BASE_FEE, eip7685::EMPTY_REQUESTS_HASH};
use alloy_genesis::Genesis;
use alloy_primitives::{address, b256, Address, BlockNumber, B256, U256};
use derive_more::From;
@ -19,7 +19,7 @@ use reth_network_peers::{
sepolia_nodes, NodeRecord,
};
use reth_primitives_traits::{
constants::{EIP1559_INITIAL_BASE_FEE, HOLESKY_GENESIS_HASH, SEPOLIA_GENESIS_HASH},
constants::{HOLESKY_GENESIS_HASH, SEPOLIA_GENESIS_HASH},
Header, SealedHeader,
};
use reth_trie_common::root::state_root_ref_unhashed;
@ -314,7 +314,7 @@ impl ChainSpec {
pub fn initial_base_fee(&self) -> Option<u64> {
// If the base fee is set in the genesis block, we use that instead of the default.
let genesis_base_fee =
self.genesis.base_fee_per_gas.map(|fee| fee as u64).unwrap_or(EIP1559_INITIAL_BASE_FEE);
self.genesis.base_fee_per_gas.map(|fee| fee as u64).unwrap_or(INITIAL_BASE_FEE);
// If London is activated at genesis, we set the initial base fee as per EIP-1559.
self.hardforks.fork(EthereumHardfork::London).active_at_block(0).then_some(genesis_base_fee)