mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 20:07:17 +00:00
Consider missing validator count for performance metric (#4928)
* Consider missing validator count * Use validator count reported * Merge branch 'master' into missing-validators * Merge refs/heads/master into missing-validators
This commit is contained in:
parent
15b649d760
commit
0470d37072
@ -61,6 +61,7 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot uint64)
|
|||||||
votedTarget := 0
|
votedTarget := 0
|
||||||
votedHead := 0
|
votedHead := 0
|
||||||
|
|
||||||
|
reported := 0
|
||||||
for i, pkey := range pubKeys {
|
for i, pkey := range pubKeys {
|
||||||
pubKey := fmt.Sprintf("%#x", pkey[:8])
|
pubKey := fmt.Sprintf("%#x", pkey[:8])
|
||||||
log := log.WithField("pubKey", pubKey)
|
log := log.WithField("pubKey", pubKey)
|
||||||
@ -95,21 +96,23 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot uint64)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if i < len(resp.InclusionSlots) && resp.InclusionSlots[i] != ^uint64(0) {
|
if reported < len(resp.InclusionSlots) && resp.InclusionSlots[i] != ^uint64(0) {
|
||||||
included++
|
included++
|
||||||
}
|
}
|
||||||
if i < len(resp.CorrectlyVotedSource) && resp.CorrectlyVotedSource[i] {
|
if reported < len(resp.CorrectlyVotedSource) && resp.CorrectlyVotedSource[i] {
|
||||||
votedSource++
|
votedSource++
|
||||||
}
|
}
|
||||||
if i < len(resp.CorrectlyVotedTarget) && resp.CorrectlyVotedTarget[i] {
|
if reported < len(resp.CorrectlyVotedTarget) && resp.CorrectlyVotedTarget[i] {
|
||||||
votedTarget++
|
votedTarget++
|
||||||
}
|
}
|
||||||
if i < len(resp.CorrectlyVotedHead) && resp.CorrectlyVotedHead[i] {
|
if reported < len(resp.CorrectlyVotedHead) && resp.CorrectlyVotedHead[i] {
|
||||||
votedHead++
|
votedHead++
|
||||||
}
|
}
|
||||||
if i < len(resp.BalancesAfterEpochTransition) {
|
if reported < len(resp.BalancesAfterEpochTransition) {
|
||||||
v.prevBalance[bytesutil.ToBytes48(pkey)] = resp.BalancesBeforeEpochTransition[i]
|
v.prevBalance[bytesutil.ToBytes48(pkey)] = resp.BalancesBeforeEpochTransition[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reported++
|
||||||
}
|
}
|
||||||
|
|
||||||
log.WithFields(logrus.Fields{
|
log.WithFields(logrus.Fields{
|
||||||
|
Loading…
Reference in New Issue
Block a user