A corrupt leftover AssumeUTXO snapshot database blocks every retry #37068

issue l0rinc opened this issue on December 2, 2026
  1. l0rinc commented at 8:16 PM on December 2, 2026: contributor

    An interrupted loadtxoutset leaves its chainstate_snapshot database behind without the base_blockhash marker, and startup only logs a warning about it. A later call reopens that directory without wiping it, so if the leftover database can't be opened (for example after corruption), every retry fails with a fatal LevelDB error until the directory is removed manually. Each failed retry also leaves the UTXO caches at 1% (#37049).

    <details> <summary>Reproducer</summary>

    diff --git a/test/functional/feature_assumeutxo.py b/test/functional/feature_assumeutxo.py
    index fa9466f2d8..452e42fd56 100755
    --- a/test/functional/feature_assumeutxo.py
    +++ b/test/functional/feature_assumeutxo.py
    @@ -216,6 +216,13 @@ class AssumeutxoTest(BitcoinTestFramework):
         def test_snapshot_with_less_work(self, dump_output_path):
             self.log.info("Test bitcoind should fail when snapshot has less accumulated work than this node.")
             node = self.nodes[0]
    +        snapshot_dir = node.chain_path / "chainstate_snapshot"
    +        snapshot_dir.mkdir()
    +        (snapshot_dir / "CURRENT").write_text("invalid", encoding="utf8")
    +        assert_raises_rpc_error(-1, "Fatal LevelDB error", node.loadtxoutset, dump_output_path)
    +        assert snapshot_dir.exists()
    +        self.cleanup_folder(snapshot_dir)
    +
             msg = "Unable to load UTXO snapshot: Population failed: Work does not exceed active chainstate."
             assert_raises_rpc_error(-32603, msg, node.loadtxoutset, dump_output_path)
     
    

    </details>

    The direct fix would be to wipe the leftover snapshot database before reopening it (as #36542 proposed), but given that this retry state disappears with snapshot loading, I'm proposing to remove AssumeUTXO entirely in #36598 instead.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-12-03 02:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me