refactor: implement BlockExecutionStrategyFactory directly on EvmConfig (#14675)

This commit is contained in:
Arsenii Kulikov
2025-02-25 01:28:21 +04:00
committed by GitHub
parent a18b0fce7c
commit c40d059dd3
24 changed files with 250 additions and 436 deletions

View File

@@ -6,7 +6,7 @@ use reth_consensus::noop::NoopConsensus;
use reth_engine_primitives::BeaconConsensusEngineHandle;
use reth_ethereum_engine_primitives::{EthEngineTypes, EthereumEngineValidator};
use reth_evm::execute::BasicBlockExecutorProvider;
use reth_evm_ethereum::{execute::EthExecutionStrategyFactory, EthEvmConfig};
use reth_evm_ethereum::EthEvmConfig;
use reth_network_api::noop::NoopNetwork;
use reth_payload_builder::test_utils::spawn_test_payload_service;
use reth_provider::test_utils::NoopProvider;
@@ -124,7 +124,7 @@ pub fn test_rpc_builder() -> RpcModuleBuilder<
NoopNetwork,
TokioTaskExecutor,
EthEvmConfig,
BasicBlockExecutorProvider<EthExecutionStrategyFactory>,
BasicBlockExecutorProvider<EthEvmConfig>,
NoopConsensus,
> {
RpcModuleBuilder::default()
@@ -132,9 +132,7 @@ pub fn test_rpc_builder() -> RpcModuleBuilder<
.with_pool(TestPoolBuilder::default().into())
.with_network(NoopNetwork::default())
.with_executor(TokioTaskExecutor::default())
.with_evm_config(EthEvmConfig::new(MAINNET.clone()))
.with_block_executor(
BasicBlockExecutorProvider::new(EthExecutionStrategyFactory::mainnet()),
)
.with_evm_config(EthEvmConfig::mainnet())
.with_block_executor(BasicBlockExecutorProvider::new(EthEvmConfig::mainnet()))
.with_consensus(NoopConsensus::default())
}

View File

@@ -38,7 +38,6 @@ mod tests {
use super::*;
use alloy_eips::eip1559::ETHEREUM_BLOCK_GAS_LIMIT_30M;
use alloy_primitives::{Address, StorageKey, StorageValue, U256};
use reth_chainspec::MAINNET;
use reth_evm_ethereum::EthEvmConfig;
use reth_network_api::noop::NoopNetwork;
use reth_provider::test_utils::{ExtendedAccount, MockEthProvider, NoopProvider};
@@ -55,7 +54,7 @@ mod tests {
fn noop_eth_api() -> EthApi<NoopProvider, TestPool, NoopNetwork, EthEvmConfig> {
let pool = testing_pool();
let evm_config = EthEvmConfig::new(MAINNET.clone());
let evm_config = EthEvmConfig::mainnet();
let cache = EthStateCache::spawn(NoopProvider::default(), Default::default());
EthApi::new(