Skip to main content

reth_node_ethereum/
node.rs

1//! Ethereum Node types config.
2
3pub use crate::{payload::EthereumPayloadBuilder, EthereumEngineValidator};
4use crate::{EthEngineTypes, EthEvmConfig};
5use alloy_eips::{eip7840::BlobParams, merge::EPOCH_SLOTS};
6use alloy_network::Ethereum;
7use alloy_rpc_types_engine::ExecutionData;
8use reth_chainspec::{ChainSpec, EthChainSpec, EthereumHardforks, Hardforks};
9use reth_engine_local::LocalPayloadAttributesBuilder;
10use reth_engine_primitives::EngineTypes;
11use reth_ethereum_consensus::EthBeaconConsensus;
12use reth_ethereum_engine_primitives::{
13    EthBuiltPayload, EthPayloadAttributes, EthPayloadBuilderAttributes,
14};
15use reth_ethereum_primitives::{EthPrimitives, TransactionSigned};
16use reth_evm::{
17    eth::spec::EthExecutorSpec, ConfigureEvm, EvmFactory, EvmFactoryFor, NextBlockEnvAttributes,
18};
19use reth_network::{primitives::BasicNetworkPrimitives, NetworkHandle, PeersInfo};
20use reth_node_api::{
21    AddOnsContext, FullNodeComponents, HeaderTy, NodeAddOns, NodePrimitives,
22    PayloadAttributesBuilder, PrimitivesTy, TxTy,
23};
24use reth_node_builder::{
25    components::{
26        BasicPayloadServiceBuilder, ComponentsBuilder, ConsensusBuilder, ExecutorBuilder,
27        NetworkBuilder, PoolBuilder, TxPoolBuilder,
28    },
29    node::{FullNodeTypes, NodeTypes},
30    rpc::{
31        BasicEngineApiBuilder, BasicEngineValidatorBuilder, EngineApiBuilder, EngineValidatorAddOn,
32        EngineValidatorBuilder, EthApiBuilder, EthApiCtx, Identity, PayloadValidatorBuilder,
33        RethRpcAddOns, RpcAddOns, RpcHandle,
34    },
35    BuilderContext, DebugNode, Node, NodeAdapter,
36};
37use reth_payload_primitives::PayloadTypes;
38use reth_provider::{providers::ProviderFactoryBuilder, EthStorage};
39use reth_rpc::{
40    eth::core::{EthApiFor, EthRpcConverterFor},
41    TestingApi, ValidationApi,
42};
43use reth_rpc_api::servers::{BlockSubmissionValidationApiServer, TestingApiServer};
44use reth_rpc_builder::{config::RethRpcServerConfig, middleware::RethRpcMiddleware};
45use reth_rpc_eth_api::{
46    helpers::{
47        config::{EthConfigApiServer, EthConfigHandler},
48        pending_block::BuildPendingEnv,
49    },
50    RpcConvert, RpcTypes, SignableTxRequest,
51};
52use reth_rpc_eth_types::{error::FromEvmError, EthApiError};
53use reth_rpc_server_types::RethRpcModule;
54use reth_tracing::tracing::{debug, info};
55use reth_transaction_pool::{
56    blobstore::DiskFileBlobStore, EthTransactionPool, PoolPooledTx, PoolTransaction,
57    TransactionPool, TransactionValidationTaskExecutor,
58};
59use revm::context::TxEnv;
60use std::{marker::PhantomData, sync::Arc, time::SystemTime};
61
62/// Type configuration for a regular Ethereum node.
63#[derive(Debug, Default, Clone, Copy)]
64#[non_exhaustive]
65pub struct EthereumNode;
66
67impl EthereumNode {
68    /// Returns a [`ComponentsBuilder`] configured for a regular Ethereum node.
69    pub fn components<Node>() -> ComponentsBuilder<
70        Node,
71        EthereumPoolBuilder,
72        BasicPayloadServiceBuilder<EthereumPayloadBuilder>,
73        EthereumNetworkBuilder,
74        EthereumExecutorBuilder,
75        EthereumConsensusBuilder,
76    >
77    where
78        Node: FullNodeTypes<
79            Types: NodeTypes<
80                ChainSpec: Hardforks + EthereumHardforks + EthExecutorSpec,
81                Primitives = EthPrimitives,
82            >,
83        >,
84        <Node::Types as NodeTypes>::Payload: PayloadTypes<
85            BuiltPayload = EthBuiltPayload,
86            PayloadAttributes = EthPayloadAttributes,
87            PayloadBuilderAttributes = EthPayloadBuilderAttributes,
88        >,
89    {
90        ComponentsBuilder::default()
91            .node_types::<Node>()
92            .pool(EthereumPoolBuilder::default())
93            .executor(EthereumExecutorBuilder::default())
94            .payload(BasicPayloadServiceBuilder::default())
95            .network(EthereumNetworkBuilder::default())
96            .consensus(EthereumConsensusBuilder::default())
97    }
98
99    /// Instantiates the [`ProviderFactoryBuilder`] for an ethereum node.
100    ///
101    /// # Open a Providerfactory in read-only mode from a datadir
102    ///
103    /// See also: [`ProviderFactoryBuilder`] and
104    /// [`ReadOnlyConfig`](reth_provider::providers::ReadOnlyConfig).
105    ///
106    /// ```no_run
107    /// use reth_chainspec::MAINNET;
108    /// use reth_node_ethereum::EthereumNode;
109    ///
110    /// fn demo(runtime: reth_tasks::Runtime) {
111    ///     let factory = EthereumNode::provider_factory_builder()
112    ///         .open_read_only(MAINNET.clone(), "datadir", runtime)
113    ///         .unwrap();
114    /// }
115    /// ```
116    ///
117    /// See also [`ProviderFactory::new`](reth_provider::ProviderFactory::new) for constructing
118    /// a [`ProviderFactory`](reth_provider::ProviderFactory) manually with all required
119    /// components.
120    pub fn provider_factory_builder() -> ProviderFactoryBuilder<Self> {
121        ProviderFactoryBuilder::default()
122    }
123}
124
125impl NodeTypes for EthereumNode {
126    type Primitives = EthPrimitives;
127    type ChainSpec = ChainSpec;
128    type Storage = EthStorage;
129    type Payload = EthEngineTypes;
130}
131
132/// Builds [`EthApi`](reth_rpc::EthApi) for Ethereum.
133#[derive(Debug)]
134pub struct EthereumEthApiBuilder<NetworkT = Ethereum>(PhantomData<NetworkT>);
135
136impl<NetworkT> Default for EthereumEthApiBuilder<NetworkT> {
137    fn default() -> Self {
138        Self(Default::default())
139    }
140}
141
142impl<N, NetworkT> EthApiBuilder<N> for EthereumEthApiBuilder<NetworkT>
143where
144    N: FullNodeComponents<
145        Types: NodeTypes<ChainSpec: Hardforks + EthereumHardforks>,
146        Evm: ConfigureEvm<NextBlockEnvCtx: BuildPendingEnv<HeaderTy<N::Types>>>,
147    >,
148    NetworkT: RpcTypes<TransactionRequest: SignableTxRequest<TxTy<N::Types>>>,
149    EthRpcConverterFor<N, NetworkT>: RpcConvert<
150        Primitives = PrimitivesTy<N::Types>,
151        Error = EthApiError,
152        Network = NetworkT,
153        Evm = N::Evm,
154    >,
155    EthApiError: FromEvmError<N::Evm>,
156{
157    type EthApi = EthApiFor<N, NetworkT>;
158
159    async fn build_eth_api(self, ctx: EthApiCtx<'_, N>) -> eyre::Result<Self::EthApi> {
160        Ok(ctx.eth_api_builder().map_converter(|r| r.with_network()).build())
161    }
162}
163
164/// Add-ons w.r.t. l1 ethereum.
165#[derive(Debug)]
166pub struct EthereumAddOns<
167    N: FullNodeComponents,
168    EthB: EthApiBuilder<N>,
169    PVB,
170    EB = BasicEngineApiBuilder<PVB>,
171    EVB = BasicEngineValidatorBuilder<PVB>,
172    RpcMiddleware = Identity,
173> {
174    inner: RpcAddOns<N, EthB, PVB, EB, EVB, RpcMiddleware>,
175}
176
177impl<N, EthB, PVB, EB, EVB, RpcMiddleware> EthereumAddOns<N, EthB, PVB, EB, EVB, RpcMiddleware>
178where
179    N: FullNodeComponents,
180    EthB: EthApiBuilder<N>,
181{
182    /// Creates a new instance from the inner `RpcAddOns`.
183    pub const fn new(inner: RpcAddOns<N, EthB, PVB, EB, EVB, RpcMiddleware>) -> Self {
184        Self { inner }
185    }
186}
187
188impl<N> Default for EthereumAddOns<N, EthereumEthApiBuilder, EthereumEngineValidatorBuilder>
189where
190    N: FullNodeComponents<
191        Types: NodeTypes<
192            ChainSpec: EthereumHardforks + Clone + 'static,
193            Payload: EngineTypes<ExecutionData = ExecutionData>
194                         + PayloadTypes<PayloadAttributes = EthPayloadAttributes>,
195            Primitives = EthPrimitives,
196        >,
197    >,
198    EthereumEthApiBuilder: EthApiBuilder<N>,
199{
200    fn default() -> Self {
201        Self::new(RpcAddOns::new(
202            EthereumEthApiBuilder::default(),
203            EthereumEngineValidatorBuilder::default(),
204            BasicEngineApiBuilder::default(),
205            BasicEngineValidatorBuilder::default(),
206            Default::default(),
207        ))
208    }
209}
210
211impl<N, EthB, PVB, EB, EVB, RpcMiddleware> EthereumAddOns<N, EthB, PVB, EB, EVB, RpcMiddleware>
212where
213    N: FullNodeComponents,
214    EthB: EthApiBuilder<N>,
215{
216    /// Replace the engine API builder.
217    pub fn with_engine_api<T>(
218        self,
219        engine_api_builder: T,
220    ) -> EthereumAddOns<N, EthB, PVB, T, EVB, RpcMiddleware>
221    where
222        T: Send,
223    {
224        let Self { inner } = self;
225        EthereumAddOns::new(inner.with_engine_api(engine_api_builder))
226    }
227
228    /// Replace the payload validator builder.
229    pub fn with_payload_validator<V, T>(
230        self,
231        payload_validator_builder: T,
232    ) -> EthereumAddOns<N, EthB, T, EB, EVB, RpcMiddleware> {
233        let Self { inner } = self;
234        EthereumAddOns::new(inner.with_payload_validator(payload_validator_builder))
235    }
236
237    /// Sets rpc middleware
238    pub fn with_rpc_middleware<T>(
239        self,
240        rpc_middleware: T,
241    ) -> EthereumAddOns<N, EthB, PVB, EB, EVB, T>
242    where
243        T: Send,
244    {
245        let Self { inner } = self;
246        EthereumAddOns::new(inner.with_rpc_middleware(rpc_middleware))
247    }
248
249    /// Sets the tokio runtime for the RPC servers.
250    ///
251    /// Caution: This runtime must not be created from within asynchronous context.
252    pub fn with_tokio_runtime(self, tokio_runtime: Option<tokio::runtime::Handle>) -> Self {
253        let Self { inner } = self;
254        Self { inner: inner.with_tokio_runtime(tokio_runtime) }
255    }
256}
257
258impl<N, EthB, PVB, EB, EVB, RpcMiddleware> NodeAddOns<N>
259    for EthereumAddOns<N, EthB, PVB, EB, EVB, RpcMiddleware>
260where
261    N: FullNodeComponents<
262        Types: NodeTypes<
263            ChainSpec: Hardforks + EthereumHardforks,
264            Primitives = EthPrimitives,
265            Payload: EngineTypes<ExecutionData = ExecutionData>,
266        >,
267        Evm: ConfigureEvm<NextBlockEnvCtx = NextBlockEnvAttributes>,
268    >,
269    EthB: EthApiBuilder<N>,
270    PVB: Send,
271    EB: EngineApiBuilder<N>,
272    EVB: EngineValidatorBuilder<N>,
273    EthApiError: FromEvmError<N::Evm>,
274    EvmFactoryFor<N::Evm>: EvmFactory<Tx = TxEnv>,
275    RpcMiddleware: RethRpcMiddleware,
276{
277    type Handle = RpcHandle<N, EthB::EthApi>;
278
279    async fn launch_add_ons(
280        self,
281        ctx: reth_node_api::AddOnsContext<'_, N>,
282    ) -> eyre::Result<Self::Handle> {
283        let validation_api = ValidationApi::<_, _, <N::Types as NodeTypes>::Payload>::new(
284            ctx.node.provider().clone(),
285            Arc::new(ctx.node.consensus().clone()),
286            ctx.node.evm_config().clone(),
287            ctx.config.rpc.flashbots_config(),
288            Box::new(ctx.node.task_executor().clone()),
289            Arc::new(EthereumEngineValidator::new(ctx.config.chain.clone())),
290        );
291
292        let eth_config =
293            EthConfigHandler::new(ctx.node.provider().clone(), ctx.node.evm_config().clone());
294
295        let testing_skip_invalid_transactions = ctx.config.rpc.testing_skip_invalid_transactions;
296
297        self.inner
298            .launch_add_ons_with(ctx, move |container| {
299                container.modules.merge_if_module_configured(
300                    RethRpcModule::Flashbots,
301                    validation_api.into_rpc(),
302                )?;
303
304                container
305                    .modules
306                    .merge_if_module_configured(RethRpcModule::Eth, eth_config.into_rpc())?;
307
308                // testing_buildBlockV1: only wire when the hidden testing module is explicitly
309                // requested on any transport. Default stays disabled to honor security guidance.
310                let mut testing_api = TestingApi::new(
311                    container.registry.eth_api().clone(),
312                    container.registry.evm_config().clone(),
313                );
314                if testing_skip_invalid_transactions {
315                    testing_api = testing_api.with_skip_invalid_transactions();
316                }
317                container
318                    .modules
319                    .merge_if_module_configured(RethRpcModule::Testing, testing_api.into_rpc())?;
320
321                Ok(())
322            })
323            .await
324    }
325}
326
327impl<N, EthB, PVB, EB, EVB, RpcMiddleware> RethRpcAddOns<N>
328    for EthereumAddOns<N, EthB, PVB, EB, EVB, RpcMiddleware>
329where
330    N: FullNodeComponents<
331        Types: NodeTypes<
332            ChainSpec: Hardforks + EthereumHardforks,
333            Primitives = EthPrimitives,
334            Payload: EngineTypes<ExecutionData = ExecutionData>,
335        >,
336        Evm: ConfigureEvm<NextBlockEnvCtx = NextBlockEnvAttributes>,
337    >,
338    EthB: EthApiBuilder<N>,
339    PVB: PayloadValidatorBuilder<N>,
340    EB: EngineApiBuilder<N>,
341    EVB: EngineValidatorBuilder<N>,
342    EthApiError: FromEvmError<N::Evm>,
343    EvmFactoryFor<N::Evm>: EvmFactory<Tx = TxEnv>,
344    RpcMiddleware: RethRpcMiddleware,
345{
346    type EthApi = EthB::EthApi;
347
348    fn hooks_mut(&mut self) -> &mut reth_node_builder::rpc::RpcHooks<N, Self::EthApi> {
349        self.inner.hooks_mut()
350    }
351}
352
353impl<N, EthB, PVB, EB, EVB, RpcMiddleware> EngineValidatorAddOn<N>
354    for EthereumAddOns<N, EthB, PVB, EB, EVB, RpcMiddleware>
355where
356    N: FullNodeComponents<
357        Types: NodeTypes<
358            ChainSpec: EthChainSpec + EthereumHardforks,
359            Primitives = EthPrimitives,
360            Payload: EngineTypes<ExecutionData = ExecutionData>,
361        >,
362        Evm: ConfigureEvm<NextBlockEnvCtx = NextBlockEnvAttributes>,
363    >,
364    EthB: EthApiBuilder<N>,
365    PVB: Send,
366    EB: EngineApiBuilder<N>,
367    EVB: EngineValidatorBuilder<N>,
368    EthApiError: FromEvmError<N::Evm>,
369    EvmFactoryFor<N::Evm>: EvmFactory<Tx = TxEnv>,
370    RpcMiddleware: Send,
371{
372    type ValidatorBuilder = EVB;
373
374    fn engine_validator_builder(&self) -> Self::ValidatorBuilder {
375        self.inner.engine_validator_builder()
376    }
377}
378
379impl<N> Node<N> for EthereumNode
380where
381    N: FullNodeTypes<Types = Self>,
382{
383    type ComponentsBuilder = ComponentsBuilder<
384        N,
385        EthereumPoolBuilder,
386        BasicPayloadServiceBuilder<EthereumPayloadBuilder>,
387        EthereumNetworkBuilder,
388        EthereumExecutorBuilder,
389        EthereumConsensusBuilder,
390    >;
391
392    type AddOns =
393        EthereumAddOns<NodeAdapter<N>, EthereumEthApiBuilder, EthereumEngineValidatorBuilder>;
394
395    fn components_builder(&self) -> Self::ComponentsBuilder {
396        Self::components()
397    }
398
399    fn add_ons(&self) -> Self::AddOns {
400        EthereumAddOns::default()
401    }
402}
403
404impl<N: FullNodeComponents<Types = Self>> DebugNode<N> for EthereumNode {
405    type RpcBlock = alloy_rpc_types_eth::Block;
406
407    fn rpc_to_primitive_block(rpc_block: Self::RpcBlock) -> reth_ethereum_primitives::Block {
408        rpc_block.into_consensus().convert_transactions()
409    }
410
411    fn local_payload_attributes_builder(
412        chain_spec: &Self::ChainSpec,
413    ) -> impl PayloadAttributesBuilder<<Self::Payload as PayloadTypes>::PayloadAttributes> {
414        LocalPayloadAttributesBuilder::new(Arc::new(chain_spec.clone()))
415    }
416}
417
418/// A regular ethereum evm and executor builder.
419#[derive(Debug, Default, Clone, Copy)]
420#[non_exhaustive]
421pub struct EthereumExecutorBuilder;
422
423impl<Types, Node> ExecutorBuilder<Node> for EthereumExecutorBuilder
424where
425    Types: NodeTypes<
426        ChainSpec: Hardforks + EthExecutorSpec + EthereumHardforks,
427        Primitives = EthPrimitives,
428    >,
429    Node: FullNodeTypes<Types = Types>,
430{
431    type EVM = EthEvmConfig<Types::ChainSpec>;
432
433    async fn build_evm(self, ctx: &BuilderContext<Node>) -> eyre::Result<Self::EVM> {
434        Ok(EthEvmConfig::new(ctx.chain_spec()))
435    }
436}
437
438/// A basic ethereum transaction pool.
439///
440/// This contains various settings that can be configured and take precedence over the node's
441/// config.
442#[derive(Debug, Default, Clone, Copy)]
443#[non_exhaustive]
444pub struct EthereumPoolBuilder {
445    // TODO add options for txpool args
446}
447
448impl<Types, Node, Evm> PoolBuilder<Node, Evm> for EthereumPoolBuilder
449where
450    Types: NodeTypes<
451        ChainSpec: EthereumHardforks,
452        Primitives: NodePrimitives<SignedTx = TransactionSigned>,
453    >,
454    Node: FullNodeTypes<Types = Types>,
455    Evm: ConfigureEvm<Primitives = PrimitivesTy<Types>> + Clone + 'static,
456{
457    type Pool = EthTransactionPool<Node::Provider, DiskFileBlobStore, Evm>;
458
459    async fn build_pool(
460        self,
461        ctx: &BuilderContext<Node>,
462        evm_config: Evm,
463    ) -> eyre::Result<Self::Pool> {
464        let pool_config = ctx.pool_config();
465
466        let blobs_disabled = ctx.config().txpool.disable_blobs_support ||
467            ctx.config().txpool.blobpool_max_count == 0;
468
469        let blob_cache_size = if let Some(blob_cache_size) = pool_config.blob_cache_size {
470            Some(blob_cache_size)
471        } else {
472            // get the current blob params for the current timestamp, fallback to default Cancun
473            // params
474            let current_timestamp =
475                SystemTime::now().duration_since(SystemTime::UNIX_EPOCH)?.as_secs();
476            let blob_params = ctx
477                .chain_spec()
478                .blob_params_at_timestamp(current_timestamp)
479                .unwrap_or_else(BlobParams::cancun);
480
481            // Derive the blob cache size from the target blob count, to auto scale it by
482            // multiplying it with the slot count for 2 epochs: 384 for pectra
483            Some((blob_params.target_blob_count * EPOCH_SLOTS * 2) as u32)
484        };
485
486        let blob_store =
487            reth_node_builder::components::create_blob_store_with_cache(ctx, blob_cache_size)?;
488
489        let validator =
490            TransactionValidationTaskExecutor::eth_builder(ctx.provider().clone(), evm_config)
491                .set_eip4844(!blobs_disabled)
492                .kzg_settings(ctx.kzg_settings()?)
493                .with_max_tx_input_bytes(ctx.config().txpool.max_tx_input_bytes)
494                .with_local_transactions_config(pool_config.local_transactions_config.clone())
495                .set_tx_fee_cap(ctx.config().rpc.rpc_tx_fee_cap)
496                .with_max_tx_gas_limit(ctx.config().txpool.max_tx_gas_limit)
497                .with_minimum_priority_fee(ctx.config().txpool.minimum_priority_fee)
498                .with_additional_tasks(ctx.config().txpool.additional_validation_tasks)
499                .build_with_tasks(ctx.task_executor().clone(), blob_store.clone());
500
501        if validator.validator().eip4844() {
502            // initializing the KZG settings can be expensive, this should be done upfront so that
503            // it doesn't impact the first block or the first gossiped blob transaction, so we
504            // initialize this in the background
505            let kzg_settings = validator.validator().kzg_settings().clone();
506            ctx.task_executor().spawn_blocking_task(async move {
507                let _ = kzg_settings.get();
508                debug!(target: "reth::cli", "Initialized KZG settings");
509            });
510        }
511
512        let transaction_pool = TxPoolBuilder::new(ctx)
513            .with_validator(validator)
514            .build_and_spawn_maintenance_task(blob_store, pool_config)?;
515
516        info!(target: "reth::cli", "Transaction pool initialized");
517        debug!(target: "reth::cli", "Spawned txpool maintenance task");
518
519        Ok(transaction_pool)
520    }
521}
522
523/// A basic ethereum payload service.
524#[derive(Debug, Default, Clone, Copy)]
525pub struct EthereumNetworkBuilder {
526    // TODO add closure to modify network
527}
528
529impl<Node, Pool> NetworkBuilder<Node, Pool> for EthereumNetworkBuilder
530where
531    Node: FullNodeTypes<Types: NodeTypes<ChainSpec: Hardforks>>,
532    Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TxTy<Node::Types>>>
533        + Unpin
534        + 'static,
535{
536    type Network =
537        NetworkHandle<BasicNetworkPrimitives<PrimitivesTy<Node::Types>, PoolPooledTx<Pool>>>;
538
539    async fn build_network(
540        self,
541        ctx: &BuilderContext<Node>,
542        pool: Pool,
543    ) -> eyre::Result<Self::Network> {
544        let network = ctx.network_builder().await?;
545        let handle = ctx.start_network(network, pool);
546        info!(target: "reth::cli", enode=%handle.local_node_record(), "P2P networking initialized");
547        Ok(handle)
548    }
549}
550
551/// A basic ethereum consensus builder.
552#[derive(Debug, Default, Clone, Copy)]
553pub struct EthereumConsensusBuilder {
554    // TODO add closure to modify consensus
555}
556
557impl<Node> ConsensusBuilder<Node> for EthereumConsensusBuilder
558where
559    Node: FullNodeTypes<
560        Types: NodeTypes<ChainSpec: EthChainSpec + EthereumHardforks, Primitives = EthPrimitives>,
561    >,
562{
563    type Consensus = Arc<EthBeaconConsensus<<Node::Types as NodeTypes>::ChainSpec>>;
564
565    async fn build_consensus(self, ctx: &BuilderContext<Node>) -> eyre::Result<Self::Consensus> {
566        Ok(Arc::new(EthBeaconConsensus::new(ctx.chain_spec())))
567    }
568}
569
570/// Builder for [`EthereumEngineValidator`].
571#[derive(Debug, Default, Clone)]
572#[non_exhaustive]
573pub struct EthereumEngineValidatorBuilder;
574
575impl<Node, Types> PayloadValidatorBuilder<Node> for EthereumEngineValidatorBuilder
576where
577    Types: NodeTypes<
578        ChainSpec: Hardforks + EthereumHardforks + Clone + 'static,
579        Payload: EngineTypes<ExecutionData = ExecutionData>
580                     + PayloadTypes<PayloadAttributes = EthPayloadAttributes>,
581        Primitives = EthPrimitives,
582    >,
583    Node: FullNodeComponents<Types = Types>,
584{
585    type Validator = EthereumEngineValidator<Types::ChainSpec>;
586
587    async fn build(self, ctx: &AddOnsContext<'_, Node>) -> eyre::Result<Self::Validator> {
588        Ok(EthereumEngineValidator::new(ctx.config.chain.clone()))
589    }
590}