Skip to content

Commit

Permalink
fix: sepc definition
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Apr 29, 2024
1 parent e15ed52 commit 7f9beee
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion crates/interpreter/src/instructions/opcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ pub const fn spec_opcode_gas(spec_id: SpecId) -> &'static [OpInfo; 256] {
const TABLE: &[OpInfo;256] = &make_gas_table(SpecId::ECOTONE);
TABLE
}
#[cfg(feature = "optimism")]
#[cfg(feature = "opbnb")]
SpecId::FERMAT => {
const TABLE: &[OpInfo;256] = &make_gas_table(SpecId::FERMAT);
TABLE
Expand Down
2 changes: 1 addition & 1 deletion crates/precompile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ impl PrecompileSpecId {
BEDROCK | REGOLITH | CANYON => Self::BERLIN,
#[cfg(feature = "optimism")]
ECOTONE => Self::CANCUN,
#[cfg(feature = "optimism")]
#[cfg(feature = "opbnb")]
FERMAT => Self::FERMAT,
}
}
Expand Down
2 changes: 2 additions & 0 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,5 @@ optional_beneficiary_reward = []

# See comments in `revm-precompile`
c-kzg = ["dep:c-kzg", "dep:once_cell", "dep:derive_more"]

opbnb = []
18 changes: 10 additions & 8 deletions crates/primitives/src/specification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ pub enum SpecId {
MERGE = 15,
BEDROCK = 16,
REGOLITH = 17,
SHANGHAI = 18,
CANYON = 19,
CANCUN = 20,
ECOTONE = 21,
FERMAT = 22,
FERMAT = 18,
SHANGHAI = 19,
CANYON = 20,
CANCUN = 21,
ECOTONE = 22,
#[default]
LATEST = u8::MAX,
}
Expand Down Expand Up @@ -104,12 +104,12 @@ impl From<&str> for SpecId {
"Bedrock" => SpecId::BEDROCK,
#[cfg(feature = "optimism")]
"Regolith" => SpecId::REGOLITH,
#[cfg(feature = "opbnb")]
"Fermat" => SpecId::FERMAT,
#[cfg(feature = "optimism")]
"Canyon" => SpecId::CANYON,
#[cfg(feature = "optimism")]
"Ecotone" => SpecId::ECOTONE,
#[cfg(feature = "optimism")]
"Fermat" => SpecId::FERMAT,
_ => Self::LATEST,
}
}
Expand Down Expand Up @@ -140,6 +140,8 @@ impl From<SpecId> for &'static str {
SpecId::BEDROCK => "Bedrock",
#[cfg(feature = "optimism")]
SpecId::REGOLITH => "Regolith",
#[cfg(feature = "opbnb")]
SpecId::FERMAT => "Fermat",
#[cfg(feature = "optimism")]
SpecId::CANYON => "Canyon",
#[cfg(feature = "optimism")]
Expand Down Expand Up @@ -201,7 +203,7 @@ spec!(REGOLITH, RegolithSpec);
spec!(CANYON, CanyonSpec);
#[cfg(feature = "optimism")]
spec!(ECOTONE, EcotoneSpec);
#[cfg(feature = "optimism")]
#[cfg(feature = "opbnb")]
spec!(FERMAT, FermatSpec);

#[macro_export]
Expand Down
2 changes: 2 additions & 0 deletions crates/revm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ optional_beneficiary_reward = ["revm-interpreter/optional_beneficiary_reward"]
secp256k1 = ["revm-precompile/secp256k1"]
c-kzg = ["revm-precompile/c-kzg"]

opbnb = ["revm-interpreter/opbnb", "revm-precompile/opbnb"]

[[example]]
name = "fork_ref_transact"
path = "../../examples/fork_ref_transact.rs"
Expand Down

0 comments on commit 7f9beee

Please sign in to comment.