From 237bb1cbd60014edab2fe55ca69f34a3cbc248eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien?= <3535019+leruaa@users.noreply.github.com> Date: Mon, 23 Dec 2024 01:32:52 -0800 Subject: [PATCH] feat: add isthmus spec (#1938) --- crates/optimism/src/handler/precompiles.rs | 7 ++++++- crates/optimism/src/spec.rs | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/crates/optimism/src/handler/precompiles.rs b/crates/optimism/src/handler/precompiles.rs index 576f2a9449..f0a81a4c54 100644 --- a/crates/optimism/src/handler/precompiles.rs +++ b/crates/optimism/src/handler/precompiles.rs @@ -87,7 +87,12 @@ where | SpecId::CANCUN, ) | OpSpec::Op( - OpSpecId::BEDROCK | OpSpecId::REGOLITH | OpSpecId::CANYON | OpSpecId::ECOTONE, + OpSpecId::BEDROCK + | OpSpecId::REGOLITH + | OpSpecId::CANYON + | OpSpecId::ECOTONE + | OpSpecId::HOLOCENE + | OpSpecId::ISTHMUS, )) => Self::new(Precompiles::new(spec.into_eth_spec().into())), OpSpec::Op(OpSpecId::FJORD) => Self::new(fjord()), OpSpec::Op(OpSpecId::GRANITE) diff --git a/crates/optimism/src/spec.rs b/crates/optimism/src/spec.rs index 77e7a6ad8c..98c1e64851 100644 --- a/crates/optimism/src/spec.rs +++ b/crates/optimism/src/spec.rs @@ -19,6 +19,8 @@ pub enum OpSpecId { ECOTONE, FJORD, GRANITE, + HOLOCENE, + ISTHMUS, } impl OpSpecId { @@ -27,7 +29,9 @@ impl OpSpecId { match self { Self::BEDROCK | Self::REGOLITH => SpecId::MERGE, Self::CANYON => SpecId::SHANGHAI, - Self::ECOTONE | Self::FJORD | Self::GRANITE => SpecId::CANCUN, + Self::ECOTONE | Self::FJORD | Self::GRANITE | Self::HOLOCENE | Self::ISTHMUS => { + SpecId::CANCUN + } } } @@ -73,6 +77,8 @@ impl From for &'static str { OpSpecId::ECOTONE => name::ECOTONE, OpSpecId::FJORD => name::FJORD, OpSpecId::GRANITE => name::GRANITE, + OpSpecId::HOLOCENE => name::HOLOCENE, + OpSpecId::ISTHMUS => name::ISTHMUS, } } } @@ -85,6 +91,8 @@ pub mod name { pub const ECOTONE: &str = "Ecotone"; pub const FJORD: &str = "Fjord"; pub const GRANITE: &str = "Granite"; + pub const HOLOCENE: &str = "Holocene"; + pub const ISTHMUS: &str = "Isthmus"; } impl OpSpec {