feat: add Evm trait (#13823)

This commit is contained in:
Arsenii Kulikov
2025-01-18 19:42:39 +04:00
committed by GitHub
parent cef0c927c9
commit c46f23f8de
25 changed files with 453 additions and 460 deletions

View File

@ -15,7 +15,9 @@ use op_alloy_rpc_types_engine::OpPayloadAttributes;
use reth_basic_payload_builder::*;
use reth_chain_state::ExecutedBlock;
use reth_chainspec::{ChainSpecProvider, EthereumHardforks};
use reth_evm::{env::EvmEnv, system_calls::SystemCaller, ConfigureEvm, NextBlockEnvAttributes};
use reth_evm::{
env::EvmEnv, system_calls::SystemCaller, ConfigureEvm, Evm, NextBlockEnvAttributes,
};
use reth_execution_types::ExecutionOutcome;
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_consensus::calculate_receipt_root_no_memo_optimism;
@ -777,9 +779,9 @@ where
))
})?;
*evm.tx_mut() = self.evm_config.tx_env(sequencer_tx.tx(), sequencer_tx.signer());
let tx_env = self.evm_config.tx_env(sequencer_tx.tx(), sequencer_tx.signer());
let ResultAndState { result, state } = match evm.transact() {
let ResultAndState { result, state } = match evm.transact(tx_env) {
Ok(res) => res,
Err(err) => {
match err {
@ -874,9 +876,9 @@ where
}
// Configure the environment for the tx.
*evm.tx_mut() = self.evm_config.tx_env(tx.tx(), tx.signer());
let tx_env = self.evm_config.tx_env(tx.tx(), tx.signer());
let ResultAndState { result, state } = match evm.transact() {
let ResultAndState { result, state } = match evm.transact(tx_env) {
Ok(res) => res,
Err(err) => {
match err {