From e86e3a33a843ebb2110ec3e45584f2fbb0940c57 Mon Sep 17 00:00:00 2001 From: Jianping Wu Date: Fri, 8 Feb 2019 19:03:33 -0800 Subject: [PATCH] Increased MAX_PROTOCOL_MESSAGE_LENGTH to 6MB. Increase nPowTargetTimespan to 20 from 10, for RegTest. --- src/chainparams.cpp | 4 ++-- src/net.h | 4 ++-- test/functional/feature_csv_activation.py | 12 ++++++------ test/functional/p2p_segwit.py | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 8c0bb84dc..9ea1ac4f7 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -260,8 +260,8 @@ public: consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in rpc activation tests) consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in rpc activation tests) consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - consensus.nPowTargetTimespan = 10; // 10 second - consensus.nPowTargetSpacing = 10; // 10 second + consensus.nPowTargetTimespan = 20; // 20 second + consensus.nPowTargetSpacing = 20; // 20 second consensus.fPowAllowMinDifficultyBlocks = true; consensus.fPowNoRetargeting = true; consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains diff --git a/src/net.h b/src/net.h index 0542ec1aa..7999fbd7f 100644 --- a/src/net.h +++ b/src/net.h @@ -51,8 +51,8 @@ static const int FEELER_INTERVAL = 120; static const unsigned int MAX_INV_SZ = 50000; /** The maximum number of new addresses to accumulate before announcing. */ static const unsigned int MAX_ADDR_TO_SEND = 1000; -/** Maximum length of incoming protocol messages (no message over 4 MB is currently acceptable). */ -static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 4 * 1000 * 1000; +/** Maximum length of incoming protocol messages (no message over 6 MB is currently acceptable). */ +static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 6 * 1000 * 1000; /** Maximum length of strSubVer in `version` message */ static const unsigned int MAX_SUBVERSION_LENGTH = 256; /** Maximum number of automatic outgoing nodes */ diff --git a/test/functional/feature_csv_activation.py b/test/functional/feature_csv_activation.py index 106f68347..b8d34dd0e 100755 --- a/test/functional/feature_csv_activation.py +++ b/test/functional/feature_csv_activation.py @@ -105,7 +105,7 @@ class BIP68_112_113Test(ComparisonTestFramework): test.run() def send_generic_input_tx(self, node, coinbases): - amount = Decimal("49.99") + amount = Decimal("499.99") return node.sendrawtransaction(ToHex(self.sign_transaction(node, self.create_transaction(node, node.getblock(coinbases.pop())['tx'][0], self.nodeaddress, amount)))) def create_transaction(self, node, txid, to_address, amount): @@ -154,7 +154,7 @@ class BIP68_112_113Test(ComparisonTestFramework): for b22 in range(2): b18txs = [] for b18 in range(2): - tx = self.create_transaction(self.nodes[0], bip68inputs[i], self.nodeaddress, Decimal("49.98")) + tx = self.create_transaction(self.nodes[0], bip68inputs[i], self.nodeaddress, Decimal("499.98")) i += 1 tx.nVersion = txversion tx.vin[0].nSequence = relative_locktimes[b31][b25][b22][b18] + locktime_delta @@ -165,7 +165,7 @@ class BIP68_112_113Test(ComparisonTestFramework): return txs def create_bip112special(self, input, txversion): - tx = self.create_transaction(self.nodes[0], input, self.nodeaddress, Decimal("49.98")) + tx = self.create_transaction(self.nodes[0], input, self.nodeaddress, Decimal("499.98")) tx.nVersion = txversion signtx = self.sign_transaction(self.nodes[0], tx) signtx.vin[0].scriptSig = CScript([-1, OP_CHECKSEQUENCEVERIFY, OP_DROP] + list(CScript(signtx.vin[0].scriptSig))) @@ -182,7 +182,7 @@ class BIP68_112_113Test(ComparisonTestFramework): for b22 in range(2): b18txs = [] for b18 in range(2): - tx = self.create_transaction(self.nodes[0], bip112inputs[i], self.nodeaddress, Decimal("49.98")) + tx = self.create_transaction(self.nodes[0], bip112inputs[i], self.nodeaddress, Decimal("499.98")) i += 1 if (varyOP_CSV): # if varying OP_CSV, nSequence is fixed tx.vin[0].nSequence = base_relative_locktime + locktime_delta @@ -282,10 +282,10 @@ class BIP68_112_113Test(ComparisonTestFramework): # Test both version 1 and version 2 transactions for all tests # BIP113 test transaction will be modified before each use to put in appropriate block time - bip113tx_v1 = self.create_transaction(self.nodes[0], bip113input, self.nodeaddress, Decimal("49.98")) + bip113tx_v1 = self.create_transaction(self.nodes[0], bip113input, self.nodeaddress, Decimal("499.98")) bip113tx_v1.vin[0].nSequence = 0xFFFFFFFE bip113tx_v1.nVersion = 1 - bip113tx_v2 = self.create_transaction(self.nodes[0], bip113input, self.nodeaddress, Decimal("49.98")) + bip113tx_v2 = self.create_transaction(self.nodes[0], bip113input, self.nodeaddress, Decimal("499.98")) bip113tx_v2.vin[0].nSequence = 0xFFFFFFFE bip113tx_v2.nVersion = 2 diff --git a/test/functional/p2p_segwit.py b/test/functional/p2p_segwit.py index 4a570a78d..e459e699d 100755 --- a/test/functional/p2p_segwit.py +++ b/test/functional/p2p_segwit.py @@ -1936,7 +1936,7 @@ class SegWitTest(BitcoinTestFramework): self.test_p2sh_witness(segwit_activated=True) self.test_witness_commitments() self.test_block_malleability() - #self.test_witness_block_size() + self.test_witness_block_size() self.test_submit_block() self.test_extra_witness_data() self.test_max_witness_push_length()