-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Bank genesis allows the supply to be incorrectly set #8919
Comments
I suggest we try to get this into 0.43 because IMHO it should go together with the proper balancing tracking work that's already been done. |
An alternative to removing is using it correctly as an invariant check in InitGenesis and ValidateGenesis unlike the current code. |
There is no proposal in the issue body @aaronc :) |
I'm in favor of this solution. I find the current solution to be inconsistent. See gaia issue. Some of the gaiad commands will update the supply while others don't causing supply validation issues if used together. It seems to me the supply set in the genesis is unnecessary and will only lead to problems. I guess it is useful in being able to visually see the total supply before starting a chain, but maybe this could be some cli command instead? If sticking with the current solution and not removing supply, I think it'd be best to add a comment into the genesis file if possible indicating the new behaviour. It'd also be great to remove all supply updates from the associated genutil commands |
Summary of Bug
Supply is just a sum of balances. Allowing it to be set separately in genesis is incorrect and should be considered a bug. This code allows the supply in genesis to override what is calculated by summing up the balances (
totalSupply
):cosmos-sdk/x/bank/keeper/genesis.go
Lines 30 to 34 in 641b13e
Proposed Fix
Use the bank
GenesisState.supply
field to check that the supply is correct inInitGenesis
andValidateGenesis
rather than allowing it to override the sum of the balances.Version
Master
Steps to Reproduce
Just set supply in genesis to an incorrect supply.
For Admin Use
The text was updated successfully, but these errors were encountered: