You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Origin range pull-through: wire range_pull helper into Origin adapters + engine (#823 follow-up) #962
Implementation follow-up to #823: the design is resolved and crates/cache/src/range_pull.rs is already complete (with align_range, encode_verified_range, AlignedRange, and a full test suite including the end-to-end iroh-blobs store round-trip). This issue tracks the remaining wiring step — extending the Origin trait with a range parameter and plumbing it through the three adapters (HTTP, S3, filesystem) and the cache engine so cold range requests fetch and verify only the chunk-group-aligned span instead of the whole blob.
📊 Assessment
Dimension
Value
Reasoning
Type
Task
Pure implementation wiring; design and verification primitives already exist
Labels
rust, medium added; enhancement, technical retained
Rust code changes across crates/cache; medium priority (efficiency improvement, no correctness regression)
Coding agent
Needs more info
The helper and code entry points are clear (#823 §Evidence in code), but the body leaves several wiring decisions implicit: (1) fallback when an origin doesn't serve {H}.obao4, (2) how blob_size is known for a cold hit before the outboard fetch, (3) composition with the engine's buffer-vs-stream retry strategy, (4) SSRF policy for the extra outboard request (#579)
crates/cache/src/origin/mod.rs — Origin::fetch signature (~line 230). Add range: Option<(u64, u64)> or a separate fetch_range(hash, aligned, max_bytes) method. Also needs fetch_outboard(hash) -> Bytes to retrieve {H}.obao4.
crates/cache/src/origin/http.rs — add Range: bytes={start}-{end-1} header on range fetch; issue a separate GET for {base_url}/{blake3_hex}.obao4 to retrieve the outboard.
crates/cache/src/origin/s3.rs — populate GetObjectRequest.range for ranged fetch; fetch the sibling {key}.obao4 object for the outboard.
crates/cache/src/origin/fs.rs — seek to fetch_start, read fetch_len bytes; open {path}.obao4 for the outboard.
crates/cache/src/engine.rs — pull_through/pull_through_attempt: when a range is present, call origin.fetch_outboard, origin.fetch_range, then range_pull::encode_verified_range, then blobs.import_bao_bytes with the chunk ranges. Route export_ranges to the client rather than get(hash).
Open decisions to resolve before a PR:
Fallback policy: when {H}.obao4 is absent (404), degrade to whole-blob pull or reject? Degrading preserves current behaviour; rejecting enforces the publishing convention. Needs a config flag or hard policy.
blob_size provenance for cold range hits:encode_verified_range and align_range both need the known blob_size. For manifest content this is in the manifest entry; for bare hashes the node may not know it before fetching. Decide whether blob_size must be carried in the StreamRequest (it already exists as total_bytes in ADR 005) or whether the node must HEAD/probe first.
Buffer-vs-stream retry composition: the existing origin_retry.buffered_max_bytes path in the engine buffers small blobs before import. Ranged imports go through import_bao_bytes (not add_stream); make sure the retry classifier handles RangeVerifyError::Verification as non-retryable and RangeVerifyError::Verification { source: EncodeError::Io } as retryable.
Activity
github-actions commentedon Jun 20, 2026
🎯 Triage report
Implementation follow-up to #823: the design is resolved and
crates/cache/src/range_pull.rsis already complete (withalign_range,encode_verified_range,AlignedRange, and a full test suite including the end-to-end iroh-blobs store round-trip). This issue tracks the remaining wiring step — extending theOrigintrait with a range parameter and plumbing it through the three adapters (HTTP, S3, filesystem) and the cache engine so cold range requests fetch and verify only the chunk-group-aligned span instead of the whole blob.📊 Assessment
rust,mediumadded;enhancement,technicalretainedcrates/cache; medium priority (efficiency improvement, no correctness regression){H}.obao4, (2) howblob_sizeis known for a cold hit before the outboard fetch, (3) composition with the engine's buffer-vs-stream retry strategy, (4) SSRF policy for the extra outboard request (#579)🔗 Similar issues
.obao4outboard request reopens the same redirect surfacerequire_authorized_originequivalent on the cache-miss pull-through path: operators cannot opt out of relaying/warming unclaimed content #821 (related) — authorized-origin gate on the samepull_through/pull_through_attemptengine path💡 Notes and suggestions
What's already done:
crates/cache/src/range_pull.rs—align_range,encode_verified_range,AlignedRange,IROH_BLOCK_SIZEre-exportcrates/cache/tests/range_pull.rs— covers alignment, tampered data/outboard/root rejection, wrong-length outboard, end-to-endimport_bao_bytes→export_rangesroundtrip (sync + async)What needs wiring (per #823 §Evidence in code):
crates/cache/src/origin/mod.rs—Origin::fetchsignature (~line 230). Addrange: Option<(u64, u64)>or a separatefetch_range(hash, aligned, max_bytes)method. Also needsfetch_outboard(hash) -> Bytesto retrieve{H}.obao4.crates/cache/src/origin/http.rs— addRange: bytes={start}-{end-1}header on range fetch; issue a separate GET for{base_url}/{blake3_hex}.obao4to retrieve the outboard.crates/cache/src/origin/s3.rs— populateGetObjectRequest.rangefor ranged fetch; fetch the sibling{key}.obao4object for the outboard.crates/cache/src/origin/fs.rs— seek tofetch_start, readfetch_lenbytes; open{path}.obao4for the outboard.crates/cache/src/engine.rs—pull_through/pull_through_attempt: when a range is present, callorigin.fetch_outboard,origin.fetch_range, thenrange_pull::encode_verified_range, thenblobs.import_bao_byteswith the chunk ranges. Routeexport_rangesto the client rather thanget(hash).Open decisions to resolve before a PR:
{H}.obao4is absent (404), degrade to whole-blob pull or reject? Degrading preserves current behaviour; rejecting enforces the publishing convention. Needs a config flag or hard policy.blob_sizeprovenance for cold range hits:encode_verified_rangeandalign_rangeboth need the knownblob_size. For manifest content this is in the manifest entry; for bare hashes the node may not know it before fetching. Decide whetherblob_sizemust be carried in theStreamRequest(it already exists astotal_bytesin ADR 005) or whether the node must HEAD/probe first.origin_retry.buffered_max_bytespath in the engine buffers small blobs before import. Ranged imports go throughimport_bao_bytes(notadd_stream); make sure the retry classifier handlesRangeVerifyError::Verificationas non-retryable andRangeVerifyError::Verification { source: EncodeError::Io }as retryable.Add this agentic workflows to your repo
To install this agentic workflow, run
fix(cache): enforce eviction guard and bound range-pull buffering (#962)
feat(cache): wire range_pull helper into origin adapters and engine (#…
feat(node): origin-tier range pull-through on cdn/client/v1 (#823, #990…