mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:47:36 +00:00
blockstorage: fix partial-mask assertions and genesis availability checks #36971
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!36971
Loading…
Reference in a new issue
No description provided.
Delete branch "l0rinc/block-data-availability-mask"
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?
Problem:
CheckBlockDataAvailabilitychecks whether the upper block has any requested bit.GetFirstBlockrequires every requested bit, so a partial match can reach its assertion. At genesis, the existing undo exception can reject an undo-only request or accept a request with missing block data. It also misses ranges containing only genesis.Fix: Require every requested bit on each block in the range, except that genesis needs no undo data. An empty mask now succeeds for a valid range because it requests no bits. Both index-startup calls supply nonempty masks.
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:
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 · Empty-mask availability behavior has no test coverage
The unit tests omit both paths that now accept an empty mask; both index-startup callers currently use nonempty masks.
Location:
src/test/blockmanager_tests.cpp:164(head).Reviewed:
41851dc3c325· Review report · Previous reportspermalink
tACK
41851dc3c3Left 2 small nits.
nit: could the comment say every flag is required, like the PR description does?
I think the two empty-mask checks Ralph suggested make sense here. Feel free to ignore, though.