Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions crates/optimism/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,10 @@ where
OpConsensusBuilder,
>;

type AddOns =
OpAddOns<NodeAdapter<N, <Self::ComponentsBuilder as NodeComponentsBuilder<N>>::Components>>;
type AddOns = OpAddOns<
NodeAdapter<N, <Self::ComponentsBuilder as NodeComponentsBuilder<N>>::Components>,
OpEthApiBuilder,
>;

fn components_builder(&self) -> Self::ComponentsBuilder {
Self::components(self)
Expand Down Expand Up @@ -236,19 +238,15 @@ impl NodeTypes for OpNode {

/// Add-ons w.r.t. optimism.
#[derive(Debug)]
pub struct OpAddOns<N>
where
pub struct OpAddOns<
N: FullNodeComponents,
OpEthApiBuilder: EthApiBuilder<N>,
{
EthB: EthApiBuilder<N>,
EV = OpEngineValidatorBuilder,
EB = OpEngineApiBuilder<OpEngineValidatorBuilder>,
> {
/// Rpc add-ons responsible for launching the RPC servers and instantiating the RPC handlers
/// and eth-api.
pub rpc_add_ons: RpcAddOns<
N,
OpEthApiBuilder,
OpEngineValidatorBuilder,
OpEngineApiBuilder<OpEngineValidatorBuilder>,
>,
pub rpc_add_ons: RpcAddOns<N, EthB, EV, EB>,
/// Data availability configuration for the OP builder.
pub da_config: OpDAConfig,
/// Sequencer client, configured to forward submitted transactions to sequencer of given OP
Expand All @@ -258,7 +256,7 @@ where
enable_tx_conditional: bool,
}

impl<N> Default for OpAddOns<N>
impl<N> Default for OpAddOns<N, OpEthApiBuilder>
where
N: FullNodeComponents<Types: NodeTypes<Primitives = OpPrimitives>>,
OpEthApiBuilder: EthApiBuilder<N>,
Expand All @@ -268,7 +266,7 @@ where
}
}

impl<N> OpAddOns<N>
impl<N> OpAddOns<N, OpEthApiBuilder>
where
N: FullNodeComponents<Types: NodeTypes<Primitives = OpPrimitives>>,
OpEthApiBuilder: EthApiBuilder<N>,
Expand All @@ -279,7 +277,7 @@ where
}
}

impl<N> NodeAddOns<N> for OpAddOns<N>
impl<N> NodeAddOns<N> for OpAddOns<N, OpEthApiBuilder>
where
N: FullNodeComponents<
Types: NodeTypes<
Expand Down Expand Up @@ -364,7 +362,7 @@ where
}
}

impl<N> RethRpcAddOns<N> for OpAddOns<N>
impl<N> RethRpcAddOns<N> for OpAddOns<N, OpEthApiBuilder>
where
N: FullNodeComponents<
Types: NodeTypes<
Expand All @@ -386,7 +384,7 @@ where
}
}

impl<N> EngineValidatorAddOn<N> for OpAddOns<N>
impl<N> EngineValidatorAddOn<N> for OpAddOns<N, OpEthApiBuilder>
where
N: FullNodeComponents<
Types: NodeTypes<
Expand Down Expand Up @@ -439,7 +437,7 @@ impl OpAddOnsBuilder {

impl OpAddOnsBuilder {
/// Builds an instance of [`OpAddOns`].
pub fn build<N>(self) -> OpAddOns<N>
pub fn build<N>(self) -> OpAddOns<N, OpEthApiBuilder>
where
N: FullNodeComponents<Types: NodeTypes<Primitives = OpPrimitives>>,
OpEthApiBuilder: EthApiBuilder<N>,
Expand All @@ -449,8 +447,8 @@ impl OpAddOnsBuilder {
OpAddOns {
rpc_add_ons: RpcAddOns::new(
OpEthApiBuilder::default().with_sequencer(sequencer_url.clone()),
Default::default(),
Default::default(),
OpEngineValidatorBuilder::default(),
OpEngineApiBuilder::default(),
),
da_config: da_config.unwrap_or_default(),
sequencer_url,
Expand Down
Loading