diff --git a/bins/revme/src/cmd.rs b/bins/revme/src/cmd.rs index cd26d9bca0..d550ae84de 100644 --- a/bins/revme/src/cmd.rs +++ b/bins/revme/src/cmd.rs @@ -40,17 +40,16 @@ pub enum Error { impl MainCmd { pub fn run(&self) -> Result<(), Error> { match self { - Self::Statetest(cmd) => cmd.run().map_err(Into::into), - Self::EofValidation(cmd) => cmd.run().map_err(Into::into), - Self::Evm(cmd) => cmd.run().map_err(Into::into), + Self::Statetest(cmd) => cmd.run()?, + Self::EofValidation(cmd) => cmd.run()?, + Self::Evm(cmd) => cmd.run()?, Self::Bytecode(cmd) => { cmd.run(); - Ok(()) } Self::Bench(cmd) => { cmd.run(); - Ok(()) } } + Ok(()) } } diff --git a/bins/revme/src/cmd/statetest/runner.rs b/bins/revme/src/cmd/statetest/runner.rs index a688488506..1005133875 100644 --- a/bins/revme/src/cmd/statetest/runner.rs +++ b/bins/revme/src/cmd/statetest/runner.rs @@ -388,7 +388,7 @@ pub fn execute_test_suite( access_list .iter() .map(|item| (item.address, item.storage_keys.clone())) - .collect::>() + .collect() }) .unwrap_or_default(); diff --git a/crates/optimism/src/handler/precompiles.rs b/crates/optimism/src/handler/precompiles.rs index c85baacb32..552b5e9d23 100644 --- a/crates/optimism/src/handler/precompiles.rs +++ b/crates/optimism/src/handler/precompiles.rs @@ -35,7 +35,6 @@ impl OpPrecompileProvider { #[inline] pub fn new_with_spec(spec: OpSpec) -> Self { match spec { - // No changes spec @ (OpSpec::Eth( SpecId::FRONTIER | SpecId::FRONTIER_THAWING @@ -57,16 +56,12 @@ impl OpPrecompileProvider { | SpecId::CANCUN, ) | OpSpec::Op( - OpSpecId::BEDROCK - | OpSpecId::REGOLITH - | OpSpecId::CANYON - | OpSpecId::ECOTONE - | OpSpecId::HOLOCENE - | OpSpecId::ISTHMUS, + OpSpecId::BEDROCK | OpSpecId::REGOLITH | OpSpecId::CANYON | OpSpecId::ECOTONE, )) => Self::new(Precompiles::new(spec.into_eth_spec().into())), OpSpec::Op(OpSpecId::FJORD) => Self::new(fjord()), - OpSpec::Op(OpSpecId::GRANITE) - | OpSpec::Eth(SpecId::PRAGUE | SpecId::OSAKA | SpecId::LATEST) => Self::new(granite()), + OpSpec::Op(OpSpecId::GRANITE | OpSpecId::HOLOCENE) => Self::new(granite()), + OpSpec::Op(OpSpecId::ISTHMUS) + | OpSpec::Eth(SpecId::PRAGUE | SpecId::OSAKA | SpecId::LATEST) => Self::new(isthumus()), } } } @@ -93,6 +88,23 @@ pub fn granite() -> &'static Precompiles { }) } +/// Returns precompiles for isthumus spec. +pub fn isthumus() -> &'static Precompiles { + static INSTANCE: OnceBox = OnceBox::new(); + INSTANCE.get_or_init(|| { + let precompiles = granite().clone(); + // Prague bls12 precompiles + // Don't include BLS12-381 precompiles in no_std builds. + #[cfg(feature = "blst")] + let precompiles = { + let mut precompiles = precompiles; + precompiles.extend(precompile::bls12_381::precompiles()); + precompiles + }; + Box::new(precompiles) + }) +} + impl PrecompileProvider for OpPrecompileProvider where CTX: ContextTrait>, diff --git a/crates/optimism/src/spec.rs b/crates/optimism/src/spec.rs index 38e4079c87..8658ca7eb0 100644 --- a/crates/optimism/src/spec.rs +++ b/crates/optimism/src/spec.rs @@ -29,9 +29,8 @@ impl OpSpecId { match self { Self::BEDROCK | Self::REGOLITH => SpecId::MERGE, Self::CANYON => SpecId::SHANGHAI, - Self::ECOTONE | Self::FJORD | Self::GRANITE | Self::HOLOCENE | Self::ISTHMUS => { - SpecId::CANCUN - } + Self::ECOTONE | Self::FJORD | Self::GRANITE | Self::HOLOCENE => SpecId::CANCUN, + Self::ISTHMUS => SpecId::PRAGUE, } }