-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Describe the feature
This currently requires additional trait bounds
reth/crates/ethereum/evm/src/config.rs
Lines 15 to 23 in 001fb92
/// Map the latest active hardfork at the given timestamp or block number to a revm [`SpecId`]. | |
pub fn revm_spec_by_timestamp_and_block_number<C>( | |
chain_spec: &C, | |
timestamp: u64, | |
block_number: u64, | |
) -> SpecId | |
where | |
C: EthereumHardforks + EthChainSpec + Hardforks, | |
{ |
just for the panic fallback
reth/crates/ethereum/evm/src/config.rs
Lines 92 to 95 in 001fb92
panic!( | |
"invalid hardfork chainspec: expected at least one hardfork, got {}", | |
chain_spec.display_hardforks() | |
) |
we can expect that at least the frontier spec is active, we assume something similar for the op variant:
reth/crates/optimism/evm/src/config.rs
Lines 54 to 56 in 001fb92
} else { | |
OpSpecId::BEDROCK | |
} |
so we can simplify this by just using EthereumHardforks
trait for this
TODO
- remove
EthChainSpec + Hardforks
- adjust
.fork().active
calls with the dedicatedis_<osaka|..>active_at<timestamp|block>
calls or
fn is_ethereum_fork_active_at_block(&self, fork: EthereumHardfork, block_number: u64) -> bool {
self.ethereum_fork_activation(fork).active_at_block(block_number)
}
We're missing some functions so we can add those to https://github.com/alloy-rs/hardforks/blob/cf2cdc868fd9e22eb15840e5c2cfa54ca4727040/crates/hardforks/src/hardfork/ethereum.rs#L605
- remove panic
reth/crates/ethereum/evm/src/config.rs
Lines 92 to 95 in 001fb92
panic!( "invalid hardfork chainspec: expected at least one hardfork, got {}", chain_spec.display_hardforks() )
Additional context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status