Repository navigation
Description
Split out of #1130 per its triage comment ("split fs pass-through from remote prewarm, and for fs pin the storage/outboard API and held/probe semantics before dispatch"). #1508 landed the discovery half (Origin::enumerate, the origin-held index, probe/DHT advertising); #1510 landed the http/s3 prewarm half. This is the remaining fs half.
Problem
To serve a blob from a configured fs origin the node imports it into the iroh-blobs store first, so a local origin costs two copies on the same disk for no benefit. Every origin byte transits the store today — dispatch.rs's miss ladder ends in populate/populate_local/pull_through_range, all of which land in iroh-blobs, and deliver reads back through CacheEngine::export_bao_range_stream.
Serve verified ranges directly from {path}/{hex[0..2]}/{hex}, using the sibling {hex}.obao4 when present and computing+persisting only the outboard when it is not (a fraction of a percent of the blob at 16 KiB chunk groups).
The open question from #1130 is answered — with a catch
Open question / main unknown: does iroh-blobs expose file-backed / referenced entries?
Yes: ImportMode::TryReference (iroh-blobs-0.103.0/src/api/proto.rs:630) via Blobs::add_path_with_opts, honored by the fs store as DataLocation::External, so export_bao opens the operator's file in place.
But it is probably the wrong route:
add_path_with_optscomputes the hash — you cannot assert "this file isH" — so it is a full BLAKE3 read pass, and it ignores an already-published{hex}.obao4. The issue's "use the sibling outboard if present" optimization is unreachable through it.- Files under
options.inline.max_data_inlinedare copied into the store regardless of mode. - Once referenced, the LRU driver's
release_for_evictioncan drop the tag on a blob whose bytes are the operator's origin file, which interacts badly withorigin_held_sizeassuming origin content takes no eviction hold.
Preferred route: iroh-blobs-free, streaming
bao_tree::io::sync::encode_ranges_validated is generic over ReadAt / Outboard / Write, and positioned-io implements ReadAt for File. So a verified, header-less bao range can stream straight from the data file + PreOrderOutboard<File> in O(chunk-group) RAM, with no new dependency.
Work
crates/bao-range: aReadAt-generic,Write-sink variant ofencode_verified_range(src/lib.rs:318). Today it takesrange_data: &[u8]and returns oneBytes, so a whole-blob pass-through would materialize the entire blob — the exact regression Buffered origin pull-through loads the whole blob into memory before serving #1132 removed. Note the header difference:encode_verified_rangeprepends the 8-byte LE size forimport_bao_bytes; the client wire form is header-less.- Outboard computation/persistence: nothing in production writes an
.obao4today (everyPreOrderMemOutboard::createcall is test-only). Decide where a computed outboard lives — the operator's origin tree (layout is ready:fs.rsalready reads{hex}.obao4andenumerateskips*.obao4) or a cache-side sidecar undercache_dir. Writing into the operator's directory is the part worth deciding deliberately. - Serve path: a new tier in
handlers/client/dispatch.rs(thehas(hash) == Ok(false)ladder), a third size source at the size gate (origin_held_sizealready exists and is already consulted by probe and the slash-safety guard), an origin-backed sibling toCacheEngine::export_bao_range_stream, anddelivery.rsteachingdeliverabout it (it hard-codes the store variant). - Eviction/hold semantics: origin-held content must stay outside the LRU/GC accounting — it is not the cache's disk to reclaim.
Test fixtures that already exist
crates/e2e/src/node.rs has seed_origin_blob_with_outboard and write_fs_origin_outboard; crates/cache/src/origin/fs.rs has seed_blob_with_outboard. The missing-outboard path (compute on first serve) is the new case.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
feat(cache): opt-in remote-origin prewarm, settle two deferred decisi…
thiras commentedon Aug 1, 2026
Audit note (2026-08-01, HEAD b2a9651): #1528 changed the serve-path shape this issue describes, so two body claims are now stale for the outboard-present case:
deliverreads back through export" — an fs origin with a published{H}.obao4now streams to the client viaserve_via_local_outboard(crates/node/src/handlers/client/dispatch.rs:472-477), sinceFilesystemOriginimplementsfetch_outboard(crates/cache/src/origin/fs.rs:400).The headline problem is untouched, though: that path still tees into the iroh-blobs store, so a local-disk origin still ends up with two copies. Also still missing: computing/persisting an outboard when absent (falls back to buffered
populate_local), and the origin-held-outside-LRU eviction semantics. One enabler landed:bao-rangenow haspositioned_io::ReadAtplumbing (crates/bao-range/src/lib.rs:278-283) that the preferred zero-copy route needs.alpergundogdu commentedon Aug 19, 2026
Attempted in #1750 (closed unmerged).
Finding: serving fs-origin blobs zero-copy (bypassing the iroh-blobs store) trades away cache hits and own-origin coalescing for popular content, and the double-store it avoids is bounded by the LRU cache (
cache_size_mb) rather than an unbounded mirror of the origin — so the net is unfavorable on the common path. A cached blob serves without re-reading or re-verifying the origin, whereas zero-copy re-verifies against the outboard on every serve; and concurrent same-hash misses coalesce onto one fill on the import path but become N independent reads under zero-copy. Thetwo_clients_coalesce_one_upstream_pull_each_payse2e made this visible (zero-copy neither coalesces nor promotes a cache entry).Revisit only as a size-aware gate. Zero-copy is a clear win for blobs larger than the cache — importing them thrashes the working set and they can't be cached anyway (the multi-GB AI-model case). So gate zero-copy on "won't fit the cache" rather than replacing import→cache→coalesce unconditionally. The reusable pieces (header-less
ReadAtrange encoder, streaming outboard compute,decdn origin index) live in #1750's history.