Skip to content

Commit

Permalink
feat: add isthmus spec (bluealloy#1938)
Browse files Browse the repository at this point in the history
  • Loading branch information
leruaa authored Dec 23, 2024
1 parent 2ebed31 commit 237bb1c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 6 additions & 1 deletion crates/optimism/src/handler/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 9 additions & 1 deletion crates/optimism/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ pub enum OpSpecId {
ECOTONE,
FJORD,
GRANITE,
HOLOCENE,
ISTHMUS,
}

impl OpSpecId {
Expand All @@ -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
}
}
}

Expand Down Expand Up @@ -73,6 +77,8 @@ impl From<OpSpecId> for &'static str {
OpSpecId::ECOTONE => name::ECOTONE,
OpSpecId::FJORD => name::FJORD,
OpSpecId::GRANITE => name::GRANITE,
OpSpecId::HOLOCENE => name::HOLOCENE,
OpSpecId::ISTHMUS => name::ISTHMUS,
}
}
}
Expand All @@ -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 {
Expand Down

0 comments on commit 237bb1c

Please sign in to comment.