only advance state in validate aggregate and proof if the epoch has changed between head state and attestation slot (#4474)

This commit is contained in:
Preston Van Loon 2020-01-09 19:11:02 -08:00 committed by GitHub
parent 2b6a5aaaf9
commit 9d8364bdfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,8 @@ func (r *Service) validateAggregateAndProof(ctx context.Context, pid peer.ID, ms
return false
}
if attSlot > s.Slot {
// Only advance state if different epoch as the committee can only change on an epoch transition.
if helpers.SlotToEpoch(attSlot) > helpers.SlotToEpoch(s.Slot) {
s, err = state.ProcessSlots(ctx, s, attSlot)
if err != nil {
traceutil.AnnotateError(span, err)