net/strategy: Log bad peerId from on_validated_block_announce (#4051)

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 <alexandru.vasile@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
Alexandru Vasile
2024-04-10 18:29:36 +03:00
committed by GitHub
parent 0d71753e0e
commit cd010925e1
2 changed files with 2 additions and 2 deletions
@@ -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))
};