mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-30 15:54:03 +02:00
Merge bitcoin/bitcoin#29939: test: add MiniWallet tagging support to avoid UTXO mixing, use in fill_mempool
dd8fa86193test: use tagged ephemeral MiniWallet instance in fill_mempool (Sebastian Falbesoner)b2037ad4aetest: add MiniWallet tagging support to avoid UTXO mixing (Sebastian Falbesoner)c8e6d08236test: refactor: eliminate COINBASE_MATURITY magic number in fill_mempool (Sebastian Falbesoner)4f347140b1test: refactor: move fill_mempool to new module mempool_util (Sebastian Falbesoner) Pull request description: Different MiniWallet instances using the same mode (either ADDRESS_OP_TRUE, RAW_OP_TRUE or RAW_P2PK) currently always create and spend UTXOs with identical output scripts, which can cause unintentional tx dependencies (see e.g. the discussion in https://github.com/bitcoin/bitcoin/pull/29827#discussion_r1565443465). In order to avoid mixing of UTXOs between instances, this PR introduces the possibility to provide a MiniWallet tag name, that is used to derive a different internal key for the taproot construction, leading to a different P2TR output script. Note that since we use script-path spending and only the key-path is changed here, no changes in the MiniWallet spending logic are needed. The new tagging option is then used in the `fill_mempool` helper to create an ephemeral wallet for the filling txs, as suggested in https://github.com/bitcoin/bitcoin/pull/29827#discussion_r1565964264. To avoid circular dependencies, `fill_mempool` is moved to a new module `mempool_util.py` first. I'm still not sure if a generic word like "tag" is the right term for what this tries to achieve, happy to pick up better suggestions. Also, maybe passing a tag name is overkill and a boolean flag like "random_output_script" is sufficient? ACKs for top commit: glozow: ACKdd8fa86193achow101: ACKdd8fa86193rkrux: tACK [dd8fa86](dd8fa86193) brunoerg: utACKdd8fa86193Tree-SHA512: 5ef3558c3ef5ac32cfa79c8f751972ca6bceaa332cd7daac7e93412a88e30dec472cb041c0845b04abf8a317036d31ebddfc3234e609ed442417894c2bdeeac9
This commit is contained in:
@@ -8,6 +8,9 @@ from decimal import Decimal
|
||||
import random
|
||||
|
||||
from test_framework.blocktools import COINBASE_MATURITY
|
||||
from test_framework.mempool_util import (
|
||||
fill_mempool,
|
||||
)
|
||||
from test_framework.messages import (
|
||||
MAX_BIP125_RBF_SEQUENCE,
|
||||
tx_from_hex,
|
||||
@@ -18,7 +21,6 @@ from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_fee_amount,
|
||||
assert_raises_rpc_error,
|
||||
fill_mempool,
|
||||
)
|
||||
from test_framework.wallet import (
|
||||
DEFAULT_FEE,
|
||||
@@ -398,7 +400,7 @@ class RPCPackagesTest(BitcoinTestFramework):
|
||||
])
|
||||
self.wallet.rescan_utxos()
|
||||
|
||||
fill_mempool(self, node, self.wallet)
|
||||
fill_mempool(self, node)
|
||||
|
||||
minrelay = node.getmempoolinfo()["minrelaytxfee"]
|
||||
parent = self.wallet.create_self_transfer(
|
||||
|
||||
Reference in New Issue
Block a user