mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-29 09:08:05 -05:00
chore(sync): remove timeout from downloader (#356)
This commit is contained in:
@@ -7,7 +7,7 @@ use crate::{
|
||||
use futures::Stream;
|
||||
use reth_primitives::SealedHeader;
|
||||
use reth_rpc_types::engine::ForkchoiceState;
|
||||
use std::{pin::Pin, time::Duration};
|
||||
use std::pin::Pin;
|
||||
|
||||
/// A Future for downloading a batch of headers.
|
||||
pub type HeaderBatchDownload<'a> = Pin<
|
||||
@@ -38,9 +38,6 @@ pub trait HeaderDownloader: Sync + Send + Unpin {
|
||||
/// The Client used to download the headers
|
||||
type Client: HeadersClient;
|
||||
|
||||
/// The request timeout duration
|
||||
fn timeout(&self) -> Duration;
|
||||
|
||||
/// The consensus engine
|
||||
fn consensus(&self) -> &Self::Consensus;
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ use std::{
|
||||
Arc,
|
||||
},
|
||||
task::{ready, Context, Poll},
|
||||
time::Duration,
|
||||
};
|
||||
use tokio::sync::{watch, Mutex};
|
||||
|
||||
@@ -59,10 +58,6 @@ impl HeaderDownloader for TestHeaderDownloader {
|
||||
type Consensus = TestConsensus;
|
||||
type Client = TestHeadersClient;
|
||||
|
||||
fn timeout(&self) -> Duration {
|
||||
Duration::from_millis(1000)
|
||||
}
|
||||
|
||||
fn consensus(&self) -> &Self::Consensus {
|
||||
&self.consensus
|
||||
}
|
||||
|
||||
@@ -35,8 +35,6 @@ pub struct LinearDownloader<C, H> {
|
||||
client: Arc<H>,
|
||||
/// The batch size per one request
|
||||
pub batch_size: u64,
|
||||
/// A single request timeout
|
||||
pub request_timeout: Duration,
|
||||
/// The number of retries for downloading
|
||||
pub request_retries: usize,
|
||||
}
|
||||
@@ -49,11 +47,6 @@ where
|
||||
type Consensus = C;
|
||||
type Client = H;
|
||||
|
||||
/// The request timeout
|
||||
fn timeout(&self) -> Duration {
|
||||
self.request_timeout
|
||||
}
|
||||
|
||||
fn consensus(&self) -> &Self::Consensus {
|
||||
self.consensus.borrow()
|
||||
}
|
||||
@@ -77,7 +70,6 @@ impl<C: Consensus, H: HeadersClient> Clone for LinearDownloader<C, H> {
|
||||
consensus: Arc::clone(&self.consensus),
|
||||
client: Arc::clone(&self.client),
|
||||
batch_size: self.batch_size,
|
||||
request_timeout: self.request_timeout,
|
||||
request_retries: self.request_retries,
|
||||
}
|
||||
}
|
||||
@@ -422,7 +414,6 @@ impl LinearDownloadBuilder {
|
||||
consensus,
|
||||
client,
|
||||
batch_size: self.batch_size,
|
||||
request_timeout: self.request_timeout,
|
||||
request_retries: self.request_retries,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user