refactor: BlockExecutionStrategy API (#14480)

This commit is contained in:
Arsenii Kulikov
2025-02-19 17:10:50 +04:00
committed by GitHub
parent 1ae733a7d1
commit 4f454c91d6
30 changed files with 423 additions and 555 deletions

View File

@ -8,7 +8,6 @@ use reth_evm::{
state_change::post_block_balance_increments, system_calls::SystemCaller, ConfigureEvmFor, Evm,
};
use reth_primitives::{NodePrimitives, RecoveredBlock, SealedHeader};
use reth_primitives_traits::{BlockBody, SignedTransaction};
use reth_provider::{BlockExecutionOutput, ChainSpecProvider, StateProviderFactory};
use reth_revm::{
database::StateProviderDatabase,
@ -85,10 +84,8 @@ where
// Re-execute all of the transactions in the block to load all touched accounts into
// the cache DB.
for tx in block.body().transactions() {
let signer =
tx.recover_signer().map_err(|_| eyre::eyre!("failed to recover sender"))?;
evm.transact_commit(self.evm_config.tx_env(tx, signer))?;
for tx in block.transactions_recovered() {
evm.transact_commit(self.evm_config.tx_env(tx))?;
}
drop(evm);

View File

@ -2775,7 +2775,7 @@ where
let mut evm = evm_config.evm_with_env(state_provider, evm_env);
// create the tx env and reset nonce
let tx_env = evm_config.tx_env(&tx, tx.signer());
let tx_env = evm_config.tx_env(&tx);
// exit early if execution is done
if cancel_execution.is_cancelled() {

View File

@ -312,7 +312,7 @@ where
// Configure the environment for the block.
let tx_recovered =
tx.try_clone_into_recovered().map_err(|_| ProviderError::SenderRecoveryError)?;
let tx_env = evm_config.tx_env(&tx_recovered, tx_recovered.signer());
let tx_env = evm_config.tx_env(tx_recovered);
let exec_result = match evm.transact(tx_env) {
Ok(result) => result,
Err(err) if err.is_invalid_tx_err() => {