WIP: [Demo] validation: remove AssumeUTXO

bitcoin/bitcoin: PR #36598

6 suggestions

Earlier concerns neither republished nor resolved: 2 suggestions. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · Marker-based upgrade tests miss the block-index guard

The new upgrade tests fail in Flatten() before reaching LoadChainstate(), so they do not protect the markerless legacy-index rejection or its ordering before a coins-database wipe.

Location: src/node/chainstate.cpp:75 (head).

Details and suggested fix

Both init_snapshot_test and btck_chainman_tests create chainstate_snapshot/base_blockhash. The constructor rejects that marker before this loop runs, so deleting the loop or moving it after InitCoinsDB() would leave those assertions passing. Add a markerless persisted-index fixture with a parent at height 1 or above whose validity is below BLOCK_VALID_CHAIN, while its child remains chain-valid. Reload it both normally and with wipe_chainstate_db, assert FAILURE_INCOMPATIBLE_DB and an unchanged coins database, then check that a full -reindex recovers. This exercises the validity flags that can survive deletion of the snapshot directory without requiring snapshot-loading code.


Link

[suggestion] · RPC removal omits the documented deprecation grace period

Unless an earlier release already deprecated these features, a mergeable extraction of this demo would remove loadtxoutset, getchainstates, and implicit rollback without the documented one-major-release -deprecatedrpc grace period.

Location: src/rpc/blockchain.cpp:3479 (head).

Details and suggested fix

The removal stub explains why loadtxoutset fails, but does not preserve its old behavior. getchainstates disappears entirely, and the previously documented dumptxoutset <path> rollback call now requires an explicit target. doc/developer-notes.md calls for keeping incompatible RPC behavior available through -deprecatedrpc for at least one major release. Before shipping the removal, provide that deprecation release with import/resumption support retained and the old RPC behavior available behind the compatibility flags, announced in help and release notes. Remove it in the following major release. This also gives snapshot users notice before an upgrade rejects their unfinished datadir.


Link

[suggestion] · The snapshot-discard recovery note omits resynchronization cost

Deleting chainstate_snapshot and using -reindex forfeits snapshot-based startup and requires validation from genesis, including downloads of missing or pruned blocks, before the node catches up to the tip.

Location: doc/release-notes-remove-assumeutxo.md:8 (head).

Details and suggested fix

The release note and Flatten() error describe this alternative only as discarding the snapshot and rebuilding the block index. Reindexing also rebuilds the UTXO state from genesis, using retained blocks where possible and downloading missing history. State that cost explicitly; the amount downloaded depends on which block files remain. Recommend finishing background validation on a supporting release before upgrading when the user needs the snapshot node to remain usable while history is checked.


Link

[suggestion] · Unfinished-snapshot recovery instructions bypass translation

GUI users with an unfinished snapshot always receive the new startup recovery instructions in English because the constructor exception is converted with Untranslated().

Location: src/validation.cpp:5372 (head).

Details and suggested fix

Flatten() throws std::runtime_error when chainstate_snapshot/base_blockhash exists. InitAndLoadChainstate() wraps e.what() in Untranslated(), and the GUI displays that unchanged English text, unlike the parallel _() rejection in LoadChainstate(). Add a translated node-level marker check before constructing ChainstateManager, retaining the constructor guard for kernel callers. This makes the upgrade instructions translatable without moving rejection past BlockManager initialization.


Link

[suggestion] · Startup rejection and broad cleanup share e02f8476

The datadir-safety boundary is harder to audit when the new startup guards and tests appear alongside RPC, documentation, fuzz-target and fixture deletions in e02f8476.

Location: src/node/chainstate.cpp:60 at e02f84763807 (commit) (commit).

Details and suggested fix

Split e02f847638070dcee71dd8e9afb3d0cf277fd61c (validation: reject legacy snapshot startup) so the first commit contains the marker rejection, validity-discontinuity scan, regression tests and release note. This isolates the checks that the marker is rejected before BlockManager construction and the index is rejected before coins-database wiping. Keep any snapshot-test removals required by the guard, including on-disk restart fixtures, in that commit. Follow it with removal of getchainstates, the AssumeUTXO docs, the snapshot fuzzer, test/util/chainstate.h, unused fixture options and candidate clearing. The existing ordering rationale remains intact: the guard closes resumption before the cleanup removes its consumers, and the final tree is unchanged.


Link

[suggestion] · Intermediate -reindex help drops the snapshot-wiping warning too early

At 19dfd0d6, new imports are disabled but existing snapshots still resume and are deleted by reindexing; the help omits that deletion before resumption is retired later in the series.

Location: src/init.cpp:544 at 19dfd0d6c9af (commit) (commit).

Details and suggested fix

19dfd0d6c9af249a6a88bb1b59b7387cb1a523f5 (rpc: stop new snapshot imports) removes both snapshot sentences from the -reindex and -reindex-chainstate help. At that revision, LoadChainstate() still calls LoadAssumeutxoChainstate() and deletes the snapshot when wipe_chainstate_db is set. Remove the now-false RPC-reload sentence there, but retain the sentence warning that the loaded snapshot chainstate is also wiped. Move its deletion to e02f847638070dcee71dd8e9afb3d0cf277fd61c (validation: reject legacy snapshot startup), which rejects stored snapshots before this path. This keeps the intermediate import-removal commit's help accurate; the final tree is consistent.


Coverage details

Earlier concerns

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

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Documented decisions

AssumeUTXO was proposed to reduce time until a node and wallet become usable, rather than eliminate historical validation work. Loading current UTXO state and syncing subsequent blocks avoids waiting for the entire preceding blockchain before use. The original proposal deliberately separated initial snapshot loading from possible later P2P distribution and consensus-level UTXO commitments.

Complete removal eliminates this bootstrapping capability, whereas removing only background validation changes its eventual verification guarantee. These are historically distinct design decisions.

Source 1 · Source 2

Snapshot authenticity was intended to depend on a reviewed, independently reproducible commitment, not the snapshot distributor. Early discussion specifically opposed an arbitrary command-line commitment: a malicious provider could otherwise persuade users to accept reassigned coins without constructing an alternative historical proof-of-work chain. This was recognized as a different attack surface from merely skipping script checks with assumevalid.

Explains the compiled AssumeUTXO commitments and import-time hash check being removed. It also explains why retaining ordinary -assumevalid does not retain the same capability or trust boundary.

Source 1 · Source 2 · Source 3

Background validation was designed to make the additional snapshot trust temporary: reconstruct UTXO state from genesis, compare its hash at the snapshot base, then discard the redundant validation chainstate. The original proposal explicitly contemplated loud failure and shutdown or fallback on disagreement; the pinned implementation invalidates the snapshot state and stops the node.

The completion hashing, failure handling and eventual normalization into an ordinary chainstate implement this local verification guarantee. They are not merely progress reporting or database cleanup.

Source 1

Two chains advancing at distant heights required storage and notification distinctions. The implementation proposal explains that separate block files prevent interleaved heights from impairing pruning, while chainstate roles let indexers ignore assumed-valid notifications and process history sequentially. The usage documentation also warns that unindexed post-snapshot blocks cannot yet be pruned.

Explains why removing AssumeUTXO permits one block-file cursor and simpler notification/index behavior. Historically these distinctions protected pruning effectiveness and index ordering, rather than representing different consensus rules.

Source 1

Later discussion identifies additional reasons for retaining historical synchronization: obtaining complete indexes and archival functionality, handling reorgs below the snapshot base, and maintaining social pressure to keep ordinary IBD affordable. The same discussion acknowledges that users may avoid or delay the additional download, weakening both eventual checking and that incentive.

Stopping background synchronization affects more than commitment verification. These are distinct functionality and ecosystem-incentive considerations, although the inspected source presents them as reasons to weigh, not established requirements.

Source 1 · Source 2

Independent verification of compiled commitments must be distinguished from making them consensus checkpoints. In #32377, an objection was that aborting ordinary IBD on a commitment mismatch would let developers prescribe the correct chain. The proposal author subsequently changed the proposal from asserting to warning while retaining strict checks for snapshot imports.

Explains the historical boundary between optional snapshot trust and ordinary validation. Distributed commitment checking was proposed as a different assurance mechanism, not an automatically equivalent replacement for local background validation.

Source 1 · Source 2 · Source 3

Ralph's inferences

The cache policy embodies a two-stage priority: minimize time to usable tip first, then accelerate removal of the temporary trust assumption. The pinned base allocates 95% to the snapshot during IBD, reverses that allocation afterward, and returns all cache to the surviving chainstate after completion. The percentages are resource policy, not protocol requirements.

The early removal of reprioritization changes this scheduling tradeoff independently of snapshot loading; eventual removal of both chainstates removes the need for runtime budget redistribution.

Source 1

Snapshot compatibility is coupled to block-index metadata, not just the existence of a second database directory. Import supplies cumulative transaction counts and adjusts historical index flags without downloading all preceding transactions; consequently startup must distinguish unfinished assumed state from ordinary validated state.

Connects the removal of transaction-count exceptions and snapshot metadata with the head's explicit rejection of unfinished snapshot state. These changes address one lifecycle boundary rather than unrelated startup special cases.

Unresolved disagreements

The inspected record does not settle whether every snapshot user should perform background validation. The original design values eventual local verification; later arguments favor explicit continuing trust in the shipped commitment, supported by ordinary IBD nodes checking it independently. Those arguments stress that background validation cannot protect use before it finishes and adds snapshot bandwidth and temporary storage to historical synchronization.

This is the central distinction between removing background validation and removing snapshot support altogether. Historical arguments establish the competing guarantees and costs, but do not establish their equivalence or a settled preference.

Source 1 · Source 2 · Source 3 · Source 4

The cost-benefit judgment about snapshot support remains contested. Critics describe multiple chainstates as a burden on critical validation and kernel work. Supporters argue that external snapshot acquisition impedes adoption and that easier distribution could serve prepackaged nodes and BTCPayServer. Other participants question whether distribution explains limited usage and whether contributor effort should instead prioritize ordinary IBD.

Complete removal trades away faster usability as well as maintenance complexity. The historical record does not justify treating low torrent participation as a reliable adoption measurement or distribution improvements as a proven solution.

Source 1 · Source 2 · Source 3 · Source 4 · Source 5