diff --git a/crates/revm/src/optimism/handler_register.rs b/crates/revm/src/optimism/handler_register.rs index bc18b7082d..022869e762 100644 --- a/crates/revm/src/optimism/handler_register.rs +++ b/crates/revm/src/optimism/handler_register.rs @@ -68,6 +68,11 @@ pub fn validate_env(env: &Env) -> Result<(), EVMError< pub fn validate_tx_against_state( context: &mut Context, ) -> Result<(), EVMError> { + // No validation is needed for deposit transactions, as they are pre-verified on L1. + if context.evm.inner.env.tx.optimism.source_hash.is_some() { + return Ok(()); + } + // storage l1 block info for later use. l1_block_info is cleared after execution. if context.evm.inner.l1_block_info.is_none() { // the L1-cost fee is only computed for Optimism non-deposit transactions. @@ -77,11 +82,6 @@ pub fn validate_tx_against_state( context.evm.inner.l1_block_info = Some(l1_block_info); } - // No validation is needed for deposit transactions, as they are pre-verified on L1. - if context.evm.inner.env.tx.optimism.source_hash.is_some() { - return Ok(()); - } - let env @ Env { cfg, tx, .. } = context.evm.inner.env.as_ref(); // load acc @@ -285,7 +285,7 @@ pub fn reimburse_caller( mainnet::reimburse_caller::(context, gas)?; } - if SPEC::SPEC_ID.is_enabled_in(SpecId::ISTHMUS) { + if !is_deposit && SPEC::SPEC_ID.is_enabled_in(SpecId::ISTHMUS) { let operator_fee_refund = context .evm .inner diff --git a/crates/revm/src/optimism/l1block.rs b/crates/revm/src/optimism/l1block.rs index 85bd80a2f0..d530f47adb 100644 --- a/crates/revm/src/optimism/l1block.rs +++ b/crates/revm/src/optimism/l1block.rs @@ -191,8 +191,8 @@ impl L1BlockInfo { /// /// Introduced in isthmus. Prior to isthmus, the operator fee is always zero. pub fn operator_fee_charge(&self, input: &[u8], gas_limit: U256, spec_id: SpecId) -> U256 { - // If the input is a deposit transaction or empty, the default value is zero. - if input.is_empty() || input.first() == Some(&0x7E) { + // If the input is a deposit transaction, the default value is zero. + if input.first() == Some(&0x7E) { return U256::ZERO; } if !spec_id.is_enabled_in(SpecId::ISTHMUS) {