Skip to main content

Module source

Module source 

Source
Expand description

The sourcing and funding seams of a fetch (#1608): [source::BlobSource] (raw-bao byte source for a range) and source::Funder (the injected funding recovery seam), plus scripted test doubles. The sourcing and funding seams of a fetch (#1608): [BlobSource], a dumb producer of raw interleaved bao bytes for a contiguous range, and Funder, the injected funding recovery seam.

§Why “dumb”

A [BlobSource] never decodes and never verifies. It opens a pull over the raw bao encoding of one decdn_bao_range::AlignedRange and yields the wire bytes on demand; the STORE’s ingest decoder (rooted at the blob hash H) verifies each chunk group exactly once, as the bytes arrive. This keeps a source — PeerSource (paid cdn/client/v1) or a future BackendSource (origin re-encode) — free of bao logic, and matches the “admit verifies once” contract of decdn_bao_range::RangedStore.

The reader a source yields is a [BaoRangeReader]: an iroh_io::AsyncStreamReader that also preserves the pull’s typed faults via [crate::sink::StashedFault], so a stalled or refusing peer is surfaced to the reputation layer rather than collapsed into an anonymous decode error.

§The Funder seam

The funding recovery step (ADR 003 § Funding recovery) goes through the injected Funder trait so the acquire loop and PeerSource stay chain-handle-agnostic: each deployment supplies its own implementation (the CLI’s CliFunder, the node’s NodeFunder) rather than the loop naming a contract instance directly.

Structs§

PeerSource
The paid BlobSource (#1608): wraps [crate::open_progressive_pull] behind [BlobSource], scoping every open to exactly the requested AlignedRange via the byte_len-bounded pull: the wire StreamRequest carries the field and the OPEN-side plumbing scopes each pull to the requested range.
PoolReplaced
The current pool no longer accepts funds, and the funding recovery step opened a new pool and made it the current pool in the buyer’s local pool store (ADR 003 § Funding recovery).

Enums§

Recovery
What one funding recovery step did (Funder::recover).

Traits§

Funder
The injected funding recovery seam (ADR 003 § Funding recovery). Wraps the deployment’s funding path (the CLI’s CliFunder and the node’s NodeFunder, each over its own chain handle), so the acquire loop and [BlobSource] never name a contract instance.

Type Aliases§

SourceFuture
A boxed, Send future returned by the async trait methods in this module — the same boxed-future async-trait shape decdn_bao_range::RangedStore and cache::Origin use, so a Funder can be held as &dyn Funder.