diff --git a/crates/exex/exex/src/context.rs b/crates/exex/exex/src/context.rs index 6edb8f558324..86939e3ba767 100644 --- a/crates/exex/exex/src/context.rs +++ b/crates/exex/exex/src/context.rs @@ -1,13 +1,11 @@ -use std::fmt::Debug; - -use reth_node_api::{FullNodeComponents, FullNodeTypes, NodeTypes}; +use crate::{ExExEvent, ExExNotification}; +use reth_node_api::FullNodeComponents; use reth_node_core::node_config::NodeConfig; use reth_primitives::Head; use reth_tasks::TaskExecutor; +use std::fmt::Debug; use tokio::sync::mpsc::{Receiver, UnboundedSender}; -use crate::{ExExEvent, ExExNotification}; - /// Captures the context that an `ExEx` has access to. pub struct ExExContext { /// The current head of the blockchain at launch. @@ -49,46 +47,39 @@ impl Debug for ExExContext { } } -impl NodeTypes for ExExContext { - type Primitives = Node::Primitives; - type Engine = Node::Engine; -} - -impl FullNodeTypes for ExExContext { - type DB = Node::DB; - type Provider = Node::Provider; -} - -impl FullNodeComponents for ExExContext { - type Pool = Node::Pool; - type Evm = Node::Evm; - type Executor = Node::Executor; - - fn pool(&self) -> &Self::Pool { +impl ExExContext { + /// Returns the transaction pool of the node. + pub fn pool(&self) -> &Node::Pool { self.components.pool() } - fn evm_config(&self) -> &Self::Evm { + /// Returns the node's evm config. + pub fn evm_config(&self) -> &Node::Evm { self.components.evm_config() } - fn block_executor(&self) -> &Self::Executor { + /// Returns the node's executor type. + pub fn block_executor(&self) -> &Node::Executor { self.components.block_executor() } - fn provider(&self) -> &Self::Provider { + /// Returns the provider of the node. + pub fn provider(&self) -> &Node::Provider { self.components.provider() } - fn network(&self) -> &reth_network::NetworkHandle { + /// Returns the handle to the network + pub fn network(&self) -> &reth_network::NetworkHandle { self.components.network() } - fn payload_builder(&self) -> &reth_payload_builder::PayloadBuilderHandle { + /// Returns the handle to the payload builder service. + pub fn payload_builder(&self) -> &reth_payload_builder::PayloadBuilderHandle { self.components.payload_builder() } - fn task_executor(&self) -> &TaskExecutor { + /// Returns the task executor. + pub fn task_executor(&self) -> &TaskExecutor { self.components.task_executor() } } diff --git a/crates/node/api/src/node.rs b/crates/node/api/src/node.rs index b8649d858c92..b58df68c44cf 100644 --- a/crates/node/api/src/node.rs +++ b/crates/node/api/src/node.rs @@ -88,7 +88,7 @@ where } /// Encapsulates all types and components of the node. -pub trait FullNodeComponents: FullNodeTypes + 'static { +pub trait FullNodeComponents: FullNodeTypes + Clone + 'static { /// The transaction pool of the node. type Pool: TransactionPool + Unpin;