mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-05-02 03:02:54 -04:00
Fix historical detection for the slasher (#5831)
* Fix historical detection for the slasher * More fixes * Fix * Run historical detection sequentially * Add context err handler * Add return * Fixes * Merge branch 'master' into slasher-fixes
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user