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

Unit of min-self-delegation #9386

Closed
4 tasks
youngjoon-lee opened this issue May 24, 2021 · 10 comments
Closed
4 tasks

Unit of min-self-delegation #9386

youngjoon-lee opened this issue May 24, 2021 · 10 comments
Assignees
Milestone

Comments

@youngjoon-lee
Copy link

youngjoon-lee commented May 24, 2021

Summary of Bug

From the create-validator guide, it seems that the unit of min-self-delegation is atom (not uatom).

But, the ValidatorBasic() was implemented as if its unit is uatom.

if msg.Value.Amount.LT(msg.MinSelfDelegation) {

If the unit should be uatom, I would suggest to force users to put a denominator to the --min-self-delegation option as discussed in #3594.

gaiad tx staking create-validator --min-self-delegation="1uatom"

If not, the ValidatorBasic() should be fixed as below, I guess.

if msg.Value.Amount.LT(sdk.TokensFromConsensusPower(msg.MinSelfDelegation.Int64())) {
    return ErrSelfDelegationBelowMinimum
}

If you guys confirm which way is correct, I can open a PR (if it's ok).

Version

Cosmos SDK v0.42.4

Steps to Reproduce

No step to reproduce. I just read source codes and found this issue.


For Admin Use

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

The min self delegation passed to the CLI and thus the message should be in the base unit. e.g. for the hub, it's uatom, i.e. 10^6. I think we just need to update the docs.

@youngjoon-lee
Copy link
Author

Cool. Thanks for your quick reply.
Yeah. The doc needs to be changed. Plus, what do you think to update the CLI as well? to get a denom as well as a number, as discussed in #3594.

--min-self-delegation=1uatom

@ryanchristo
Copy link
Contributor

ryanchristo commented May 25, 2021

Thanks @youngjoon-lee for reporting the issue!

The document that you are referring to lives in the Gaia repository if you would like to submit a fix there. I think adding denom requirements at the client level is something we would still like to do so a pull request here would be welcome as well.

@aaronc aaronc added the C:CLI label May 28, 2021
@aaronc
Copy link
Member

aaronc commented May 28, 2021

@shahankhatch can you take a look at this from the gaia side?

@ryanchristo
Copy link
Contributor

ryanchristo commented Jun 1, 2021

@youngjoon-lee Are you still interested in submitting a pull request to make the denom required?

@youngjoon-lee
Copy link
Author

@youngjoon-lee Are you still interested in submitting a pull request to make the denom required?

Thank you for your reply. Sure! I will submit a PR this week regards to the CLI option, and another PR for Gaia documents to the Gaia repo.

@ryanchristo
Copy link
Contributor

Awesome! I think a fix for the documentation has already been submitted but updating the CLI is all yours.

@ryanchristo
Copy link
Contributor

Hey @youngjoon-lee! I just wanted to check in and see if you are still planning on tackling the CLI change.

@youngjoon-lee
Copy link
Author

@ryanchristo Yes. Sorry for late. I will open a PR this week.

@ryanchristo
Copy link
Contributor

No worries! I was just checking. Thanks for letting us know.

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.

4 participants