mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-23 11:48:33 +00:00
Remove std/random again
This commit is contained in:
parent
718feef802
commit
960666d1ed
@ -8,7 +8,6 @@
|
|||||||
import
|
import
|
||||||
# Standard library
|
# Standard library
|
||||||
std/[math, os, strformat, strutils, tables, times,
|
std/[math, os, strformat, strutils, tables, times,
|
||||||
random, # TODO: review usage of Nim RNG
|
|
||||||
terminal, osproc],
|
terminal, osproc],
|
||||||
system/ansi_c,
|
system/ansi_c,
|
||||||
|
|
||||||
@ -656,12 +655,11 @@ proc setupSelfSlashingProtection(node: BeaconNode, slot: Slot) =
|
|||||||
# 2 epochs is dangerous because it'll guarantee colliding probes in the
|
# 2 epochs is dangerous because it'll guarantee colliding probes in the
|
||||||
# overlapping case.
|
# overlapping case.
|
||||||
|
|
||||||
# TODO: is a pseudo-random RNG enough here?
|
let rng = node.network.rng
|
||||||
# If so, should we store the state explicitly?
|
|
||||||
|
|
||||||
# So dPE == 2 -> epoch + 1, always; dPE == 3 -> epoch + (1 or 2), etc.
|
# So dPE == 2 -> epoch + 1, always; dPE == 3 -> epoch + (1 or 2), etc.
|
||||||
node.processor.gossipSlashingProtection.probeEpoch =
|
node.processor.gossipSlashingProtection.probeEpoch =
|
||||||
slot.epoch + 1 + rand(duplicateValidatorEpochs.int - 2).uint64
|
slot.epoch + 1 + rng[].rand(duplicateValidatorEpochs.int - 2).uint64
|
||||||
doAssert node.processor.gossipSlashingProtection.probeEpoch <
|
doAssert node.processor.gossipSlashingProtection.probeEpoch <
|
||||||
node.processor.gossipSlashingProtection.broadcastStartEpoch
|
node.processor.gossipSlashingProtection.broadcastStartEpoch
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user