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"
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.
yeah let's have each module define a ValidateGenesis function
Most helpful comment
yeah let's have each module define a
ValidateGenesisfunction