diff --git a/crates/payload/basic/src/optimism.rs b/crates/payload/basic/src/optimism.rs index 78f1ae2f126..c208e527557 100644 --- a/crates/payload/basic/src/optimism.rs +++ b/crates/payload/basic/src/optimism.rs @@ -7,6 +7,7 @@ use reth_revm::{ optimism::{executor::fail_deposit_tx, L1BlockInfo}, to_reth_acc, }; +use revm::primitives::ExecutionResult; /// Constructs an Ethereum transaction payload from the transactions sent through the /// Payload attributes by the sequencer. If the `no_tx_pool` argument is passed in @@ -209,7 +210,12 @@ where // usage as the gas limit of their transaction. After Regolith, system transactions // are deprecated and all deposit transactions report the gas used during execution // regardless of whether or not the transaction reverts. - if is_regolith || !sequencer_tx.is_deposit() { + if is_regolith && + sequencer_tx.is_deposit() && + matches!(result, ExecutionResult::Halt { .. }) + { + cumulative_gas_used += sequencer_tx.gas_limit(); + } else if is_regolith || !sequencer_tx.is_deposit() { cumulative_gas_used += result.gas_used(); } else if sequencer_tx.is_deposit() && (!result.is_success() || !sequencer_tx.is_system_transaction()) diff --git a/crates/revm/src/optimism/executor.rs b/crates/revm/src/optimism/executor.rs index 064c2eef685..b2f7ba50db0 100644 --- a/crates/revm/src/optimism/executor.rs +++ b/crates/revm/src/optimism/executor.rs @@ -8,7 +8,7 @@ use reth_interfaces::executor::{BlockExecutionError, BlockValidationError}; use reth_primitives::{bytes::BytesMut, Address, Block, Hardfork, Receipt, U256}; use reth_provider::{BlockExecutor, PostState, StateProvider}; use reth_revm_primitives::into_reth_log; -use revm::primitives::ResultAndState; +use revm::primitives::{ExecutionResult, ResultAndState}; use std::sync::Arc; impl BlockExecutor for Executor @@ -205,7 +205,12 @@ where // usage as the gas limit of their transaction. After Regolith, system transactions // are deprecated and all deposit transactions report the gas used during execution // regardless of whether or not the transaction reverts. - if is_regolith || !transaction.is_deposit() { + if is_regolith && + transaction.is_deposit() && + matches!(result, ExecutionResult::Halt { .. }) + { + cumulative_gas_used += transaction.gas_limit(); + } else if is_regolith || !transaction.is_deposit() { cumulative_gas_used += result.gas_used(); } else if transaction.is_deposit() && (!result.is_success() || !transaction.is_system_transaction())