From b76921b33048ef06c680d97dfd3f0020f708e201 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 15 Jan 2021 16:39:58 +1000 Subject: [PATCH] Update some comments in zebra-network Add ticket numbers, and update based on design decisions and new code. --- zebra-network/src/peer/handshake.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/zebra-network/src/peer/handshake.rs b/zebra-network/src/peer/handshake.rs index 8158194fd0a..a7ffd641ae2 100644 --- a/zebra-network/src/peer/handshake.rs +++ b/zebra-network/src/peer/handshake.rs @@ -192,9 +192,9 @@ where let (tcp_stream, addr) = req; let connector_span = span!(Level::INFO, "connector", addr = ?addr); - // set parent: None for the peer connection span, as it should exist - // independently of its creation source (inbound connection, crawler, - // initial peer, ...) + // set the peer connection span's parent to the global span, as it + // should exist independently of its creation source (inbound + // connection, crawler, initial peer, ...) let connection_span = span!(parent: &self.parent_span, Level::INFO, "peer", addr = ?addr); // Clone these upfront, so they can be moved into the future. @@ -315,12 +315,13 @@ where // auto currentEpoch = CurrentEpoch(GetHeight(), consensusParams); // if (pfrom->nVersion < consensusParams.vUpgrades[currentEpoch].nProtocolVersion) // - // For approximately 1.5 days before a network upgrade, we also need to: - // - avoid old peers, and - // - prefer updated peers. - // For example, we could reject old peers with probability 0.5. + // For approximately 1.5 days before a network upgrade, zcashd also: + // - avoids old peers, and + // - prefers updated peers. + // We haven't decided if we need this behaviour in Zebra yet (see #706). + // + // At the network upgrade, we also need to disconnect from old peers (see #1334). // - // At the network upgrade, we also need to disconnect from old peers. // TODO: replace min_for_upgrade(network, MIN_NETWORK_UPGRADE) with // current_min(network, height) where network is the // configured network, and height is the best tip's block