diff --git a/beacon-chain/rpc/beacon/attestations.go b/beacon-chain/rpc/beacon/attestations.go index 9bcf244d55..c90feb817d 100644 --- a/beacon-chain/rpc/beacon/attestations.go +++ b/beacon-chain/rpc/beacon/attestations.go @@ -159,7 +159,7 @@ func (bs *Server) ListIndexedAttestations( if err != nil { return nil, status.Errorf( codes.Internal, - "Could not retrieve state for attestation data block root %v: %v", + "Could not retrieve state for attestation data block root %#x: %v", targetRoot, err, ) diff --git a/slasher/beaconclient/receivers.go b/slasher/beaconclient/receivers.go index 6cbd0c5faf..ec4b54e9e6 100644 --- a/slasher/beaconclient/receivers.go +++ b/slasher/beaconclient/receivers.go @@ -104,7 +104,7 @@ func (bs *Service) receiveAttestations(ctx context.Context) { break default: log.WithError(err).Errorf("Could not receive attestations from beacon node. rpc status: %v", e.Code()) - return + break } } else { log.WithError(err).Error("Could not receive attestations from beacon node") diff --git a/slasher/detection/service.go b/slasher/detection/service.go index 5a6f3e71a3..8c15c966d1 100644 --- a/slasher/detection/service.go +++ b/slasher/detection/service.go @@ -132,11 +132,20 @@ func (ds *Service) detectHistoricalChainData(ctx context.Context) { ) for _, att := range indexedAtts { + if ctx.Err() == context.Canceled { + log.WithError(ctx.Err()).Error("context has been canceled, ending detection") + return + } slashings, err := ds.DetectAttesterSlashings(ctx, att) if err != nil { log.WithError(err).Error("Could not detect attester slashings") continue } + if len(slashings) < 1 { + if err := ds.minMaxSpanDetector.UpdateSpans(ctx, att); err != nil { + log.WithError(err).Error("Could not update spans") + } + } ds.submitAttesterSlashings(ctx, slashings) } latestStoredHead = ðpb.ChainHead{HeadEpoch: epoch}