-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After network upgrade activation, reject new connections from outdated peers #1334
Comments
Rather than implementing any special network upgrade disconnection logic, I think it would be much cleaner to (1) decline to connect to peers speaking the old protocol and (2) ensure that all network connections are short-lived by churning peer connections. This is better because it avoids introducing extra modes into our network code. |
xref #706 with discussion on the above point |
Assigning this ticket to sprint 7, because it's required for testnet activation. |
Closed by #2519. |
Motivation
zcashd
rejects new connections from outdated peers after a network upgrade activates.Previously, the Zebra developers manually incremented the
CURRENT_VERSION
andMIN_NETWORK_UPGRADE
version after each network upgrade activation.But that's not an ideal solution, because it:
CURRENT_VERSION
is incrementedMIN_NETWORK_UPGRADE
Specifications
Original specification: ZIP 201: Network Peer Management for Overwinter
Since this is a network protocol specification, Zebra is free to adopt any compatible design.
Draft Zebra behaviour: ZIP 252: Deployment of the NU5 Network Upgrade - Support in Zebra
Solution
Increment the network protocol version after Zebra's network upgrade implementation is complete (see #1841).
Calculate the minimum peer protocol version based on the current best tip height:
MIN_NETWORK_UPGRADE
with amin_peer_version
function, which changes at each network upgrade activation, based on the best tip heightwatch
channel to broadcast the best (non-finalized or finalized) tip height (the same channel as After network upgrade activation, close existing connections to outdated peers #2262)MIN_ACTIVE_NETWORK_UPGRADE
function, and use it to calculate the minimum network protocol version we'll accept during the initial syncNetwork
argument, and (possibly) return a different network upgrade for each networkCanopy
until after NU5 activation on each networkHandshaker:
min_peer_version
Documentation:
Testing:
Alternative Solutions
Manually increment
MIN_NETWORK_UPGRADE
after each network upgrade. This will cause Zebra to fail after each network upgrade, until the user installs the latest version.Related Issues
A previous PR that incremented these constants is #1333.
#706 evicting old peers in the days before a network upgrade
#337 ZIP-200: Network Upgrade Mechanism
Follow Up
Re-deploy long-running Foundation Zebra nodes
The text was updated successfully, but these errors were encountered: