only show setting up doppelganger detection log message if enabled (#3391)

* only show setting up doppelganger detection log message if enabled

* correct indentation
This commit is contained in:
tersec 2022-02-14 19:24:38 +00:00 committed by GitHub
parent 6849536742
commit 2275fad335
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -97,7 +97,7 @@ type
## whose purpose is to quickly filter out spam, then will (usually) delegate ## whose purpose is to quickly filter out spam, then will (usually) delegate
## full validation to the proper manager - finally, metrics and monitoring ## full validation to the proper manager - finally, metrics and monitoring
## are updated. ## are updated.
doppelGangerDetectionEnabled*: bool doppelgangerDetectionEnabled*: bool
# Local sources of truth for validation # Local sources of truth for validation
# ---------------------------------------------------------------- # ----------------------------------------------------------------
@ -136,7 +136,7 @@ type
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
proc new*(T: type Eth2Processor, proc new*(T: type Eth2Processor,
doppelGangerDetectionEnabled: bool, doppelgangerDetectionEnabled: bool,
blockProcessor: ref BlockProcessor, blockProcessor: ref BlockProcessor,
validatorMonitor: ref ValidatorMonitor, validatorMonitor: ref ValidatorMonitor,
dag: ChainDAGRef, dag: ChainDAGRef,
@ -150,7 +150,7 @@ proc new*(T: type Eth2Processor,
taskpool: TaskPoolPtr taskpool: TaskPoolPtr
): ref Eth2Processor = ): ref Eth2Processor =
(ref Eth2Processor)( (ref Eth2Processor)(
doppelGangerDetectionEnabled: doppelGangerDetectionEnabled, doppelgangerDetectionEnabled: doppelgangerDetectionEnabled,
doppelgangerDetection: DoppelgangerProtection( doppelgangerDetection: DoppelgangerProtection(
nodeLaunchSlot: getBeaconTime().slotOrZero, nodeLaunchSlot: getBeaconTime().slotOrZero,
broadcastStartEpoch: FAR_FUTURE_EPOCH), broadcastStartEpoch: FAR_FUTURE_EPOCH),
@ -242,10 +242,10 @@ proc setupDoppelgangerDetection*(self: var Eth2Processor, slot: Slot) =
self.doppelgangerDetection.broadcastStartEpoch = self.doppelgangerDetection.broadcastStartEpoch =
slot.epoch + duplicateValidatorEpochs slot.epoch + duplicateValidatorEpochs
notice "Setting up doppelganger protection", if self.doppelgangerDetectionEnabled:
notice "Setting up doppelganger detection",
epoch = slot.epoch, epoch = slot.epoch,
broadcastStartEpoch = broadcastStartEpoch = self.doppelgangerDetection.broadcastStartEpoch
self.doppelgangerDetection.broadcastStartEpoch
proc checkForPotentialDoppelganger( proc checkForPotentialDoppelganger(
self: var Eth2Processor, attestation: Attestation, self: var Eth2Processor, attestation: Attestation,