Repository navigation
feat: serve-side stream-while-store for http/s3 via publisher outboard (#1130) - #1528
Conversation
|
Warning Review limit reached
Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (18)
WalkthroughThis change adds origin outboard discovery and verified, header-less BAO streaming for whole-blob cache misses. The node can stream origin data to clients while teeing it into local storage, falls back when no outboard is available, and exposes metrics and end-to-end validation for the new path. ChangesOrigin outboard stream-while-store
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant CacheEngine
participant Origin
participant LocalOutboardPull
participant WindowForwardLoop
participant CacheStore
Client->>CacheEngine: request whole blob
CacheEngine->>Origin: fetch size and .obao4 sibling
Origin-->>CacheEngine: outboard and plaintext stream
CacheEngine->>LocalOutboardPull: start verified BAO encoding
LocalOutboardPull->>WindowForwardLoop: encoded chunks
WindowForwardLoop-->>Client: window-paced response
WindowForwardLoop->>CacheStore: tee plaintext into cache
LocalOutboardPull-->>WindowForwardLoop: verification completion
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Coverage reportTotal: 80.14% (was 80.25%, ▼ 0.11%) — 55210/68890 lines
History
|
Adds a standalone way to fetch just the sibling {H}.obao4 outboard with
no accompanying blob data, feeding a later stream-while-store serve path
(#1130). New OutboardFetch enum (Found/NotFound/Unsupported) alongside a
fetch_outboard trait method (default Unsupported); fs/http/s3 override it
by mirroring their existing fetch_range outboard sub-fetch and size
patterns (fs reads the sibling file bounded by outboard_max_bytes; http
GETs {url}.obao4 with redirects disabled, distinguishing 404 from other
declines; s3 issues GetObject on {key}.obao4).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
…rces Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
…upt-safe Adds decdn_local_outboard_serves_total (incremented at entry to serve_via_local_outboard) so tests can distinguish the stream-while-store serve tier from the buffered populate_local fallback deterministically. Fixes a real bug it caught: LocalOutboardPull's WireWriter forwarded bao-encoder writes verbatim (up to one 16 KiB chunk-group per write), violating window_forward_loop's CHUNK_SIZE-per-chunk relay invariant and causing every stream-while-store fetch to fail as NotFound; WireWriter now splits into CHUNK_SIZE-bounded pieces before sending. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
fe813ab to
1975762
Compare
…1563, #1576, #1579) (#1581) * docs: strike the never-implemented origin_range_pull_enabled knob (#1555) The knob only ever existed in ADR 037 and one stale doc comment; range pull-through is ungated in code and the whole-blob fallback already makes every attempt correct, so the toggle bought nothing. Remove the ADR Parameters row, the "MAY disable" sentence, and the dead clause in the cache engine's `Unsupported` doc. Co-Authored-By: Claude Opus 4.8 <[email protected]> * docs(adr): stop linking canonical ADRs into _history; widen link-gate (#1559) Canonical ADRs no longer reference the _history archive (it stays on disk for audit): delink the retired-ADR mentions in 026/028/architecture to inline-code names, drop the "Body archived verbatim" clauses, and add a check-no-history-links guard so they cannot come back. Widen check-anchor-targets to docs/ + root markdown (runbook, CONTRIBUTING, CLAUDE, CHANGELOG, README) by resolving each link relative to its own file's directory, and widen the CI adr changes filter to match. Also drop the changelog-voice amendment note atop ADR 026 — the body already carries the final 10% POL / 19% App Incentives / 15% combined numbers. Co-Authored-By: Claude Opus 4.8 <[email protected]> * docs(adr): correct residual propose/ratify origin-assignment language (#1558) #1491 replaced per-assignment DAO ratification with one-time publisher vetting + instant assigns, but the glossary Publisher entry and ADR 019's authorized-origins bullet still described the old model. Align both with the vetted-publisher-seats-directly model already stated elsewhere in the same files. Co-Authored-By: Claude Opus 4.8 <[email protected]> * docs(adr): sync BuybackBurner docs with the three-layer venue-neutral refactor (#1579) The docs still described BuybackBurner as one flat contract. Add a "Declared on" column to the ADR 003 member table and mark setVault Balancer-only; document the Permit2 approvals footgun in the L2 deployment appendix (with the canonical Permit2 address); and drop references to a nonexistent IBuybackBurner interface across ADR 018 and a stale contract comment — FeeRouter holds buybackBurner as a plain address and never calls a typed method on it, so no interface is warranted. Co-Authored-By: Claude Opus 4.8 <[email protected]> * refactor: delete dead public surface and stale lint suppressions (#1563) Sweep zero-caller public items and out-of-date `#[allow]`s left behind by landed work: - protocol: delete `StreamRequest::requested_len()` (no callers; serving sites derive the `byte_len == 0` sentinel inline). - gossip: drop `GossipService::spawn`'s `_endpoint` param and its `needless_pass_by_value` allow; the caller no longer clones an endpoint for nothing. - node/admin: remove the never-read `AdminState::signer` field, its `dead_code` allow, and its construction sites (handlers use `voucher_signer`). - node/handlers: drop the stale `dead_code` allow + comment on `ProgressiveSource::LocalOutboard`; it is constructed in the production serve path (`window.rs`) since #1528. - common/config: remove the blanket `#![allow(dead_code)]` in `resolved.rs`; the fields are `pub` and genuinely read, so none is actually dead. - cache: delete the `CacheEngine::stats()` zeros-stub and its `CacheStats` type (no callers; intended gossip consumer never materialized). - node: collapse `probe_client` into the identical `decdn_client_pull::probe::probe_once` (re-exported as `client_requester`); delete the duplicate module. - common/cli: `--publisher-registry-address` is validate-only on the daemon; document it as such (dropping it cascades into the resolver, `ResolvedConfig`, `config validate`, and ~60 test literals). - gossip: verified `RESUBSCRIBE_FAILED_LABEL` is incremented on the resubscribe-failure path; left as-is. Co-Authored-By: Claude Opus 4.8 <[email protected]> * test(e2e): scope long-journey lint allows to the functions that need them (#1576) `clippy::too_many_lines` / `clippy::cognitive_complexity` were suppressed file-wide alongside the standard test allows. Narrow them to function-scoped `#[allow(..., reason = "...")]` on only the long journey functions, matching the #1569 idiom in `slash_appeal.rs` / `g_origin_01`. The standard test allows (`unwrap_used`, `expect_used`, `panic`, `indexing_slicing`, `duration_suboptimal_units`) stay file-level. Narrowing surfaced functions that had quietly grown past the threshold under the file-wide blanket: - cli_fetch_topup.rs: `run_multi_interval_topup` (144) and `run_two_topup_fetch` (162), not just `run`. - anvil_bringup_shutdown_e2e.rs: `build_config` (101, a flat resolved-config struct literal) alongside the drain journey test. Each now carries its own reason. `coop_close_watermark_reconcile.rs`'s `run` is under the threshold, so it needs no scoped allow at all. Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
Serve-side stream-while-store for http/s3 (#1130, part 3B)
Serves a whole-blob http/s3 cache miss by streaming the blob from the origin straight to the paying client while teeing it into the store — so time-to-first-byte no longer waits for the whole blob to land. When the node's own origin (S3/R2/B2/HTTP/fs) holds the blob and publishes the sibling
{H}.obao4outboard, the node produces bao verified-wire on the fly from that outboard and drives it through the existing #856 window/voucher serve loop. When no outboard is published it degrades cleanly to today's bufferedpopulate_local-then-serve path.How it works
Origin::fetch_outboard(+OutboardFetch) fetches just the{H}.obao4sibling (fs/http/s3 impls; defaultUnsupported).decdn-bao-range::streaming— a sync, header-less whole-blob bao encoder (leaf crate staystokio-free / iroh-blobs-free, CLI binary-split regression: publisher links cache crate (iroh-blobs/AWS SDK) #578).LocalOutboardPull(decdn-cache) fetches the outboard once, then runs the encoder onspawn_blockingbridged to the async origin plaintext stream via two boundedmpscchannels, exposingnext_chunk/finish/abandon— the same shape asNodeProgressivePull.ProgressiveSource { Node, LocalOutboard }abstracts the bao source so the window serve loop drives either uniformly.serve_via_local_outboard+ a new dispatch tier (whole-blob,pull_authorized) that prefers the stream path and falls back totry_local_populatewhen no outboard exists.Safety / correctness
H. A mid-stream verify failure is a wire fault handled by the existingwindow_forward_loopcorruption arm — no new signing or slash path (signingok:falseis provably safe post-refactor(slashing): retire the phantom-announcement offense #1512).total_bytesis the outboard/HEAD-derived content size; emitted wire length ==expected_wire_bytes.decdn-bao-rangeleaf-crate invariant held (onlybao-tree/bytes/positioned-io/thiserror).Tests
origin_stream_while_store.rs): first-fetch streams (proven via the newdecdn_local_outboard_serves_totalcounter == 1 + teed into store), no-outboard falls back byte-correct (counter == 0), corrupt outboard fails safe (client rejects, daemon stays healthy, no slash).bao-range(reference-equality of the streaming encoder) andcache(LocalOutboardPull).clippy --workspace --all-targetsclean,cargo nextest runall pass, both anvil-e2e targets compile.Reviewer notes (disclosed)
pull_authorized, independent of thelocal_populateconfig (a deliberate choice; trivially tied tolocal_populateif preferred).InFlightcollision or a deposit/leech/size reject, the node has already fetched the{H}.obao4outboard (~0.4% of blob) and opened the origin stream before abandoning — bounded, and strictly less egress than the buffered fallback it precedes.Originally planned as stacked on #1523; that PR squash-merged to main first, so this targets
maindirectly and its 3 base commits (already in main) were dropped on rebase.🤖 Generated with Claude Code
Summary by CodeRabbit