Skip to main content

ExecutionSpec

Trait ExecutionSpec 

pub trait ExecutionSpec: FromEvmVersion {
    // Required methods
    fn evm_version_name(&self) -> String;
    fn from_foundry_hardfork(hardfork: FoundryHardfork) -> Option<Self>;

    // Provided methods
    fn from_network_hardfork(_: &str) -> Option<Self> { ... }
    fn historical_hardfork(
        chain_id: u64,
        timestamp: u64,
    ) -> Option<FoundryHardfork> { ... }
    fn fork_hardfork(
        chain_id: u64,
        timestamp: u64,
        endpoint_hardfork: Option<FoundryHardfork>,
    ) -> Option<FoundryHardfork> { ... }
    fn reported_hardfork(self) -> Option<FoundryHardfork> { ... }
}
Expand description

Conversion, hardfork scheduling, and trace metadata for a concrete execution spec.

Required Methods§

Provided Methods§

fn from_network_hardfork(_: &str) -> Option<Self>

fn historical_hardfork(chain_id: u64, timestamp: u64) -> Option<FoundryHardfork>

Returns this family’s hardfork at a historical source-chain timestamp. Unknown source chains return None; this never discovers another execution family.

fn fork_hardfork( chain_id: u64, timestamp: u64, endpoint_hardfork: Option<FoundryHardfork>, ) -> Option<FoundryHardfork>

Resolves a local fork’s hardfork from compatible endpoint metadata or its source schedule. Ethereum overrides this to retain the configured EVM version for local forks.

fn reported_hardfork(self) -> Option<FoundryHardfork>

Returns exact metadata for a directly selected spec, when the family requires it. Ethereum and Optimism retain their existing absence of metadata for direct spec overrides.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl ExecutionSpec for OpSpecId

Available on crate feature optimism only.
§

fn evm_version_name(&self) -> String

§

fn from_network_hardfork(hardfork: &str) -> Option<OpSpecId>

§

fn from_foundry_hardfork(hardfork: FoundryHardfork) -> Option<OpSpecId>

§

fn fork_hardfork( chain_id: u64, timestamp: u64, endpoint_hardfork: Option<FoundryHardfork>, ) -> Option<FoundryHardfork>

§

fn historical_hardfork(chain_id: u64, timestamp: u64) -> Option<FoundryHardfork>

§

impl ExecutionSpec for SpecId

§

fn evm_version_name(&self) -> String

§

fn from_network_hardfork(hardfork: &str) -> Option<SpecId>

§

fn from_foundry_hardfork(hardfork: FoundryHardfork) -> Option<SpecId>

§

fn fork_hardfork( _chain_id: u64, _timestamp: u64, _endpoint_hardfork: Option<FoundryHardfork>, ) -> Option<FoundryHardfork>

Implementors§

§

impl ExecutionSpec for BaseSpecId

Available on crate feature base only.
§

impl ExecutionSpec for MonadHardfork

Available on crate feature monad only.
§

impl ExecutionSpec for TempoHardfork