Interrupted AssumeUTXO validation is reported as a statistics failure #37072

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

    If shutdown interrupts the final UTXO hash, MaybeValidateSnapshot() returns STATS_FAILED, the same result as a real statistics failure. At startup, a shutdown request during that hash then fails initialization with "UTXO snapshot failed to validate. Restart to resume normal initial block download, or try loading a different snapshot." instead of exiting quietly.

    <details> <summary>Reproducer</summary>

    diff --git a/src/test/validation_chainstatemanager_tests.cpp b/src/test/validation_chainstatemanager_tests.cpp
    index d8463f5dc3..0402ee22e5 100644
    --- a/src/test/validation_chainstatemanager_tests.cpp
    +++ b/src/test/validation_chainstatemanager_tests.cpp
    @@ -949,6 +949,14 @@ BOOST_FIXTURE_TEST_CASE(chainstatemanager_snapshot_completion_hash_mismatch, Sna
         }
     }
     
    +BOOST_FIXTURE_TEST_CASE(chainstatemanager_snapshot_hash_interrupted, SnapshotTestSetup)
    +{
    +    auto [validated, snapshot]{this->SetupSnapshot()};
    +    BOOST_REQUIRE((*Assert(m_node.shutdown_signal))());
    +    BOOST_CHECK_EQUAL(WITH_LOCK(::cs_main, return Assert(m_node.chainman)->MaybeValidateSnapshot(*validated, *snapshot)), SnapshotCompletionResult::STATS_FAILED);
    +    BOOST_REQUIRE(m_node.shutdown_signal->reset());
    +}
    +
     /** Helper function to parse args into args_man and return the result of applying them to opts */
     template <typename Options>
     util::Result<Options> SetOptsFromArgs(ArgsManager& args_man, Options opts,
    

    </details>

    The direct fix would be to represent interruption separately and run completion only after validation succeeds (extending the restart problem in #32029), but given that this validation lifecycle disappears with background validation, 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