Skip to content

Commit

Permalink
Fix unstable after #2244 (#2255)
Browse files Browse the repository at this point in the history
  • Loading branch information
mratsim authored Jan 21, 2021
1 parent 69d6ffd commit 718feef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion beacon_chain/nimbus_beacon_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1749,4 +1753,3 @@ programMain:
waitFor testWeb3Provider(config.web3TestUrl,
depositContractAddress,
depositContractDeployedAt)

0 comments on commit 718feef

Please sign in to comment.