diff --git a/doc/release-notes-6189.md b/doc/release-notes-6189.md new file mode 100644 index 0000000000..be8815c960 --- /dev/null +++ b/doc/release-notes-6189.md @@ -0,0 +1,5 @@ +Tests +----- + +- For the `regtest` network the BIP 66 (DERSIG) activation height was changed + from 1251 to 102. (dash#6189) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index d946b2d84b..90e652a839 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -797,7 +797,7 @@ public: consensus.BIP34Height = 500; // BIP34 activated on regtest (Used in functional tests) 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.BIP147Height = 432; // BIP147 activated on regtest (Used in functional tests) consensus.CSVHeight = 432; // CSV activated on regtest (Used in rpc activation tests) consensus.DIP0001Height = 2000; diff --git a/test/functional/feature_dersig.py b/test/functional/feature_dersig.py index 6e3a49df3e..597bce5a7e 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, ) @@ -24,8 +25,6 @@ from test_framework.wallet import ( MiniWalletMode, ) -DERSIG_HEIGHT = 1251 - # A canonical signature consists of: # <30> <02> <02> @@ -88,8 +87,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 9c4eab3a37..1e6b23d354 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -27,6 +27,7 @@ import subprocess from test_framework.address import ADDRESS_BCRT1_P2SH_OP_TRUE from test_framework.blocktools import ( + DERSIG_HEIGHT, create_block, create_coinbase, TIME_GENESIS_BLOCK, @@ -143,7 +144,7 @@ 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}, + 'bip66': {'type': 'buried', 'active': True, 'height': DERSIG_HEIGHT}, 'bip65': {'type': 'buried', 'active': False, 'height': 1351}, 'bip147': { 'type': 'buried', 'active': False, 'height': 432}, 'csv': {'type': 'buried', 'active': False, 'height': 432}, diff --git a/test/functional/test_framework/blocktools.py b/test/functional/test_framework/blocktools.py index 423ffbeb49..ae909a9ee0 100644 --- a/test/functional/test_framework/blocktools.py +++ b/test/functional/test_framework/blocktools.py @@ -36,6 +36,7 @@ TIME_GENESIS_BLOCK = 1417713337 COINBASE_MATURITY = 100 # Soft-fork activation heights +DERSIG_HEIGHT = 102 # BIP 66 CLTV_HEIGHT = 1351 CSV_ACTIVATION_HEIGHT = 432