Skip to content

Commit fafe896

Browse files
author
MarcoFalke
committed
test: Set regtest.BIP66Height = 102 to speed up tests
1 parent c4b42aa commit fafe896

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

doc/release-notes.md

+3
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ RPC
108108
Tests
109109
-----
110110

111+
- For the `regtest` network the BIP 66 (DERSIG) activation height was changed
112+
from 1251 to 102. (#22632)
113+
111114
Credits
112115
=======
113116

src/chainparams.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ class CRegTestParams : public CChainParams {
393393
consensus.BIP34Height = 2; // BIP34 activated on regtest (Block at height 1 not enforced for testing purposes)
394394
consensus.BIP34Hash = uint256();
395395
consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in functional tests)
396-
consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in functional tests)
396+
consensus.BIP66Height = 102; // BIP66 activated on regtest (Block at height 101 and earlier not enforced for testing purposes)
397397
consensus.CSVHeight = 432; // CSV activated on regtest (Used in rpc activation tests)
398398
consensus.SegwitHeight = 0; // SEGWIT is always activated on regtest unless overridden
399399
consensus.MinBIP9WarningHeight = 0;

test/functional/feature_dersig.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""Test BIP66 (DER SIG).
66
7-
Test that the DERSIG soft-fork activates at (regtest) height 1251.
7+
Test the DERSIG soft-fork activation on regtest.
88
"""
99

1010
from test_framework.blocktools import (
11+
DERSIG_HEIGHT,
1112
create_block,
1213
create_coinbase,
1314
)
@@ -23,8 +24,6 @@
2324
MiniWalletMode,
2425
)
2526

26-
DERSIG_HEIGHT = 1251
27-
2827

2928
# A canonical signature consists of:
3029
# <30> <total len> <02> <len R> <R> <02> <len S> <S> <hashtype>
@@ -90,8 +89,10 @@ def run_test(self):
9089
block.rehash()
9190
block.solve()
9291

92+
assert_equal(self.nodes[0].getblockcount(), DERSIG_HEIGHT - 2)
9393
self.test_dersig_info(is_active=False) # Not active as of current tip and next block does not need to obey rules
9494
peer.send_and_ping(msg_block(block))
95+
assert_equal(self.nodes[0].getblockcount(), DERSIG_HEIGHT - 1)
9596
self.test_dersig_info(is_active=True) # Not active as of current tip, but next block must obey rules
9697
assert_equal(self.nodes[0].getbestblockhash(), block.hash)
9798

test/functional/rpc_blockchain.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
from test_framework.address import ADDRESS_BCRT1_P2WSH_OP_TRUE
2929
from test_framework.blocktools import (
30+
DERSIG_HEIGHT,
3031
create_block,
3132
create_coinbase,
3233
TIME_GENESIS_BLOCK,
@@ -141,7 +142,7 @@ def _test_getblockchaininfo(self):
141142

142143
assert_equal(res['softforks'], {
143144
'bip34': {'type': 'buried', 'active': True, 'height': 2},
144-
'bip66': {'type': 'buried', 'active': False, 'height': 1251},
145+
'bip66': {'type': 'buried', 'active': True, 'height': DERSIG_HEIGHT},
145146
'bip65': {'type': 'buried', 'active': False, 'height': 1351},
146147
'csv': {'type': 'buried', 'active': False, 'height': 432},
147148
'segwit': {'type': 'buried', 'active': True, 'height': 0},

test/functional/test_framework/blocktools.py

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
COINBASE_MATURITY = 100
5656

5757
# Soft-fork activation heights
58+
DERSIG_HEIGHT = 102 # BIP 66
5859
CLTV_HEIGHT = 1351
5960
CSV_ACTIVATION_HEIGHT = 432
6061

0 commit comments

Comments
 (0)