Skip to content
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

Validator status improvements and fix #5775

Merged
merged 9 commits into from
May 8, 2020
Merged

Validator status improvements and fix #5775

merged 9 commits into from
May 8, 2020

Conversation

0xKiwi
Copy link
Contributor

@0xKiwi 0xKiwi commented May 7, 2020

What type of PR is this?
Improvement

What does this PR do? Why is it needed?
This PR changes all references of ValidatorAtIndex to ValidatorAtIndexReadOnly since there are no modifications made to validators throughout this function.

Also fixes a reporting issue made in #5396

Which issues(s) does this PR fix?
Fixes #5720

@0xKiwi 0xKiwi requested a review from a team as a code owner May 7, 2020 15:27
for _, ctnr := range dc.deposits {
// Search the list backwards since this function is only used for
// pending activation validators and the newest deposits are always at the end.
for i := len(dc.deposits) - 1; i > 0; i-- {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If anyone disagrees with this change please let me know, this function is only used for newer validators so I figured it'd make sense.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, nice catch!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change this back, this picks the wrong deposit in the event of top-ups. Its why the tests fail now.

rauljordan
rauljordan previously approved these changes May 7, 2020
for _, ctnr := range dc.deposits {
// Search the list backwards since this function is only used for
// pending activation validators and the newest deposits are always at the end.
for i := len(dc.deposits) - 1; i > 0; i-- {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, nice catch!

@0xKiwi
Copy link
Contributor Author

0xKiwi commented May 7, 2020

@rauljordan it seems like the deposit change breaks a test TestBeaconDB_DepositByPubkey_ReturnsFirstMatchingDeposit. Is there a strong reason for looking for the first deposit?

for _, ctnr := range dc.deposits {
// Search the list backwards since this function is only used for
// pending activation validators and the newest deposits are always at the end.
for i := len(dc.deposits) - 1; i > 0; i-- {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change this back, this picks the wrong deposit in the event of top-ups. Its why the tests fail now.

@0xKiwi 0xKiwi requested a review from nisdas May 8, 2020 13:11
@codecov
Copy link

codecov bot commented May 8, 2020

Codecov Report

Merging #5775 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #5775   +/-   ##
=======================================
  Coverage   57.80%   57.80%           
=======================================
  Files         312      312           
  Lines       26437    26437           
=======================================
  Hits        15282    15282           
  Misses       9040     9040           
  Partials     2115     2115           

@0xKiwi 0xKiwi merged commit 03c7a6c into master May 8, 2020
@delete-merged-branch delete-merged-branch bot deleted the val-status-optimize branch May 8, 2020 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validator status DEPOSITED never returned to Prometheus metrics
3 participants