mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
Check attestation has pre state before retrieving it (#6149)
* Use state util to get block root * Move prestate to below Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
parent
6c0fbcc622
commit
6af7664a56
@ -69,12 +69,6 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p
|
||||
traceutil.AnnotateError(span, err)
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
preState, err := s.chain.AttestationPreState(ctx, att)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to retrieve pre state")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
if !strings.HasPrefix(originalTopic, fmt.Sprintf(format, digest, att.Data.CommitteeIndex)) {
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
@ -101,6 +95,12 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
|
||||
preState, err := s.chain.AttestationPreState(ctx, att)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to retrieve pre state")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
// Attestation's signature is a valid BLS signature and belongs to correct public key..
|
||||
if !featureconfig.Get().DisableStrictAttestationPubsubVerification {
|
||||
if err := blocks.VerifyAttestation(ctx, preState, att); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user