feat: add functions for env creation (#12928)

This commit is contained in:
Matthias Seitz
2024-11-27 23:35:23 +01:00
committed by GitHub
parent 8d70e8921b
commit 2179301590
8 changed files with 39 additions and 60 deletions

View File

@ -12,10 +12,8 @@ use reth_primitives::{Receipt, SealedBlockWithSenders, SealedHeader};
use reth_primitives_traits::SignedTransaction;
use reth_provider::{BlockExecutionOutput, ChainSpecProvider, StateProviderFactory};
use reth_revm::{
database::StateProviderDatabase,
db::states::bundle_state::BundleRetention,
primitives::{BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg},
DatabaseCommit, StateBuilder,
database::StateProviderDatabase, db::states::bundle_state::BundleRetention,
primitives::EnvWithHandlerCfg, DatabaseCommit, StateBuilder,
};
use reth_rpc_api::DebugApiClient;
use reth_tracing::tracing::warn;
@ -76,9 +74,7 @@ where
.build();
// Setup environment for the execution.
let mut cfg = CfgEnvWithHandlerCfg::new(Default::default(), Default::default());
let mut block_env = BlockEnv::default();
self.evm_config.fill_cfg_and_block_env(&mut cfg, &mut block_env, block.header(), U256::MAX);
let (cfg, block_env) = self.evm_config.cfg_and_block_env(block.header(), U256::MAX);
// Setup EVM
let mut evm = self.evm_config.evm_with_env(