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

Cliff validator power not correctly updated when cliff validator increases in power #1857

Closed
cwgoes opened this issue Jul 27, 2018 · 5 comments · Fixed by #1858
Closed

Cliff validator power not correctly updated when cliff validator increases in power #1857

cwgoes opened this issue Jul 27, 2018 · 5 comments · Fixed by #1858

Comments

@cwgoes
Copy link
Contributor

cwgoes commented Jul 27, 2018

Caught by fuzzer (#1783).

UpdateValidator has a special case for an already-bonded validator increasing in power where it skips the usual store iteration - but if the cliff validator has increased in power, this will fail to update the power stored at ValidatorPowerCliffKey.

@cwgoes
Copy link
Contributor Author

cwgoes commented Jul 27, 2018

Also, if the cliff validator increases in power, it might stop being the cliff validator - I don't think we handle that correctly.

@alexanderbez
Copy link
Contributor

I think this might be a good chance for me to get my hands dirty with staking.

@cwgoes
Copy link
Contributor Author

cwgoes commented Jul 27, 2018

I think this might be a good chance for me to get my hands dirty with staking.

Great - also pulling in @rigelrozanski, might want to discuss what we want to change quickly first.

Note that this is really two distinct bugs:

  • If the cliff validator power increases beyond the second-lowest-power validator, we need to switch cliff validators
  • If the cliff validator power increases but it's still the lowest-power validator, we need to update the ValidatorPowerCliffKey for future comparisions to the cliff validator power

#1858 has an isolating testcase for each, feel free to take over that PR.

@alexanderbez
Copy link
Contributor

Great. @rigelrozanski let's sync up on this.

@rigelrozanski
Copy link
Contributor

Let's talk about this on Monday - great catch fuzzer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants