Trait reth_network_p2p::headers::downloader::HeaderDownloader
source · pub trait HeaderDownloader:
Send
+ Sync
+ Stream<Item = HeadersDownloaderResult<Vec<SealedHeader>>>
+ Unpin {
// Required methods
fn update_local_head(&mut self, head: SealedHeader);
fn update_sync_target(&mut self, target: SyncTarget);
fn set_batch_size(&mut self, limit: usize);
// Provided method
fn update_sync_gap(&mut self, head: SealedHeader, target: SyncTarget) { ... }
}
Expand description
A downloader capable of fetching and yielding block headers.
A downloader represents a distinct strategy for submitting requests to download block headers,
while a HeadersClient
represents a client capable
of fulfilling these requests.
A HeaderDownloader
is a [Stream] that returns batches of headers.
Required Methods§
sourcefn update_local_head(&mut self, head: SealedHeader)
fn update_local_head(&mut self, head: SealedHeader)
Updates the block number of the local database
sourcefn update_sync_target(&mut self, target: SyncTarget)
fn update_sync_target(&mut self, target: SyncTarget)
Updates the target we want to sync to
sourcefn set_batch_size(&mut self, limit: usize)
fn set_batch_size(&mut self, limit: usize)
Sets the headers batch size that the Stream should return.
Provided Methods§
sourcefn update_sync_gap(&mut self, head: SealedHeader, target: SyncTarget)
fn update_sync_gap(&mut self, head: SealedHeader, target: SyncTarget)
Updates the gap to sync which ranges from local head to the sync target
See also HeaderDownloader::update_sync_target
and
HeaderDownloader::update_local_head
Implementors§
impl HeaderDownloader for TestHeaderDownloader
Available on crate feature
test-utils
only.