Repository navigation
[31.x] Backport #35168 - #36361
Closed
fametrano wants to merge 2 commits into
Closed
[31.x] Backport #35168#36361fametrano wants to merge 2 commits into
fametrano wants to merge 2 commits into
Conversation
LoadBlockIndex() adds to m_blocks_unlinked based only on nTx > 0, without checking BLOCK_HAVE_DATA. Pruning preserves nTx but clears BLOCK_HAVE_DATA, so a pruned block whose parent was header-only gets re-added on every restart, causing the CheckBlockIndex() assertion that entries must have data on disk to fail. Check that BLOCK_HAVE_DATA is set before inserting into m_blocks_unlinked. Fixes bitcoin#35050. (cherry picked from commit 0e4b0ba)
A pruned stale-fork block whose parent doesn't have any transactions shouldn't be added to m_blocks_unlinked when starting up a node. (cherry picked from commit 3f44f9a)
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36361. ReviewsSee the guideline and AI policy for information on the review process. |
Member
|
This is missing the backport metadata, so I've added that (and release notes in #36662) |
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.
Backports:
m_blocks_unlinkedon startup #35168v31.1still has the pre-fixLoadBlockIndex. It re-adds a pruned block tom_blocks_unlinkedwhen its parent is header-only (#35050). When the next block connects,CheckBlockIndexfails withAssertion failed: (!foundInUnlinked).-checkblockindexis on by default only on regtest, so this crashes functional-test suites run against 31.x. With default settings, nodes on mainnet, testnet and signet do not run this check, so they do not crash.Both commits are clean cherry-picks (
-x). The only difference from master is context intest_runner.py. The newfeature_prune_stale_fork.pyfails on thev31.1release binary with the assertion above. It passes on this branch, built fromdepends. Two runs each, on macOS arm64.Made with my usual tools: a computer, the Internet and an LLM. The mistakes, as usual, are all mine.