Open
Description
opened on Apr 5, 2022
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
SetUpgradeHandler
to accept theModuleManager
as an argument - Update the
ModuleManager
interface 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. PerhapsValidateState
orValidateGenesisState
. - 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
Activity