Skip to content

Commit

Permalink
Remove duplicated sig verification (#5676)
Browse files Browse the repository at this point in the history
* Remove duplicated sig verification
  • Loading branch information
terencechain committed Apr 29, 2020
1 parent 81a7bc7 commit 05fcb10
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions beacon-chain/sync/validate_aggregate_proof.go
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 05fcb10

Please sign in to comment.