Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(op-isthmus): missing granite precompiles and disable eof #2065

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/primitives/src/specification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ pub enum SpecId {
GRANITE = 23,
HOLOCENE = 24,
PRAGUE = 25,
OSAKA = 26,
ISTHMUS = 27,
ISTHMUS = 26,
OSAKA = 27,
#[default]
LATEST = u8::MAX,
}
Expand Down
16 changes: 6 additions & 10 deletions crates/revm/src/optimism/handler_register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,25 +355,21 @@ pub fn deduct_caller<SPEC: Spec, EXT, DB: Database>(
));
};

let tx_l1_cost = context
let l1_block = context
.evm
.inner
.l1_block_info
.as_mut()
.expect("L1BlockInfo should be loaded")
.calculate_tx_l1_cost(enveloped_tx, SPEC::SPEC_ID);
.expect("L1BlockInfo should be loaded");

let tx_l1_cost = l1_block.calculate_tx_l1_cost(enveloped_tx, SPEC::SPEC_ID);
caller_account.info.balance = caller_account.info.balance.saturating_sub(tx_l1_cost);

// Deduct the operator fee from the caller's account.
let gas_limit = U256::from(context.evm.inner.env.tx.gas_limit);

let operator_fee_charge = context
.evm
.inner
.l1_block_info
.as_ref()
.expect("L1BlockInfo should be loaded")
.operator_fee_charge(enveloped_tx, gas_limit, SPEC::SPEC_ID);
let operator_fee_charge =
l1_block.operator_fee_charge(enveloped_tx, gas_limit, SPEC::SPEC_ID);

caller_account.info.balance = caller_account
.info
Expand Down
2 changes: 1 addition & 1 deletion crates/revm/src/optimism/precompile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub(crate) fn granite() -> &'static Precompiles {
pub(crate) fn isthmus() -> &'static Precompiles {
static INSTANCE: OnceBox<Precompiles> = OnceBox::new();
INSTANCE.get_or_init(|| {
let precompiles = Precompiles::cancun().clone();
let precompiles = granite().clone();

// Don't include BLS12-381 precompiles in no_std builds.
#[cfg(feature = "blst")]
Expand Down