Skip to content

docs(adr)!: a node proves the blob size - #2880

Closed
alpergundogdu wants to merge 2 commits into
mainfrom
claude/size-proof-adr
Closed

alpergundogdu wants to merge 2 commits into
mainfrom
claude/size-proof-adr

Conversation

@alpergundogdu

@alpergundogdu alpergundogdu commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Draft of the ADR change for #2879. It changes ADR text only, so the ADR on this branch describes a wire field that the code does not carry yet.

What the draft says

adr/005-protocol.md § bounded byte ranges:

  • A StreamResponse with ok = true, and a ProbeResponse that states total_bytes, carries a size proof in its extension: the final BLAKE3 chunk and the parent hashes on its path to the root.
  • The receiver MUST verify the proof against the content hash before it plans, splits, allocates, compares the size with a cap, or pays against it.
  • A proof depends on the hash alone, so any party can pass it on. The origin makes it at import. A node keeps the proof it verified from its upstream.
  • A node states no size that it cannot prove.
  • The sentence "A claimed blob size is a hint" is removed.

Not done in this draft

These still treat the size as a claim and must change before this leaves draft.

  • adr/005-protocol.md: the max_blob_size paragraphs that say nothing verifies total_bytes before the bytes arrive
  • adr/039-multi-source-parallel-fetch.md: "The size of a blob is a hint" and the claim growth rule
  • adr/appendix-gateway.md: the gateway's paid size pull
  • adr/appendix-bundles.md: proven size against manifest size
  • adr/037-regional-proxy-warming.md criterion 13, adr/013-schema-evolution.md extension fields
  • adr/038-bao-verified-range-streaming.md: the proof format, if it is defined there

Open decisions

  • Encoding: decided, the final 1 KiB chunk. The proof is the stock bao-tree encoding of the last chunk at block size 0, and the stock decoder verifies it. A throwaway test over 14 sizes from 1 byte to 37 MiB confirmed that the proof verifies under the true size and under no wrong size, and measured proofs between 1 byte and 1.7 KiB. The verifier is a small function in decdn-bao-range that takes the root, the size and the proof. The generator at chunk granularity needs the hashes inside the last chunk group, which the group-level .obao4 outboard does not store, so it computes them from the last group's bytes.
  • Probe or stream only. The draft puts the proof on both. A proof on every probe answer makes probes larger.
  • Serving without a proof. The draft forbids a size without a proof. A node that holds a blob without its tail and has no proof must fetch one first.
  • refactor(client,node)!: a size claim only picks the verification shape #2874. It is on hold as a draft. Its fixes that do not depend on trusting the size should merge with the implementation of this change.

Checks

pre-commit passes the ADR book and reference hygiene hooks. The cargo-deny advisories hook fails on two advisories that this change does not touch (RUSTSEC-2026-0387, RUSTSEC-2026-0441).

🤖 Generated with Claude Code

A StreamResponse, and a ProbeResponse that states total_bytes, carries a
size proof: the final BLAKE3 chunk and its path to the root. The
receiver verifies the proof against the content hash before it uses the
size. A proof depends on the hash alone, so the origin makes it at
import and any node passes it on.

Refs #2879

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@alpergundogdu

Copy link
Copy Markdown
Contributor Author

Superseded by #2885, which carries both ADR commits of this PR unchanged.

@alpergundogdu
alpergundogdu deleted the claude/size-proof-adr branch November 18, 2026 11:23
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.

1 participant