Auto merge of #4105 - Eirik0:testnet-blossom-activation, r=Eirik0

Testnet Blossom activation

This PR includes a fix to an inconsistency introduced in #4101, sets the Blossom activation height on testnet, adds notable changes for v2.0.7, and includes some additional testing for Blossom activation.
This commit is contained in:
Homu 2019-08-19 11:40:46 -07:00
commit a495edbbfa
9 changed files with 45 additions and 13 deletions

View File

@ -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)

View File

@ -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 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. The testnet Blossom activation height is 584000.
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.

View File

@ -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'
);

View File

@ -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()

View File

@ -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)

View File

@ -39,13 +39,23 @@ 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_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

View File

@ -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

View File

@ -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");

View File

@ -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;