mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 12:20:38 +00:00
policy: sum package weight in int64_t #36535
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36535
Loading…
Reference in a new issue
No description provided.
Delete branch "packages-weight-int64"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
IsWellFormedPackagesums the package weight withstd::accumulatestarting from a plain0, so the running total is anint. A package heavier thanINT_MAXwould wrap and could pass theMAX_PACKAGE_WEIGHTcheck. No package that large reaches this check today, since RPC request bodies are capped at 32 MiB and P2P messages at 4 MB, so this is defense in depth. It picks up the one-line fix from #35473, which was closed with an invitation to do so.I start the sum from
int64_t{0}, as the vsize sum invalidation.cppalready does. I did not add a test, since the one on #35473 was turned down. I checked the fix locally with a throwaway test that puts one transaction of 88M weight into a package 25 times: before the fix the package is rejected aspackage-contains-duplicates, after it aspackage-too-large.The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Base:
649bc0a645eb127a9b1e6d078f8d129be6380c87Head:
faaabe4454c14537e9f23bd349d43d7233df14feI found no actionable issues in this static review.
Full review report
lgtm ACK
faaabe4454as a cosmetic style cleanup. For reference, this is a C++ language bug/pitfall which was fixed in C++23 with fold_left:
https://godbolt.org/z/9q7YvjPv9
ACK
faaabe4454