Skip to content

Remove std/random #2256

@mratsim

Description

@mratsim

We reintroduced std/random in #2255 to unbreak the unstable branch.

It is used here:

# 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions