mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 16:26:37 +00:00
AssumeUTXO: allow retrying loadtxoutset after an interrupted load #36542
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36542
Loading…
Reference in a new issue
No description provided.
Delete branch "l0rinc/assumeutxo-recover-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem: An interrupted
loadtxoutsetcan leave an incompletechainstate_snapshotdatabase without its requiredbase_blockhashmarker. A later call can fail to open that database, requiring the operator to remove it manually before retrying.Fix: Wipe the snapshot database before opening it so a later call can replace incomplete data. LevelDB acquires the database lock before deleting files, so a database held open by another load cannot be wiped. Also correct the startup warning to identify the missing marker and explain that retrying replaces the directory.
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.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
Reviewers, this pull request conflicts with the following ones:
loadtxoutsetRPC with a startup arg by l0rinc)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
🔵 Suggestion · Startup warning omits manual cleanup for abandoned snapshot loads
If the operator abandons the snapshot or a retry fails before database initialization, the warning provides no cleanup option for the unused directory, which remains on disk and triggers warnings on later startups.
Location:
src/node/utxo_snapshot.cpp:60(head).🔵 Suggestion · Retry coverage stops before successful snapshot activation
The new malformed-directory fixture tests opening and failure cleanup, not successful activation after replacement or the corrected missing-marker startup warning.
Location:
test/functional/feature_assumeutxo.py:221(head).🔵 Suggestion · Snapshot wipe omits its lock-based safety rationale
The new on-disk wipe relies on LevelDB acquiring the database lock before deleting files, but the call site does not explain that safety requirement or why replacement is needed.
Location:
src/validation.cpp:5690(head).Review coverage was incomplete.
Reviewed:
15a891d4021e· Full review report · Previous reportspermalink
Found a simpler fix using the existing database wipe option, which lets interrupted loads be retried.
Should the regression test also cover a snapshot database whose LOCK is held by another process?
tACK
15a891d402Tested on Linux aarch64 (Debian 13, GCC 14.2.0):
restart-retry-pruned,restart-retry-default,readable-leftover-retry, andlocked-leftover-retrypassed. The locked case returned RPC error-1, left the database files unchanged, and the retry succeeded after the lock was released.feature_assumeutxo.pypassed in a direct slot run on the same head.Closing in favor of #36598