Exit attest/aggregate routine on attestation failure.

This commit is contained in:
Jim McDonald 2020-10-20 07:22:41 +01:00
parent fd5540086f
commit c6adf2c7e5
No known key found for this signature in database
GPG Key ID: 89CEB61B2AD2A5E7
2 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,5 @@
Development
- do not attempt to aggregate a failed attestation
- error appropriately when misconfigured
- avoid crash if accountmanager not configured
- avoid crash if beacon committee subscription information is not present

View File

@ -102,9 +102,10 @@ func (s *Service) AttestAndScheduleAggregate(ctx context.Context, data interface
attestations, err := s.attester.Attest(ctx, duty)
if err != nil {
log.Warn().Err(err).Msg("Failed to attest")
return
}
if len(attestations) == 0 {
if len(attestations) == 0 || attestations[0].Data == nil {
log.Debug().Msg("No attestations; nothing to aggregate")
return
}