From cfdf0403328e05b12a8a737134bfa6886181e49c Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Thu, 18 Jul 2019 12:13:27 +0200 Subject: [PATCH 1/9] test: Fix AuthServiceProxy closed conn detection --- qa/rpc-tests/test_framework/authproxy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qa/rpc-tests/test_framework/authproxy.py b/qa/rpc-tests/test_framework/authproxy.py index 28b33e286..c3b3e7eb3 100644 --- a/qa/rpc-tests/test_framework/authproxy.py +++ b/qa/rpc-tests/test_framework/authproxy.py @@ -120,10 +120,12 @@ class AuthServiceProxy(object): return self._get_response() except Exception as e: # If connection was closed, try again. + # Python 2.7 error message was changed in https://github.com/python/cpython/pull/2825 # Python 3.5+ raises BrokenPipeError instead of BadStatusLine when the connection was reset. # ConnectionResetError happens on FreeBSD with Python 3.4. # These classes don't exist in Python 2.x, so we can't refer to them directly. - if ((isinstance(e, httplib.BadStatusLine) and e.line == "''") + if ((isinstance(e, httplib.BadStatusLine) + and e.line in ("''", "No status line received - the server has closed the connection")) or e.__class__.__name__ in ('BrokenPipeError', 'ConnectionResetError')): self.__conn.close() self.__conn.request(method, path, postdata, headers) From f58bc7b638c74c667c7750f2d25ce55dc9479fd3 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Fri, 16 Aug 2019 20:18:40 +0100 Subject: [PATCH 2/9] Add RPC test and test framework constants for Sapling->Blossom activation. Signed-off-by: Daira Hopwood --- qa/rpc-tests/mempool_nu_activation.py | 19 +++++++++++++++---- qa/rpc-tests/test_framework/mininode.py | 13 ++++++++++++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/qa/rpc-tests/mempool_nu_activation.py b/qa/rpc-tests/mempool_nu_activation.py index 6a862635b..8a88deed1 100755 --- a/qa/rpc-tests/mempool_nu_activation.py +++ b/qa/rpc-tests/mempool_nu_activation.py @@ -6,9 +6,11 @@ import sys; assert sys.version_info < (3,), ur"This script does not run under Python 3. Please use Python 2.7.x." from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal, initialize_chain_clean, \ - start_node, connect_nodes, wait_and_assert_operationid_status, \ +from test_framework.util import ( + assert_equal, assert_true, initialize_chain_clean, + start_node, connect_nodes, wait_and_assert_operationid_status, get_coinbase_address +) from test_framework.authproxy import JSONRPCException from decimal import Decimal @@ -22,6 +24,7 @@ class MempoolUpgradeActivationTest(BitcoinTestFramework): args = ["-checkmempool", "-debug=mempool", "-blockmaxsize=4000", "-nuparams=5ba81b19:200", # Overwinter "-nuparams=76b809bb:210", # Sapling + "-nuparams=2bb40e60:220", # Blossom ] self.nodes = [] self.nodes.append(start_node(0, self.options.tmpdir, args)) @@ -72,10 +75,10 @@ class MempoolUpgradeActivationTest(BitcoinTestFramework): while self.nodes[1].getmempoolinfo()['bytes'] < 2 * 4000: try: x_txids.append(self.nodes[1].sendtoaddress(node0_taddr, Decimal('0.001'))) - assert_equal(chaintip_branchid, "00000000") except JSONRPCException: # This fails due to expiring soon threshold, which applies from Overwinter onwards. - assert_equal(info["upgrades"][chaintip_branchid]["name"], "Overwinter") + upgrade_name = info["upgrades"][chaintip_branchid]["name"] + assert_true(upgrade_name in ("Overwinter", "Sapling"), upgrade_name) break self.sync_all() @@ -156,5 +159,13 @@ class MempoolUpgradeActivationTest(BitcoinTestFramework): nu_activation_checks() # Current height = 215 + self.nodes[0].generate(2) + self.sync_all() + + print('Testing Sapling -> Blossom activation boundary') + # Current height = 217 + nu_activation_checks() + # Current height = 225 + if __name__ == '__main__': MempoolUpgradeActivationTest().main() diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py index bbeaaf8f8..fc9693e5b 100755 --- a/qa/rpc-tests/test_framework/mininode.py +++ b/qa/rpc-tests/test_framework/mininode.py @@ -39,13 +39,24 @@ from .equihash import ( zcash_person, ) -OVERWINTER_PROTO_VERSION = 170003 BIP0031_VERSION = 60000 SPROUT_PROTO_VERSION = 170002 # past bip-31 for ping/pong +OVERWINTER_PROTO_VERSION = 170003 SAPLING_PROTO_VERSION = 170006 +BLOSSOM_TESTNET_PROTO_VERSION = 170007 +BLOSSOM_PROTO_VERSION = 170008 + MY_SUBVERSION = "/python-mininode-tester:0.0.1/" +SPROUT_VERSION_GROUP_ID = 0x00000000 OVERWINTER_VERSION_GROUP_ID = 0x03C48270 +SAPLING_VERSION_GROUP_ID = 0x892F2085 +# No transaction format change in Blossom. + +SPROUT_BRANCH_ID = 0x00000000 +OVERWINTER_BRANCH_ID = 0x5BA81B19 +SAPLING_BRANCH_ID = 0x76B809BB +BLOSSOM_BRANCH_ID = 0x2BB40E60 MAX_INV_SZ = 50000 From b49e782ebae52363353f15476fefa739ea13d4d1 Mon Sep 17 00:00:00 2001 From: Eirik Ogilvie-Wigley Date: Fri, 16 Aug 2019 12:47:43 -0600 Subject: [PATCH 3/9] Update download path --- depends/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/Makefile b/depends/Makefile index 5c1fb9fdd..aa07755f0 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -4,7 +4,7 @@ SOURCES_PATH ?= $(BASEDIR)/sources BASE_CACHE ?= $(BASEDIR)/built SDK_PATH ?= $(BASEDIR)/SDKs NO_WALLET ?= -PRIORITY_DOWNLOAD_PATH ?= https://z.cash/depends-sources +PRIORITY_DOWNLOAD_PATH ?= https://download.z.cash/depends-sources BUILD ?= $(shell ./config.guess) HOST ?= $(BUILD) From 1288fb1dd8b89b1bf0bf4eba270d7b6b93d88fc8 Mon Sep 17 00:00:00 2001 From: Eirik Ogilvie-Wigley Date: Fri, 16 Aug 2019 12:55:41 -0600 Subject: [PATCH 4/9] Set testnet Blossom activation height --- src/chainparams.cpp | 3 +-- src/version.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index cf21eceb0..f322df6f6 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -306,8 +306,7 @@ public: consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nProtocolVersion = 170007; consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight = 280000; consensus.vUpgrades[Consensus::UPGRADE_BLOSSOM].nProtocolVersion = 170008; - consensus.vUpgrades[Consensus::UPGRADE_BLOSSOM].nActivationHeight = - Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT; + consensus.vUpgrades[Consensus::UPGRADE_BLOSSOM].nActivationHeight = 584000; // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000000000001d0c4d9cd"); diff --git a/src/version.h b/src/version.h index ed0b111b1..6a1a25f9b 100644 --- a/src/version.h +++ b/src/version.h @@ -9,7 +9,7 @@ * network protocol versioning */ -static const int PROTOCOL_VERSION = 170007; +static const int PROTOCOL_VERSION = 170008; //! initial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; From 6bb36fb379f848e1e7598e0ddb57bf4290e18a70 Mon Sep 17 00:00:00 2001 From: Eirik Ogilvie-Wigley Date: Fri, 16 Aug 2019 13:13:53 -0600 Subject: [PATCH 5/9] Notable changes for v2.0.7 --- doc/release-notes.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/release-notes.md b/doc/release-notes.md index a29094b51..8b46eb35f 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -4,3 +4,14 @@ release-notes at release time) Notable changes =============== +Shorter Block Times +------------------- +Shorter block times are coming to Zcash! In the v2.0.7 release we have implemented [ZIP208](https://github.com/zcash/zips/blob/master/zip-0208.rst) which take effect when Blossom activates. Upon activation, the block times for Zcash will decrease from 150s to 75s, and the block reward will will decrease accordingly. This effects at what block height halving events will occur, but should not effect the overall rate at which Zcash is mined. The total founder's reward stays the same, and the total supply of Zcash is decreased microscopically due to rounding. + +Blossom Activation on Testnet +----------------------------- +The v2.0.7 release includes Blossom activation on testnet bringing shorter block times. Testnet Blossom activation height is 584000. + +Insight Explorer +---------------- +The insight explorer has been incorporated in to Zcash. *This is an experimental feature* and therefore is subject change. To enable add the `experimentalfeatures=1`, `txindex=1`, and `insightexplorer=1` flags to `zcash.conf`. This feature adds several RPCs to `zcashd` which allow the user to run an insight explorer. From 94f642c80abab38dbb545bb13cbdf1eb4ce8d3b3 Mon Sep 17 00:00:00 2001 From: Eirik Ogilvie-Wigley Date: Fri, 16 Aug 2019 13:17:21 -0600 Subject: [PATCH 6/9] Enable shorter block times rpc test --- qa/pull-tester/rpc-tests.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh index 73da74b6c..d70351444 100755 --- a/qa/pull-tester/rpc-tests.sh +++ b/qa/pull-tester/rpc-tests.sh @@ -77,8 +77,7 @@ testScripts=( 'p2p_node_bloom.py' 'regtest_signrawtransaction.py' 'finalsaplingroot.py' - # TODO: enable the following test when updating PROTOCOL_VERSION in version.h for Blossom - # 'shorter_block_times.py' + 'shorter_block_times.py' 'sprout_sapling_migration.py' 'turnstile.py' ); From b6499624fe8c115edd992d5fa03998ef4da34696 Mon Sep 17 00:00:00 2001 From: Eirik Ogilvie-Wigley Date: Fri, 16 Aug 2019 16:07:15 -0600 Subject: [PATCH 7/9] Grammatical fixes and improvements Co-Authored-By: Daira Hopwood --- doc/release-notes.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index 8b46eb35f..0fba2dc2c 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -6,12 +6,12 @@ Notable changes Shorter Block Times ------------------- -Shorter block times are coming to Zcash! In the v2.0.7 release we have implemented [ZIP208](https://github.com/zcash/zips/blob/master/zip-0208.rst) which take effect when Blossom activates. Upon activation, the block times for Zcash will decrease from 150s to 75s, and the block reward will will decrease accordingly. This effects at what block height halving events will occur, but should not effect the overall rate at which Zcash is mined. The total founder's reward stays the same, and the total supply of Zcash is decreased microscopically due to rounding. +Shorter block times are coming to Zcash! In the v2.0.7 release we have implemented [ZIP208](https://github.com/zcash/zips/blob/master/zip-0208.rst) which will take effect when Blossom activates. Upon activation, the block times for Zcash will decrease from 150 seconds to 75 seconds, and the block reward will decrease accordingly. This affects at what block height halving events will occur, but should not affect the overall rate at which Zcash is mined. The total founders' reward stays the same, and the total supply of Zcash is decreased only microscopically due to rounding. Blossom Activation on Testnet ----------------------------- -The v2.0.7 release includes Blossom activation on testnet bringing shorter block times. Testnet Blossom activation height is 584000. +The v2.0.7 release includes Blossom activation on testnet, bringing shorter block times. The testnet Blossom activation height is 584000. Insight Explorer ---------------- -The insight explorer has been incorporated in to Zcash. *This is an experimental feature* and therefore is subject change. To enable add the `experimentalfeatures=1`, `txindex=1`, and `insightexplorer=1` flags to `zcash.conf`. This feature adds several RPCs to `zcashd` which allow the user to run an insight explorer. +Changes needed for the Insight explorer have been incorporated into Zcash. *This is an experimental feature* and therefore is subject to change. To enable, add the `experimentalfeatures=1`, `txindex=1`, and `insightexplorer=1` flags to `zcash.conf`. This feature adds several RPCs to `zcashd` which allow the user to run an Insight explorer. From 5ac48d8ebc7decc5cb4e97851aa49524af53b558 Mon Sep 17 00:00:00 2001 From: zebambam Date: Wed, 14 Aug 2019 11:42:31 -0700 Subject: [PATCH 8/9] Updated location to new download server, fixing #4100 --- qa/zcash/test-depends-sources-mirror.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/zcash/test-depends-sources-mirror.py b/qa/zcash/test-depends-sources-mirror.py index 85dd146b8..5f36a3d59 100755 --- a/qa/zcash/test-depends-sources-mirror.py +++ b/qa/zcash/test-depends-sources-mirror.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2 -# This script tests that the package mirror at https://z.cash/depends-sources/ +# This script tests that the package mirror at https://download.z.cash/depends-sources/ # contains all of the packages required to build this version of Zcash. # # This script assumes you've just built Zcash, and that as a result of that From b54725fbed20978fdd8fe4f53244e40e769dd943 Mon Sep 17 00:00:00 2001 From: Eirik Ogilvie-Wigley Date: Mon, 19 Aug 2019 12:30:24 -0600 Subject: [PATCH 9/9] Remove constant Co-Authored-By: str4d --- qa/rpc-tests/test_framework/mininode.py | 1 - 1 file changed, 1 deletion(-) diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py index fc9693e5b..89b7ecf40 100755 --- a/qa/rpc-tests/test_framework/mininode.py +++ b/qa/rpc-tests/test_framework/mininode.py @@ -43,7 +43,6 @@ BIP0031_VERSION = 60000 SPROUT_PROTO_VERSION = 170002 # past bip-31 for ping/pong OVERWINTER_PROTO_VERSION = 170003 SAPLING_PROTO_VERSION = 170006 -BLOSSOM_TESTNET_PROTO_VERSION = 170007 BLOSSOM_PROTO_VERSION = 170008 MY_SUBVERSION = "/python-mininode-tester:0.0.1/"