From cd010925e12c3c1d22b47cc9185c394366e65c5f Mon Sep 17 00:00:00 2001 From: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> Date: Wed, 10 Apr 2024 18:29:36 +0300 Subject: [PATCH] net/strategy: Log bad peerId from on_validated_block_announce (#4051) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This tiny PR extends the `on_validated_block_announce` log with the bad PeerID. Used to identify if the peerID is malicious by correlating with other logs (ie peer-set). While at it, have removed the `\n` from a multiline log, which did not play well with [sub-triage-logs](https://github.com/lexnv/sub-triage-logs/tree/master). cc @paritytech/networking --------- Signed-off-by: Alexandru Vasile Co-authored-by: Bastian Köcher --- polkadot/node/network/statement-distribution/src/v2/cluster.rs | 2 +- substrate/client/network/sync/src/strategy/chain_sync.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/polkadot/node/network/statement-distribution/src/v2/cluster.rs b/polkadot/node/network/statement-distribution/src/v2/cluster.rs index 87cdc389cb..c3f45314b2 100644 --- a/polkadot/node/network/statement-distribution/src/v2/cluster.rs +++ b/polkadot/node/network/statement-distribution/src/v2/cluster.rs @@ -442,7 +442,7 @@ impl ClusterTracker { target: LOG_TARGET, pending_statements = ?self.pending, ?parent_hash, - "Cluster has too many pending statements, something wrong with our connection to our group peers \n + "Cluster has too many pending statements, something wrong with our connection to our group peers Restart might be needed if validator gets 0 backing rewards for more than 3-4 consecutive sessions" ); } diff --git a/substrate/client/network/sync/src/strategy/chain_sync.rs b/substrate/client/network/sync/src/strategy/chain_sync.rs index 1a7a18f2ea..fcda259079 100644 --- a/substrate/client/network/sync/src/strategy/chain_sync.rs +++ b/substrate/client/network/sync/src/strategy/chain_sync.rs @@ -1063,7 +1063,7 @@ where let peer = if let Some(peer) = self.peers.get_mut(&peer_id) { peer } else { - error!(target: LOG_TARGET, "💔 Called `on_validated_block_announce` with a bad peer ID"); + error!(target: LOG_TARGET, "💔 Called `on_validated_block_announce` with a bad peer ID {peer_id}"); return Some((hash, number)) };