deactivate doppelganger protection during genesis (#3362)

* deactivate Doppelganger Protection during genesis

* also don't actually flag supposed-doppelgangers (because they're before broadcastStartEpoch) on GENESIS_SLOT start
This commit is contained in:
tersec 2022-02-07 05:12:36 +00:00 committed by GitHub
parent 70579f2fb1
commit bf3ef987e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -78,7 +78,7 @@ type
## of gossip interleaving between nodes so long as they don't gossip at ## of gossip interleaving between nodes so long as they don't gossip at
## the same time. ## the same time.
nodeLaunchSlot: Slot ##\ nodeLaunchSlot*: Slot ##\
## Set once, at node launch. This functions as a basic protection against ## Set once, at node launch. This functions as a basic protection against
## false positives from attestations persisting within the gossip network ## false positives from attestations persisting within the gossip network
## across quick restarts. ## across quick restarts.
@ -260,7 +260,8 @@ proc checkForPotentialDoppelganger(
return return
if attestation.data.slot.epoch < if attestation.data.slot.epoch <
self.doppelgangerDetection.broadcastStartEpoch: self.doppelgangerDetection.broadcastStartEpoch and
self.doppelgangerDetection.nodeLaunchSlot > GENESIS_SLOT:
for validatorIndex in attesterIndices: for validatorIndex in attesterIndices:
let validatorPubkey = self.dag.validatorKey(validatorIndex).get().toPubKey() let validatorPubkey = self.dag.validatorKey(validatorIndex).get().toPubKey()
if not isNil(self.validatorPool[].getValidator(validatorPubkey)): if not isNil(self.validatorPool[].getValidator(validatorPubkey)):

View File

@ -1029,6 +1029,7 @@ proc handleValidatorDuties*(node: BeaconNode, lastSlot, slot: Slot) {.async.} =
# means that it'd be okay not to continue, but it won't gossip regardless. # means that it'd be okay not to continue, but it won't gossip regardless.
if curSlot.epoch < if curSlot.epoch <
node.processor[].doppelgangerDetection.broadcastStartEpoch and node.processor[].doppelgangerDetection.broadcastStartEpoch and
node.processor[].doppelgangerDetection.nodeLaunchSlot > GENESIS_SLOT and
node.config.doppelgangerDetection: node.config.doppelgangerDetection:
let let
nextAttestationSlot = node.actionTracker.getNextAttestationSlot(slot - 1) nextAttestationSlot = node.actionTracker.getNextAttestationSlot(slot - 1)

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright (c) 2020-2021 Status Research & Development GmbH. Licensed under # Copyright (c) 2020-2022 Status Research & Development GmbH. Licensed under
# either of: # either of:
# - Apache License, version 2.0 # - Apache License, version 2.0
# - MIT license # - MIT license
@ -487,7 +487,6 @@ for NUM_NODE in $(seq 0 $(( NUM_NODES - 1 ))); do
--metrics \ --metrics \
--metrics-address="127.0.0.1" \ --metrics-address="127.0.0.1" \
--metrics-port="$(( BASE_METRICS_PORT + NUM_NODE ))" \ --metrics-port="$(( BASE_METRICS_PORT + NUM_NODE ))" \
--doppelganger-detection=off \
${EXTRA_ARGS} \ ${EXTRA_ARGS} \
> "${DATA_DIR}/log${NUM_NODE}.txt" 2>&1 & > "${DATA_DIR}/log${NUM_NODE}.txt" 2>&1 &