Start disconnecting from outdated peers a few days before network upgrade activation #4545
Labels
A-network
Area: Network protocol updates or fixes
C-security
Category: Security issues
I-remote-node-overload
Zebra can overload other nodes on the network
NU-7
Network Upgrade: NU7 specific tasks
Milestone
Motivation
To avoid Zcash peer connection storms, we want to start disconnecting from outdated peers before network upgrade activation.
Specifications
Here is what
zcashd
does:https://zips.z.cash/zip-0201#network-coalescence
Designs
Optional:
ChangePeerConnections
request from Tracking: security: Limit ability of synthetic nodes to take up connection slots. Credit: Ziggurat Team #7822, but add an "outdated peers only" filter to it.Possible Implementation
Launch a peer set background task that waits until the block height has changed, checks if it is near a network upgrade, then sends a
ChangePeerConnections { disconnect_outdated: true }
request.Then sleep until the next request could be sent, whether a request was sent or not. This avoids locking the state watch channel too much.
Out of Scope
optional changes
reconnection_peers
, rather than always choosing the first one. To prefer peers that are more likely to reconnect, randomly select two peer indexes using sample, then return the peer at the lower index.Compatibility
Here are the
zcashd
parameters:height >= (activation_height - NETWORK_UPGRADE_PEER_PREFERENCE_BLOCK_PERIOD)
NETWORK_UPGRADE_PEER_PREFERENCE_BLOCK_PERIOD
is 1728, or 1.5 daysFor Zebra, we could use:
zcashd
This makes the number of disconnections 2-6 times the peer set size. (The peer limits are 75 outbound and 125 inbound peers.) So if half the peers on the network are upgraded, Zebra should be connected to 75% - 98% upgraded peers when the network upgrade activates.
The text was updated successfully, but these errors were encountered: