Skip to content

Commit

Permalink
Display Num Pruned Items in Slasher Only When Actually Prunes (#9989)
Browse files Browse the repository at this point in the history
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
  • Loading branch information
rauljordan and prylabs-bulldozer[bot] authored Dec 7, 2021
1 parent 2bcda2e commit 1eff00f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions beacon-chain/slasher/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,14 @@ func (s *Service) pruneSlasherDataWithinSlidingWindow(ctx context.Context, curre
if err != nil {
return errors.Wrap(err, "Could not prune proposals")
}
log.WithFields(logrus.Fields{
"prunedAttestationRecords": numPrunedAtts,
"prunedProposalRecords": numPrunedProposals,
"elapsed": time.Since(start),
}).Info("Successfully ran slasher data pruning")
fields := logrus.Fields{}
if numPrunedAtts > 0 {
fields["numPrunedAtts"] = numPrunedAtts
}
if numPrunedProposals > 0 {
fields["numPrunedProposals"] = numPrunedProposals
}
fields["elapsed"] = time.Since(start)
log.WithFields(fields).Info("Done pruning old attestations and proposals for slasher")
return nil
}

0 comments on commit 1eff00f

Please sign in to comment.