[WIP] test: Fix reorg patterns in mempool tests to use proper fork-based approach #32587

pull i-am-yuvi wants to merge 1 commits into bitcoin:master from i-am-yuvi:2025-05-update_test_reorg_behaviour changing 1 files +33 −11
  1. i-am-yuvi commented at 1:26 pm on May 22, 2025: contributor

    Addresses #32531

    This is a Work In Progress, not ready for review yet.

    Currently updating functional tests to replace direct use of invalidateblock with proper fork-based reorg behaviour. The direct invalidation approach bypasses important validation checks and has depth limitations(10 block) that don’t match real-world reorg scenarios.

    Plan:

    • Fix mempool_ephemeral_dust.py reorg patterns
    • Audit and fix other mempool_*.py tests
    • Update any additional tests using problematic reorg patterns

    Will mark ready for review once all functional tests are updated and verified.

  2. DrahtBot commented at 1:26 pm on May 22, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32587.

    Reviews

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #32468 (rpc: generatetomany by polespinasa)

    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.

  3. instagibbs commented at 1:27 pm on May 22, 2025: member
    feel free to ping me when it’s ready
  4. i-am-yuvi commented at 1:30 pm on May 22, 2025: contributor

    feel free to ping me when it’s ready

    Sure!

  5. fix: reorg behaviour in mempool tests
    The current test directly uses invalidatblock to trigger
    mempool re-entry of transactions. Unfortunately, the
    behavior doesn't match what a real reorg would look like. As
    a result you get surprising behavior such as the mempool
    descendant chain limits being exceeded, or if a fork is
    greater than 10 blocks deep, evicted block transactions stop
    being submitted back into in the mempool.
    
    Fix this by preparing an empty fork chain, invalidating that
    via rpc, and then continuing with the logic, finally
    reconsidering the fork chain once the rest of the test is
    prepared. This triggers a more typical codepath.
    
    see https://github.com/bitcoin/bitcoin/pull/32516/commits/2b202e9db56487e658fc41089178f31ef4259a0d
    79caa92ca9
  6. i-am-yuvi force-pushed on May 23, 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: 2025-05-25 18:12 UTC

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