test: fix `mining_prioritisetransaction` check that always passes #36921

pull w0xlt wants to merge 1 commits into bitcoin:master from w0xlt:test-prioritisetransaction-gbt-rebuild changing 1 files +7 −5
  1. w0xlt commented at 2:23 AM on November 20, 2026: contributor

    mining_prioritisetransaction.py checks that prioritisetransaction alone makes getblocktemplate return a new block, by comparing the whole template before and after moving mocktime 10 seconds forward. But curtime comes from the clock, so the two templates always differ, even if the template wasn't rebuilt.

    This PR checks that the deprioritised transaction drops out of the template instead. If you remove the counter bump in CTxMemPool::PrioritiseTransaction (the fix this check was added for in #10196), the test from master still passes but this one fails.

  2. test: check the rebuilt getblocktemplate transactions after prioritisetransaction
    The check that prioritisetransaction makes getblocktemplate return a new
    block compared the whole template. curtime follows the mock clock, so the
    comparison passed even when the cached template was reused. Check that the
    deprioritised transaction leaves the template instead.
    
    Co-authored-by: Enoch Azariah <66912335+enochaz@users.noreply.github.com>
    3066c8e128
  3. DrahtBot added the label Tests on Nov 20, 2026
  4. DrahtBot commented at 2:24 AM on November 20, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #36922 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36922.svg"></sub> (mining: use a steady clock for the getblocktemplate rebuild interval by w0xlt)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. Pranav-error commented at 5:02 AM on November 20, 2026: none

    I verified that the check on master is effectively vacuous. Removing the prioritisetransaction call still makes the test pass (exit 0), while the PR correctly fails with an AssertionError. A mutation removing ++nTransactionsUpdated is also caught by the PR but passes on master.

    The issue is that curtime gets refreshed even when the cached block template is reused, so the existing check never actually verifies the intended update. The PR also relies on the +10s mocktime bump, without which its test fails.

    These results confirm that the PR makes the test meaningfully validate the transaction prioritisation behavior.


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-11-20 15:51 UTC

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