Peer banning
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/.
:eyes:
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?