diff --git a/polkadot/node/network/bridge/src/lib.rs b/polkadot/node/network/bridge/src/lib.rs index 48059c42be..28aea415a3 100644 --- a/polkadot/node/network/bridge/src/lib.rs +++ b/polkadot/node/network/bridge/src/lib.rs @@ -433,10 +433,12 @@ where } Ok(FromOverseer::Communication { msg }) => match msg { NetworkBridgeMessage::ReportPeer(peer, rep) => { - tracing::debug!( - target: LOG_TARGET, - action = "ReportPeer" - ); + if !rep.is_benefit() { + tracing::debug!( + target: LOG_TARGET, + action = "ReportPeer" + ); + } network_service.report_peer(peer, rep).await? } NetworkBridgeMessage::DisconnectPeer(peer, peer_set) => { diff --git a/polkadot/node/network/protocol/src/reputation.rs b/polkadot/node/network/protocol/src/reputation.rs index 774b00b6b6..1773ecdcb8 100644 --- a/polkadot/node/network/protocol/src/reputation.rs +++ b/polkadot/node/network/protocol/src/reputation.rs @@ -55,6 +55,17 @@ impl UnifiedReputationChange { } } + /// Whether the reputation change is for good behavior. + pub const fn is_benefit(&self) -> bool { + match self { + Self::BenefitMajorFirst(_) | + Self::BenefitMajor(_) | + Self::BenefitMinorFirst(_) | + Self::BenefitMinor(_) => true, + _ => false, + } + } + /// Convert into a base reputation as used with substrate. pub const fn into_base_rep(self) -> ReputationChange { ReputationChange::new(