rpc: reject AssumeUTXO rollback without tip data

bitcoin/bitcoin: PR #36503

1 suggestion

Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · Commit 4107215 mixes independent rollback changes with test rewrites

In 4107215, error-message and test rewrites obscure the separate rollback-boundary relaxation and unpruned-snapshot guard, which have distinct effects and can be validated in separate commits.

Location: src/rpc/blockchain.cpp:3181 at 4107215392f3 (commit) (commit).

Details and suggested fix

2f3691604532702075d669fe82a96b03b9bda483 characterizes the GetFirstBlock assertion on pruned n1. 5400833ffe4373dbd2b264f58388f0349f6a2dbd replaces the assertion-prone call with GetPruneHeight, retaining the pruned-only guard and the >= boundary. 4107215392f3b9896c96f6ac01674eeb122adc95 then combines two behavior changes with a message rename and helper extraction that rewrite all three existing rollback-error assertions. Its >= to > change also affects ordinary pruned nodes: only blocks above the target are disconnected, so rollback_to_base.dat tests a newly accepted boundary. The unpruned-snapshot extension has a different effect. Source inspection shows that its n2 fixture would previously have copied the UTXO set and returned RPC_INTERNAL_ERROR (Failed to read block at height 299), rather than hitting the assertion.

Keep the reproducer and narrow-fix boundaries. Split 4107215 into a message/check_rollback_unavailable commit, a boundary-change commit with rollback_to_base.dat, and an unpruned-snapshot guard commit with the conditional prune lock and n2 test. This leaves the final tree unchanged while allowing each behavior and its test to be reviewed separately. Optionally characterize n2's existing internal error in the reproducer first. Update the PR description's claim that the existing pruning error is reused.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.