-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
Description
Summary
It's technically possible to have an on-chain upgrade with invalid genesis state that would result in a functional network.
Consider the upcoming Hub's Theta upgrade. This upgrade includes an SDK version bump to 0.45 which has x/bank metadata changes. Assuming the developers are unaware of these changes and what would constitute a valid state, then it's completely possible to miss setting the correct and expected metadata for assets.
However, the upgrade and network will still "work" in this particular case.
Proposal
My proposal is simple, require that the SetUpgradeHandler method in x/upgrade calls ValidateGenesis after executing the upgrade closure function.
- Update
SetUpgradeHandlerto accept theModuleManageras an argument - Update the
ModuleManagerinterface to have a method that validates genesis state. There already is one but that only works on raw data. We need a method to call on already existing data in state. PerhapsValidateStateorValidateGenesisState. - Call the method in (2) after the closure function is called in
SetUpgradeHandler.
For Admin Use
- Not duplicate issue
- Appropriate labels applied
- Appropriate contributors tagged
- Contributor assigned/self-assigned