-
Notifications
You must be signed in to change notification settings - Fork 297
Closed
Labels
Description
We reintroduced std/random in #2255 to unbreak the unstable branch.
It is used here:
nimbus-eth2/beacon_chain/nimbus_beacon_node.nim
Lines 650 to 664 in 718feef
| # randomize() already called; also, never probe on first epoch in guard | |
| # period, so that existing, running validators can be picked up. Whilst | |
| # this reduces entropy for overlapping-start cases, and increases their | |
| # collision likelihood, that can be compensated for by increasing guard | |
| # epoch periods by 1. As a corollary, 1 guard epoch won't detect when a | |
| # duplicate pair overlaps exactly, only the running/starting case. Even | |
| # 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 |
We should remove its usage (except in test) and err on the side of safety.