Stop enforcing descendant size/count limits

Cluster size limits should be enough.
This commit is contained in:
Suhas Daftuar committed 2025-11-18 08:57:51 -05:00
1 parent 89ae38f489
commit cf3ab8e1d0
7 files changed
+26 -78

No files matched your search

+6 -7
View File
@@ -196,15 +196,15 @@ class MempoolTRUC(BitcoinTestFramework):
node.invalidateblock(block["hash"])
self.check_mempool([tx_v3_block["txid"], tx_v2_block["txid"], tx_v3_block2["txid"], tx_v2_from_v3["txid"], tx_v3_from_v2["txid"], tx_v3_child_large["txid"], tx_chain_1["txid"], tx_chain_2["txid"], tx_chain_3["txid"], tx_chain_4["txid"]])
@cleanup(extra_args=["-limitdescendantsize=10"])
@cleanup(extra_args=["-limitclustercount=1"])
def test_nondefault_package_limits(self):
"""
Max standard tx size + TRUC rules imply the ancestor/descendant rules (at their default
Max standard tx size + TRUC rules imply the cluster rules (at their default
values), but those checks must not be skipped. Ensure both sets of checks are done by
changing the ancestor/descendant limit configurations.
changing the cluster limit configurations.
"""
node = self.nodes[0]
self.log.info("Test that a decreased limitdescendantsize also applies to TRUC child")
self.log.info("Test that a decreased cluster count limit also applies to TRUC child")
parent_target_vsize = 9990
child_target_vsize = 500
tx_v3_parent_large1 = self.wallet.send_self_transfer(
@@ -218,12 +218,11 @@ class MempoolTRUC(BitcoinTestFramework):
version=3
)
# Parent and child are within v3 limits, but parent's 10kvB descendant limit is exceeded
# Parent and child are within v3 limits, but cluster count limit is exceeded.
assert_greater_than_or_equal(TRUC_MAX_VSIZE, tx_v3_parent_large1["tx"].get_vsize())
assert_greater_than_or_equal(TRUC_CHILD_MAX_VSIZE, tx_v3_child_large1["tx"].get_vsize())
assert_greater_than(tx_v3_parent_large1["tx"].get_vsize() + tx_v3_child_large1["tx"].get_vsize(), 10000)
assert_raises_rpc_error(-26, f"too-long-mempool-chain, exceeds descendant size limit for tx {tx_v3_parent_large1['txid']}", node.sendrawtransaction, tx_v3_child_large1["hex"])
assert_raises_rpc_error(-26, "too-large-cluster", node.sendrawtransaction, tx_v3_child_large1["hex"])
self.check_mempool([tx_v3_parent_large1["txid"]])
assert_equal(node.getmempoolentry(tx_v3_parent_large1["txid"])["descendantcount"], 1)
self.generate(node, 1)