2

I've noticed that some of the frame pallets have migrations and others don't, so I was just wondering if all the required migrations are implemented by the frame pallets, or if it depends on the pallet? Also, is there anything that a chain using these pallets needs to do to make sure the migrations run and storage upgrades are performed correctly?

Thanks,

1 Answer 1

1

This depends on how it is used.

For instance, there are situations where you may require additional data information that cannot be configured at runtime. Take Polkadot's case of appointing Alice as their council member. It would not be advisable to include such logic in the pallet, as it would impact all downstream projects.

I don't think there is a guaranteed way to ensure the success of the migration. However, there are measures that can increase its chances. You can refer to this link (https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/scheduler/src/migration.rs) where they use StorageVersion to track the migration version for handling multiple migrations in this pallet. Additionally, you can check out this link (https://github.com/paritytech/try-runtime-cli). It's always recommended to try running it before actually performing the runtime upgrade on your chain as it simulates the migration and allows you to verify the results, helping you write accurate migration code.

1
  • Thank you! So really to be sure you would need to check each pallet for storage changes and make sure does are accounted for in the migration logic, and if not implement the migration logic yourself, correct? Is there any place where storage changes are documented?
    – Sebastian
    Nov 8, 2023 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.