refactor: assumeutxo M3 review follow-ups - #7585
Conversation
7959fa8 to
9190215
Compare
|
🕓 Ready for review — 4 ahead in queue (commit d4851d8) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe changes add shared suffix constants for snapshot-related directories. Chainstate recovery, invalidation, and cleanup now derive paths from the base Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…ecovery RecoverSnapshotCleanup re-spelled the snapshot, todelete and INVALID directory names as string literals while the rename sites derived them from SNAPSHOT_CHAINSTATE_SUFFIX or inlined them. A rename of any suffix would compile cleanly while crash recovery silently stopped matching the on-disk layout. Define the INVALID and todelete suffixes next to SNAPSHOT_CHAINSTATE_SUFFIX and consume them at every producer and consumer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…n loop The candidate-admission pass in ResetBlockFailureFlags called ChainstateManager::GetAll() for every reconsidered block, re-acquiring cs_main recursively and heap-allocating a vector per iteration even though the chainstate set cannot change while cs_main is held for the whole function. Fetch the set once before the loop. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
assert(snapshot_base_height == index_new.nHeight) restated assert(index_new.nHeight == snapshot_base_height) from four lines earlier; upstream carries only the first assert plus the curr_height check. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
9190215 to
d4851d8
Compare
Issue being fixed or feature implemented
Review of the assumeutxo M3 PR (#7553, now merged) surfaced three small non-blocking cleanups. They were split out so #7553 could merge as-is:
RecoverSnapshotCleanup()re-spelled all four snapshot-lifecycle directory names as string literals while the rename sites derived them fromSNAPSHOT_CHAINSTATE_SUFFIXor inlined them. A rename of any suffix would compile cleanly while crash recovery silently stopped matching the on-disk layout.ResetBlockFailureFlags()calledChainstateManager::GetAll()inside the per-block loop, re-acquiringcs_mainrecursively and heap-allocating a vector per reconsidered block even though the chainstate set cannot change whilecs_mainis held for the whole function.MaybeCompleteSnapshotValidation()carriedassert(snapshot_base_height == index_new.nHeight)four lines after asserting the same equality.What was done?
SNAPSHOT_INVALID_SUFFIXandSNAPSHOT_TODELETE_SUFFIXnext toSNAPSHOT_CHAINSTATE_SUFFIXinnode/utxo_snapshot.hand consume them inRecoverSnapshotCleanup(),InvalidateCoinsDBOnDisk(), andValidatedSnapshotCleanup(). Test files intentionally keep spelled-out literals so they would catch an accidental rename of the on-disk names.GetAll()call above the admission loop.How Has This Been Tested?
Both touched translation units compile with
--enable-werror. No behavior change is intended; the existingvalidation_chainstatemanager_testssnapshot-recovery cases cover the renamed-directory handling.Breaking Changes
None.
Checklist: