Repository navigation
Conversation
…raw size claim With max_blob_bytes = 0 (the SDK Downloader/Streamer default), claim_reach returned u64::MAX, so coverage and segment planning were sized by the peer's raw size claim — the unsigned probe hint or the signed but unbounded StreamResponse.total_bytes. Planning is linear in blocks, so a 2^50 claim cost ~2 GiB and ~37 s before a byte was paid or verified. num_blocks also truncated to u32 silently (a 2^58 claim wrapped to zero blocks; its comment said ~256 EiB, but a 64 MiB block makes the real limit 256 PiB). Cap-0 sizing now reaches at most a 1 TiB ceiling past the furthest requested range, while the growth limit stays unbounded: the store bound still grows geometrically as bytes verify, so a genuinely larger blob completes and RAM stays proportional to verified progress. num_blocks saturates at u32::MAX instead of wrapping, with both doc comments corrected, and Streamer::prove_size refuses a cap-0 claim beyond the ceiling instead of opening a window at the claimed end. Closes #2843 Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 4 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
…step wiring The cap-free ceiling doc counts planning state, not bit-packed coverage bitmaps (16,384 blocks is ~2 MiB of planning state, 2 KiB of bitmap per lane), num_blocks saturates just under 2^58 bytes (u32::MAX blocks is one block short of it), claim_reach covers the no-cap arm of its whole-blob sentence, and the streamer cap doc names what the window reaches under the ceiling. The ceiling doc also states the explicit-range limit: a range is served to at most the ceiling past its start; longer ranges need a real cap. The grow step moves into next_bound(bound, c0, extra, limit), whose doc names the hang a reach-clamped growth would cause at cap 0, with a unit test pinning that a bound at the ceiling grows past it under an unbounded limit. prove_size gains an inclusive-boundary test (a claim at the ceiling still tries the proof; one byte past opens nothing), and the uncapped acquire test asserts its progress samples are non-empty. Co-Authored-By: Claude Fable 5 <[email protected]>
ReviewCorrectness1. A cap-0 explicit range that ends at or past the ceiling becomes a whole-blob tail ( At cap 0, Scenario: Downloader, Fix: size the cap-0 reach from the caller's own range ends, which are caller-chosen, not peer-controlled: 2. A bounded cap-0 range longer than the ceiling pays for 1 TiB, then fails with a generic error ( A bounded range (a Streamer window with Fix: the same change as item 1. Letting the cap-0 reach extend to the caller's requested range end removes the limit, and the follow-up issue becomes unnecessary. 3. A resumed, unproven bound past the ceiling is shrunk on every run ( At cap 0 Scenario: a 3 TiB cap-0 download is interrupted at bound 2.5 TiB with 2 TiB present. On resume the bound drops to 1 TiB, and the bytes past it leave Fix: clamp only under a real cap, 4.
Fix: have Tests5. No end-to-end test of a cap-0 blob past the ceiling The only coverage of "a blob larger than the ceiling completes" is the unit check Fix: define the ceiling in blocks, Cleanup6. Fix: 7. Fix: inline 8. The same rationale appears three times, framed around the alternative the code does not take The Decision for the author
🤖 Generated with Claude Code |
…gress An explicit range is a tail only when it reaches the caller's raw claim, so the cap-0 sizing clamp no longer turns a range short of the claim into a whole-blob fetch. Every range that ends past the store's bound grows it as bytes verify, never past its own end or the claim, so a cap-0 range or window longer than the sizing ceiling completes in full. With no cap, a store's bound past the reach stands as far as the bytes it holds, so a resumed record keeps its verified progress. prove_size takes its ceiling from claim_reach and logs why it refuses a claim past it. The growth-limit wrappers are inlined, and a test-only override of the ceiling lets end-to-end tests cross it with small blobs. Closes #2865 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Addressed in ee89b63. Item by item: 1 and 2 (cap-0 explicit ranges past the ceiling): fixed with a different mechanism. I did not size the reach from the range ends, for two reasons:
Instead,
Planning stays proportional to verified bytes. The 2 TiB range in a 10 TiB blob fetches exactly 2 TiB, a long window completes, and #2865 is closed. 3 (resumed bound shrunk): fixed, with one guard. 4: fixed. 5: tests added, with a different mechanism. Scaling the ceiling by
I checked each test against the bug it guards: put that bug back and the test fails. Clamping the grow step to the reach makes the whole-blob test hang until nextest times it out. 6, 7, 8: done. The remaining 🤖 Generated with Claude Code |
|
Superseded by #2885: every size is proven before anything is planned, so the cap-0 claim sizing this bounds (claim_reach) is deleted there, and num_blocks saturates. |
With
max_blob_bytes = 0(the SDKDownloader/Streamerdefault),claim_reachreturnedu64::MAX. Coverage and segment planning were therefore sized by the peer's raw size claim: the unsigned probe hint, or the signed but unboundedStreamResponse.total_bytes. Planning is linear in blocks, so a 2^50 claim cost about 2 GiB and 37 s before a byte was paid for or verified.num_blocksalso truncated to u32. Its comment said the limit was about 256 EiB, but with a 64 MiB block the real limit is 256 PiB, so a 2^58 claim wrapped to zero blocks.Cap-0 sizing now reaches at most a 1 TiB ceiling past the furthest requested range start. Growth has no limit: the store's bound grows geometrically as bytes verify, so a larger blob completes and RAM stays proportional to verified progress. The same rule applies to explicit ranges:
num_blocksnow saturates instead of wrapping, with both doc comments corrected.Streamer::prove_sizerefuses, and logs, a claim past the cap or the cap-0 ceiling instead of opening a window at the claimed end.Trade-off at cap 0: a blob or range more than 1 TiB past its start pays about 14–15 grow rounds per extra TiB, and each round waits for the lanes to drain. Before this change it planned in one pass, from the unverified claim.
Closes #2843
Closes #2865
🤖 Generated with Claude Code