Skip to content

Commit 1927432

Browse files
committed
Merge bitcoin/bitcoin#32859: functional test: correctly detect nonstd TRUC tx vsize in feature_taproot
f0524cd functional test: correctly detect nonstd TRUC tx vsize in feature_taproot (Greg Sanders) Pull request description: Resolves bitcoin/bitcoin#32841 (comment) ACKs for top commit: davidgumberg: utACK bitcoin/bitcoin@f0524cd achow101: ACK f0524cd darosior: utACK f0524cd w0xlt: ACK bitcoin/bitcoin@f0524cd Tree-SHA512: b803c94f7a683b51bab88ae788384ff484a3e6597153bf022263bbc9531dd3faebb7832db26f2b8b4c0d0337c59991d0beca167def5aebe3e9a5d8a9bfdaaba5
2 parents 68ca13e + f0524cd commit 1927432

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/functional/feature_taproot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@ def byte_popper(expr):
644644

645645
TX_MAX_STANDARD_VERSION = 3
646646
TX_STANDARD_VERSIONS = [1, 2, TX_MAX_STANDARD_VERSION]
647+
TRUC_MAX_VSIZE = 10000 # test doesn't cover in-mempool spends, so only this limit is hit
647648

648649
# === Actual test cases ===
649650

@@ -1538,7 +1539,9 @@ def test_spenders(self, node, spenders, input_counts):
15381539
is_standard_tx = (
15391540
fail_input is None # Must be valid to be standard
15401541
and (all(utxo.spender.is_standard for utxo in input_utxos)) # All inputs must be standard
1541-
and tx.version in TX_STANDARD_VERSIONS) # The tx version must be standard
1542+
and tx.version in TX_STANDARD_VERSIONS # The tx version must be standard
1543+
and not (tx.version == 3 and tx.get_vsize() > TRUC_MAX_VSIZE) # Topological standardness rules must be followed
1544+
)
15421545
msg = ','.join(utxo.spender.comment + ("*" if n == fail_input else "") for n, utxo in enumerate(input_utxos))
15431546
if is_standard_tx:
15441547
node.sendrawtransaction(tx.serialize().hex(), 0)

0 commit comments

Comments
 (0)