feat: switch to composable executor for Ethereum (#11838)

This commit is contained in:
Federico Gimenez
2024-10-19 19:59:32 +02:00
committed by GitHub
parent d0ac833946
commit cd828c06d9
13 changed files with 316 additions and 1648 deletions

View File

@ -31,7 +31,7 @@ use reth_node_api::{
use reth_node_core::{args::RpcServerArgs, node_config::NodeConfig};
use reth_node_ethereum::{
node::{EthereumAddOns, EthereumPayloadBuilder},
EthExecutorProvider, EthereumNode,
BasicBlockExecutorProvider, EthExecutionStrategyFactory, EthereumNode,
};
use reth_primitives::{
revm_primitives::{CfgEnvWithHandlerCfg, TxEnv},
@ -158,7 +158,7 @@ where
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = ChainSpec>>,
{
type EVM = MyEvmConfig;
type Executor = EthExecutorProvider<Self::EVM>;
type Executor = BasicBlockExecutorProvider<EthExecutionStrategyFactory<Self::EVM>>;
async fn build_evm(
self,
@ -166,7 +166,10 @@ where
) -> eyre::Result<(Self::EVM, Self::Executor)> {
Ok((
MyEvmConfig::new(ctx.chain_spec()),
EthExecutorProvider::new(ctx.chain_spec(), MyEvmConfig::new(ctx.chain_spec())),
BasicBlockExecutorProvider::new(EthExecutionStrategyFactory::new(
ctx.chain_spec(),
MyEvmConfig::new(ctx.chain_spec()),
)),
))
}
}

View File

@ -20,7 +20,10 @@ use reth::{
use reth_chainspec::{Chain, ChainSpec};
use reth_node_api::{ConfigureEvm, ConfigureEvmEnv, FullNodeTypes, NodeTypes};
use reth_node_core::{args::RpcServerArgs, node_config::NodeConfig};
use reth_node_ethereum::{node::EthereumAddOns, EthEvmConfig, EthExecutorProvider, EthereumNode};
use reth_node_ethereum::{
node::EthereumAddOns, BasicBlockExecutorProvider, EthEvmConfig, EthExecutionStrategyFactory,
EthereumNode,
};
use reth_primitives::{
revm_primitives::{SpecId, StatefulPrecompileMut},
Header, TransactionSigned,
@ -224,7 +227,7 @@ where
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = ChainSpec>>,
{
type EVM = MyEvmConfig;
type Executor = EthExecutorProvider<Self::EVM>;
type Executor = BasicBlockExecutorProvider<EthExecutionStrategyFactory<Self::EVM>>;
async fn build_evm(
self,
@ -234,7 +237,13 @@ where
inner: EthEvmConfig::new(ctx.chain_spec()),
precompile_cache: self.precompile_cache.clone(),
};
Ok((evm_config.clone(), EthExecutorProvider::new(ctx.chain_spec(), evm_config)))
Ok((
evm_config.clone(),
BasicBlockExecutorProvider::new(EthExecutionStrategyFactory::new(
ctx.chain_spec(),
evm_config,
)),
))
}
}