Validator: fix percentages to be per 100 (#5527)

* fix percentages to be per 100
* Merge branch 'master' into fix-percentages
* Merge refs/heads/master into fix-percentages
This commit is contained in:
Preston Van Loon 2020-04-19 20:10:53 -07:00 committed by GitHub
parent 1c6d1fabf3
commit 9ae492e2cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,10 +118,10 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot uint64)
log.WithFields(logrus.Fields{
"epoch": (slot / params.BeaconConfig().SlotsPerEpoch) - 1,
"attestationInclusionPercentage": fmt.Sprintf("%.2f", float64(included)/float64(len(resp.InclusionSlots))),
"correctlyVotedSourcePercentage": fmt.Sprintf("%.2f", float64(votedSource)/float64(len(resp.CorrectlyVotedSource))),
"correctlyVotedTargetPercentage": fmt.Sprintf("%.2f", float64(votedTarget)/float64(len(resp.CorrectlyVotedTarget))),
"correctlyVotedHeadPercentage": fmt.Sprintf("%.2f", float64(votedHead)/float64(len(resp.CorrectlyVotedHead))),
"attestationInclusionPercentage": fmt.Sprintf("%.2f", float64(included)/float64(len(resp.InclusionSlots)*100)),
"correctlyVotedSourcePercentage": fmt.Sprintf("%.2f", float64(votedSource)/float64(len(resp.CorrectlyVotedSource)*100)),
"correctlyVotedTargetPercentage": fmt.Sprintf("%.2f", float64(votedTarget)/float64(len(resp.CorrectlyVotedTarget)*100)),
"correctlyVotedHeadPercentage": fmt.Sprintf("%.2f", float64(votedHead)/float64(len(resp.CorrectlyVotedHead)*100)),
}).Info("Previous epoch aggregated voting summary")
return nil