From 2275fad335f5d5b1a91c129d1bfb8bccb82761bc Mon Sep 17 00:00:00 2001 From: tersec Date: Mon, 14 Feb 2022 19:24:38 +0000 Subject: [PATCH] only show setting up doppelganger detection log message if enabled (#3391) * only show setting up doppelganger detection log message if enabled * correct indentation --- beacon_chain/gossip_processing/eth2_processor.nim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/beacon_chain/gossip_processing/eth2_processor.nim b/beacon_chain/gossip_processing/eth2_processor.nim index bdaceac43..cf9a9c5df 100644 --- a/beacon_chain/gossip_processing/eth2_processor.nim +++ b/beacon_chain/gossip_processing/eth2_processor.nim @@ -97,7 +97,7 @@ type ## whose purpose is to quickly filter out spam, then will (usually) delegate ## full validation to the proper manager - finally, metrics and monitoring ## are updated. - doppelGangerDetectionEnabled*: bool + doppelgangerDetectionEnabled*: bool # Local sources of truth for validation # ---------------------------------------------------------------- @@ -136,7 +136,7 @@ type # ------------------------------------------------------------------------------ proc new*(T: type Eth2Processor, - doppelGangerDetectionEnabled: bool, + doppelgangerDetectionEnabled: bool, blockProcessor: ref BlockProcessor, validatorMonitor: ref ValidatorMonitor, dag: ChainDAGRef, @@ -150,7 +150,7 @@ proc new*(T: type Eth2Processor, taskpool: TaskPoolPtr ): ref Eth2Processor = (ref Eth2Processor)( - doppelGangerDetectionEnabled: doppelGangerDetectionEnabled, + doppelgangerDetectionEnabled: doppelgangerDetectionEnabled, doppelgangerDetection: DoppelgangerProtection( nodeLaunchSlot: getBeaconTime().slotOrZero, broadcastStartEpoch: FAR_FUTURE_EPOCH), @@ -242,10 +242,10 @@ proc setupDoppelgangerDetection*(self: var Eth2Processor, slot: Slot) = self.doppelgangerDetection.broadcastStartEpoch = slot.epoch + duplicateValidatorEpochs - notice "Setting up doppelganger protection", - epoch = slot.epoch, - broadcastStartEpoch = - self.doppelgangerDetection.broadcastStartEpoch + if self.doppelgangerDetectionEnabled: + notice "Setting up doppelganger detection", + epoch = slot.epoch, + broadcastStartEpoch = self.doppelgangerDetection.broadcastStartEpoch proc checkForPotentialDoppelganger( self: var Eth2Processor, attestation: Attestation,