Backports:
[31.x] Backports #36662
pull fanquake wants to merge 4 commits into bitcoin:31.x from fanquake:36358_36361 changing 8 files +91 −6-
fanquake commented at 1:08 PM on October 26, 2026: member
-
13a4e14ca0
net: don't discourage private broadcast peers
Keep private broadcast connections outside normal discouragement handling. Misbehaving private broadcast peers are still disconnected. Github-Pull: #36312 Rebased-From: eab6630addc385d013db5fe6779679228e445d09
-
ea1a787dfa
validation: Don't add pruned blocks to m_blocks_unlinked on startup
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 #35050. Github-Pull: #35168 Rebased-From: 0e4b0bacecf94063342c7f9eb9b03dac8a7a7936
-
0c432de3df
test: Add coverage for m_blocks_unlinked invariant in LoadBlockIndex
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. Github-Pull: #35168 Rebased-From: 3f44f9aef7ccd0417fcd0c2f33f20615ea5c11e6
-
doc: update release notes for v31.x 1bb872a8c8
- fanquake requested review from sedited on Oct 26, 2026
- fanquake requested review from marcofleon on Oct 26, 2026
- DrahtBot added the label Backport on Oct 26, 2026
- fanquake added this to the milestone 31.2 on Oct 26, 2026
-
DrahtBot commented at 1:08 PM on October 26, 2026: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
External sites
- Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36662
- Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36662.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36662#author-ralph
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline and AI policy for information on the review process.
Type Reviewers ACK marcofleon, sedited If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
-
rreview commented at 1:27 PM on October 26, 2026: none
<!-- ralph-major:bitcoin/bitcoin -->
Ralph found major issues at 1bb872a8c83c643adc56eece18b7b0864bc9b91b.
Prune request does not remove the stale-fork block file (test/functional/feature_prune_stale_fork.py:30, head)
At height 500, the prune request is clamped to height 212 because pruning retains the last 288 blocks. In
-fastprunemode, block files roll over at 64 KiB, and the small coinbase-only blocks do not fill the file containing the height-2 stale-fork child by height 212. Manual pruning removes only whole files whose last block height is within the prune limit, so the child remains available and the followinggetblockassertion fails before restart. Mine enough blocks for the child's file to become eligible for pruning, or otherwise ensure that file is pruned before asserting the error. -
sedited commented at 1:37 PM on October 26, 2026: contributor
The Ralph finding looks like nothing to me.
- marcofleon approved
-
marcofleon commented at 1:43 PM on October 26, 2026: contributor
ACK 1bb872a8c83c643adc56eece18b7b0864bc9b91b
I think Ralph would maybe be right if the test's chain started from genesis and the fork was at the second block. But that's not the case for this test, as the fork happens at block 201.
C'mon Ralph...
- sedited approved
-
sedited commented at 1:44 PM on October 26, 2026: contributor
ACK 1bb872a8c83c643adc56eece18b7b0864bc9b91b
- fanquake merged this on Oct 26, 2026
- fanquake closed this on Oct 26, 2026
- fanquake deleted the branch on Oct 26, 2026