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
client: cap-0 explicit ranges longer than the 1 TiB sizing ceiling truncate or overfetch #2865
Follow-up to #2864 (issue #2843). The cap-free sizing ceiling (UNCAPPED_SIZING_CEILING, 1 TiB) bounds how far past the furthest requested range start the planner sizes its work. Growth past it is driven by the grow loop, which only runs for tail targets, so with max_blob_bytes = 0 an explicit single range longer than 1 TiB behaves differently from a whole-blob fetch:
Bounded streamer window (Streamer::open_range with len > 1 TiB into a larger blob): Want::new clips the range to offset + 1 TiB and marks it non-tail, so the acquire returns Ok at that prefix and the reader fails with "stream fetch finished with X of Y bytes readable" after 1 TiB has been delivered and paid.
Unbounded downloader range (DownloadTarget.ranges with len ≥ 1 TiB): the clipped end makes the range pass reaches_end, so it is reclassified as a tail and the fetch grows to the blob's true end — paying for bytes past the requested end (the bundle donor-splice path would fetch donor bytes).
Exposure is narrow: cap 0 is an explicit opt-out in the CLI and the bundle engine (both default to a 1 TiB cap) and only the SDK defaults to it; the gateway always passes a positive cap, and decdn get never sets a range. The limit is documented on the ceiling const and in the PR body.
Widening the reach by the caller's range ends is NOT a safe fix: range lengths are often claim-derived (e.g. a whole-blob range built from the probe hint), which reopens the unbounded-sizing DoS #2843 fixed. A fix likely needs to distinguish truly caller-chosen ends, or a typed error when a cap-0 range is clipped at the ceiling.
While in the area, two small doc sites out of #2864's scope:
crates/cli/src/commands/fetch.rs ~1397: the prove_size → Ok(None) log says "the claim's last chunk group is not the blob's last"; a claim past the cap or the cap-0 ceiling also lands there — reword to cover both.
crates/common/src/cli/fetch.rs--max-blob-mb help: could state that 0 still sizes work from at most 1 TiB past the requested offset.
PR #2864 fixes this in ee89b63. A range is now a tail only when it reaches the caller's raw claim. Every other range that ends past the bound grows the bound as its bytes verify, but never past its own end or the claim. A cap-0 window longer than the ceiling therefore completes, and an unbounded range no longer fetches past its end. The prove_size log reword landed in the same commit. The --max-blob-mb help nit moved to #2875.
Fixed by #2885: Want::new keeps a requested end on any range with a length and clips it to the bound — only a zero-length range is a tail (the doc on Want::new cites this issue). The cap-0 claim-sizing machinery this issue describes (UNCAPPED_SIZING_CEILING, the grow loop) is deleted: sizes are proven before planning.
Activity
fix(client): grow exact ranges past the cap-0 ceiling by verified pro…
yigitdot commentedon Nov 11, 2026
PR #2864 fixes this in ee89b63. A range is now a tail only when it reaches the caller's raw claim. Every other range that ends past the bound grows the bound as its bytes verify, but never past its own end or the claim. A cap-0 window longer than the ceiling therefore completes, and an unbounded range no longer fetches past its end. The
prove_sizelog reword landed in the same commit. The--max-blob-mbhelp nit moved to #2875.🤖 Generated with Claude Code
feat!: the size proof is the only statement of a blob size (#2879) (#…
yigitdot commentedon Nov 13, 2026
Fixed by #2885: Want::new keeps a requested end on any range with a length and clips it to the bound — only a zero-length range is a tail (the doc on Want::new cites this issue). The cap-0 claim-sizing machinery this issue describes (UNCAPPED_SIZING_CEILING, the grow loop) is deleted: sizes are proven before planning.