feat: make downloaders and clients generic over block parts (#12469)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Arsenii Kulikov
2024-11-12 19:13:21 +04:00
committed by GitHub
parent 3a337cd7d4
commit aece53ae88
60 changed files with 631 additions and 409 deletions

View File

@@ -760,7 +760,7 @@ where
/// necessary
pub async fn max_block<C>(&self, client: C) -> eyre::Result<Option<BlockNumber>>
where
C: HeadersClient,
C: HeadersClient<Header = reth_primitives::Header>,
{
self.node_config().max_block(client, self.provider_factory().clone()).await
}

View File

@@ -12,7 +12,7 @@ use reth_downloaders::{
use reth_evm::execute::BlockExecutorProvider;
use reth_exex::ExExManagerHandle;
use reth_network_p2p::{
bodies::downloader::BodyDownloader, headers::downloader::HeaderDownloader, BlockClient,
bodies::downloader::BodyDownloader, headers::downloader::HeaderDownloader, EthBlockClient,
};
use reth_provider::{providers::ProviderNodeTypes, ProviderFactory};
use reth_stages::{prelude::DefaultStages, stages::ExecutionStage, Pipeline, StageSet};
@@ -38,7 +38,7 @@ pub fn build_networked_pipeline<N, Client, Executor>(
) -> eyre::Result<Pipeline<N>>
where
N: ProviderNodeTypes,
Client: BlockClient + 'static,
Client: EthBlockClient + 'static,
Executor: BlockExecutorProvider,
{
// building network downloaders using the fetch client
@@ -84,8 +84,8 @@ pub fn build_pipeline<N, H, B, Executor>(
) -> eyre::Result<Pipeline<N>>
where
N: ProviderNodeTypes,
H: HeaderDownloader + 'static,
B: BodyDownloader + 'static,
H: HeaderDownloader<Header = reth_primitives::Header> + 'static,
B: BodyDownloader<Body = reth_primitives::BlockBody> + 'static,
Executor: BlockExecutorProvider,
{
let mut builder = Pipeline::<N>::builder();