[31.x] Backports #36662

Manually merged
fanquake merged 4 commits from 36358_36361 into 31.x 2026-10-26 14:23:27 +00:00 AGit
fanquake commented 2026-10-26 13:08:26 +00:00 (Migrated from github.com)

Backports:

Backports: * #35168 * #36312
DrahtBot commented 2026-10-26 13:08:37 +00:00 (Migrated from github.com)

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.

Type Reviewers
ACK marcofleon, sedited

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

<!--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](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [marcofleon](https://github.com/bitcoin/bitcoin/pull/36662#pullrequestreview-5652901607), [sedited](https://github.com/bitcoin/bitcoin/pull/36662#pullrequestreview-5652913358) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

Base: 3708efd056e52c7005976b8148f9d1feb722d7da
Head: 1bb872a8c83c643adc56eece18b7b0864bc9b91b

Findings

Major

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 -fastprune mode, 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 following getblock assertion 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.

Review coverage was incomplete.

Review limitations
  • adversarial: The inspection limit prevented checking pruneblockchain's minimum-height guard and the -fastprune threshold configuration, which could affect whether the new functional test reaches its restart regression check.
  • adversarial_deepseek: Stage did not complete (ValueError).
  • verifier: The cited original and backport discussion claims in concept_candidate were not independently verified; the assessment below is based on checked-out code.
  • verifier: The adversarial_deepseek stage did not complete, so no specific question from that stage was available to check.

Full review report

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:1e40d4c29146a38cb238a037edaa35c22b13996a5383ed7a85e089a15d569009:c9412d948811529792d161d97aa6951829440e3d548b7c576bb8d4df4183e0d0 --> Base: `3708efd056e52c7005976b8148f9d1feb722d7da` Head: `1bb872a8c83c643adc56eece18b7b0864bc9b91b` ##### Findings **Major** **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 `-fastprune` mode, 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 following `getblock` assertion 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. Review coverage was incomplete. <details> <summary>Review limitations</summary> - adversarial: The inspection limit prevented checking pruneblockchain's minimum-height guard and the -fastprune threshold configuration, which could affect whether the new functional test reaches its restart regression check. - adversarial_deepseek: Stage did not complete (ValueError). - verifier: The cited original and backport discussion claims in concept_candidate were not independently verified; the assessment below is based on checked-out code. - verifier: The adversarial_deepseek stage did not complete, so no specific question from that stage was available to check. </details> [Full review report](<https://review.fish.foo/traces/36662-1bb872a8c83c643adc56eece18b7b0864bc9b91b-1363-1.html>)
rreview commented 2026-10-26 13:27:05 +00:00 (Migrated from github.com)

Ralph found major issues at 1bb872a8c8.

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 -fastprune mode, 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 following getblock assertion 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.

Full report

<!-- 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 `-fastprune` mode, 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 following `getblock` assertion 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. [Full report](https://review.fish.foo/traces/36662-1bb872a8c83c643adc56eece18b7b0864bc9b91b-1363-1.html)
sedited commented 2026-10-26 13:37:31 +00:00 (Migrated from github.com)

The Ralph finding looks like nothing to me.

The Ralph finding looks like nothing to me.
marcofleon (Migrated from github.com) approved these changes 2026-10-26 13:43:31 +00:00
marcofleon (Migrated from github.com) left a comment

ACK 1bb872a8c8

Backports are clean.

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...

ACK 1bb872a8c83c643adc56eece18b7b0864bc9b91b Backports are clean. 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 (Migrated from github.com) approved these changes 2026-10-26 13:44:25 +00:00
sedited (Migrated from github.com) left a comment
ACK 1bb872a8c83c643adc56eece18b7b0864bc9b91b
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36662
No description provided.