mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(downloader): replace database with header provider (#5472)
This commit is contained in:
@ -147,7 +147,11 @@ impl ImportCommand {
|
||||
.into_task();
|
||||
|
||||
let body_downloader = BodiesDownloaderBuilder::from(config.stages.bodies)
|
||||
.build(file_client.clone(), consensus.clone(), db.clone())
|
||||
.build(
|
||||
file_client.clone(),
|
||||
consensus.clone(),
|
||||
ProviderFactory::new(db.clone(), self.chain.clone()),
|
||||
)
|
||||
.into_task();
|
||||
|
||||
let (tip_tx, tip_rx) = watch::channel(B256::ZERO);
|
||||
|
||||
@ -102,7 +102,11 @@ impl Command {
|
||||
.into_task_with(task_executor);
|
||||
|
||||
let body_downloader = BodiesDownloaderBuilder::from(config.stages.bodies)
|
||||
.build(client, Arc::clone(&consensus), db.clone())
|
||||
.build(
|
||||
client,
|
||||
Arc::clone(&consensus),
|
||||
ProviderFactory::new(db.clone(), self.chain.clone()),
|
||||
)
|
||||
.into_task_with(task_executor);
|
||||
|
||||
let stage_conf = &config.stages;
|
||||
|
||||
@ -617,7 +617,11 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {
|
||||
.into_task_with(task_executor);
|
||||
|
||||
let body_downloader = BodiesDownloaderBuilder::from(config.stages.bodies)
|
||||
.build(client, Arc::clone(&consensus), db.clone())
|
||||
.build(
|
||||
client,
|
||||
Arc::clone(&consensus),
|
||||
ProviderFactory::new(db.clone(), self.chain.clone()),
|
||||
)
|
||||
.into_task_with(task_executor);
|
||||
|
||||
let pipeline = self
|
||||
|
||||
@ -163,6 +163,9 @@ impl Command {
|
||||
|
||||
let default_peers_path = data_dir.known_peers_path();
|
||||
|
||||
let provider_factory =
|
||||
Arc::new(ProviderFactory::new(db.clone(), self.chain.clone()));
|
||||
|
||||
let network = self
|
||||
.network
|
||||
.network_config(
|
||||
@ -171,7 +174,7 @@ impl Command {
|
||||
p2p_secret_key,
|
||||
default_peers_path,
|
||||
)
|
||||
.build(Arc::new(ProviderFactory::new(db.clone(), self.chain.clone())))
|
||||
.build(provider_factory.clone())
|
||||
.start_network()
|
||||
.await?;
|
||||
let fetch_client = Arc::new(network.fetch_client().await?);
|
||||
@ -187,9 +190,8 @@ impl Command {
|
||||
config.stages.bodies.downloader_min_concurrent_requests..=
|
||||
config.stages.bodies.downloader_max_concurrent_requests,
|
||||
)
|
||||
.build(fetch_client, consensus.clone(), db.clone()),
|
||||
.build(fetch_client, consensus.clone(), provider_factory),
|
||||
);
|
||||
|
||||
(Box::new(stage), None)
|
||||
}
|
||||
StageEnum::Senders => (Box::new(SenderRecoveryStage::new(batch_size)), None),
|
||||
|
||||
Reference in New Issue
Block a user