mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-15 09:25:33 -05:00
refactor: relax OpAddOns trait bounds (#16582)
This commit is contained in:
@@ -25,8 +25,8 @@ use reth_node_builder::{
|
||||
},
|
||||
node::{FullNodeTypes, NodeTypes},
|
||||
rpc::{
|
||||
EngineValidatorAddOn, EngineValidatorBuilder, EthApiBuilder, RethRpcAddOns,
|
||||
RethRpcServerHandles, RpcAddOns, RpcContext, RpcHandle,
|
||||
EngineApiBuilder, EngineValidatorAddOn, EngineValidatorBuilder, EthApiBuilder,
|
||||
RethRpcAddOns, RethRpcServerHandles, RpcAddOns, RpcContext, RpcHandle,
|
||||
},
|
||||
BuilderContext, DebugNode, Node, NodeAdapter, NodeComponentsBuilder,
|
||||
};
|
||||
@@ -201,6 +201,8 @@ where
|
||||
type AddOns = OpAddOns<
|
||||
NodeAdapter<N, <Self::ComponentsBuilder as NodeComponentsBuilder<N>>::Components>,
|
||||
OpEthApiBuilder,
|
||||
OpEngineValidatorBuilder,
|
||||
OpEngineApiBuilder<OpEngineValidatorBuilder>,
|
||||
>;
|
||||
|
||||
fn components_builder(&self) -> Self::ComponentsBuilder {
|
||||
@@ -238,12 +240,7 @@ impl NodeTypes for OpNode {
|
||||
|
||||
/// Add-ons w.r.t. optimism.
|
||||
#[derive(Debug)]
|
||||
pub struct OpAddOns<
|
||||
N: FullNodeComponents,
|
||||
EthB: EthApiBuilder<N>,
|
||||
EV = OpEngineValidatorBuilder,
|
||||
EB = OpEngineApiBuilder<OpEngineValidatorBuilder>,
|
||||
> {
|
||||
pub struct OpAddOns<N: FullNodeComponents, EthB: EthApiBuilder<N>, EV, EB> {
|
||||
/// Rpc add-ons responsible for launching the RPC servers and instantiating the RPC handlers
|
||||
/// and eth-api.
|
||||
pub rpc_add_ons: RpcAddOns<N, EthB, EV, EB>,
|
||||
@@ -258,7 +255,13 @@ pub struct OpAddOns<
|
||||
enable_tx_conditional: bool,
|
||||
}
|
||||
|
||||
impl<N, NetworkT> Default for OpAddOns<N, OpEthApiBuilder<NetworkT>>
|
||||
impl<N, NetworkT> Default
|
||||
for OpAddOns<
|
||||
N,
|
||||
OpEthApiBuilder<NetworkT>,
|
||||
OpEngineValidatorBuilder,
|
||||
OpEngineApiBuilder<OpEngineValidatorBuilder>,
|
||||
>
|
||||
where
|
||||
N: FullNodeComponents<Types: NodeTypes>,
|
||||
OpEthApiBuilder<NetworkT>: EthApiBuilder<N>,
|
||||
@@ -268,7 +271,13 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<N, NetworkT> OpAddOns<N, OpEthApiBuilder<NetworkT>>
|
||||
impl<N, NetworkT>
|
||||
OpAddOns<
|
||||
N,
|
||||
OpEthApiBuilder<NetworkT>,
|
||||
OpEngineValidatorBuilder,
|
||||
OpEngineApiBuilder<OpEngineValidatorBuilder>,
|
||||
>
|
||||
where
|
||||
N: FullNodeComponents<Types: NodeTypes>,
|
||||
OpEthApiBuilder<NetworkT>: EthApiBuilder<N>,
|
||||
@@ -341,7 +350,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<N, NetworkT> NodeAddOns<N> for OpAddOns<N, OpEthApiBuilder<NetworkT>>
|
||||
impl<N, NetworkT, EV, EB> NodeAddOns<N> for OpAddOns<N, OpEthApiBuilder<NetworkT>, EV, EB>
|
||||
where
|
||||
N: FullNodeComponents<
|
||||
Types: NodeTypes<
|
||||
@@ -357,6 +366,8 @@ where
|
||||
EvmFactoryFor<N::Evm>: EvmFactory<Tx = op_revm::OpTransaction<TxEnv>>,
|
||||
OpEthApi<N, NetworkT>: FullEthApiServer<Provider = N::Provider, Pool = N::Pool>,
|
||||
NetworkT: op_alloy_network::Network + Unpin,
|
||||
EV: EngineValidatorBuilder<N>,
|
||||
EB: EngineApiBuilder<N>,
|
||||
{
|
||||
type Handle = RpcHandle<N, OpEthApi<N, NetworkT>>;
|
||||
|
||||
@@ -434,7 +445,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<N, NetworkT> RethRpcAddOns<N> for OpAddOns<N, OpEthApiBuilder<NetworkT>>
|
||||
impl<N, NetworkT, EV, EB> RethRpcAddOns<N> for OpAddOns<N, OpEthApiBuilder<NetworkT>, EV, EB>
|
||||
where
|
||||
N: FullNodeComponents<
|
||||
Types: NodeTypes<
|
||||
@@ -450,6 +461,8 @@ where
|
||||
EvmFactoryFor<N::Evm>: EvmFactory<Tx = op_revm::OpTransaction<TxEnv>>,
|
||||
OpEthApi<N, NetworkT>: FullEthApiServer<Provider = N::Provider, Pool = N::Pool>,
|
||||
NetworkT: op_alloy_network::Network + Unpin,
|
||||
EV: EngineValidatorBuilder<N>,
|
||||
EB: EngineApiBuilder<N>,
|
||||
{
|
||||
type EthApi = OpEthApi<N, NetworkT>;
|
||||
|
||||
@@ -458,7 +471,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<N, NetworkT> EngineValidatorAddOn<N> for OpAddOns<N, OpEthApiBuilder<NetworkT>>
|
||||
impl<N, NetworkT, EV, EB> EngineValidatorAddOn<N> for OpAddOns<N, OpEthApiBuilder<NetworkT>, EV, EB>
|
||||
where
|
||||
N: FullNodeComponents<
|
||||
Types: NodeTypes<
|
||||
@@ -468,6 +481,8 @@ where
|
||||
>,
|
||||
>,
|
||||
OpEthApiBuilder<NetworkT>: EthApiBuilder<N>,
|
||||
EV: EngineValidatorBuilder<N>,
|
||||
EB: EngineApiBuilder<N>,
|
||||
{
|
||||
type Validator = OpEngineValidator<
|
||||
N::Provider,
|
||||
@@ -537,7 +552,14 @@ impl<NetworkT> OpAddOnsBuilder<NetworkT> {
|
||||
|
||||
impl<NetworkT> OpAddOnsBuilder<NetworkT> {
|
||||
/// Builds an instance of [`OpAddOns`].
|
||||
pub fn build<N>(self) -> OpAddOns<N, OpEthApiBuilder<NetworkT>>
|
||||
pub fn build<N>(
|
||||
self,
|
||||
) -> OpAddOns<
|
||||
N,
|
||||
OpEthApiBuilder<NetworkT>,
|
||||
OpEngineValidatorBuilder,
|
||||
OpEngineApiBuilder<OpEngineValidatorBuilder>,
|
||||
>
|
||||
where
|
||||
N: FullNodeComponents<Types: NodeTypes>,
|
||||
OpEthApiBuilder<NetworkT>: EthApiBuilder<N>,
|
||||
|
||||
Reference in New Issue
Block a user