Remove ping optimization #291
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The PING mechanism for discv5 informs our peers of ENR updates as the sequence number is included with the PING. We ping every connected peer by default every 5 minutes (not all at once, each peer has a 5 minute timer).
Once we have decided that our ENR should be updated (given the PONG's from our peers have aligned on a fixed value) we have been sending out PINGs to all our peers to inform them to update our ENR. This is an optimization that allows us to quickly form connections and get our ENR into the routing table of other peers as soon as we know we are externally contactable.
We are investigating an issue, whereby a non-stable decision as to our external address can lead to ping amplifications. If we think this is likely to happen, it probably isn't worth this optimization, also sending these excessive pings is quite noisey and probably its fine to wait for the natural 5 minute ping to gradually disseminate our new ENRs to the network.
Discovery ENR propagation is a slow process anyway, so changing from rapid updates with a small risk of amplification to a slow spread of the ENR could be the more reasonable choice.