Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
frisitano committed Dec 20, 2024
1 parent 471764a commit 7186038
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 24 deletions.
2 changes: 1 addition & 1 deletion crates/scroll/node/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use reth_consensus::noop::NoopConsensus;
use reth_node_builder::{components::ConsensusBuilder, BuilderContext, FullNodeTypes};

/// The consensus builder for Scroll.
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct ScrollConsensusBuilder;

impl<Node: FullNodeTypes> ConsensusBuilder<Node> for ScrollConsensusBuilder {
Expand Down
1 change: 0 additions & 1 deletion crates/scroll/node/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use reth_node_builder::{
};
use reth_node_types::NodeTypesWithEngine;
use reth_primitives::{Block, EthPrimitives, SealedBlock, SealedBlockFor};
use reth_primitives_traits::NodePrimitives;
use reth_scroll_chainspec::ScrollChainSpec;

/// Builder for [`ScrollEngineValidator`].
Expand Down
2 changes: 1 addition & 1 deletion crates/scroll/node/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use reth_scroll_chainspec::ScrollChainSpec;
use reth_scroll_evm::{ScrollEvmConfig, ScrollExecutionStrategyFactory};

/// Executor builder for Scroll.
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct ScrollExecutorBuilder;

impl<Node> ExecutorBuilder<Node> for ScrollExecutorBuilder
Expand Down
56 changes: 38 additions & 18 deletions crates/scroll/node/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
//! Node specific implementations for Scroll.
#![cfg(all(feature = "scroll", not(feature = "optimism")))]

use reth_ethereum_engine_primitives::EthEngineTypes;
use reth_ethereum_engine_primitives::{
EthBuiltPayload, EthPayloadAttributes, EthPayloadBuilderAttributes,
};
use reth_node_builder::{
components::ComponentsBuilder, FullNodeTypes, Node, NodeAdapter, NodeComponentsBuilder,
components::ComponentsBuilder,
node::{FullNodeTypes, NodeTypes, NodeTypesWithEngine},
Node, NodeAdapter, NodeComponentsBuilder, PayloadTypes,
};
use reth_node_types::{NodeTypesWithDB, NodeTypesWithEngine};
use reth_primitives::EthPrimitives;
use reth_scroll_chainspec::ScrollChainSpec;

Expand Down Expand Up @@ -39,16 +42,39 @@ mod types;
#[derive(Clone, Debug)]
pub struct ScrollNode;

impl ScrollNode {
/// Returns a [`ComponentsBuilder`] configured for a regular Ethereum node.
pub fn components<Node>() -> ComponentsBuilder<
Node,
ScrollPoolBuilder,
ScrollPayloadBuilder,
ScrollNetworkBuilder,
ScrollExecutorBuilder,
ScrollConsensusBuilder,
>
where
Node: FullNodeTypes<
Types: NodeTypes<ChainSpec = ScrollChainSpec, Primitives = EthPrimitives>,
>,
<Node::Types as NodeTypesWithEngine>::Engine: PayloadTypes<
BuiltPayload = EthBuiltPayload,
PayloadAttributes = EthPayloadAttributes,
PayloadBuilderAttributes = EthPayloadBuilderAttributes,
>,
{
ComponentsBuilder::default()
.node_types::<Node>()
.pool(ScrollPoolBuilder)
.payload(ScrollPayloadBuilder)
.network(ScrollNetworkBuilder)
.executor(ScrollExecutorBuilder)
.consensus(ScrollConsensusBuilder)
}
}

impl<N> Node<N> for ScrollNode
where
N: FullNodeTypes,
N::Types: NodeTypesWithDB
+ NodeTypesWithEngine<
ChainSpec = ScrollChainSpec,
Primitives = EthPrimitives,
Engine = EthEngineTypes,
Storage = ScrollStorage,
>,
N: FullNodeTypes<Types = Self>,
{
type ComponentsBuilder = ComponentsBuilder<
N,
Expand All @@ -64,13 +90,7 @@ where
>;

fn components_builder(&self) -> Self::ComponentsBuilder {
ComponentsBuilder::default()
.node_types::<N>()
.pool(ScrollPoolBuilder)
.payload(ScrollPayloadBuilder)
.network(ScrollNetworkBuilder)
.executor(ScrollExecutorBuilder)
.consensus(ScrollConsensusBuilder)
Self::components()
}

fn add_ons(&self) -> Self::AddOns {
Expand Down
2 changes: 1 addition & 1 deletion crates/scroll/node/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use reth_tracing::tracing::info;
use reth_transaction_pool::{PoolTransaction, TransactionPool};

/// The network builder for Scroll.
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct ScrollNetworkBuilder;

impl<Node, Pool> NetworkBuilder<Node, Pool> for ScrollNetworkBuilder
Expand Down
2 changes: 1 addition & 1 deletion crates/scroll/node/src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use reth_provider::CanonStateSubscriptions;
use reth_transaction_pool::TransactionPool;

/// Payload builder for Scroll.
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct ScrollPayloadBuilder;

impl<Node, Pool> PayloadServiceBuilder<Node, Pool> for ScrollPayloadBuilder
Expand Down
2 changes: 1 addition & 1 deletion crates/scroll/node/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use reth_scroll_chainspec::ScrollChainSpec;
use reth_transaction_pool::noop::NoopTransactionPool;

/// Pool builder for Scroll.
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct ScrollPoolBuilder;

impl<Node> PoolBuilder<Node> for ScrollPoolBuilder
Expand Down

0 comments on commit 7186038

Please sign in to comment.