test: Add wallet reorg test during assumeutxo background sync #34535

pull b-l-u-e wants to merge 1 commits into bitcoin:master from b-l-u-e:test-wallet-reorg-assumeutxo changing 1 files +81 −2
  1. b-l-u-e commented at 9:23 pm on February 8, 2026: contributor

    This PR adds a test that verifies wallet balance consistency when a chain reorg occurs while assumeutxo background validation is in progress

    motivation currently test file tests wallet functionality with snapshots but there is no test covering what happens when reorg occurs during background validation phase.

    so what it tests

    • wallet state remains consistent through reorg
    • balance updates when coins are orphaned
  2. DrahtBot added the label Tests on Feb 8, 2026
  3. DrahtBot commented at 9:24 pm on February 8, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK yuvicc

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

    LLM Linter (✨ experimental)

    Possible typos and grammar issues:

    • Restore wallet created at snapshot height it should be empty before sync -> Restore wallet created at snapshot height; it should be empty before sync [run-on sentence missing punctuation; needs a separator or conjunction to be grammatical]
    • Payment is post snapshot and intended to be orphaned by the reorg ensure seen first -> Payment is post-snapshot and intended to be orphaned by the reorg; ensure it is seen first [missing hyphen in “post-snapshot” and a separator plus subject “it” to make the instruction grammatical]

    2026-02-16 20:16:22

  4. b-l-u-e marked this as ready for review on Feb 9, 2026
  5. in test/functional/wallet_assumeutxo.py:156 in 3a8f776299
    151+        # Build an alternative chain on n0 that excludes the post snapshot wallet payment
    152+        fork_point = SNAPSHOT_BASE_HEIGHT
    153+        orig_height = n0.getblockcount()
    154+        orig_chainwork = int(n0.getblockchaininfo()['chainwork'], 16)
    155+        self.disconnect_nodes(n3.index, n0.index)
    156+        n0.invalidateblock(n0.getblockhash(fork_point + 1))
    


    yuvicc commented at 5:04 am on February 16, 2026:
    Instead of using invalidateblock directly, we could leverage fork-based reorg testing here so that it matches the real re-org scenario. For more see mempool_updatefromblock.py test.

    b-l-u-e commented at 7:55 pm on February 16, 2026:
    i made changes to use fork-based reorg , thanks for the tip
  6. yuvicc commented at 5:05 am on February 16, 2026: contributor
    Concept ACK
  7. b-l-u-e force-pushed on Feb 16, 2026
  8. test: Add wallet reorg test during assumeutxo background sync
    Signed-off-by: b-l-u-e <winnie.gitau282@gmail.com>
    75368100aa
  9. b-l-u-e force-pushed on Feb 16, 2026
  10. DrahtBot added the label CI failed on Feb 16, 2026
  11. DrahtBot removed the label CI failed on Feb 16, 2026

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-02-17 06:13 UTC

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