You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was checking out module.Manager.RunMigrations to see what happens when new modules are added and created #8988.
When a module is added to a chain during an upgrade, we should probably be calling its InitGenesis method. Modules probably expect that InitGenesis was called at some point and may do some special initialization there even with empty genesis state. Either this should either happen automatically in RunMigrations (with an empty genesis state) or explicitly in the UpgradeHandler with possibly some initial state. What do you think @AmauryM@technicallyty ?
The text was updated successfully, but these errors were encountered:
Calling InitGenesis with empty state iif fromVersion == 0 makes sense to me
If an app developer wants to override that, they can just explicitly set the module's fromVersion to the latest version in the upgrade handler, and call InitGenesis with their own custom genesis.
Calling InitGenesis with empty state iif fromVersion == 0 makes sense to me
If an app developer wants to override that, they can just explicitly set the module's fromVersion to the latest version in the upgrade handler, and call InitGenesis with their own custom genesis.
Makes sense. I like that approach. Let's remember to document that.
I was checking out
module.Manager.RunMigrations
to see what happens when new modules are added and created #8988.When a module is added to a chain during an upgrade, we should probably be calling its
InitGenesis
method. Modules probably expect thatInitGenesis
was called at some point and may do some special initialization there even with empty genesis state. Either this should either happen automatically inRunMigrations
(with an empty genesis state) or explicitly in theUpgradeHandler
with possibly some initial state. What do you think @AmauryM @technicallyty ?The text was updated successfully, but these errors were encountered: