AssumeUTXO restart can treat an unlinked snapshot block as a chain candidate #37070

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

    During background sync, the snapshot block can be stored before one of its ancestors and remain in m_blocks_unlinked only in memory. After restart, its hardcoded chain transaction count makes it a background-chain candidate, and FindMostWorkChain() aborts when it reaches the unlinked parent.

    <details> <summary>Reproducer</summary>

    diff --git a/test/functional/feature_assumeutxo.py b/test/functional/feature_assumeutxo.py
    index fa9466f2d8..6564171fb4 100755
    --- a/test/functional/feature_assumeutxo.py
    +++ b/test/functional/feature_assumeutxo.py
    @@ -677,6 +677,13 @@ class AssumeutxoTest(BitcoinTestFramework):
             snapshot_block = n0.getblock(snapshot_hash, 0)
             n1.submitblock(snapshot_block)
     
    +        self.log.info("Restart while some of the snapshot block's ancestors are missing")
    +        self.restart_node(1, extra_args=self.extra_args[1], wait_for_full_init=False)
    +        n1.getblock(snapshot_hash)
    +        normal, snapshot = n1.getchainstates()['chainstates']
    +        assert_equal(normal['blocks'], START_HEIGHT)
    +        assert_equal(snapshot['blocks'], PAUSE_HEIGHT)
    +
             self.connect_nodes(0, 1)
     
             self.log.info(f"Ensuring snapshot chain syncs to tip. ({FINAL_HEIGHT})")
    

    </details>

    The direct fix would be to restore the snapshot block's unlinked state and keep it out of the background candidate set until its parent links (as #36702 proposes, while remaining compatible with #36149), but given that this candidate exception exists only for AssumeUTXO, 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