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

MsgCreateValidator should not allow a self delegation of 0 consensus power #8908

Closed
4 tasks
colin-axner opened this issue Mar 17, 2021 · 1 comment · Fixed by #8909
Closed
4 tasks

MsgCreateValidator should not allow a self delegation of 0 consensus power #8908

colin-axner opened this issue Mar 17, 2021 · 1 comment · Fixed by #8909

Comments

@colin-axner
Copy link
Contributor

Summary

The MsgCreateValidator does not check if the PotentialConsensusPower of the self delegation is 0. It checks if the self delegation is positive, but if the self delegation is less than the PowerReduction, the consensus power will be 0. This results in the validator set being nil after running gentx with too low of an amount.

The error returned in this situation:

Error: error during handshake: error on replay: validator set is nil in genesis and still empty after InitChain

This error is very confusing for users since the gentx was clearly ran and the msg create validator is clearly included in genesis. It is pretty hard to debug as well

Alternatively, we could just add this check to the client code if for some reason this modification isn't safe to make in x/staking


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@colin-axner
Copy link
Contributor Author

So we cannot change the minimum self delegation requirements since this could cause existing validators to have invalid minimum self delegation amounts. There's probably a way to fix it, but I'll let someone else look into it

We can change the create validator message to require an initial delegation of at least one consensus power. This seems reasonable to me

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 a pull request may close this issue.

1 participant