From c95d980bc23fa1ece334adbdc4ffcb5ae8d40fc1 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 4 Aug 2020 12:53:09 +1000 Subject: [PATCH] doc: Explain current and minimum network protocol versions --- zebra-network/src/constants.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/zebra-network/src/constants.rs b/zebra-network/src/constants.rs index e218f355e..babb16f44 100644 --- a/zebra-network/src/constants.rs +++ b/zebra-network/src/constants.rs @@ -40,15 +40,20 @@ pub const TIMESTAMP_TRUNCATION_SECONDS: i64 = 30 * 60; /// [BIP 14]: https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki pub const USER_AGENT: &str = "/🦓Zebra🦓:3.0.0-alpha.0/"; -/// The Zcash network protocol version implemented by this crate. +/// The Zcash network protocol version implemented by this crate, and advertised +/// during connection setup. /// -/// This protocol version might be the current version on Mainnet or Testnet, -/// based on where we are in the network upgrade cycle. +/// The current protocol version is checked by our peers. If it is too old, +/// newer peers will refuse to connect to us. +/// +/// The current protocol version typically changes before Mainnet and Testnet +/// network upgrades. pub const CURRENT_VERSION: Version = Version(170_012); /// The most recent bilateral consensus upgrade implemented by this crate. /// -/// Used to select the minimum supported version for peer connections. +/// The minimum network upgrade is used to check the protocol versions of our +/// peers. If their versions are too old, we will disconnect from them. // // TODO: replace with NetworkUpgrade::current(network, height). // See the detailed comment in handshake.rs, where this constant is used.