From 9d8364bdfa035d3fd9c7b2d5b1b6f2e62ae39db7 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 9 Jan 2020 19:11:02 -0800 Subject: [PATCH] only advance state in validate aggregate and proof if the epoch has changed between head state and attestation slot (#4474) --- beacon-chain/sync/validate_aggregate_proof.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beacon-chain/sync/validate_aggregate_proof.go b/beacon-chain/sync/validate_aggregate_proof.go index cb7580bdb..fff9e4ec4 100644 --- a/beacon-chain/sync/validate_aggregate_proof.go +++ b/beacon-chain/sync/validate_aggregate_proof.go @@ -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)