feat: use new ChainHardforks type on ChainSpec (#9065)

This commit is contained in:
joshieDo
2024-06-27 19:39:35 +02:00
committed by GitHub
parent c23fe39dd3
commit 50ee497c75
57 changed files with 1708 additions and 1465 deletions

View File

@ -8,7 +8,7 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
use reth_chainspec::{Chain, ChainSpec, Hardfork};
use reth_chainspec::{Chain, ChainSpec, EthereumHardfork, EthereumHardforks};
use reth_consensus::{Consensus, ConsensusError, PostExecutionInput};
use reth_consensus_common::validation::{
validate_4844_header_standalone, validate_against_parent_4844,
@ -51,7 +51,7 @@ impl EthBeaconConsensus {
) -> Result<(), ConsensusError> {
// Determine the parent gas limit, considering elasticity multiplier on the London fork.
let parent_gas_limit =
if self.chain_spec.fork(Hardfork::London).transitions_at_block(header.number) {
if self.chain_spec.fork(EthereumHardfork::London).transitions_at_block(header.number) {
parent.gas_limit *
self.chain_spec
.base_fee_params_at_timestamp(header.timestamp)
@ -153,7 +153,7 @@ impl Consensus for EthBeaconConsensus {
) -> Result<(), ConsensusError> {
let is_post_merge = self
.chain_spec
.fork(Hardfork::Paris)
.fork(EthereumHardfork::Paris)
.active_at_ttd(total_difficulty, header.difficulty);
if is_post_merge {

View File

@ -1,4 +1,4 @@
use reth_chainspec::ChainSpec;
use reth_chainspec::{ChainSpec, EthereumHardforks};
use reth_consensus::ConsensusError;
use reth_primitives::{
gas_spent_by_transactions, BlockWithSenders, Bloom, GotExpected, Receipt, Request, B256,