Skip to content

Commit

Permalink
fix specs and conditional op/taiko flags, todo: taiko handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
CeciliaZ030 committed Jan 18, 2024
1 parent 3ec69ee commit 72a085e
Show file tree
Hide file tree
Showing 12 changed files with 103 additions and 586 deletions.
2 changes: 1 addition & 1 deletion crates/interpreter/src/instruction_result.rs
Expand Up @@ -87,7 +87,7 @@ impl From<HaltReason> for InstructionResult {
HaltReason::CallNotAllowedInsideStatic => Self::CallNotAllowedInsideStatic,
HaltReason::OutOfFunds => Self::OutOfFunds,
HaltReason::CallTooDeep => Self::CallTooDeep,
#[cfg(feature = "optimism")]
#[cfg(all(feature = "optimism", not(feature = "taiko")))]
HaltReason::FailedDeposit => Self::FatalExternalError,
}
}
Expand Down
11 changes: 8 additions & 3 deletions crates/interpreter/src/instructions/opcode.rs
Expand Up @@ -857,21 +857,26 @@ pub const fn spec_opcode_gas(spec_id: SpecId) -> &'static [OpInfo; 256] {
TABLE
}
)*
#[cfg(feature = "optimism")]
#[cfg(all(feature = "optimism", not(feature = "taiko")))]
SpecId::BEDROCK => {
const TABLE: &[OpInfo;256] = &make_gas_table(SpecId::BEDROCK);
TABLE
}
#[cfg(feature = "optimism")]
#[cfg(all(feature = "optimism", not(feature = "taiko")))]
SpecId::REGOLITH => {
const TABLE: &[OpInfo;256] = &make_gas_table(SpecId::REGOLITH);
TABLE
}
#[cfg(feature = "optimism")]
#[cfg(all(feature = "optimism", not(feature = "taiko")))]
SpecId::CANYON => {
const TABLE: &[OpInfo;256] = &make_gas_table(SpecId::CANYON);
TABLE
}
#[cfg(all(feature = "taiko", not(feature = "optimism")))]
SpecId::KATLA => {
const TABLE: &[OpInfo;256] = &make_gas_table(SpecId::KATLA);
TABLE
}
}
};
}
Expand Down
4 changes: 3 additions & 1 deletion crates/precompile/src/lib.rs
Expand Up @@ -256,8 +256,10 @@ impl PrecompileSpecId {
BERLIN | LONDON | ARROW_GLACIER | GRAY_GLACIER | MERGE | SHANGHAI => Self::BERLIN,
CANCUN => Self::CANCUN,
LATEST => Self::LATEST,
#[cfg(feature = "optimism")]
#[cfg(all(feature = "optimism", not(feature = "taiko")))]
BEDROCK | REGOLITH | CANYON => Self::BERLIN,
#[cfg(all(feature = "taiko", not(feature = "optimism")))]
KATLA => Self::BERLIN, // TODO(Cecilia): what is this?
}
}
}
Expand Down

0 comments on commit 72a085e

Please sign in to comment.