feat: concurrent headers downloader (#891)

This commit is contained in:
Matthias Seitz
2023-01-20 12:06:06 +01:00
committed by GitHub
parent eb11da8adf
commit b4080a7de5
11 changed files with 1346 additions and 705 deletions

View File

@ -150,13 +150,19 @@ impl Command {
.with_channel(sender)
.push(HeaderStage {
downloader: headers::linear::LinearDownloadBuilder::default()
.batch_size(config.stages.headers.downloader_batch_size)
.retries(config.stages.headers.downloader_retries)
.build(consensus.clone(), fetch_client.clone()),
.request_limit(config.stages.headers.downloader_batch_size)
.stream_batch_size(config.stages.headers.commit_threshold as usize)
// NOTE: the head and target will be set from inside the stage before the
// downloader is called
.build(
consensus.clone(),
fetch_client.clone(),
Default::default(),
Default::default(),
),
consensus: consensus.clone(),
client: fetch_client.clone(),
network_handle: network.clone(),
commit_threshold: config.stages.headers.commit_threshold,
metrics: HeaderMetrics::default(),
})
.push(TotalDifficultyStage {