Skip to content

Commit

Permalink
substrate: peer_store: log warn on disconnecting because of reputation (
Browse files Browse the repository at this point in the history
paritytech#1299)

* substrate: peer_store: log error on disconnecting because of reputation

Disconnecting and banning a peer because of negative reputation is
usually an indicative of one of two things:
1. We've got a bug that forces disconnects.
2. We've got malicious peers that try to attack us.

We both cases I don't think we should hide this behind a trace log
and we should log errors, so that things are easy to notice and
debug/mitigated.

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>

* Move from error to warn

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
  • Loading branch information
alexggh authored Aug 31, 2023
1 parent 109287f commit 5559b75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion substrate/client/network/src/peer_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl PeerStoreInner {
if peer_info.reputation < BANNED_THRESHOLD {
self.protocols.iter().for_each(|handle| handle.disconnect_peer(peer_id));

log::trace!(
log::warn!(
target: LOG_TARGET,
"Report {}: {:+} to {}. Reason: {}. Banned, disconnecting.",
peer_id,
Expand Down

0 comments on commit 5559b75

Please sign in to comment.