Skip to main content

Module source_set

Module source_set 

Source
Expand description

The sources of one blob (ADR 039 § Source set and selection): [source_set::SourceSet] tracks each holder’s health, lane, and retry timing behind the injected [source_set::SourceProvider] seam. The sources of one blob (ADR 039 § Source set and selection).

A SourceSet holds every provider known to hold the blob, the lane built for each, and when each may be tried again. It never drops a source: a delivery fault cools it (in the command-wide [PeerHealth]), a price refusal parks it until the deposit rises, and a lane-build or discovery error backs off and retries. A partial holder that keeps refusing ranges outside its coverage is barred from pull-through and serves only the blocks it covers. A source that declines this fetch is excluded for this blob. A refusal never ends a fetch on its own (ADR 039 §Failure handling): the fetch ends when every known source declined it, or on a unanimous verdict after a fresh discovery found nothing new: every known source is priced out (funding needed), or every one says it does not hold the blob, declined it, or is barred from the only work left (not-found).

The state is synchronous. The acquire loop runs the connect and discover futures itself, so lanes keep streaming while a lane builds or discovery runs.

Structs§

Holder
One provider that holds (part of) the blob.
NoAffordableSource
Funding needed: no known source serves at the pool’s current funding, a fresh discovery found no other source, and no funding recovery step could raise the deposit (ADR 003 § Funding recovery).
NoNodeWillServe
Every known source declined this fetch (ADR 039 §Failure handling). The fetch ends at once, without a fresh discovery. reasons are the reasons the client collected, each once, in the order it first saw them.
NoSourceHasBlob
Every known source says it does not hold the blob, and a fresh discovery found no other holder. The acquire loop raises it as context on the last refusal that marked a source absent, so the error chain also holds that UpstreamRefused.
StaticSources
A [SourceProvider] over a fixed set of prebuilt lanes: for SDK callers that dial their own providers, and for tests. Discovery returns the same set; each lane is handed out once. So a static set serves one blob’s [SourceSet]: a crate::Downloader over it fetches one target, and a second target finds no lane to build.

Enums§

DeclineReason
Why one source declined this fetch (ADR 005 §Open-time refusal classes).

Constants§

ABSENT_AFTER_NOT_FOUND
How many NotFound answers in a row, with no verified byte between them, mark a provider that is not a probed holder as absent. The same count of NotFound answers for ranges outside a probed partial holder’s coverage bars it from pull-through ([SourceSet::no_pull_through]), and for one block inside it drops that block from its coverage for a while.