-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix inaccurate validator balance metrics #6134
Conversation
} | ||
continue | ||
} | ||
prevEpoch := (slot / params.BeaconConfig().SlotsPerEpoch) - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about slot 0? I believe we have a helper func called helpers.PrevEpoch that checks for underflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code doesn't run in epoch 0, but I'll use the helper func.
Ah, but PrevEpoch only takes state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets make a small helper then in this file that checks for underflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment to detail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of changes in validator metrics. Note to self to cross check to ensure this doesn't break validator grafana dashboard
Testing now. Give me 30 mins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested. Looks good to me other than Raul's feedback
Just for the sake of defensive programming, always good to check for underflow @0xKiwi |
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
This PR solves the issue of validator metrics being inaccurate, previously the validator client was assuming the response from the beacon node was in the same order requested, but it is actually sorted by validator index. This changes the validator client to use the public key response to set the order received.
Fixes #5305 and fixes #5600