mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: integrate ExecutorProvider (#7798)
This commit is contained in:
@ -19,7 +19,7 @@ use reth::{
|
||||
};
|
||||
use reth_node_api::{ConfigureEvm, ConfigureEvmEnv, FullNodeTypes};
|
||||
use reth_node_core::{args::RpcServerArgs, node_config::NodeConfig};
|
||||
use reth_node_ethereum::{EthEvmConfig, EthereumNode};
|
||||
use reth_node_ethereum::{EthEvmConfig, EthExecutorProvider, EthereumNode};
|
||||
use reth_primitives::{Chain, ChainSpec, Genesis, Header, Transaction};
|
||||
use reth_tracing::{RethTracer, Tracer};
|
||||
use std::sync::Arc;
|
||||
@ -106,7 +106,7 @@ impl ConfigureEvm for MyEvmConfig {
|
||||
}
|
||||
}
|
||||
|
||||
/// A regular ethereum evm and executor builder.
|
||||
/// Builds a regular ethereum block executor that uses the custom EVM.
|
||||
#[derive(Debug, Default, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
pub struct MyExecutorBuilder;
|
||||
@ -116,9 +116,16 @@ where
|
||||
Node: FullNodeTypes,
|
||||
{
|
||||
type EVM = MyEvmConfig;
|
||||
type Executor = EthExecutorProvider<Self::EVM>;
|
||||
|
||||
async fn build_evm(self, _ctx: &BuilderContext<Node>) -> eyre::Result<Self::EVM> {
|
||||
Ok(MyEvmConfig::default())
|
||||
async fn build_evm(
|
||||
self,
|
||||
ctx: &BuilderContext<Node>,
|
||||
) -> eyre::Result<(Self::EVM, Self::Executor)> {
|
||||
Ok((
|
||||
MyEvmConfig::default(),
|
||||
EthExecutorProvider::new(ctx.chain_spec(), MyEvmConfig::default()),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user