type GossipedBlockDownloads = Downloads<Timeout<Buffer<BoxService<Request, Response, BoxError>, Request>>, Timeout<Buffer<BoxService<Request, Hash, RouterError>, Request>>, Buffer<BoxService<Request, Response, BoxError>, Request>>;Aliased Type§
struct GossipedBlockDownloads {
full_verify_concurrency_limit: usize,
network: Timeout<Buffer<BoxService<Request, Response, Box<dyn Error + Send + Sync>>, Request>>,
verifier: Timeout<Buffer<BoxService<Request, Hash, RouterError>, Request>>,
state: Buffer<BoxService<Request, Response, Box<dyn Error + Send + Sync>>, Request>,
latest_chain_tip: LatestChainTip,
pending: FuturesUnordered<JoinHandle<Result<Hash, (Box<dyn Error + Send + Sync>, Hash, Option<PeerSocketAddr>)>>>,
cancel_handles: HashMap<Hash, (Sender<()>, Option<IpAddr>)>,
in_flight_ips: HashSet<IpAddr>,
}Fields§
§full_verify_concurrency_limit: usizeThe configured full verification concurrency limit, after applying the minimum limit.
network: Timeout<Buffer<BoxService<Request, Response, Box<dyn Error + Send + Sync>>, Request>>A service that forwards requests to connected peers, and returns their responses.
verifier: Timeout<Buffer<BoxService<Request, Hash, RouterError>, Request>>A service that verifies downloaded blocks.
state: Buffer<BoxService<Request, Response, Box<dyn Error + Send + Sync>>, Request>A service that manages cached blockchain state.
latest_chain_tip: LatestChainTipAllows efficient access to the best tip of the blockchain.
pending: FuturesUnordered<JoinHandle<Result<Hash, (Box<dyn Error + Send + Sync>, Hash, Option<PeerSocketAddr>)>>>A list of pending block download and verify tasks.
cancel_handles: HashMap<Hash, (Sender<()>, Option<IpAddr>)>Cancellation handles for tasks in Self::pending, keyed by block
hash. The Option<IpAddr> is the advertiser IP recorded in
Self::in_flight_ips, so completion can remove it by hash lookup.
in_flight_ips: HashSet<IpAddr>Advertiser IPs with an in-flight download and verify task.
Invariant: an IP is present iff some entry in Self::cancel_handles
has value (_, Some(ip)). Enforces the one-download-per-IP cap.
Size-bounded by full_verify_concurrency_limit (≤ MAX_INBOUND_CONCURRENCY),
inherited from the DownloadAction::FullQueue check on
Self::pending.
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 368 bytes