Merge bitcoin/bitcoin#31953: rpc: Allow fullrbf fee bump in (psbt)bumpfee
fa86190e6erpc: Allow fullrbf fee bump (MarcoFalke) Pull request description: The RPCs (psbt)bumpfee, and the GUI, reject fee bumps when BIP 125 signalling is absent in the transaction even when the mempool and other RPCs allow them. Fix the confusion by allowing the fee bump. This is done after fullrbf is always on (https://github.com/bitcoin/bitcoin/pull/30592) ACKs for top commit: 1440000bytes: reACK https://github.com/bitcoin/bitcoin/commit/fa86190e6ed2aeda7bcceaf96f52403816bcd751 achow101: ACKfa86190e6ew0xlt: ACK https://github.com/bitcoin/bitcoin/pull/31953/commits/fa86190e6ed2aeda7bcceaf96f52403816bcd751 rkrux: reACKfa86190e6eglozow: ACKfa86190e6eTree-SHA512: b2ffe8dcadbe71e9be767a16cf8aa0bf383c2de7aa1aee9438d125f444e24f3f7e4f02ddb28981bd3b8b645b6a24a407b4ad6bb0b21946ae637e78f6386e05bf
This commit is contained in:
6 files changed
+35
-19
No files matched your search
@@ -42,6 +42,7 @@ COIN = 100000000 # 1 btc in satoshis
|
||||
MAX_MONEY = 21000000 * COIN
|
||||
|
||||
MAX_BIP125_RBF_SEQUENCE = 0xfffffffd # Sequence number that is rbf-opt-in (BIP 125) and csv-opt-out (BIP 68)
|
||||
MAX_SEQUENCE_NONFINAL = 0xfffffffe # Sequence number that is csv-opt-out (BIP 68)
|
||||
SEQUENCE_FINAL = 0xffffffff # Sequence number that disables nLockTime if set for every input of a tx
|
||||
|
||||
MAX_PROTOCOL_MESSAGE_LENGTH = 4000000 # Maximum length of incoming protocol messages
|
||||
|
||||
@@ -20,6 +20,7 @@ from test_framework.blocktools import (
|
||||
)
|
||||
from test_framework.messages import (
|
||||
MAX_BIP125_RBF_SEQUENCE,
|
||||
MAX_SEQUENCE_NONFINAL,
|
||||
)
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import (
|
||||
@@ -94,7 +95,7 @@ class BumpFeeTest(BitcoinTestFramework):
|
||||
test_simple_bumpfee_succeeds(self, mode, rbf_node, peer_node, dest_address)
|
||||
self.test_invalid_parameters(rbf_node, peer_node, dest_address)
|
||||
test_segwit_bumpfee_succeeds(self, rbf_node, dest_address)
|
||||
test_nonrbf_bumpfee_fails(self, peer_node, dest_address)
|
||||
test_nonrbf_bumpfee_succeeds(self, peer_node, dest_address)
|
||||
test_notmine_bumpfee(self, rbf_node, peer_node, dest_address)
|
||||
test_bumpfee_with_descendant_fails(self, rbf_node, rbf_node_address, dest_address)
|
||||
test_bumpfee_with_abandoned_descendant_succeeds(self, rbf_node, rbf_node_address, dest_address)
|
||||
@@ -372,10 +373,10 @@ def test_segwit_bumpfee_succeeds(self, rbf_node, dest_address):
|
||||
self.clear_mempool()
|
||||
|
||||
|
||||
def test_nonrbf_bumpfee_fails(self, peer_node, dest_address):
|
||||
self.log.info('Test that we cannot replace a non RBF transaction')
|
||||
def test_nonrbf_bumpfee_succeeds(self, peer_node, dest_address):
|
||||
self.log.info("Test that we can replace a non RBF transaction")
|
||||
not_rbfid = peer_node.sendtoaddress(dest_address, Decimal("0.00090000"))
|
||||
assert_raises_rpc_error(-4, "Transaction is not BIP 125 replaceable", peer_node.bumpfee, not_rbfid)
|
||||
peer_node.bumpfee(not_rbfid)
|
||||
self.clear_mempool()
|
||||
|
||||
|
||||
@@ -678,11 +679,20 @@ def test_rebumping(self, rbf_node, dest_address):
|
||||
|
||||
|
||||
def test_rebumping_not_replaceable(self, rbf_node, dest_address):
|
||||
self.log.info('Test that re-bumping non-replaceable fails')
|
||||
self.log.info("Test that re-bumping non-replaceable passes")
|
||||
rbfid = spend_one_input(rbf_node, dest_address)
|
||||
|
||||
def check_sequence(tx, seq_in):
|
||||
tx = rbf_node.getrawtransaction(tx["txid"])
|
||||
tx = rbf_node.decoderawtransaction(tx)
|
||||
seq = [i["sequence"] for i in tx["vin"]]
|
||||
assert_equal(seq, [seq_in])
|
||||
|
||||
bumped = rbf_node.bumpfee(rbfid, fee_rate=ECONOMICAL, replaceable=False)
|
||||
assert_raises_rpc_error(-4, "Transaction is not BIP 125 replaceable", rbf_node.bumpfee, bumped["txid"],
|
||||
{"fee_rate": NORMAL})
|
||||
check_sequence(bumped, MAX_SEQUENCE_NONFINAL)
|
||||
bumped = rbf_node.bumpfee(bumped["txid"], {"fee_rate": NORMAL})
|
||||
check_sequence(bumped, MAX_BIP125_RBF_SEQUENCE)
|
||||
|
||||
self.clear_mempool()
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user