Downgrades a valid log (#2057)

## Issue Addressed

#2046 

## Proposed Changes

The log was originally intended to verify the correct logic and ordering of events when scoring peers. The queued tasks can be structured in such a way that peers can be banned after they are disconnected. Therefore the error log is now downgraded to  debug log.
This commit is contained in:
Age Manning
2020-12-08 10:48:45 +00:00
parent 57489e620f
commit 4f85371ce8
4 changed files with 24 additions and 19 deletions

View File

@@ -474,8 +474,9 @@ impl<TSpec: EthSpec> PeerDB<TSpec> {
// Check and verify all the connection states
match info.connection_status() {
PeerConnectionStatus::Disconnected { .. } => {
// It should not be possible to ban a peer that is already disconnected.
error!(log_ref, "Banning a disconnected peer"; "peer_id" => %peer_id);
// It is possible to ban a peer that has a disconnected score, if there are many
// events that score it poorly and are processed after it has disconnected.
debug!(log_ref, "Banning a disconnected peer"; "peer_id" => %peer_id);
self.disconnected_peers = self.disconnected_peers.saturating_sub(1);
info.ban();
self.banned_peers_count