diff --git a/doc/release-notes.md b/doc/release-notes.md index 61c65d5a3e..01ef3610c9 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -108,6 +108,9 @@ RPC Tests ----- +- For the `regtest` network the BIP 66 (DERSIG) activation height was changed + from 1251 to 102. (#22632) + Credits ======= diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 15b563a76f..0bf2956584 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -569,7 +569,7 @@ public: consensus.BIP34Height = 2; // BIP34 activated on regtest (Block at height 1 not enforced for testing purposes) consensus.BIP34Hash = uint256(); consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in functional tests) - consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in functional tests) + consensus.BIP66Height = 102; // BIP66 activated on regtest (Block at height 101 and earlier not enforced for testing purposes) consensus.CSVHeight = 432; // CSV activated on regtest (Used in rpc activation tests) consensus.SegwitHeight = 0; // SEGWIT is always activated on regtest unless overridden consensus.MinBIP9WarningHeight = 0; diff --git a/test/bitcoin_functional/functional/test_framework/util.py b/test/bitcoin_functional/functional/test_framework/util.py index cb83ec20de..4f4b325f75 100644 --- a/test/bitcoin_functional/functional/test_framework/util.py +++ b/test/bitcoin_functional/functional/test_framework/util.py @@ -315,7 +315,7 @@ def initialize_datadir(dirname, n): f.write("walletrbf=0\n") # Default is 1 in Elements f.write("con_bip34height=100000000\n") f.write("con_bip65height=1351\n") - f.write("con_bip66height=1251\n") + f.write("con_bip66height=102\n") f.write("con_genesis_style=bitcoin\n") f.write("con_csv_deploy_start=0\n") # Default is -1 (always active) f.write("blindedaddresses=0\n") diff --git a/test/functional/feature_dersig.py b/test/functional/feature_dersig.py index eb027c554a..5dd6cb6cb2 100755 --- a/test/functional/feature_dersig.py +++ b/test/functional/feature_dersig.py @@ -4,10 +4,11 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test BIP66 (DER SIG). -Test that the DERSIG soft-fork activates at (regtest) height 1251. +Test the DERSIG soft-fork activation on regtest. """ from test_framework.blocktools import ( + DERSIG_HEIGHT, create_block, create_coinbase, ) @@ -23,8 +24,6 @@ from test_framework.wallet import ( MiniWalletMode, ) -DERSIG_HEIGHT = 1251 - # A canonical signature consists of: # <30> <02> <02> @@ -90,8 +89,10 @@ class BIP66Test(BitcoinTestFramework): block.rehash() block.solve() + assert_equal(self.nodes[0].getblockcount(), DERSIG_HEIGHT - 2) self.test_dersig_info(is_active=False) # Not active as of current tip and next block does not need to obey rules peer.send_and_ping(msg_block(block)) + assert_equal(self.nodes[0].getblockcount(), DERSIG_HEIGHT - 1) self.test_dersig_info(is_active=True) # Not active as of current tip, but next block must obey rules assert_equal(self.nodes[0].getbestblockhash(), block.hash) diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index 727bed4881..93c4d7e20d 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -28,6 +28,7 @@ import subprocess from test_framework.address import ADDRESS_BCRT1_P2WSH_OP_TRUE from test_framework.blocktools import ( + DERSIG_HEIGHT, create_block, create_coinbase, TIME_GENESIS_BLOCK, @@ -140,8 +141,8 @@ class BlockchainTest(BitcoinTestFramework): assert_greater_than(res['size_on_disk'], 0) assert_equal(res['softforks'], { - 'bip34': {'type': 'buried', 'active': False, 'height': 500}, - 'bip66': {'type': 'buried', 'active': False, 'height': 1251}, + 'bip34': {'type': 'buried', 'active': True, 'height': 2}, + 'bip66': {'type': 'buried', 'active': True, 'height': DERSIG_HEIGHT}, 'bip65': {'type': 'buried', 'active': False, 'height': 1351}, 'csv': {'type': 'buried', 'active': False, 'height': 432}, 'segwit': {'type': 'buried', 'active': True, 'height': 0}, diff --git a/test/functional/test_framework/blocktools.py b/test/functional/test_framework/blocktools.py index f02b65a126..90795e2df6 100644 --- a/test/functional/test_framework/blocktools.py +++ b/test/functional/test_framework/blocktools.py @@ -56,6 +56,7 @@ TIME_GENESIS_BLOCK = 1296688602 COINBASE_MATURITY = 100 # Soft-fork activation heights +DERSIG_HEIGHT = 102 # BIP 66 CLTV_HEIGHT = 1351 CSV_ACTIVATION_HEIGHT = 432 diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 0dba605fc0..1fe52d4324 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -391,9 +391,9 @@ def write_config(config_path, *, n, chain, extra_config="", disable_autoconnect= f.write("con_connect_genesis_outputs=0\n") f.write("anyonecanspendaremine=0\n") f.write("walletrbf=0\n") # Default is 1 in Elements - f.write("con_bip34height=500\n") + f.write("con_bip34height=2\n") f.write("con_bip65height=1351\n") - f.write("con_bip66height=1251\n") + f.write("con_bip66height=102\n") f.write("blindedaddresses=0\n") # Set to minimize broken tests in favor of custom f.write("evbparams=dynafed:"+str(2**31)+":::\n") # Never starts unless overridden f.write("minrelaytxfee=0.00001\n")