aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormerge-script <fanquake@gmail.com>2024-07-12 17:15:27 +0100
committermerge-script <fanquake@gmail.com>2024-07-12 17:15:27 +0100
commitc4d45b695ef27e21d35e886b08887e2ecf272ce7 (patch)
treebe7be4f88c3ee5752ed7ad080ac9689cbe540209 /test
parent4d6af61d879914a660e73db5c2f2e6c4d0aa8243 (diff)
parent3f00aae14092ca076cff7f9ddf6155c601979fcd (diff)
Merge bitcoin/bitcoin#30295: #28984 package rbf followups
3f00aae14092ca076cff7f9ddf6155c601979fcd package rbf: cpfp structure requires package > parent feerate (Greg Sanders) ad7f1f697f01845470f8df0944a94012fabcba09 test package rbf boundary conditions more closely (Greg Sanders) ff4558d441f377a372647972d35b5476b94579c9 doc: reword package RBF documentation (Greg Sanders) de669a883bf65c576cc596b20a576d7bb1618182 doc: replace mention of V3 with TRUC (Greg Sanders) Pull request description: Some suggested nits/changes from #28984 ACKs for top commit: glozow: ACK 3f00aae1409 murchandamus: ACK 3f00aae14092ca076cff7f9ddf6155c601979fcd Tree-SHA512: 79434cc8aba25a43e99793298cdc99cad807db2c3a2e780a31953f244b95eecd97b90559abd67fbf30996c00966675fa257253a7812ec4727420226162c629ae
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/mempool_package_rbf.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/test/functional/mempool_package_rbf.py b/test/functional/mempool_package_rbf.py
index ceb9530394..e9658aa8d0 100755
--- a/test/functional/mempool_package_rbf.py
+++ b/test/functional/mempool_package_rbf.py
@@ -168,11 +168,20 @@ class PackageRBFTest(BitcoinTestFramework):
self.assert_mempool_contents(expected=package_txns1)
self.log.info("Check replacement pays for incremental bandwidth")
- package_hex3, package_txns3 = self.create_simple_package(coin, parent_fee=DEFAULT_FEE, child_fee=DEFAULT_CHILD_FEE)
- pkg_results3 = node.submitpackage(package_hex3)
- assert_equal(f"package RBF failed: insufficient anti-DoS fees, rejecting replacement {package_txns3[1].rehash()}, not enough additional fees to relay; 0.00 < 0.00000{sum([tx.get_vsize() for tx in package_txns3])}", pkg_results3["package_msg"])
-
+ _, placeholder_txns3 = self.create_simple_package(coin)
+ package_3_size = sum([tx.get_vsize() for tx in placeholder_txns3])
+ incremental_sats_required = Decimal(package_3_size) / COIN
+ incremental_sats_short = incremental_sats_required - Decimal("0.00000001")
+ # Recreate the package with slightly higher fee once we know the size of the new package, but still short of required fee
+ failure_package_hex3, failure_package_txns3 = self.create_simple_package(coin, parent_fee=DEFAULT_FEE, child_fee=DEFAULT_CHILD_FEE + incremental_sats_short)
+ assert_equal(package_3_size, sum([tx.get_vsize() for tx in failure_package_txns3]))
+ pkg_results3 = node.submitpackage(failure_package_hex3)
+ assert_equal(f"package RBF failed: insufficient anti-DoS fees, rejecting replacement {failure_package_txns3[1].rehash()}, not enough additional fees to relay; {incremental_sats_short} < {incremental_sats_required}", pkg_results3["package_msg"])
self.assert_mempool_contents(expected=package_txns1)
+
+ success_package_hex3, success_package_txns3 = self.create_simple_package(coin, parent_fee=DEFAULT_FEE, child_fee=DEFAULT_CHILD_FEE + incremental_sats_required)
+ node.submitpackage(success_package_hex3)
+ self.assert_mempool_contents(expected=success_package_txns3)
self.generate(node, 1)
self.log.info("Check Package RBF must have strict cpfp structure")
@@ -180,11 +189,14 @@ class PackageRBFTest(BitcoinTestFramework):
package_hex4, package_txns4 = self.create_simple_package(coin, parent_fee=DEFAULT_FEE, child_fee=DEFAULT_CHILD_FEE)
node.submitpackage(package_hex4)
self.assert_mempool_contents(expected=package_txns4)
- package_hex5, package_txns5 = self.create_simple_package(coin, parent_fee=DEFAULT_CHILD_FEE, child_fee=DEFAULT_CHILD_FEE - Decimal("0.00000001"))
+ package_hex5, package_txns5 = self.create_simple_package(coin, parent_fee=DEFAULT_CHILD_FEE, child_fee=DEFAULT_CHILD_FEE)
pkg_results5 = node.submitpackage(package_hex5)
- assert 'package RBF failed: package feerate is less than parent feerate' in pkg_results5["package_msg"]
-
+ assert 'package RBF failed: package feerate is less than or equal to parent feerate' in pkg_results5["package_msg"]
self.assert_mempool_contents(expected=package_txns4)
+
+ package_hex5_1, package_txns5_1 = self.create_simple_package(coin, parent_fee=DEFAULT_CHILD_FEE, child_fee=DEFAULT_CHILD_FEE + Decimal("0.00000001"))
+ node.submitpackage(package_hex5_1)
+ self.assert_mempool_contents(expected=package_txns5_1)
self.generate(node, 1)
def test_package_rbf_max_conflicts(self):