diff --git a/packages/beacon-node/src/network/processor/gossipValidatorFn.ts b/packages/beacon-node/src/network/processor/gossipValidatorFn.ts index 9624b29c6b..cf6a7be07b 100644 --- a/packages/beacon-node/src/network/processor/gossipValidatorFn.ts +++ b/packages/beacon-node/src/network/processor/gossipValidatorFn.ts @@ -46,13 +46,19 @@ export function getGossipValidatorBatchFn( })) ); - return results.map((e) => { + return results.map((e, i) => { if (e == null) { return TopicValidatorResult.Accept; } + const {clientAgent, clientVersion, propagationSource} = messageInfos[i]; + if (!(e instanceof AttestationError)) { - logger.debug(`Gossip batch validation ${type} threw a non-AttestationError`, {}, e as Error); + logger.debug( + `Gossip batch validation ${type} threw a non-AttestationError`, + {peerId: prettyPrintPeerIdStr(propagationSource), clientAgent, clientVersion}, + e as Error + ); metrics?.networkProcessor.gossipValidationIgnore.inc({topic: type}); return TopicValidatorResult.Ignore; } @@ -67,7 +73,11 @@ export function getGossipValidatorBatchFn( metrics?.networkProcessor.gossipValidationReject.inc({topic: type}); // only beacon_attestation topic is validated in batch metrics?.networkProcessor.gossipAttestationRejectByReason.inc({reason: e.type.code}); - logger.debug(`Gossip validation ${type} rejected`, {}, e); + logger.debug( + `Gossip validation ${type} rejected`, + {peerId: prettyPrintPeerIdStr(propagationSource), clientAgent, clientVersion}, + e + ); return TopicValidatorResult.Reject; } }); @@ -125,7 +135,11 @@ export function getGossipValidatorFn(gossipHandlers: GossipHandlers, modules: Va } catch (e) { if (!(e instanceof GossipActionError)) { // not deserve to log error here, it looks too dangerous to users - logger.debug(`Gossip validation ${type} threw a non-GossipActionError`, {}, e as Error); + logger.debug( + `Gossip validation ${type} threw a non-GossipActionError`, + {peerId: prettyPrintPeerIdStr(propagationSource), clientAgent, clientVersion}, + e as Error + ); return TopicValidatorResult.Ignore; }