I am working on Substrate-based node upgrades.
I stick to Polkadot releases and start from polkadot-v0.8.25 to the latest versions. While upgrading I need to make sure that I don’t miss any storage migrations. I’ve tried this algorithm:
- Find migration code in the Substrate repository.
- Find the location of the migration execution in the Substrate repository.
- If the execution location isn’t found in the Substrate repository and is found in the Polkadot repository, I consider adding this migration to my node.
But this approach is very time consuming so I’m looking for some optimisations. I’ve checked couple of releases along with a bunch of PRs with “E1-runtimemigration” label and it looks like there are two ways to execute a migration:
- From a pallet itself via onRuntimeUpgrade hook (or some other handlers) and decl_storage!. Looks like I don’t need to execute this type of migration on my own.
- From runtime/polkadot/src/lib.rs -> frame_executive::Executive.
- Can someone confirm that I should care only about the migrations executed from runtime/polkadot/src/lib.rs -> frame_executive::Executive?
- If I am wrong, what are the other places to execute the migrations and how to identify them?