Repository navigation
feat(bundle): report the bytes a pull paid for beside downloaded - #2443
Merged
Merged
Conversation
The bundle pull summary's downloaded figure comes from entry sizes, so a run that paid for bytes twice, or paid for bytes it then dropped after a lane fault, printed the same summary as a clean run. PoolLedger::paid_bytes counts what a lane's own vouchers and hash-chain reveals paid for past its seed, leaving out the jump a reseed or rebase makes. LaneLedgers::paid_bytes sums it over the run's lanes, and BundleReport::paid_bytes carries a pull's share to the CLI: a paid_bytes field in --json and a (paid P) part on the human transfer line. Closes #2377 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code Coverage OverviewLanguages: Rust Rust / code-coverage/cargo-llvm-covThe overall line coverage in commit 6f38c2c in the Show a line coverage summary of the most impacted files.
Updated |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A rebase below the bytes a run already paid clamped the paid-bytes baseline at zero, so the figure depended on the lane's seed. A heal down now sets the baseline to min(baseline, node watermark): claims the node never accepted leave the count, and claims below the seed that the run signs again count as its payment. Also corrects the paid_bytes docs (armed vouchers, failed entries, the transfer line), documents the report line in appendix-bundles, and adds tests for the per-pull delta (manifest fetch excluded), a confirmed armed voucher, a rejected reveal and seed independence after a rebase. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
Review follow-up (6f38c2c):
🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2377.
Summary
downloadedin thedecdn bundle pullsummary comes from entry sizes. So a run that pays for bytes twice, or pays for bytes it then drops after a lane fault, prints the same summary as a clean run. This PR adds a figure counted from payment.PoolLedger::paid_bytes(crates/client/src/ledger.rs): the lane bytes the ledger's own vouchers and hash-chain reveals paid for past its seed. Areseedor rebase moves the watermark to the node's figure, not through a proof this ledger sent, so a newPipeline::baselineshifts by the heal's jump and the jump never counts. An armed voucher whose send is unconfirmed is not counted.LaneLedgers::paid_bytes: the sum over the run's lanes.BundleReport::paid_bytes: a pull's share, computed as the change across the pull. The lanes outlive one pull (manifest fetch, earlier pulls of the same puller). On a pool replacement, the first pass's total is taken before the registry is replaced.paid_bytesfield in--json, anddownloaded X (paid P) → reconstructed Yon the human line. The paid part is left out only when nothing was downloaded or paid.paid_bytesis wire bytes, so it includes the bao proof overhead. A clean pull shows it slightly abovedownloaded, and wasted payment shows up as a larger gap.Wire bytes that arrive but never verify are out of scope. A follow-up issue tracks them.
Tests
paid_bytes.cli_bundle_pull_range_dedup):paid_bytesequals the billed redb watermark delta on a whole-file pull and a range-dedup pull, and is 0 on a whole-file reuse.Commands run:
cargo clippy --workspace --all-targets -D warnings,cargo clippy -p decdn-e2e --features anvil-e2e,cargo nextest run -p decdn-client -p decdn-cli(1606 passed), thecargo docdeny gate,cargo fmt --check, and the e2e binary (8/8 passed run serially).🤖 Generated with Claude Code