2020-09-14 07:22:13 -07:00
|
|
|
::
|
|
|
|
|
|
|
|
ZIP: 252
|
|
|
|
Title: Deployment of the NU5 Network Upgrade
|
2021-02-23 00:10:22 -08:00
|
|
|
Owners: Daira Hopwood <daira@electriccoin.co>, teor <teor@zfnd.org>
|
2021-02-23 00:07:41 -08:00
|
|
|
Status: Draft
|
2020-11-14 14:06:46 -08:00
|
|
|
Category: Consensus / Network
|
2021-02-23 00:10:22 -08:00
|
|
|
Created: 2021-02-23
|
2021-02-23 00:08:10 -08:00
|
|
|
License: MIT
|
|
|
|
|
|
|
|
|
|
|
|
Terminology
|
|
|
|
===========
|
|
|
|
|
|
|
|
The key words "MUST", "MUST NOT", "SHOULD", and "MAY" in this document are to be
|
|
|
|
interpreted as described in RFC 2119. [#RFC2119]_
|
|
|
|
|
|
|
|
The term "network upgrade" in this document is to be interpreted as described in
|
|
|
|
ZIP 200. [#zip-0200]_
|
|
|
|
|
|
|
|
The terms "Testnet" and "Mainnet" are to be interpreted as described in
|
|
|
|
section 3.11 of the Zcash Protocol Specification [#protocol-networks]_.
|
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
NU5 is the code-name for the sixth Zcash network upgrade, also known as
|
|
|
|
Network Upgrade 5.
|
2021-02-23 00:08:10 -08:00
|
|
|
|
|
|
|
|
|
|
|
Abstract
|
|
|
|
========
|
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
This proposal defines the deployment of the NU5 network upgrade.
|
2021-02-23 00:08:10 -08:00
|
|
|
|
|
|
|
|
|
|
|
Specification
|
|
|
|
=============
|
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
NU5 deployment
|
2021-02-23 00:08:10 -08:00
|
|
|
-----------------
|
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
The primary sources of information about NU5 consensus protocol changes are:
|
2021-02-23 00:08:10 -08:00
|
|
|
|
|
|
|
- The Zcash Protocol Specification [#protocol]_
|
|
|
|
- ZIP 200: Network Upgrade Mechanism [#zip-0200]_
|
2021-02-23 00:21:56 -08:00
|
|
|
- **TODO: Select ZIPs**
|
2021-02-23 00:08:10 -08:00
|
|
|
|
|
|
|
The network handshake and peer management mechanisms defined in ZIP 201 [#zip-0201]_
|
|
|
|
also apply to this upgrade.
|
|
|
|
|
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
The following network upgrade constants [#zip-0200]_ are defined for the NU5
|
2021-02-23 00:08:10 -08:00
|
|
|
upgrade:
|
|
|
|
|
|
|
|
CONSENSUS_BRANCH_ID
|
|
|
|
``0xE9FF75A6``
|
|
|
|
|
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
ACTIVATION_HEIGHT (NU5)
|
2021-02-23 00:08:10 -08:00
|
|
|
Testnet: 1028500
|
|
|
|
|
|
|
|
Mainnet: 1046400
|
|
|
|
|
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
Nodes compatible with NU5 activation on testnet MUST advertise protocol version
|
|
|
|
170012 or later. Nodes compatible with NU5 activation on mainnet MUST advertise
|
2021-02-23 00:08:10 -08:00
|
|
|
protocol version 170013 or later. The minimum peer protocol version that
|
2021-02-23 00:14:04 -08:00
|
|
|
NU5-compatible nodes will connect to is 170002.
|
2021-02-23 00:08:10 -08:00
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
Pre-NU5 testnet nodes are defined as nodes on testnet advertising a protocol
|
|
|
|
version less than 170012. Pre-NU5 mainnet nodes are defined as nodes on mainnet
|
2021-02-23 00:08:10 -08:00
|
|
|
advertising a protocol version less than 170013.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
Once NU5 activates on testnet or mainnet, NU5 nodes SHOULD take steps to:
|
2021-02-23 00:08:10 -08:00
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
- reject new connections from pre-NU5 nodes on that network;
|
|
|
|
- disconnect any existing connections to pre-NU5 nodes on that network.
|
2021-02-23 00:08:10 -08:00
|
|
|
|
|
|
|
|
|
|
|
Backward compatibility
|
|
|
|
======================
|
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
Prior to the network upgrade activating on each network, NU5 and pre-NU5
|
2021-02-23 00:41:28 -08:00
|
|
|
nodes are compatible and can connect to each other.
|
2021-02-23 00:08:10 -08:00
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
Once the network upgrades, even though pre-NU5 nodes can still accept the
|
|
|
|
numerically larger protocol version used by NU5 as being valid, NU5 nodes
|
2021-02-23 00:08:10 -08:00
|
|
|
will always disconnect peers using lower protocol versions.
|
|
|
|
|
2021-02-23 00:21:56 -08:00
|
|
|
**TODO: Delete if ZIP-225: Version 5 Transaction Format is accepted**
|
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
Unlike Overwinter and Sapling, and like Blossom and Heartwood, NU5 does not
|
|
|
|
define a new transaction version. NU5 transactions are therefore in the same
|
2021-02-23 00:08:10 -08:00
|
|
|
v4 format as Sapling transactions; use the same version group ID, i.e. 0x892F2085
|
|
|
|
as defined in [#protocol-txnencodingandconsensus]_; and use the same transaction digest
|
|
|
|
algorithm as defined in [#zip-0243]_. This does not imply that transactions are
|
2021-02-23 00:14:04 -08:00
|
|
|
valid across the NU5 activation, since signatures MUST use the appropriate
|
2021-02-23 00:08:10 -08:00
|
|
|
consensus branch ID. [#zip-0243]_
|
|
|
|
|
|
|
|
|
|
|
|
Support in zcashd
|
|
|
|
=================
|
|
|
|
|
2021-02-23 00:14:04 -08:00
|
|
|
Support for NU5 on testnet will be implemented in ``zcashd`` version 3.1.0, which
|
|
|
|
will advertise protocol version 170012. Support for NU5 on mainnet will be implemented
|
2021-02-23 00:08:10 -08:00
|
|
|
in ``zcashd`` version 4.0.0, which will advertise protocol version 170013.
|
|
|
|
|
|
|
|
|
2021-02-23 00:41:28 -08:00
|
|
|
Backward compatibility in zcashd
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
The minimum peer protocol version that NU5-compatible ``zcashd`` nodes will connect to
|
|
|
|
is 170002.
|
|
|
|
|
|
|
|
|
|
|
|
NU5 deployment for zcashd
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
For each network, approximately 1.5 days (defined in terms of
|
|
|
|
block height) before the corresponding NU5 activation height, nodes compatible
|
|
|
|
with NU5 activation on that network will change the behaviour of their peer
|
|
|
|
connection logic in order to prefer pre-NU5 peers on that network for eviction
|
|
|
|
from the set of peer connections::
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The period before a network upgrade activates, where connections to upgrading peers are preferred (in blocks).
|
|
|
|
* This was three days for upgrades up to and including Blossom, and is 1.5 days from Heartwood onward.
|
|
|
|
*/
|
|
|
|
static const int NETWORK_UPGRADE_PEER_PREFERENCE_BLOCK_PERIOD = 1728;
|
|
|
|
|
|
|
|
The implementation is similar to that for Overwinter which was described in
|
|
|
|
[#zip-0201]_.
|
|
|
|
|
|
|
|
However, NU5 nodes will have a preference for connecting to other NU5 nodes, so
|
|
|
|
pre-NU5 nodes will gradually be disconnected in the run up to activation.
|
|
|
|
|
|
|
|
|
2021-02-23 00:08:10 -08:00
|
|
|
References
|
|
|
|
==========
|
|
|
|
|
2021-02-23 00:21:56 -08:00
|
|
|
**TODO: Update spec versions**
|
|
|
|
|
2021-02-23 00:08:10 -08:00
|
|
|
.. [#RFC2119] `RFC 2119: Key words for use in RFCs to Indicate Requirement Levels <https://www.rfc-editor.org/rfc/rfc2119.html>`_
|
|
|
|
.. [#protocol] `Zcash Protocol Specification, Version 2020.1.15 or later <protocol/canopy.pdf>`_
|
|
|
|
.. [#protocol-networks] `Zcash Protocol Specification, Version 2020.1.15. Section 3.11: Mainnet and Testnet <protocol/canopy.pdf#networks>`_
|
|
|
|
.. [#protocol-txnencodingandconsensus] `Zcash Protocol Specification, Version 2020.1.15. Section 7.1: Transaction Encoding and Consensus <protocol/canopy.pdf#txnencodingandconsensus>`_
|
|
|
|
.. [#zip-0200] `ZIP 200: Network Upgrade Activation Mechanism <zip-0200.rst>`_
|
|
|
|
.. [#zip-0201] `ZIP 201: Network Peer Management for Overwinter <zip-0201.rst>`_
|
2021-02-23 00:21:56 -08:00
|
|
|
**TODO: Delete if ZIP-225: Version 5 Transaction Format is accepted**
|
2021-02-23 00:08:10 -08:00
|
|
|
.. [#zip-0243] `ZIP 243: Transaction Signature Validation for Sapling <zip-0243.rst>`_
|