v30.3-roots.1 · Commit 3: [PATCH 03/68] feat(policy): preserve Roots relay and network controls on Core 30.3
test/functional/mempool_truc.py
Before: test/functional/mempool_truc.py · After: test/functional/mempool_truc.py
File metadata
index 098631b5c414e1d6df76914ea25e695dbcfe103f..dd34685ac585b16b482d9ebfad4d96a82be4eb24 100755
Download original patch · Release notes
Diff rows 1–150 of 150. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
test/functional/mempool_truc.py
CHANGED
|
@@ -4,6 +4,9 @@
|
|
| 4 |
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
| 5 |
from decimal import Decimal
|
| 6 |
|
|
|
|
|
|
|
|
|
|
| 7 |
from test_framework.test_framework import BitcoinTestFramework
|
| 8 |
from test_framework.util import (
|
| 9 |
assert_not_equal,
|
|
@@ -56,7 +59,7 @@ class MempoolTRUC(BitcoinTestFramework):
|
|
| 56 |
self.log.info("Test TRUC-specific maximum transaction vsize")
|
| 57 |
tx_v3_heavy = self.wallet.create_self_transfer(target_vsize=TRUC_MAX_VSIZE + 1, version=3)
|
| 58 |
assert_greater_than_or_equal(tx_v3_heavy["tx"].get_vsize(), TRUC_MAX_VSIZE)
|
| 59 |
-
expected_error_heavy = f"TRUC-violation, version=3 tx {tx_v3_heavy['txid']} (wtxid={tx_v3_heavy['wtxid']}) is too big"
|
| 60 |
assert_raises_rpc_error(-26, expected_error_heavy, node.sendrawtransaction, tx_v3_heavy["hex"])
|
| 61 |
self.check_mempool([])
|
| 62 |
|
|
@@ -76,7 +79,7 @@ class MempoolTRUC(BitcoinTestFramework):
|
|
| 76 |
version=3
|
| 77 |
)
|
| 78 |
assert_greater_than_or_equal(tx_v3_child_heavy["tx"].get_vsize(), TRUC_CHILD_MAX_VSIZE)
|
| 79 |
-
expected_error_child_heavy = f"TRUC-violation, version=3 child tx {tx_v3_child_heavy['txid']} (wtxid={tx_v3_child_heavy['wtxid']}) is too big"
|
| 80 |
assert_raises_rpc_error(-26, expected_error_child_heavy, node.sendrawtransaction, tx_v3_child_heavy["hex"])
|
| 81 |
self.check_mempool([tx_v3_parent_normal["txid"]])
|
| 82 |
# tx has no descendants
|
|
@@ -114,6 +117,7 @@ class MempoolTRUC(BitcoinTestFramework):
|
|
| 114 |
from_node=node,
|
| 115 |
fee_rate=DEFAULT_FEE,
|
| 116 |
utxo_to_spend=utxo_v3_bip125,
|
|
|
|
| 117 |
version=3
|
| 118 |
)
|
| 119 |
self.check_mempool([tx_v3_bip125["txid"]])
|
|
@@ -156,12 +160,11 @@ class MempoolTRUC(BitcoinTestFramework):
|
|
| 156 |
utxo_to_spend=tx_v3_parent["new_utxo"],
|
| 157 |
version=2
|
| 158 |
)
|
| 159 |
-
expected_error_v2_v3 = f"TRUC-violation, non-version=3 tx {tx_v3_child_rbf_v2['txid']} (wtxid={tx_v3_child_rbf_v2['wtxid']}) cannot spend from version=3 tx {tx_v3_parent['txid']} (wtxid={tx_v3_parent['wtxid']})"
|
| 160 |
assert_raises_rpc_error(-26, expected_error_v2_v3, node.sendrawtransaction, tx_v3_child_rbf_v2["hex"])
|
| 161 |
self.check_mempool([tx_v3_bip125_rbf_v2["txid"], tx_v3_parent["txid"], tx_v3_child["txid"]])
|
| 162 |
|
| 163 |
-
|
| 164 |
-
@cleanup()
|
| 165 |
def test_truc_reorg(self):
|
| 166 |
node = self.nodes[0]
|
| 167 |
self.log.info("Test that, during a reorg, TRUC rules are not enforced")
|
|
@@ -277,20 +280,20 @@ class MempoolTRUC(BitcoinTestFramework):
|
|
| 277 |
|
| 278 |
self.check_mempool([])
|
| 279 |
result = node.submitpackage([tx_v3_parent_normal["hex"], tx_v3_parent_2_normal["hex"], tx_v3_child_multiparent["hex"]])
|
| 280 |
-
assert_equal(result['package_msg'], f"TRUC-violation, tx {tx_v3_child_multiparent['txid']} (wtxid={tx_v3_child_multiparent['wtxid']}) would have too many ancestors")
|
| 281 |
self.check_mempool([])
|
| 282 |
|
| 283 |
self.check_mempool([])
|
| 284 |
result = node.submitpackage([tx_v3_parent_normal["hex"], tx_v3_child_heavy["hex"]])
|
| 285 |
# tx_v3_child_heavy is heavy based on vsize, not sigops.
|
| 286 |
-
assert_equal(result['package_msg'], f"TRUC-violation, version=3 child tx {tx_v3_child_heavy['txid']} (wtxid={tx_v3_child_heavy['wtxid']}) is too big: {tx_v3_child_heavy['tx'].get_vsize()} > 1000 virtual bytes")
|
| 287 |
self.check_mempool([])
|
| 288 |
|
| 289 |
tx_v3_parent = self.wallet.create_self_transfer(version=3)
|
| 290 |
tx_v3_child = self.wallet.create_self_transfer(utxo_to_spend=tx_v3_parent["new_utxo"], version=3)
|
| 291 |
tx_v3_grandchild = self.wallet.create_self_transfer(utxo_to_spend=tx_v3_child["new_utxo"], version=3)
|
| 292 |
result = node.testmempoolaccept([tx_v3_parent["hex"], tx_v3_child["hex"], tx_v3_grandchild["hex"]])
|
| 293 |
-
assert all([txresult["package-error"] == f"TRUC-violation, tx {tx_v3_grandchild['txid']} (wtxid={tx_v3_grandchild['wtxid']}) would have too many ancestors" for txresult in result])
|
| 294 |
|
| 295 |
@cleanup(extra_args=None)
|
| 296 |
def test_truc_ancestors_package_and_mempool(self):
|
|
@@ -319,7 +322,7 @@ class MempoolTRUC(BitcoinTestFramework):
|
|
| 319 |
|
| 320 |
# submitpackage(B, C) should fail
|
| 321 |
result = node.submitpackage([tx_0fee_parent["hex"], tx_child_violator["hex"]])
|
| 322 |
-
assert_equal(result['package_msg'], f"TRUC-violation, tx {tx_child_violator['txid']} (wtxid={tx_child_violator['wtxid']}) would have too many ancestors")
|
| 323 |
self.check_mempool([tx_in_mempool["txid"]])
|
| 324 |
|
| 325 |
@cleanup(extra_args=None)
|
|
@@ -372,17 +375,17 @@ class MempoolTRUC(BitcoinTestFramework):
|
|
| 372 |
# Fails with another non-related transaction via testmempoolaccept
|
| 373 |
tx_unrelated = self.wallet.create_self_transfer(version=3)
|
| 374 |
result_test_unrelated = node.testmempoolaccept([tx_sibling_1["hex"], tx_unrelated["hex"]])
|
| 375 |
-
assert_equal(result_test_unrelated[0]["reject-reason"], "TRUC-violation")
|
| 376 |
|
| 377 |
# Fails in a package via testmempoolaccept
|
| 378 |
result_test_1p1c = node.testmempoolaccept([tx_sibling_1["hex"], tx_has_mempool_uncle["hex"]])
|
| 379 |
-
assert_equal(result_test_1p1c[0]["reject-reason"], "TRUC-violation")
|
| 380 |
|
| 381 |
# Allowed when tx is submitted in a package and evaluated individually.
|
| 382 |
# Note that the child failed since it would be the 3rd generation.
|
| 383 |
result_package_indiv = node.submitpackage([tx_sibling_1["hex"], tx_has_mempool_uncle["hex"]])
|
| 384 |
self.check_mempool([tx_mempool_parent["txid"], tx_sibling_1["txid"]])
|
| 385 |
-
expected_error_gen3 = f"TRUC-violation, tx {tx_has_mempool_uncle['txid']} (wtxid={tx_has_mempool_uncle['wtxid']}) would have too many ancestors"
|
| 386 |
|
| 387 |
assert_equal(result_package_indiv["tx-results"][tx_has_mempool_uncle['wtxid']]['error'], expected_error_gen3)
|
| 388 |
|
|
@@ -393,7 +396,7 @@ class MempoolTRUC(BitcoinTestFramework):
|
|
| 393 |
# Child cannot pay for sibling eviction for parent, as it violates TRUC topology limits
|
| 394 |
result_package_cpfp = node.submitpackage([tx_sibling_3["hex"], tx_bumps_parent_with_sibling["hex"]])
|
| 395 |
self.check_mempool([tx_mempool_parent["txid"], tx_sibling_2["txid"]])
|
| 396 |
-
expected_error_cpfp = f"TRUC-violation, tx {tx_mempool_parent['txid']} (wtxid={tx_mempool_parent['wtxid']}) would exceed descendant count limit"
|
| 397 |
|
| 398 |
assert_equal(result_package_cpfp["tx-results"][tx_sibling_3['wtxid']]['error'], expected_error_cpfp)
|
| 399 |
|
|
@@ -414,7 +417,7 @@ class MempoolTRUC(BitcoinTestFramework):
|
|
| 414 |
)
|
| 415 |
self.check_mempool([])
|
| 416 |
result = node.submitpackage([tx_v3_parent["hex"], tx_v2_child["hex"]])
|
| 417 |
-
assert_equal(result['package_msg'], f"TRUC-violation, non-version=3 tx {tx_v2_child['txid']} (wtxid={tx_v2_child['wtxid']}) cannot spend from version=3 tx {tx_v3_parent['txid']} (wtxid={tx_v3_parent['wtxid']})")
|
| 418 |
self.check_mempool([])
|
| 419 |
|
| 420 |
@cleanup(extra_args=None)
|
|
@@ -435,11 +438,11 @@ class MempoolTRUC(BitcoinTestFramework):
|
|
| 435 |
assert all([result["allowed"] for result in test_accept_v2_and_v3])
|
| 436 |
|
| 437 |
test_accept_v3_from_v2 = node.testmempoolaccept([tx_v2["hex"], tx_v3_from_v2["hex"]])
|
| 438 |
-
expected_error_v3_from_v2 = f"TRUC-violation, version=3 tx {tx_v3_from_v2['txid']} (wtxid={tx_v3_from_v2['wtxid']}) cannot spend from non-version=3 tx {tx_v2['txid']} (wtxid={tx_v2['wtxid']})"
|
| 439 |
assert all([result["package-error"] == expected_error_v3_from_v2 for result in test_accept_v3_from_v2])
|
| 440 |
|
| 441 |
test_accept_v2_from_v3 = node.testmempoolaccept([tx_v3["hex"], tx_v2_from_v3["hex"]])
|
| 442 |
-
expected_error_v2_from_v3 = f"TRUC-violation, non-version=3 tx {tx_v2_from_v3['txid']} (wtxid={tx_v2_from_v3['wtxid']}) cannot spend from version=3 tx {tx_v3['txid']} (wtxid={tx_v3['wtxid']})"
|
| 443 |
assert all([result["package-error"] == expected_error_v2_from_v3 for result in test_accept_v2_from_v3])
|
| 444 |
|
| 445 |
test_accept_pairs = node.testmempoolaccept([tx_v2["hex"], tx_v3["hex"], tx_v2_from_v2["hex"], tx_v3_from_v3["hex"]])
|
|
@@ -451,7 +454,7 @@ class MempoolTRUC(BitcoinTestFramework):
|
|
| 451 |
tx_v3_child_1 = self.wallet.create_self_transfer(utxo_to_spend=tx_v3_parent["new_utxos"][0], version=3)
|
| 452 |
tx_v3_child_2 = self.wallet.create_self_transfer(utxo_to_spend=tx_v3_parent["new_utxos"][1], version=3)
|
| 453 |
test_accept_2children = node.testmempoolaccept([tx_v3_parent["hex"], tx_v3_child_1["hex"], tx_v3_child_2["hex"]])
|
| 454 |
-
expected_error_2children = f"TRUC-violation, tx {tx_v3_parent['txid']} (wtxid={tx_v3_parent['wtxid']}) would exceed descendant count limit"
|
| 455 |
assert all([result["package-error"] == expected_error_2children for result in test_accept_2children])
|
| 456 |
|
| 457 |
# Extra TRUC transaction does not get incorrectly marked as extra descendant
|
|
@@ -460,7 +463,7 @@ class MempoolTRUC(BitcoinTestFramework):
|
|
| 460 |
|
| 461 |
# Extra TRUC transaction does not make us ignore the extra descendant
|
| 462 |
test_accept_2children_with_exra = node.testmempoolaccept([tx_v3_parent["hex"], tx_v3_child_1["hex"], tx_v3_child_2["hex"], tx_v3_independent["hex"]])
|
| 463 |
-
expected_error_extra = f"TRUC-violation, tx {tx_v3_parent['txid']} (wtxid={tx_v3_parent['wtxid']}) would exceed descendant count limit"
|
| 464 |
assert all([result["package-error"] == expected_error_extra for result in test_accept_2children_with_exra])
|
| 465 |
# Same result if the parent is already in mempool
|
| 466 |
node.sendrawtransaction(tx_v3_parent["hex"])
|
|
@@ -597,7 +600,7 @@ class MempoolTRUC(BitcoinTestFramework):
|
|
| 597 |
utxo_to_spend=tx_with_multi_children["new_utxos"][2],
|
| 598 |
fee_rate=DEFAULT_FEE*50
|
| 599 |
)
|
| 600 |
-
expected_error_2siblings = f"TRUC-violation, tx {tx_with_multi_children['txid']} (wtxid={tx_with_multi_children['wtxid']}) would exceed descendant count limit"
|
| 601 |
assert_raises_rpc_error(-26, expected_error_2siblings, node.sendrawtransaction, tx_with_sibling3["hex"])
|
| 602 |
|
| 603 |
# However, an RBF (with conflicting inputs) is possible even if the resulting cluster size exceeds 2
|
|
|
|
| 4 |
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
| 5 |
from decimal import Decimal
|
| 6 |
|
| 7 |
+
from test_framework.messages import (
|
| 8 |
+
MAX_BIP125_RBF_SEQUENCE,
|
| 9 |
+
)
|
| 10 |
from test_framework.test_framework import BitcoinTestFramework
|
| 11 |
from test_framework.util import (
|
| 12 |
assert_not_equal,
|
|
|
|
| 59 |
self.log.info("Test TRUC-specific maximum transaction vsize")
|
| 60 |
tx_v3_heavy = self.wallet.create_self_transfer(target_vsize=TRUC_MAX_VSIZE + 1, version=3)
|
| 61 |
assert_greater_than_or_equal(tx_v3_heavy["tx"].get_vsize(), TRUC_MAX_VSIZE)
|
| 62 |
+
expected_error_heavy = f"truc-vsize-toobig, version=3 tx {tx_v3_heavy['txid']} (wtxid={tx_v3_heavy['wtxid']}) is too big"
|
| 63 |
assert_raises_rpc_error(-26, expected_error_heavy, node.sendrawtransaction, tx_v3_heavy["hex"])
|
| 64 |
self.check_mempool([])
|
| 65 |
|
|
|
|
| 79 |
version=3
|
| 80 |
)
|
| 81 |
assert_greater_than_or_equal(tx_v3_child_heavy["tx"].get_vsize(), TRUC_CHILD_MAX_VSIZE)
|
| 82 |
+
expected_error_child_heavy = f"truc-child-toobig, version=3 child tx {tx_v3_child_heavy['txid']} (wtxid={tx_v3_child_heavy['wtxid']}) is too big"
|
| 83 |
assert_raises_rpc_error(-26, expected_error_child_heavy, node.sendrawtransaction, tx_v3_child_heavy["hex"])
|
| 84 |
self.check_mempool([tx_v3_parent_normal["txid"]])
|
| 85 |
# tx has no descendants
|
|
|
|
| 117 |
from_node=node,
|
| 118 |
fee_rate=DEFAULT_FEE,
|
| 119 |
utxo_to_spend=utxo_v3_bip125,
|
| 120 |
+
sequence=MAX_BIP125_RBF_SEQUENCE,
|
| 121 |
version=3
|
| 122 |
)
|
| 123 |
self.check_mempool([tx_v3_bip125["txid"]])
|
|
|
|
| 160 |
utxo_to_spend=tx_v3_parent["new_utxo"],
|
| 161 |
version=2
|
| 162 |
)
|
| 163 |
+
expected_error_v2_v3 = f"truc-spent-by-nontruc, non-version=3 tx {tx_v3_child_rbf_v2['txid']} (wtxid={tx_v3_child_rbf_v2['wtxid']}) cannot spend from version=3 tx {tx_v3_parent['txid']} (wtxid={tx_v3_parent['wtxid']})"
|
| 164 |
assert_raises_rpc_error(-26, expected_error_v2_v3, node.sendrawtransaction, tx_v3_child_rbf_v2["hex"])
|
| 165 |
self.check_mempool([tx_v3_bip125_rbf_v2["txid"], tx_v3_parent["txid"], tx_v3_child["txid"]])
|
| 166 |
|
| 167 |
+
@cleanup(extra_args=["-datacarriersize=40000"])
|
|
|
|
| 168 |
def test_truc_reorg(self):
|
| 169 |
node = self.nodes[0]
|
| 170 |
self.log.info("Test that, during a reorg, TRUC rules are not enforced")
|
|
|
|
| 280 |
|
| 281 |
self.check_mempool([])
|
| 282 |
result = node.submitpackage([tx_v3_parent_normal["hex"], tx_v3_parent_2_normal["hex"], tx_v3_child_multiparent["hex"]])
|
| 283 |
+
assert_equal(result['package_msg'], f"truc-ancestors-toomany, tx {tx_v3_child_multiparent['txid']} (wtxid={tx_v3_child_multiparent['wtxid']}) would have too many ancestors")
|
| 284 |
self.check_mempool([])
|
| 285 |
|
| 286 |
self.check_mempool([])
|
| 287 |
result = node.submitpackage([tx_v3_parent_normal["hex"], tx_v3_child_heavy["hex"]])
|
| 288 |
# tx_v3_child_heavy is heavy based on vsize, not sigops.
|
| 289 |
+
assert_equal(result['package_msg'], f"truc-child-toobig, version=3 child tx {tx_v3_child_heavy['txid']} (wtxid={tx_v3_child_heavy['wtxid']}) is too big: {tx_v3_child_heavy['tx'].get_vsize()} > 1000 virtual bytes")
|
| 290 |
self.check_mempool([])
|
| 291 |
|
| 292 |
tx_v3_parent = self.wallet.create_self_transfer(version=3)
|
| 293 |
tx_v3_child = self.wallet.create_self_transfer(utxo_to_spend=tx_v3_parent["new_utxo"], version=3)
|
| 294 |
tx_v3_grandchild = self.wallet.create_self_transfer(utxo_to_spend=tx_v3_child["new_utxo"], version=3)
|
| 295 |
result = node.testmempoolaccept([tx_v3_parent["hex"], tx_v3_child["hex"], tx_v3_grandchild["hex"]])
|
| 296 |
+
assert all([txresult["package-error"] == f"truc-parent-and-child-both, tx {tx_v3_grandchild['txid']} (wtxid={tx_v3_grandchild['wtxid']}) would have too many ancestors" for txresult in result])
|
| 297 |
|
| 298 |
@cleanup(extra_args=None)
|
| 299 |
def test_truc_ancestors_package_and_mempool(self):
|
|
|
|
| 322 |
|
| 323 |
# submitpackage(B, C) should fail
|
| 324 |
result = node.submitpackage([tx_0fee_parent["hex"], tx_child_violator["hex"]])
|
| 325 |
+
assert_equal(result['package_msg'], f"truc-parent-and-child-both, tx {tx_child_violator['txid']} (wtxid={tx_child_violator['wtxid']}) would have too many ancestors")
|
| 326 |
self.check_mempool([tx_in_mempool["txid"]])
|
| 327 |
|
| 328 |
@cleanup(extra_args=None)
|
|
|
|
| 375 |
# Fails with another non-related transaction via testmempoolaccept
|
| 376 |
tx_unrelated = self.wallet.create_self_transfer(version=3)
|
| 377 |
result_test_unrelated = node.testmempoolaccept([tx_sibling_1["hex"], tx_unrelated["hex"]])
|
| 378 |
+
assert_equal(result_test_unrelated[0]["reject-reason"], "truc-descendants-toomany")
|
| 379 |
|
| 380 |
# Fails in a package via testmempoolaccept
|
| 381 |
result_test_1p1c = node.testmempoolaccept([tx_sibling_1["hex"], tx_has_mempool_uncle["hex"]])
|
| 382 |
+
assert_equal(result_test_1p1c[0]["reject-reason"], "truc-descendants-toomany")
|
| 383 |
|
| 384 |
# Allowed when tx is submitted in a package and evaluated individually.
|
| 385 |
# Note that the child failed since it would be the 3rd generation.
|
| 386 |
result_package_indiv = node.submitpackage([tx_sibling_1["hex"], tx_has_mempool_uncle["hex"]])
|
| 387 |
self.check_mempool([tx_mempool_parent["txid"], tx_sibling_1["txid"]])
|
| 388 |
+
expected_error_gen3 = f"truc-ancestors-toomany, tx {tx_has_mempool_uncle['txid']} (wtxid={tx_has_mempool_uncle['wtxid']}) would have too many ancestors"
|
| 389 |
|
| 390 |
assert_equal(result_package_indiv["tx-results"][tx_has_mempool_uncle['wtxid']]['error'], expected_error_gen3)
|
| 391 |
|
|
|
|
| 396 |
# Child cannot pay for sibling eviction for parent, as it violates TRUC topology limits
|
| 397 |
result_package_cpfp = node.submitpackage([tx_sibling_3["hex"], tx_bumps_parent_with_sibling["hex"]])
|
| 398 |
self.check_mempool([tx_mempool_parent["txid"], tx_sibling_2["txid"]])
|
| 399 |
+
expected_error_cpfp = f"truc-descendants-toomany, tx {tx_mempool_parent['txid']} (wtxid={tx_mempool_parent['wtxid']}) would exceed descendant count limit"
|
| 400 |
|
| 401 |
assert_equal(result_package_cpfp["tx-results"][tx_sibling_3['wtxid']]['error'], expected_error_cpfp)
|
| 402 |
|
|
|
|
| 417 |
)
|
| 418 |
self.check_mempool([])
|
| 419 |
result = node.submitpackage([tx_v3_parent["hex"], tx_v2_child["hex"]])
|
| 420 |
+
assert_equal(result['package_msg'], f"truc-spent-by-nontruc, non-version=3 tx {tx_v2_child['txid']} (wtxid={tx_v2_child['wtxid']}) cannot spend from version=3 tx {tx_v3_parent['txid']} (wtxid={tx_v3_parent['wtxid']})")
|
| 421 |
self.check_mempool([])
|
| 422 |
|
| 423 |
@cleanup(extra_args=None)
|
|
|
|
| 438 |
assert all([result["allowed"] for result in test_accept_v2_and_v3])
|
| 439 |
|
| 440 |
test_accept_v3_from_v2 = node.testmempoolaccept([tx_v2["hex"], tx_v3_from_v2["hex"]])
|
| 441 |
+
expected_error_v3_from_v2 = f"truc-spends-nontruc, version=3 tx {tx_v3_from_v2['txid']} (wtxid={tx_v3_from_v2['wtxid']}) cannot spend from non-version=3 tx {tx_v2['txid']} (wtxid={tx_v2['wtxid']})"
|
| 442 |
assert all([result["package-error"] == expected_error_v3_from_v2 for result in test_accept_v3_from_v2])
|
| 443 |
|
| 444 |
test_accept_v2_from_v3 = node.testmempoolaccept([tx_v3["hex"], tx_v2_from_v3["hex"]])
|
| 445 |
+
expected_error_v2_from_v3 = f"truc-spent-by-nontruc, non-version=3 tx {tx_v2_from_v3['txid']} (wtxid={tx_v2_from_v3['wtxid']}) cannot spend from version=3 tx {tx_v3['txid']} (wtxid={tx_v3['wtxid']})"
|
| 446 |
assert all([result["package-error"] == expected_error_v2_from_v3 for result in test_accept_v2_from_v3])
|
| 447 |
|
| 448 |
test_accept_pairs = node.testmempoolaccept([tx_v2["hex"], tx_v3["hex"], tx_v2_from_v2["hex"], tx_v3_from_v3["hex"]])
|
|
|
|
| 454 |
tx_v3_child_1 = self.wallet.create_self_transfer(utxo_to_spend=tx_v3_parent["new_utxos"][0], version=3)
|
| 455 |
tx_v3_child_2 = self.wallet.create_self_transfer(utxo_to_spend=tx_v3_parent["new_utxos"][1], version=3)
|
| 456 |
test_accept_2children = node.testmempoolaccept([tx_v3_parent["hex"], tx_v3_child_1["hex"], tx_v3_child_2["hex"]])
|
| 457 |
+
expected_error_2children = f"truc-sibling-known, tx {tx_v3_parent['txid']} (wtxid={tx_v3_parent['wtxid']}) would exceed descendant count limit"
|
| 458 |
assert all([result["package-error"] == expected_error_2children for result in test_accept_2children])
|
| 459 |
|
| 460 |
# Extra TRUC transaction does not get incorrectly marked as extra descendant
|
|
|
|
| 463 |
|
| 464 |
# Extra TRUC transaction does not make us ignore the extra descendant
|
| 465 |
test_accept_2children_with_exra = node.testmempoolaccept([tx_v3_parent["hex"], tx_v3_child_1["hex"], tx_v3_child_2["hex"], tx_v3_independent["hex"]])
|
| 466 |
+
expected_error_extra = f"truc-sibling-known, tx {tx_v3_parent['txid']} (wtxid={tx_v3_parent['wtxid']}) would exceed descendant count limit"
|
| 467 |
assert all([result["package-error"] == expected_error_extra for result in test_accept_2children_with_exra])
|
| 468 |
# Same result if the parent is already in mempool
|
| 469 |
node.sendrawtransaction(tx_v3_parent["hex"])
|
|
|
|
| 600 |
utxo_to_spend=tx_with_multi_children["new_utxos"][2],
|
| 601 |
fee_rate=DEFAULT_FEE*50
|
| 602 |
)
|
| 603 |
+
expected_error_2siblings = f"truc-descendants-toomany, tx {tx_with_multi_children['txid']} (wtxid={tx_with_multi_children['wtxid']}) would exceed descendant count limit"
|
| 604 |
assert_raises_rpc_error(-26, expected_error_2siblings, node.sendrawtransaction, tx_with_sibling3["hex"])
|
| 605 |
|
| 606 |
# However, an RBF (with conflicting inputs) is possible even if the resulting cluster size exceeds 2
|