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

Increase total supply validation + add to total supply with added accounts #8139

Closed
4 tasks
colin-axner opened this issue Dec 10, 2020 · 2 comments · Fixed by #8418
Closed
4 tasks

Increase total supply validation + add to total supply with added accounts #8139

colin-axner opened this issue Dec 10, 2020 · 2 comments · Fixed by #8418
Assignees
Labels
C:CLI C:genesis relating to chain genesis

Comments

@colin-axner
Copy link
Contributor

colin-axner commented Dec 10, 2020

Summary of Bug

When starting up an internal testnet, we used an existing genesis file to import existing accounts and then added account balances to the genesis file using the gaiad add-genesis-account.

Two things turned out wrong:

  • adding the account balances did not update the total supply
  • running validate-genesis which resides in genutil, does basic validation of the genesis which results in a simple check if the supply is a valid sdk coin. Our genesis file with an incorrect total supply successfully passed validation

Solution

Adding a genesis account should update the total supply. Running genesis validation should check that all the account balances equal the total supply

Part of this may be a cosmos/gaia issue, but the supply validation is definitely an SDK issue


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@colin-axner colin-axner added C:CLI C:genesis relating to chain genesis labels Dec 10, 2020
@fedekunze fedekunze added this to the v0.40.1 milestone Jan 17, 2021
@clevinson
Copy link
Contributor

@colin-axner We're looking to cut v0.40.2 next week for an updated hub proposal. Do you think this will get resolved in time, or should we punt to the next v0.40.x point release.

@fedekunze
Copy link
Collaborator

fedekunze commented Jan 22, 2021

Adding a genesis account should update the total supply. Running genesis validation should check that all the account balances equal the total supply

The balance vs supply check is already done by the invariant during init genesis (although not on validation). We just need to add the acc balance to the supply on genesis acc creation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:CLI C:genesis relating to chain genesis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants