-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Reduce the spam from network misbehaviours #1750
Conversation
if self.banned_peers[pos].1 > Instant::now() { | ||
return | ||
} else { | ||
self.banned_peers.remove(pos); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this not re-ban them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(i see, it does below)
It would be good to get some clarity on what "misbehaviour" means here and why we have good reason to believe it will never happen between any of our nodes. If there were ever a systematic reason why nodes believed other nodes were misbehaving (erroneously) then we would instantly halt the network. |
The misbehaviour here will only happen if the node doesn't support the protocol that we request (eg. we request "bbq" but the remote only supports "sub", or the remote is an IPFS node for some reason). The tests in Substrate are high-level enough that we are sure that this will never happen between two nodes running the same commit. |
Could we make it "failed to negotiate |
* Reduce the spam from network misbehaviours * Add protocol id to misbehaviour
cc #1738
Once a node misbehaves on the network, we print a warning once and ban it for 5 minutes.
Also fixes a bug where banning didn't work because we would clear the list of banned peers every time
poll()
was called.