Skip to content

Commit 2275fad

Browse files
authored
only show setting up doppelganger detection log message if enabled (#3391)
* only show setting up doppelganger detection log message if enabled * correct indentation
1 parent 6849536 commit 2275fad

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

beacon_chain/gossip_processing/eth2_processor.nim

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ type
9797
## whose purpose is to quickly filter out spam, then will (usually) delegate
9898
## full validation to the proper manager - finally, metrics and monitoring
9999
## are updated.
100-
doppelGangerDetectionEnabled*: bool
100+
doppelgangerDetectionEnabled*: bool
101101

102102
# Local sources of truth for validation
103103
# ----------------------------------------------------------------
@@ -136,7 +136,7 @@ type
136136
# ------------------------------------------------------------------------------
137137

138138
proc new*(T: type Eth2Processor,
139-
doppelGangerDetectionEnabled: bool,
139+
doppelgangerDetectionEnabled: bool,
140140
blockProcessor: ref BlockProcessor,
141141
validatorMonitor: ref ValidatorMonitor,
142142
dag: ChainDAGRef,
@@ -150,7 +150,7 @@ proc new*(T: type Eth2Processor,
150150
taskpool: TaskPoolPtr
151151
): ref Eth2Processor =
152152
(ref Eth2Processor)(
153-
doppelGangerDetectionEnabled: doppelGangerDetectionEnabled,
153+
doppelgangerDetectionEnabled: doppelgangerDetectionEnabled,
154154
doppelgangerDetection: DoppelgangerProtection(
155155
nodeLaunchSlot: getBeaconTime().slotOrZero,
156156
broadcastStartEpoch: FAR_FUTURE_EPOCH),
@@ -242,10 +242,10 @@ proc setupDoppelgangerDetection*(self: var Eth2Processor, slot: Slot) =
242242

243243
self.doppelgangerDetection.broadcastStartEpoch =
244244
slot.epoch + duplicateValidatorEpochs
245-
notice "Setting up doppelganger protection",
246-
epoch = slot.epoch,
247-
broadcastStartEpoch =
248-
self.doppelgangerDetection.broadcastStartEpoch
245+
if self.doppelgangerDetectionEnabled:
246+
notice "Setting up doppelganger detection",
247+
epoch = slot.epoch,
248+
broadcastStartEpoch = self.doppelgangerDetection.broadcastStartEpoch
249249

250250
proc checkForPotentialDoppelganger(
251251
self: var Eth2Processor, attestation: Attestation,

0 commit comments

Comments
 (0)