diff --git a/crates/precompile/src/lib.rs b/crates/precompile/src/lib.rs index 7da8d2d162..d5f5d54267 100644 --- a/crates/precompile/src/lib.rs +++ b/crates/precompile/src/lib.rs @@ -359,7 +359,7 @@ impl PrecompileSpecId { #[cfg(feature = "scroll")] PRE_BERNOULLI => Self::PRE_BERNOULLI, #[cfg(feature = "scroll")] - BERNOULLI | CURIE | EUCLID_V1 => Self::BERNOULLI, + BERNOULLI | CURIE => Self::BERNOULLI, #[cfg(feature = "scroll")] EUCLID_V2 => Self::EUCLID_V2, #[cfg(feature = "optimism")] diff --git a/crates/primitives/src/specification.rs b/crates/primitives/src/specification.rs index ddc50a6312..c3e7aed042 100644 --- a/crates/primitives/src/specification.rs +++ b/crates/primitives/src/specification.rs @@ -112,13 +112,13 @@ pub enum SpecId { /// Although the Curie update include new opcodes in Cancun, the most important change /// `EIP-4844` is not included. So we sort it before Cancun. CURIE = 19, - /// EuclidV1 does not change the EVM behavior. - EUCLID_V1 = 20, /// EuclidV2 - EUCLID_V2 = 21, - CANCUN = 22, - PRAGUE = 23, - OSAKA = 24, + /// + /// Note: EuclidV1 does not change the EVM behavior. + EUCLID_V2 = 20, + CANCUN = 21, + PRAGUE = 22, + OSAKA = 23, #[default] LATEST = u8::MAX, } @@ -185,8 +185,6 @@ impl From<&str> for SpecId { #[cfg(feature = "scroll")] "Curie" => SpecId::CURIE, #[cfg(feature = "scroll")] - "EuclidV1" => SpecId::EUCLID_V1, - #[cfg(feature = "scroll")] "EuclidV2" => SpecId::EUCLID_V2, _ => Self::LATEST, } @@ -239,8 +237,6 @@ impl From for &'static str { #[cfg(feature = "scroll")] SpecId::CURIE => "Curie", #[cfg(feature = "scroll")] - SpecId::EUCLID_V1 => "EuclidV1", - #[cfg(feature = "scroll")] SpecId::EUCLID_V2 => "EuclidV2", SpecId::LATEST => "Latest", } @@ -318,8 +314,6 @@ spec!(BERNOULLI, BernoulliSpec); #[cfg(feature = "scroll")] spec!(CURIE, CurieSpec); #[cfg(feature = "scroll")] -spec!(EUCLID_V1, EuclidV1Spec); -#[cfg(feature = "scroll")] spec!(EUCLID_V2, EuclidV2Spec); #[cfg(not(any(feature = "optimism", feature = "scroll")))] @@ -577,11 +571,6 @@ macro_rules! spec_to_generic { $e } #[cfg(feature = "scroll")] - $crate::SpecId::EUCLID_V1 => { - use $crate::EuclidV1Spec as SPEC; - $e - } - #[cfg(feature = "scroll")] $crate::SpecId::EUCLID_V2 => { use $crate::EuclidV2Spec as SPEC; $e @@ -628,8 +617,6 @@ mod tests { #[cfg(feature = "scroll")] spec_to_generic!(CURIE, assert_eq!(SPEC::SPEC_ID, CURIE)); #[cfg(feature = "scroll")] - spec_to_generic!(EUCLID_V1, assert_eq!(SPEC::SPEC_ID, EUCLID_V1)); - #[cfg(feature = "scroll")] spec_to_generic!(EUCLID_V2, assert_eq!(SPEC::SPEC_ID, EUCLID_V2)); spec_to_generic!(CANCUN, assert_eq!(SPEC::SPEC_ID, CANCUN)); #[cfg(feature = "optimism")] @@ -827,7 +814,6 @@ mod scroll_tests { assert!(PreBernoulliSpec::enabled(SpecId::SHANGHAI)); assert!(!PreBernoulliSpec::enabled(SpecId::BERNOULLI)); assert!(!PreBernoulliSpec::enabled(SpecId::CURIE)); - assert!(!PreBernoulliSpec::enabled(SpecId::EUCLID_V1)); assert!(!PreBernoulliSpec::enabled(SpecId::EUCLID_V2)); assert!(!PreBernoulliSpec::enabled(SpecId::CANCUN)); assert!(!PreBernoulliSpec::enabled(SpecId::LATEST)); @@ -839,7 +825,6 @@ mod scroll_tests { assert!(BernoulliSpec::enabled(SpecId::SHANGHAI)); assert!(BernoulliSpec::enabled(SpecId::PRE_BERNOULLI)); assert!(!BernoulliSpec::enabled(SpecId::CURIE)); - assert!(!BernoulliSpec::enabled(SpecId::EUCLID_V1)); assert!(!BernoulliSpec::enabled(SpecId::EUCLID_V2)); assert!(!BernoulliSpec::enabled(SpecId::CANCUN)); assert!(!BernoulliSpec::enabled(SpecId::LATEST)); @@ -851,24 +836,11 @@ mod scroll_tests { assert!(CurieSpec::enabled(SpecId::SHANGHAI)); assert!(CurieSpec::enabled(SpecId::PRE_BERNOULLI)); assert!(CurieSpec::enabled(SpecId::BERNOULLI)); - assert!(!CurieSpec::enabled(SpecId::EUCLID_V1)); assert!(!CurieSpec::enabled(SpecId::EUCLID_V2)); assert!(!CurieSpec::enabled(SpecId::CANCUN)); assert!(!CurieSpec::enabled(SpecId::LATEST)); } - #[test] - fn test_euclid_v1_post_merge_hardforks() { - assert!(EuclidV1Spec::enabled(SpecId::MERGE)); - assert!(EuclidV1Spec::enabled(SpecId::SHANGHAI)); - assert!(EuclidV1Spec::enabled(SpecId::PRE_BERNOULLI)); - assert!(EuclidV1Spec::enabled(SpecId::BERNOULLI)); - assert!(EuclidV1Spec::enabled(SpecId::CURIE)); - assert!(!EuclidV1Spec::enabled(SpecId::EUCLID_V2)); - assert!(!EuclidV1Spec::enabled(SpecId::CANCUN)); - assert!(!EuclidV1Spec::enabled(SpecId::LATEST)); - } - #[test] fn test_euclid_v2_post_merge_hardforks() { assert!(EuclidV2Spec::enabled(SpecId::MERGE)); @@ -876,7 +848,6 @@ mod scroll_tests { assert!(EuclidV2Spec::enabled(SpecId::PRE_BERNOULLI)); assert!(EuclidV2Spec::enabled(SpecId::BERNOULLI)); assert!(EuclidV2Spec::enabled(SpecId::CURIE)); - assert!(EuclidV2Spec::enabled(SpecId::EUCLID_V1)); assert!(!EuclidV2Spec::enabled(SpecId::CANCUN)); assert!(!EuclidV2Spec::enabled(SpecId::LATEST)); } diff --git a/crates/revm/src/handler/mainnet/pre_execution.rs b/crates/revm/src/handler/mainnet/pre_execution.rs index 0805ea547e..d04ae8b619 100644 --- a/crates/revm/src/handler/mainnet/pre_execution.rs +++ b/crates/revm/src/handler/mainnet/pre_execution.rs @@ -12,7 +12,6 @@ use crate::{ }, Context, ContextPrecompiles, }; -use revm_precompile::primitives::SpecId; /// Main precompile load #[inline] @@ -109,7 +108,7 @@ pub fn apply_eip7702_auth_list( return Ok(0); } #[cfg(feature = "scroll")] - if !SPEC::enabled(SpecId::EUCLID_V2) { + if !SPEC::enabled(crate::primitives::SpecId::EUCLID_V2) { return Ok(0); }