mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:29:40 +00:00
refactor: Use u64 consistently for flatfile sizes #36725
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!36725
Loading…
Reference in a new issue
No description provided.
Delete branch "2611-file-size-u64"
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?
unsignedis a 32-bit integer (even on 64-bit platforms). File sizes are generally measured in 64-bit integers and using 32-bit integers or architecture-dependent integers is brittle and confusing.So use u64 consistently for flatfile sizes in this refactor.
Also, use
LARGE_INTEGER'sQuadParton Windows, which is recommended since C++11.Also, unit test VarInt overflow errors.
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.Conflicts
Reviewers, this pull request conflicts with the following ones:
util::Expectedby yuvicc)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
🔵 Suggestion · The increment-overflow test leaves
2^39unexplainedThe unexplained constant makes this unit test's connection to the decoder's increment-overflow boundary difficult to verify.
Location:
src/test/serialize_tests.cpp:165(head).Review coverage was incomplete.
Reviewed:
fa2c8df1810f· Full review report · Previous reportspermalink
Concept ACK
utACK
fa2c8df181ACK
fa2c8df181nPos,nSizeandnUndoSizewere already u64, so this makes the remaining flatfile sizes match them. I checked that the block and undo size headers on disk stay 4 bytes. Built the PR at this commit and ranserialize_tests,flatfile_testsandblockmanager_tests, which all look good.ACK
fa2c8df181