2 suggestions
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.
Optional improvements
[suggestion] · Batch pruning tests miss a gap in the selected file set
Both new pruning tests select a contiguous prefix, so their assertions would miss a regression that also pruned an unselected file between selected files.
Location: src/test/blockmanager_tests.cpp:151 (head).
Details and suggested fix
PruneBlockFiles({file0, file1}) only checks file2 as a survivor, and the manual-path test selects the same prefix. Replacing the bitmap membership predicate with nFile <= *setFilesToPrune.rbegin(), while retaining input prevalidation, would leave these assertions passing. The production selectors can skip populated files on height checks, and assumeutxo's separate cursors can interleave file numbers, so batch selection must preserve gaps. Reuse the three-file fixture to prune {file0, file2} and check that tip1 retains BLOCK_HAVE_DATA, BLOCK_HAVE_UNDO, nFile, nDataPos and nUndoPos, its file-info size stays nonzero, and it is not dirty. Use tip1/file1 for subsequent survivor checks and {file1, file2 + 1} for the mixed out-of-range request.
[suggestion] · Batch-pruning fixture uses a parentless header and assumes file zero
The synthetic header-only entry would make subsequent index checking assert, while the file-zero dirty-set checks rely on file0 being zero without asserting it.
Location: src/test/blockmanager_tests.cpp:128 (head).
Details and suggested fix
InsertBlockIndex(uint256::ONE) leaves pprev == nullptr, height zero and no tree validity, rather than constructing a real header-only block. With check_block_index = 1, another header submission would reach the assertion requiring a parent for every entry outside the best-header chain. The current test avoids that path by completing all block processing before the insertion. Submit only the header of a block built on the tip through ProcessNewBlockHeaders before taking the long-lived cs_main lock instead. This preserves nFile == 0 and the absent data/undo flags while supplying a valid parent, height and tree validity; the existing WriteBlockIndexDB() clears its initial dirty mark. Also add BOOST_REQUIRE_EQUAL(file0, 0). That holds in the current fresh fixture, but asserting it prevents fixture changes from silently stopping the header dirty-set checks from exercising file-zero pruning.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: The status guard's file-zero rationale is undocumented (earlier report)