nakamoto icon indicating copy to clipboard operation
nakamoto copied to clipboard

Peer banning

Open cloudhead opened this issue 4 years ago • 2 comments

Peers that misbehave or shouldn't be connected to / retry-ed for a while should be banned. We're mainly interested in saving time and bandwidth by doing this.

The banned peers should be stored in the client::peer::Cache with the ban duration and start time.

It probably makes sense to create a BanManager for this alongside the other sub-protocols in p2p/src/protocol/.

cloudhead avatar Jan 23 '21 22:01 cloudhead

:eyes:

UnknownCypher avatar May 17 '22 18:05 UnknownCypher

Bitcoind's describes its approach to banning pretty well. They opt to de-prioritize misbehaving peers instead of banning, which is left up to the users. They avoid banning due to risk of splitting the network on a protocol upgrade.

"Attempting to automatically disconnect or ban any class of peer carries the risk of splitting the network. For example, if we banned/disconnected for a transaction that fails a policy check and a future version changes the policy check so the transaction is accepted, then that transaction could cause the network to split between old nodes and new nodes."

How would you like to proceed?

UnknownCypher avatar May 19 '22 14:05 UnknownCypher