Avoid bad peers propagation #1134
Labels
Discussion
Initial issue state - proposed but not yet accepted
Enhancement
Type - Changes that may affect performance, usability or add new features to existing modules.
P2P
Module - peer-to-peer message exchange and network optimisations, at TCP or UDP level (not HTTP).
(Originally from @decentralisedkev on #366)
Summary
Problems:
Do you have any solution you want to propose?
Add the heartbeat messages into the p2p protocol;
ping
andpong
. So a node sends aping
message with a nonce, the other node then replies with apong
message with the same nonce to signify that the connection is still alive.Implement an inflight message tracker for each peer that the node has connected to. If a
getheaders
message is sent and aheaders
is not heard within 30 seconds, for example, the node should disconnect from that peer.An example implementation of this can be seen here: https://github.com/decentralisedkev/neo-go/blob/v2/pkg/p2p/peer/stall/stall.go
With these solutions in place, nodes will stop keeping a large number of bad peers or peers that are ran for a short period of time.
Where in the software does this update applies to?
The text was updated successfully, but these errors were encountered: