chore: use cache to determine hardfork (#6989)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
yjh
2024-03-06 19:54:20 +08:00
committed by GitHub
parent 00f97f34ad
commit f5be92573c
5 changed files with 14 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
//! This contains the [EngineTypes] trait and implementations for ethereum mainnet types.
use core::fmt;
use reth_primitives::{ChainSpec, Hardfork};
use reth_primitives::ChainSpec;
/// Contains traits to abstract over payload attributes types and default implementations of the
/// [PayloadAttributes] trait for ethereum mainnet and optimism types.
@@ -119,7 +119,7 @@ pub fn validate_withdrawals_presence(
timestamp: u64,
has_withdrawals: bool,
) -> Result<(), AttributesValidationError> {
let is_shanghai = chain_spec.fork(Hardfork::Shanghai).active_at_timestamp(timestamp);
let is_shanghai = chain_spec.is_shanghai_active_at_timestamp(timestamp);
match version {
EngineApiMessageVersion::V1 => {