From ba68d19ab18e69c4b07c140d9b4dc28947ec0537 Mon Sep 17 00:00:00 2001 From: terence tsao Date: Wed, 29 Apr 2020 08:34:04 -0700 Subject: [PATCH] Remove duplicated sig verification --- beacon-chain/sync/validate_aggregate_proof.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/beacon-chain/sync/validate_aggregate_proof.go b/beacon-chain/sync/validate_aggregate_proof.go index 8ee383949943..167650d980b9 100644 --- a/beacon-chain/sync/validate_aggregate_proof.go +++ b/beacon-chain/sync/validate_aggregate_proof.go @@ -74,10 +74,6 @@ func (r *Service) validateAggregateAndProof(ctx context.Context, pid peer.ID, ms return false } - if !featureconfig.Get().DisableStrictAttestationPubsubVerification && !r.chain.IsValidAttestation(ctx, m.Message.Aggregate) { - return false - } - r.setAggregatorIndexSlotSeen(m.Message.Aggregate.Data.Slot, m.Message.AggregatorIndex) msg.ValidatorData = m @@ -129,9 +125,11 @@ func (r *Service) validateAggregatedAtt(ctx context.Context, signed *ethpb.Signe } // Verify aggregated attestation has a valid signature. - if err := blocks.VerifyAttestation(ctx, s, signed.Message.Aggregate); err != nil { - traceutil.AnnotateError(span, err) - return false + if !featureconfig.Get().DisableStrictAttestationPubsubVerification { + if err := blocks.VerifyAttestation(ctx, s, signed.Message.Aggregate); err != nil { + traceutil.AnnotateError(span, err) + return false + } } return true