Skip to content

docs(adr): range-keyed partial-holder discovery over obao4 (#1506) - #1885

Merged
alpergundogdu merged 2 commits into
mainfrom
claude/issue-1506-spec-plan-496e25
Aug 31, 2026
Merged

alpergundogdu merged 2 commits into
mainfrom
claude/issue-1506-spec-plan-496e25

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Closes the design half of #1506. Amends the discovery ADRs so partial holders become serving supply — disjoint byte ranges source from many holders instead of funnelling onto the full-holder set, distributing serve load and revenue across the population.

What changed (ADR-only; no code)

ADR 022 — Content Discovery

  • Provider / StoreRequest / BatchStoreRequest carry a coarse 64 MiB Coverage bitmap; FIND_VALUE returns Provider{node, coverage} response-side (the query carries no range — Kademlia semantics unchanged).
  • Advertise gate relaxes from Complete to ≥1 verified block.
  • New § Range-keyed partial-holder discovery: the probe bitmap is the fresh authority, the DHT record a stale routing hint; has_blob redefined as "≥1 verified byte" (the signed set {hash, has_blob, rate_per_mb, timestamp_us} stays frozen — no contract change); the has_blob:false + non-empty-bitmap consistency rule; partial-serve; demand-windowed node assembly. ACs 21–25.

ADR 039 — Multi-Source Fetch

  • Flips the "full holders only" premise: admit partial holders by coverage, assign each block to a covering holder, warm uncovered blocks once.
  • § Node pull leg and the demand window: the same scheduler drives the node's cache-miss pull leg with a sliding demand window, so a node becomes a full holder only when downstream demand consumes the whole blob. ACs 8–9.

ADR 037 / 038 — consistency

  • Flipped to present-tense: DHT advertising is now range-keyed (037), and 038's scope-boundary / cross-ADR / AC no longer assert range-addressed discovery is deferred. No ADR is left contradicting the change.

Discovery model (why two surfaces)

Clients discover latency-first (registry + probe, never DHT); nodes discover holder-first (DHT FIND_VALUE). So coverage rides both the DHT record (node-facing, stale hint) and the probe response (fresh authority) — one shared 64 MiB granularity.

Not in this PR

Implementation. The spec and a task-decomposed plan (PR1 = bitmap plumbing; PR2 = coverage-aware scheduler on both consumers, with a sliding-window spike) live in scratch, not the repo. No contract change; the frozen signed set and slash paths (ADR 014) are untouched.

All ADR reference-hygiene guards pass (make check-refs).

🤖 Generated with Claude Code

Amend ADR 022 and 039 to make partial holders discoverable and serveable
by byte range, so disjoint ranges source from many holders instead of
funnelling onto full holders — distributing serve load and revenue across
the holder population.

ADR 022 (Content Discovery):
- Provider/StoreRequest/BatchStoreRequest carry a coarse 64 MiB Coverage
  bitmap; FIND_VALUE returns Provider{node,coverage} response-side (query
  carries no range, Kademlia unchanged).
- Advertise gate relaxes from Complete to >=1 verified block.
- New section: probe bitmap as the fresh authority, DHT record as a stale
  routing hint, has_blob redefined as >=1 verified byte (frozen signed set,
  no contract change), the has_blob:false + non-empty bitmap consistency
  rule, partial-serve, and demand-windowed node assembly.

ADR 039 (Multi-Source Fetch):
- Flip the full-holder-only premise: admit partial holders by coverage,
  assign each block to a covering holder, warm uncovered blocks once.
- Node pull leg drives the same scheduler with a sliding demand window.

Consistency: ADR 037 (DHT advertising is now range-keyed) and ADR 038
(scope-boundary / cross-ADR / AC) flipped to match — no ADR is left
asserting range-addressed discovery is deferred. All ADR reference-hygiene
guards pass.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 31, 2026 15:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the discovery and multi-source-fetch ADRs to make partial holders first-class serving supply by introducing range-keyed (coverage bitmap) discovery at a coarse 64 MiB block granularity, enabling composition of a blob from disjoint cached ranges across many holders.

Changes:

  • Extend cdn/dht/v1 provider records (and STORE/BatchStore) to include a coarse 64 MiB Coverage bitmap, and redefine discovery semantics around partial holders (ADR 022).
  • Update the multi-source scheduler model to assign work by coverage and warm only uncovered blocks, and specify that the same scheduler also drives the node’s cache-miss pull leg with a sliding demand window (ADR 039).
  • Align proxy-warming and bao verified-range streaming ADRs to the new range-keyed discovery model and remove now-stale “deferred” assertions (ADR 037, ADR 038).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
adr/022-content-discovery.md Adds coverage-carrying Provider/STORE shapes and specifies range-keyed partial-holder discovery semantics.
adr/039-multi-source-parallel-fetch.md Updates scheduler assumptions to admit partial holders by coverage; adds demand-windowed node pull-leg behavior.
adr/038-bao-verified-range-streaming.md Reframes scope boundary to rely on ADR 022 for range-keyed discovery while keeping this ADR focused on verification.
adr/037-regional-proxy-warming.md Updates probing/advertising text so warmed partials become discoverable serving supply via coverage.
Suppressed comments (1)

adr/022-content-discovery.md:145

  • This STORE flow trigger says publication begins when the node verifies its first byte ("any verified partial"), but the record being published requires a non-empty 64 MiB Coverage bitmap. That combination implies the first publish could carry an empty bitmap, which the earlier types forbid. Reword the trigger to match the 64 MiB block-granularity publish gate used elsewhere (e.g., Acceptance Criteria #21 and ADR 037).
When a node verifies its first byte of blob H — on any verified partial, not only on `Complete`:

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread adr/022-content-discovery.md Resolved
Comment thread adr/022-content-discovery.md Resolved
Comment thread adr/037-regional-proxy-warming.md Resolved
Comment thread adr/022-content-discovery.md Resolved
…ot the byte (#1506)

has_blob and coverage are two views of one fact, so publish, has_blob, and
the bitmap all key on the 64 MiB discovery block: has_blob:true iff the
coverage bitmap is non-empty. A sub-block fragment reports empty coverage
and is not advertised; serving any range still signs ok:true, so actual
serves stay slashable regardless of the possession bool. Consistency rule
is now the biconditional (both false+non-empty and true+empty are
malformed). Also: 'entries' (not 'hashes') for the BatchStore admitted
tail, and the node-to-node pull-through requirement is 'covers the needed
range', not 'holds the full blob'. Addresses PR #1885 review.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@alpergundogdu
alpergundogdu merged commit 881d205 into main Aug 31, 2026
25 checks passed
@alpergundogdu
alpergundogdu deleted the claude/issue-1506-spec-plan-496e25 branch August 31, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants