From 590456e3f1043ba0680e0afec9fd7653db1098bb Mon Sep 17 00:00:00 2001
From: Peter Todd <pete@petertodd.org>
Date: Fri, 4 Aug 2023 13:56:04 +0000
Subject: policy: enable full-rbf by default

Enable full rbf (mempool policy) by default and update tests accordingly.
---
 test/functional/feature_rbf.py     | 5 ++++-
 test/functional/mempool_accept.py  | 1 +
 test/functional/mempool_truc.py    | 2 +-
 test/functional/p2p_permissions.py | 5 ++++-
 4 files changed, 10 insertions(+), 3 deletions(-)

(limited to 'test')

diff --git a/test/functional/feature_rbf.py b/test/functional/feature_rbf.py
index 739b9b9bb9..3b7f6ead72 100755
--- a/test/functional/feature_rbf.py
+++ b/test/functional/feature_rbf.py
@@ -26,15 +26,18 @@ class ReplaceByFeeTest(BitcoinTestFramework):
 
     def set_test_params(self):
         self.num_nodes = 2
+        # both nodes disable full-rbf to test BIP125 signaling
         self.extra_args = [
             [
+                "-mempoolfullrbf=0",
                 "-limitancestorcount=50",
                 "-limitancestorsize=101",
                 "-limitdescendantcount=200",
                 "-limitdescendantsize=101",
             ],
-            # second node has default mempool parameters
+            # second node has default mempool parameters, besides mempoolfullrbf being disabled
             [
+                "-mempoolfullrbf=0",
             ],
         ]
         self.supports_cli = False
diff --git a/test/functional/mempool_accept.py b/test/functional/mempool_accept.py
index e1cee46839..6a4268354a 100755
--- a/test/functional/mempool_accept.py
+++ b/test/functional/mempool_accept.py
@@ -54,6 +54,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
         self.num_nodes = 1
         self.extra_args = [[
             '-txindex','-permitbaremultisig=0',
+            '-mempoolfullrbf=0',
         ]] * self.num_nodes
         self.supports_cli = False
 
diff --git a/test/functional/mempool_truc.py b/test/functional/mempool_truc.py
index e1f3d77201..fa6fc89e70 100755
--- a/test/functional/mempool_truc.py
+++ b/test/functional/mempool_truc.py
@@ -162,7 +162,7 @@ class MempoolTRUC(BitcoinTestFramework):
         self.check_mempool([tx_v3_bip125_rbf_v2["txid"], tx_v3_parent["txid"], tx_v3_child["txid"]])
 
 
-    @cleanup(extra_args=None)
+    @cleanup(extra_args=["-mempoolfullrbf=0"])
     def test_truc_bip125(self):
         node = self.nodes[0]
         self.log.info("Test TRUC transactions that don't signal BIP125 are replaceable")
diff --git a/test/functional/p2p_permissions.py b/test/functional/p2p_permissions.py
index 80a27943fd..89189517f0 100755
--- a/test/functional/p2p_permissions.py
+++ b/test/functional/p2p_permissions.py
@@ -119,6 +119,9 @@ class P2PPermissionsTests(BitcoinTestFramework):
 
         self.log.debug("Check that node[1] will not send an invalid tx to node[0]")
         tx.vout[0].nValue += 1
+        # add dust to cause policy rejection but no disconnection
+        tx.vout.append(tx.vout[0])
+        tx.vout[-1].nValue = 0
         txid = tx.rehash()
         # Send the transaction twice. The first time, it'll be rejected by ATMP because it conflicts
         # with a mempool transaction. The second time, it'll be in the m_recent_rejects filter.
@@ -126,7 +129,7 @@ class P2PPermissionsTests(BitcoinTestFramework):
             [tx],
             self.nodes[1],
             success=False,
-            reject_reason='{} (wtxid={}) from peer=0 was not accepted: txn-mempool-conflict'.format(txid, tx.getwtxid())
+            reject_reason='{} (wtxid={}) from peer=0 was not accepted: dust'.format(txid, tx.getwtxid())
         )
 
         p2p_rebroadcast_wallet.send_txs_and_test(
-- 
cgit v1.2.3