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

Validate genesis params from staking #890

Closed
ebuchman opened this issue Apr 21, 2018 · 2 comments
Closed

Validate genesis params from staking #890

ebuchman opened this issue Apr 21, 2018 · 2 comments

Comments

@ebuchman
Copy link
Member

We need to validate the staking.GenesisState when unmarshalled from the genesis.json or else fill in defaults. Otherwise we easily get panics, for instance if goal_bonded isn't provided, then it defaults to 0, which results in "divide by 0 errors"

@cwgoes cwgoes added this to the 1.0 Code Freeze milestone Apr 27, 2018
@cwgoes
Copy link
Contributor

cwgoes commented May 30, 2018

Perhaps modules which need to enforce these kinds of invariants have a CheckInvariants function, which can be called in this case, whenever we import or manually modify state (especially during software upgrades), and by a gaiad check command for debugging.

@rigelrozanski
Copy link
Contributor

yeah let's have each module define a ValidateGenesis function

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

No branches or pull requests

4 participants