mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:47:36 +00:00
AssumeUTXO: replace loadtxoutset RPC with a startup arg #36778
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!36778
Loading…
Reference in a new issue
No description provided.
Delete branch "l0rinc/assumeutxo-startup"
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: Loading a UTXO snapshot through RPC requires coordinating with the active chain, mempool, caches and advertised services while the node is running.
Fix: Replace the
loadtxoutsetRPC with-loadtxoutset=<file>and finish importing during chainstate initialization, before networking and mempool loading begin.Require a receiver that has not advanced beyond genesis, already knows the snapshot base header and has no stored blocks beyond genesis or unfinished reindexing.
This removes runtime activation checks, temporary import cache resizing and service demotion while preserving snapshot validation, resumption and background validation.
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:
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.
1 additional verified finding in the Review report.
Earlier concerns remain unresolved; see the Run archive linked from the Review report.
🔴 Major · Genesis-only import lacks a reliable mainnet header-preparation workflow
A fresh mainnet receiver must know the snapshot base header without storing post-genesis blocks, but ordinary synchronization cannot reliably preserve that state; the documented alternative requires roughly 965,000 parent-ordered
submitheadercalls for the latest snapshot.Location:
src/init.cpp:1414(head).🟠 Minor · The RPC removal skips the documented compatibility grace period
Existing
loadtxoutsetcallers lose the working RPC immediately, rather than having the documented one-major-release migration period behind-deprecatedrpc.Location:
src/rpc/blockchain.cpp:3504(head).🟠 Minor · The snapshot-tip notification can release startup before historical genesis connects
With retained headers and an empty ordinary coins DB, startup can expose a null historical tip to RPC or peer processing before genesis connects; no documented production workflow producing this state was identified.
Location:
src/validation.cpp:5770(head).🟠 Minor · A leftover import option produces the wrong restart guidance
After a successful import, restarting with
-loadtxoutsetfails with advice to use a separate datadir, although removing the option lets the existing snapshot resume.Location:
src/init.cpp:1553(head).🟠 Minor · An older startup wallet can prevent background validation after import
A genesis receiver may have an autoloaded wallet whose saved locator and birth time require history below the snapshot base, for example a restored older backup. With such a wallet, startup now aborts after the snapshot has already been committed. Restarting without
-loadtxoutsetresumes the snapshot and fails the same wallet load, so background validation never runs until the wallet is disabled. A wallet with a recent birth time skips the rescan and is unaffected.Location:
src/init.cpp:1561(head).🔵 Suggestion · The splash screen shows no progress during startup snapshot import
Qt users see a static loading message throughout snapshot deserialization, flushing and hashing, without progress or the available shutdown hint.
Location:
src/init.cpp:1433(head).Review coverage was incomplete.
Reviewed:
393d05b33cc4· Review report · Previous reportspermalink
🐙 This pull request conflicts with the target branch and needs rebase.
🚧 At least one of the CI tasks failed.
Task
iwyu: https://github.com/bitcoin/bitcoin/actions/runs/42045836029/job/127308391176LLM reason (✨ experimental): CI failed because IWYU/clang-format detected an uncommitted include change in
src/init.cpp(<unordered_map>); the diff check then exited nonzero.Hints
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
Concept ACK
This would also resolve https://github.com/bitcoin/bitcoin/pull/36346
Concept ACK
I also read Ralph's review and confirmed two of its points, the major on getting headers into a node at genesis (on signet) and the minor on the restart message when
-loadtxoutsetis left in the config. I think both are worth fixing in this PR.Could
feature_reindex_init.pyget a case for!SnapshotImportRequested(args)? The case below fails without it and passes with it.Concept -1 for me -- for assumeutxo to be meaningfully usable, snapshots need to be downloaded via p2p, so the snapshot load needs to happen while the system is running, not at startup. I understand the appeal, and have now implemented "loadtxoutset" as a startup argument myself twice, but I think it's fundamentally a dead end.
I don't think these are incompatible. We could defer block synchronization until the headers and the snapshot have been downloaded via P2P and the snapshot has been activated, avoiding corner cases such as importing a snapshot whose base block is on a different branch from our active chain.
It's no secret that my preferred solution would be to remove the dual-chainstate AssumeUTXO machinery altogether. I'm trying to get there in smaller steps that eliminate edge cases and reduce complexity along the way, even if the intermediate states aren't ideal in isolation.
If these individual simplifications don't make sense on their own, we'd have to consider the removal in one much larger step - which I'd prefer to avoid since I expect more pushback there and want to find if there's a simpler set that we would mostly agree on.
If your end state is "remove assumeutxo altogether" then this would be a step in that direction, though I believe describing that as just "remove the dual-chainstate implemention" is deceptive.
If the aim is to continue supporting assumeutxo (and improve it) then the steps need to be be "(1) provide a non-dual-chainstate assumeutxo implementation, (2) remove the dual-chainstate assumeutxo implementation", but moving the code to startup only isn't helpful to either step.
It's removing a few corner cases, and I have a few other similar open PRs carving out chunks.
Do you have a better idea how to propose the removal in smaller chunks to find out what the consensus is about this contentious feature?