Skip to content

Commit

Permalink
reduce detection epochs after validator no longer live
Browse files Browse the repository at this point in the history
  • Loading branch information
olegshmuelov committed Feb 17, 2025
1 parent 71d7856 commit 35e6d97
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions doppelganger/doppelganger.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,15 @@ func (ds *doppelgangerHandler) processLivenessData(epoch phase0.Epoch, livenessD
continue
}

// If the validator was previously marked as permanently unsafe (detected as live elsewhere),
// but is now considered inactive, we reset the detection period to be safer.
// Since we just checked for liveness now, we reduce the default detection period by 1
// to ensure it gets checked once again in the next epoch before being marked safe.
if state.remainingEpochs == PermanentlyUnsafe {
ds.logger.Debug("Validator is no longer live, resetting to default detection epochs",
state.remainingEpochs = DefaultRemainingDetectionEpochs - 1
ds.logger.Debug("Validator is no longer live but requires further checks",
fields.ValidatorIndex(response.Index),
)
state.remainingEpochs = DefaultRemainingDetectionEpochs
zap.Uint64("remaining_epochs", state.remainingEpochs))
continue
}

Expand Down

0 comments on commit 35e6d97

Please sign in to comment.