test: assumeutxo: spend coin from snapshot chainstate after loading #29215

pull theStack wants to merge 1 commits into bitcoin:master from theStack:202401-test-assumeutxo-spend_coin_from_snapshot_chainstate changing 1 files +19 −1
  1. theStack commented at 1:00 AM on January 10, 2024: contributor

    This PR extends the AssumeUTXO functional test by submitting a spending transaction for an UTXO that is only available in a the snapshot chainstate (after loading via loadtxoutset), i.e. it hasn't been seen in a block before. With that we can verify that snapshot coins are visible to the mempool.

    Note that we unfortunately can't use MiniWallet here, as the only available UTXO to spend from the snapshot chainstate is at height 200, where a P2PKH created from the test framework's deterministic private key is used (see TestNode.generate(...) and the PRIV_KEYS array). Coinbase outputs with smaller heights (<= 199) would be part of the pre-generated chain and hence not qualify for the "UTXO is only in snapshot chainstate and has never been seen in a block" scenario, coinbase outputs with larger heights (>= 201) can't be spent due to immaturity, as the snapshot chainstate block height is 299.

    One could of course mine a different chain with outputs that MiniWallet supports (e.g. taproot anyone-can-spend), but this would change the hardcoded AssumeUTXO hash, colliding with other PRs like #28838, so I wanted to avoid that.

  2. test: assumeutxo: spend coin from snapshot chainstate after loading
    Check that an UTXO that is only available in the snapshot chainstate
    is also visible to the mempool by submitting a spending transaction.
    931575418e
  3. DrahtBot commented at 1:00 AM on January 10, 2024: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko, jamesob

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Tests on Jan 10, 2024
  5. maflcko commented at 8:42 AM on January 10, 2024: member

    lgtm ACK 931575418e082af37b88b1819125b0d0f0fabbd5

  6. jamesob commented at 2:38 PM on January 10, 2024: contributor
  7. glozow assigned glozow on Jan 10, 2024
  8. glozow merged this on Jan 10, 2024
  9. glozow closed this on Jan 10, 2024

  10. theStack deleted the branch on Jan 10, 2024
  11. glozow unassigned glozow on Jan 10, 2024
  12. bitcoin locked this on Jan 9, 2025

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-04-14 21:13 UTC

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