feat: NodePrimitivesProvider (#12855)

This commit is contained in:
Arsenii Kulikov
2024-11-26 16:06:55 +04:00
committed by GitHub
parent b34fb7883a
commit 26fc701814
40 changed files with 239 additions and 148 deletions

View File

@ -28,7 +28,7 @@ use reth_node_core::{
primitives::Head,
};
use reth_node_events::{cl::ConsensusLayerHealthEvents, node};
use reth_primitives::EthereumHardforks;
use reth_primitives::{EthPrimitives, EthereumHardforks};
use reth_provider::providers::{BlockchainProvider2, ProviderNodeTypes};
use reth_tasks::TaskExecutor;
use reth_tokio_util::EventSender;
@ -70,7 +70,8 @@ impl EngineNodeLauncher {
impl<Types, T, CB, AO> LaunchNode<NodeBuilderWithComponents<T, CB, AO>> for EngineNodeLauncher
where
Types: ProviderNodeTypes + NodeTypesWithEngine + PersistenceNodeTypes,
Types:
ProviderNodeTypes<Primitives = EthPrimitives> + NodeTypesWithEngine + PersistenceNodeTypes,
T: FullNodeTypes<Types = Types, Provider = BlockchainProvider2<Types>>,
CB: NodeComponentsBuilder<T>,
AO: RethRpcAddOns<NodeAdapter<T, CB::Components>>,

View File

@ -10,7 +10,7 @@ use reth_exex::{
DEFAULT_EXEX_MANAGER_CAPACITY,
};
use reth_node_api::{FullNodeComponents, NodeTypes};
use reth_primitives::Head;
use reth_primitives::{EthPrimitives, Head};
use reth_provider::CanonStateSubscriptions;
use reth_tracing::tracing::{debug, info};
use tracing::Instrument;
@ -25,7 +25,9 @@ pub struct ExExLauncher<Node: FullNodeComponents> {
config_container: WithConfigs<<Node::Types as NodeTypes>::ChainSpec>,
}
impl<Node: FullNodeComponents + Clone> ExExLauncher<Node> {
impl<Node: FullNodeComponents<Types: NodeTypes<Primitives = EthPrimitives>> + Clone>
ExExLauncher<Node>
{
/// Create a new `ExExLauncher` with the given extensions.
pub const fn new(
head: Head,

View File

@ -18,6 +18,7 @@ use reth_node_core::{
version::{CARGO_PKG_VERSION, CLIENT_CODE, NAME_CLIENT, VERGEN_GIT_SHA},
};
use reth_payload_builder::PayloadStore;
use reth_primitives::EthPrimitives;
use reth_provider::providers::ProviderNodeTypes;
use reth_rpc::{
eth::{EthApiTypes, FullEthApiServer},
@ -402,7 +403,7 @@ where
impl<N, EthApi, EV> RpcAddOns<N, EthApi, EV>
where
N: FullNodeComponents<
Types: ProviderNodeTypes,
Types: ProviderNodeTypes<Primitives = EthPrimitives>,
PayloadBuilder: PayloadBuilder<PayloadType = <N::Types as NodeTypesWithEngine>::Engine>,
>,
EthApi: EthApiTypes + FullEthApiServer + AddDevSigners + Unpin + 'static,
@ -524,7 +525,7 @@ where
impl<N, EthApi, EV> NodeAddOns<N> for RpcAddOns<N, EthApi, EV>
where
N: FullNodeComponents<
Types: ProviderNodeTypes,
Types: ProviderNodeTypes<Primitives = EthPrimitives>,
PayloadBuilder: PayloadBuilder<PayloadType = <N::Types as NodeTypesWithEngine>::Engine>,
>,
EthApi: EthApiTypes + FullEthApiServer + AddDevSigners + Unpin + 'static,
@ -566,7 +567,9 @@ pub trait EthApiBuilder<N: FullNodeComponents>: 'static {
fn build(ctx: &EthApiBuilderCtx<N>) -> Self;
}
impl<N: FullNodeComponents> EthApiBuilder<N> for EthApi<N::Provider, N::Pool, N::Network, N::Evm> {
impl<N: FullNodeComponents<Types: NodeTypes<Primitives = EthPrimitives>>> EthApiBuilder<N>
for EthApi<N::Provider, N::Pool, N::Network, N::Evm>
{
fn build(ctx: &EthApiBuilderCtx<N>) -> Self {
Self::with_spawner(ctx)
}