mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add Primitives AT to BlockExecutorProvider (#12994)
This commit is contained in:
@ -26,7 +26,7 @@ use reth_evm::execute::{
|
||||
};
|
||||
use reth_evm_ethereum::EthEvmConfig;
|
||||
use reth_node_ethereum::{node::EthereumAddOns, BasicBlockExecutorProvider, EthereumNode};
|
||||
use reth_primitives::{BlockWithSenders, Receipt};
|
||||
use reth_primitives::{BlockWithSenders, EthPrimitives, Receipt};
|
||||
use std::{fmt::Display, sync::Arc};
|
||||
|
||||
pub const SYSTEM_ADDRESS: Address = address!("fffffffffffffffffffffffffffffffffffffffe");
|
||||
@ -59,7 +59,7 @@ pub struct CustomExecutorBuilder;
|
||||
|
||||
impl<Types, Node> ExecutorBuilder<Node> for CustomExecutorBuilder
|
||||
where
|
||||
Types: NodeTypesWithEngine<ChainSpec = ChainSpec>,
|
||||
Types: NodeTypesWithEngine<ChainSpec = ChainSpec, Primitives = EthPrimitives>,
|
||||
Node: FullNodeTypes<Types = Types>,
|
||||
{
|
||||
type EVM = EthEvmConfig;
|
||||
@ -88,6 +88,7 @@ pub struct CustomExecutorStrategyFactory {
|
||||
}
|
||||
|
||||
impl BlockExecutionStrategyFactory for CustomExecutorStrategyFactory {
|
||||
type Primitives = EthPrimitives;
|
||||
type Strategy<DB: Database<Error: Into<ProviderError> + Display>> = CustomExecutorStrategy<DB>;
|
||||
|
||||
fn create_strategy<DB>(&self, db: DB) -> Self::Strategy<DB>
|
||||
@ -135,10 +136,12 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<DB> BlockExecutionStrategy<DB> for CustomExecutorStrategy<DB>
|
||||
impl<DB> BlockExecutionStrategy for CustomExecutorStrategy<DB>
|
||||
where
|
||||
DB: Database<Error: Into<ProviderError> + Display>,
|
||||
{
|
||||
type DB = DB;
|
||||
type Primitives = EthPrimitives;
|
||||
type Error = BlockExecutionError;
|
||||
|
||||
fn apply_pre_execution_changes(
|
||||
|
||||
@ -153,7 +153,7 @@ pub struct MyExecutorBuilder;
|
||||
|
||||
impl<Node> ExecutorBuilder<Node> for MyExecutorBuilder
|
||||
where
|
||||
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = ChainSpec>>,
|
||||
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = ChainSpec, Primitives = EthPrimitives>>,
|
||||
{
|
||||
type EVM = MyEvmConfig;
|
||||
type Executor = BasicBlockExecutorProvider<EthExecutionStrategyFactory<Self::EVM>>;
|
||||
|
||||
@ -28,7 +28,7 @@ use reth_node_ethereum::{
|
||||
node::EthereumAddOns, BasicBlockExecutorProvider, EthEvmConfig, EthExecutionStrategyFactory,
|
||||
EthereumNode,
|
||||
};
|
||||
use reth_primitives::TransactionSigned;
|
||||
use reth_primitives::{EthPrimitives, TransactionSigned};
|
||||
use reth_tracing::{RethTracer, Tracer};
|
||||
use schnellru::{ByLength, LruMap};
|
||||
use std::{collections::HashMap, convert::Infallible, sync::Arc};
|
||||
@ -226,7 +226,7 @@ pub struct MyExecutorBuilder {
|
||||
|
||||
impl<Node> ExecutorBuilder<Node> for MyExecutorBuilder
|
||||
where
|
||||
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = ChainSpec>>,
|
||||
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = ChainSpec, Primitives = EthPrimitives>>,
|
||||
{
|
||||
type EVM = MyEvmConfig;
|
||||
type Executor = BasicBlockExecutorProvider<EthExecutionStrategyFactory<Self::EVM>>;
|
||||
|
||||
Reference in New Issue
Block a user