reth_downloaders/
lib.rs

1//! Implements the downloader algorithms.
2//!
3//! ## Feature Flags
4//!
5//! - `test-utils`: Export utilities for testing
6//! - `file-client`: Enables the file-based clients for reading blocks and receipts from files.
7
8#![doc(
9    html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
10    html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
11    issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
12)]
13#![cfg_attr(not(test), warn(unused_crate_dependencies))]
14#![cfg_attr(docsrs, feature(doc_cfg))]
15
16#[cfg(any(test, feature = "test-utils"))]
17use tempfile as _;
18
19/// The collection of algorithms for downloading block bodies.
20pub mod bodies;
21
22/// The collection of algorithms for downloading block headers.
23pub mod headers;
24
25/// Common downloader metrics.
26pub mod metrics;
27
28/// Module managing file-based data retrieval and buffering.
29///
30/// Contains [`FileClient`](file_client::FileClient) to read block data from files,
31/// efficiently buffering headers and bodies for retrieval.
32#[cfg(any(test, feature = "file-client"))]
33pub mod file_client;
34
35/// Module managing file-based data retrieval and buffering of receipts.
36///
37/// Contains [`ReceiptFileClient`](receipt_file_client::ReceiptFileClient) to read receipt data from
38/// files, efficiently buffering receipts for retrieval.
39#[cfg(any(test, feature = "file-client"))]
40pub mod receipt_file_client;
41
42/// Module with a codec for reading and encoding block bodies in files.
43///
44/// Enables decoding and encoding `Block` types within file contexts.
45#[cfg(any(test, feature = "file-client"))]
46pub mod file_codec;
47
48#[cfg(any(test, feature = "test-utils"))]
49pub mod test_utils;
50
51#[cfg(any(test, feature = "file-client"))]
52pub use file_client::{DecodedFileChunk, FileClientError};