test: cover cluster limits during reorgs #36214

pull yuvicc wants to merge 1 commits into bitcoin:master from yuvicc:2026-7-add_reorg_test_cluster_mempoool changing 1 files +40 −0
  1. yuvicc commented at 4:10 AM on September 10, 2026: contributor

    This PR adds functional test coverage for cluster-limit handling during reorgs.

    Transactions resurrected from disconnected blocks are added before their existing mempool children are linked in the transaction graph. Once those dependencies are restored, oversized clusters must be trimmed back within their configured count and size limits.

  2. DrahtBot added the label Tests on Sep 10, 2026
  3. DrahtBot commented at 4:11 AM on September 10, 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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. fanquake commented at 8:56 AM on September 10, 2026: member
  5. instagibbs commented at 12:32 PM on September 10, 2026: member

    I think the only thing this test adds over test_chainlimits_exceeded and transaction_graph_test is testing the pre-existing mempool children are added back in to the clusters. Thoughts?

  6. yuvicc commented at 1:21 PM on September 10, 2026: contributor

    I think the only thing this test adds over test_chainlimits_exceeded and transaction_graph_test is testing the pre-existing mempool children are added back in to the clusters.

    Agree, transaction_graph_test covers reconnecting existing children. These tests cover clusters that become oversized only after reconnecting existing children, exercising Trim() for count, size, and merged clusters.

  7. sedited commented at 5:30 PM on October 23, 2026: contributor

    for count, size, and merged clusters.

    Not sure it's useful to run through all of them. Can you trim this down to just the case that actually kills a mutant?

  8. test: cover cluster limits during reorgs 6da6d5ac69
  9. yuvicc force-pushed on Oct 28, 2026
  10. yuvicc commented at 5:29 AM on October 28, 2026: contributor

    Trimmed to a single case. The mutant this kills is skipping the cluster trim in UpdateTransactionsFromBlock after a reorg.

    <details> <summary> diff </summary>

    --- a/src/txmempool.cpp
    +++ b/src/txmempool.cpp
    @@ -112,7 +112,7 @@
             }
         }
    
    -    auto txs_to_remove = m_txgraph->Trim(); // Enforce cluster size limits.
    +    std::vector<TxGraph::Ref*> txs_to_remove; // Enforce cluster size limits.
         for (auto txptr : txs_to_remove) {
             const CTxMemPoolEntry& entry = *(static_cast<const CTxMemPoolEntry*>(txptr));
             removeUnchecked(mapTx.iterator_to(entry), MemPoolRemovalReason::SIZELIMIT);
    

    </details>

  11. maflcko commented at 5:57 AM on October 28, 2026: member

    If there is a killed mutant, could include the diff in a comment?

  12. yuvicc commented at 6:13 AM on October 28, 2026: contributor

    If there is a killed mutant, could include the diff in a comment?

    I've updated the above comment.


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-10-30 09:40 UTC