Skip to content
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
8 changes: 7 additions & 1 deletion crates/payload/basic/src/optimism.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())
Expand Down
9 changes: 7 additions & 2 deletions crates/revm/src/optimism/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DB> BlockExecutor<DB> for Executor<DB>
Expand Down Expand Up @@ -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())
Expand Down