diff --git a/handlers/api.go b/handlers/api.go index de8e9027c7..69f93d5795 100644 --- a/handlers/api.go +++ b/handlers/api.go @@ -1060,6 +1060,11 @@ func getExpectedSyncCommitteeSlots(validators []uint64, epoch uint64) (expectedS return 0, nil } + lastFinalizedEpoch := services.LatestFinalizedEpoch() + if epoch > lastFinalizedEpoch { + epoch = lastFinalizedEpoch + } + // retrieve activation and exit epochs from database per validator type ValidatorInfo struct { Id int64 `db:"validatorindex"`