diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index df1a937eb6..5490f28592 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -8,6 +8,7 @@ import # Standard library std/[math, os, strformat, strutils, tables, times, + random, # TODO: review usage of Nim RNG terminal, osproc], system/ansi_c, @@ -655,6 +656,9 @@ proc setupSelfSlashingProtection(node: BeaconNode, slot: Slot) = # 2 epochs is dangerous because it'll guarantee colliding probes in the # overlapping case. + # TODO: is a pseudo-random RNG enough here? + # If so, should we store the state explicitly? + # So dPE == 2 -> epoch + 1, always; dPE == 3 -> epoch + (1 or 2), etc. node.processor.gossipSlashingProtection.probeEpoch = slot.epoch + 1 + rand(duplicateValidatorEpochs.int - 2).uint64 @@ -1749,4 +1753,3 @@ programMain: waitFor testWeb3Provider(config.web3TestUrl, depositContractAddress, depositContractDeployedAt) -