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
2 changes: 1 addition & 1 deletion crates/engine/util/src/reorg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ where
let tx_recovered =
tx.try_into_recovered().map_err(|_| ProviderError::SenderRecoveryError)?;
let gas_used = match builder.execute_transaction(tx_recovered) {
Ok(gas_used) => gas_used,
Ok(gas_used) => gas_used.tx_gas_used(),
Err(BlockExecutionError::Validation(BlockValidationError::InvalidTx {
hash,
error,
Expand Down
2 changes: 1 addition & 1 deletion crates/ethereum/payload/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ where
let tx_hash = *tx.tx_hash();

let gas_used = match builder.execute_transaction(tx) {
Ok(gas_used) => gas_used,
Ok(gas_used) => gas_used.tx_gas_used(),
Err(BlockExecutionError::Validation(BlockValidationError::InvalidTx {
error, ..
})) => {
Expand Down
12 changes: 6 additions & 6 deletions crates/evm/evm/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{ConfigureEvm, Database, OnStateHook, TxEnvFor};
use alloc::{boxed::Box, sync::Arc, vec::Vec};
use alloy_consensus::{BlockHeader, Header};
use alloy_eips::eip2718::WithEncoded;
pub use alloy_evm::block::{BlockExecutor, BlockExecutorFactory};
pub use alloy_evm::block::{BlockExecutor, BlockExecutorFactory, GasOutput};
use alloy_evm::{
block::{CommitChanges, ExecutableTxParts},
Evm, EvmEnv, EvmFactory, RecoveredTx, ToTxEnv,
Expand Down Expand Up @@ -327,15 +327,15 @@ pub trait BlockBuilder {
&mut self,
tx: impl ExecutorTx<Self::Executor>,
f: impl FnOnce(&<Self::Executor as BlockExecutor>::Result) -> CommitChanges,
) -> Result<Option<u64>, BlockExecutionError>;
) -> Result<Option<GasOutput>, BlockExecutionError>;

/// Invokes [`BlockExecutor::execute_transaction_with_result_closure`] and saves the
/// transaction in internal state.
fn execute_transaction_with_result_closure(
&mut self,
tx: impl ExecutorTx<Self::Executor>,
f: impl FnOnce(&<Self::Executor as BlockExecutor>::Result),
) -> Result<u64, BlockExecutionError> {
) -> Result<GasOutput, BlockExecutionError> {
self.execute_transaction_with_commit_condition(tx, |res| {
f(res);
CommitChanges::Yes
Expand All @@ -348,7 +348,7 @@ pub trait BlockBuilder {
fn execute_transaction(
&mut self,
tx: impl ExecutorTx<Self::Executor>,
) -> Result<u64, BlockExecutionError> {
) -> Result<GasOutput, BlockExecutionError> {
self.execute_transaction_with_result_closure(tx, |_| ())
}

Expand Down Expand Up @@ -460,13 +460,13 @@ where
&mut self,
tx: impl ExecutorTx<Self::Executor>,
f: impl FnOnce(&<Self::Executor as BlockExecutor>::Result) -> CommitChanges,
) -> Result<Option<u64>, BlockExecutionError> {
) -> Result<Option<GasOutput>, BlockExecutionError> {
let (tx_env, tx) = tx.into_parts();
if let Some(gas_used) =
self.executor.execute_transaction_with_commit_condition((tx_env, &tx), f)?
{
self.transactions.push(tx);
Ok(Some(gas_used.tx_gas_used()))
Ok(Some(gas_used))
} else {
Ok(None)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-eth-api/src/helpers/pending_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ pub trait LoadPendingBlock:
}

let gas_used = match builder.execute_transaction(tx) {
Ok(gas_used) => gas_used,
Ok(gas_used) => gas_used.tx_gas_used(),
Err(BlockExecutionError::Validation(BlockValidationError::InvalidTx {
error,
..
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ where

let tip = tx.effective_tip_per_gas(base_fee).unwrap_or_default();
let gas_used = match builder.execute_transaction(tx) {
Ok(gas_used) => gas_used,
Ok(gas_used) => gas_used.tx_gas_used(),
Err(err) => {
if skip_invalid_transactions {
debug!(
Expand Down
Loading