v30.3-roots.1 · Commit 7: [PATCH 07/68] build: adapt Roots maintenance and assurance to Core 30.3
test/functional/feature_taproot.py
Before: test/functional/feature_taproot.py · After: test/functional/feature_taproot.py
File metadata
index 348b2b67e84ada2d5f60887f6b051ab45f31f1c4..fd704cdb19652ccdc886cf1f6218a2c916859f9e 100755
Download original patch · Release notes
Diff rows 1–32 of 32. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.
test/functional/feature_taproot.py
CHANGED
|
@@ -118,6 +118,9 @@ import hashlib
|
|
|
118
118
|
import os
|
|
119
119
|
import random
|
|
120
120
|
|
|
121
|
+
# Keep in sync with DEFAULT_SCRIPT_SIZE_POLICY_LIMIT in src/policy/policy.h.
|
|
122
|
+
ROOTS_DEFAULT_MAX_SCRIPT_SIZE = 1650
|
|
123
|
+
|
|
121
124
|
# Whether or not to output generated test vectors, in JSON format.
|
|
122
125
|
GEN_TEST_VECTORS = False
|
|
123
126
|
|
|
@@ -1073,7 +1076,7 @@ def spenders_taproot_active():
|
|
|
1073
1076
|
# Test that an input stack size of 1000 elements is permitted, but 1001 isn't.
|
|
1074
1077
|
add_spender(spenders, "tapscript/1000inputs", leaf="t23", **common, inputs=[getter("sign")] + [b'' for _ in range(999)], failure={"leaf": "t24", "inputs": [getter("sign")] + [b'' for _ in range(1000)]}, **ERR_STACK_SIZE)
|
|
1075
1078
|
# Test that pushing a MAX_SCRIPT_ELEMENT_SIZE byte stack element is valid, but one longer is not.
|
|
1076
|
-
add_spender(spenders, "tapscript/pushmaxlimit", leaf="t25", **common, **SINGLE_SIG, failure={"leaf": "t26"}, **ERR_PUSH_SIZE)
|
|
1079
|
+
add_spender(spenders, "tapscript/pushmaxlimit", standard=False, leaf="t25", **common, **SINGLE_SIG, failure={"leaf": "t26"}, **ERR_PUSH_SIZE)
|
|
1077
1080
|
# Test that 999-of-999 multisig works (but 1000-of-1000 triggers stack size limits)
|
|
1078
1081
|
add_spender(spenders, "tapscript/bigmulti", leaf="t33", **common, inputs=big_spend_inputs, num=999, failure={"leaf": "t34", "num": 1000}, **ERR_STACK_SIZE)
|
|
1079
1082
|
# Test that the CLEANSTACK rule is consensus critical in tapscript
|
|
@@ -1412,6 +1415,7 @@ class TaprootTest(BitcoinTestFramework):
|
|
|
1412
1415
|
def set_test_params(self):
|
|
1413
1416
|
self.num_nodes = 1
|
|
1414
1417
|
self.setup_clean_chain = True
|
|
1418
|
+
self.extra_args = [["-acceptnonstddatacarrier=1"]]
|
|
1415
1419
|
|
|
1416
1420
|
def block_submit(self, node, txs, msg, err_msg, cb_pubkey=None, fees=0, sigops_weight=0, witness=False, accept=False):
|
|
1417
1421
|
|
|
@@ -1629,6 +1633,8 @@ class TaprootTest(BitcoinTestFramework):
|
|
|
1629
1633
|
and (all(utxo.spender.is_standard for utxo in input_utxos)) # All inputs must be standard
|
|
1630
1634
|
and tx.version in TX_STANDARD_VERSIONS # The tx version must be standard
|
|
1631
1635
|
and not (tx.version == 3 and tx.get_vsize() > TRUC_MAX_VSIZE) # Topological standardness rules must be followed
|
|
1636
|
+
# Roots applies -maxscriptsize to each serialized witness stack.
|
|
1637
|
+
and all(len(txin_witness.serialize()) <= ROOTS_DEFAULT_MAX_SCRIPT_SIZE for txin_witness in tx.wit.vtxinwit)
|
|
1632
1638
|
)
|
|
1633
1639
|
msg = ','.join(utxo.spender.comment + ("*" if n == fail_input else "") for n, utxo in enumerate(input_utxos))
|
|
1634
1640
|
if is_standard_tx:
|