@@ -516,8 +516,10 @@ proc setupSelfSlashingProtection(node: BeaconNode, slot: Slot) =
516516 #
517517 # This approach catches both startup and network outage conditions.
518518
519+ const duplicateValidatorEpochs = 2
520+
519521 node.processor.dupProtection.broadcastStartEpoch =
520- slot.epoch + node.config.dupProtectionEpochs
522+ slot.epoch + duplicateValidatorEpochs
521523 # randomize() already called; also, never probe on first epoch in guard
522524 # period, so that existing, running validators can be picked up. Whilst
523525 # this reduces entropy for overlapping-start cases, and increases their
@@ -526,14 +528,12 @@ proc setupSelfSlashingProtection(node: BeaconNode, slot: Slot) =
526528 # duplicate pair overlaps exactly, only the running/starting case. Even
527529 # 2 epochs is dangerous because it'll guarantee colliding probes in the
528530 # overlapping case.
529- if node.config.dupProtectionEpochs > 1 :
530- # So dPE == 2 -> epoch + 1, always; dPE == 3 -> epoch + (1 or 2), etc.
531- node.processor.dupProtection.probeEpoch =
532- slot.epoch + 1 + rand (node.config.dupProtectionEpochs.int - 2 ).uint64
533- doAssert node.processor.dupProtection.probeEpoch <
534- node.processor.dupProtection.broadcastStartEpoch
535- else :
536- node.processor.dupProtection.probeEpoch = 0 .Epoch # don't probe
531+
532+ # So dPE == 2 -> epoch + 1, always; dPE == 3 -> epoch + (1 or 2), etc.
533+ node.processor.dupProtection.probeEpoch =
534+ slot.epoch + 1 + rand (duplicateValidatorEpochs.int - 2 ).uint64
535+ doAssert node.processor.dupProtection.probeEpoch <
536+ node.processor.dupProtection.broadcastStartEpoch
537537
538538 debug " Setting up self-slashing protection" ,
539539 epoch = slot.epoch,
0 commit comments