evm: use Header AT in ConfigureEvmEnv (#10968)

This commit is contained in:
Thomas Coratger
2024-09-18 01:03:15 +02:00
committed by GitHub
parent a8078f66dd
commit 5e9f38164d
42 changed files with 220 additions and 134 deletions

View File

@@ -4,6 +4,7 @@ use std::{future::Future, marker::PhantomData};
use reth_consensus::Consensus;
use reth_evm::execute::BlockExecutorProvider;
use reth_primitives::Header;
use reth_transaction_pool::TransactionPool;
use crate::{
@@ -371,7 +372,7 @@ where
F: FnOnce(&BuilderContext<Node>) -> Fut + Send,
Fut: Future<Output = eyre::Result<Components<Node, Pool, EVM, Executor, Cons>>> + Send,
Pool: TransactionPool + Unpin + 'static,
EVM: ConfigureEvm,
EVM: ConfigureEvm<Header = Header>,
Executor: BlockExecutorProvider,
Cons: Consensus + Clone + Unpin + 'static,
{

View File

@@ -2,6 +2,7 @@
use crate::{BuilderContext, FullNodeTypes};
use reth_evm::execute::BlockExecutorProvider;
use reth_node_api::ConfigureEvm;
use reth_primitives::Header;
use std::future::Future;
/// A type that knows how to build the executor types.
@@ -9,7 +10,7 @@ pub trait ExecutorBuilder<Node: FullNodeTypes>: Send {
/// The EVM config to use.
///
/// This provides the node with the necessary configuration to configure an EVM.
type EVM: ConfigureEvm;
type EVM: ConfigureEvm<Header = Header>;
/// The type that knows how to execute blocks.
type Executor: BlockExecutorProvider;
@@ -24,7 +25,7 @@ pub trait ExecutorBuilder<Node: FullNodeTypes>: Send {
impl<Node, F, Fut, EVM, Executor> ExecutorBuilder<Node> for F
where
Node: FullNodeTypes,
EVM: ConfigureEvm,
EVM: ConfigureEvm<Header = Header>,
Executor: BlockExecutorProvider,
F: FnOnce(&BuilderContext<Node>) -> Fut + Send,
Fut: Future<Output = eyre::Result<(EVM, Executor)>> + Send,

View File

@@ -27,6 +27,7 @@ use reth_network::NetworkHandle;
use reth_network_api::FullNetwork;
use reth_node_api::NodeTypesWithEngine;
use reth_payload_builder::PayloadBuilderHandle;
use reth_primitives::Header;
use reth_transaction_pool::TransactionPool;
use crate::{ConfigureEvm, FullNodeTypes};
@@ -41,7 +42,7 @@ pub trait NodeComponents<T: FullNodeTypes>: Clone + Unpin + Send + Sync + 'stati
type Pool: TransactionPool + Unpin;
/// The node's EVM configuration, defining settings for the Ethereum Virtual Machine.
type Evm: ConfigureEvm;
type Evm: ConfigureEvm<Header = Header>;
/// The type that knows how to execute blocks.
type Executor: BlockExecutorProvider;
@@ -95,7 +96,7 @@ impl<Node, Pool, EVM, Executor, Cons> NodeComponents<Node>
where
Node: FullNodeTypes,
Pool: TransactionPool + Unpin + 'static,
EVM: ConfigureEvm,
EVM: ConfigureEvm<Header = Header>,
Executor: BlockExecutorProvider,
Cons: Consensus + Clone + Unpin + 'static,
{
@@ -136,7 +137,7 @@ impl<Node, Pool, EVM, Executor, Cons> Clone for Components<Node, Pool, EVM, Exec
where
Node: FullNodeTypes,
Pool: TransactionPool,
EVM: ConfigureEvm,
EVM: ConfigureEvm<Header = Header>,
Executor: BlockExecutorProvider,
Cons: Consensus + Clone,
{