Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calamari: Migrate all pallets from PalletVersion to StorageVersion #460

Closed
Garandor opened this issue Mar 25, 2022 · 1 comment · Fixed by #726
Closed

Calamari: Migrate all pallets from PalletVersion to StorageVersion #460

Garandor opened this issue Mar 25, 2022 · 1 comment · Fixed by #726
Assignees
Labels
A-calamari Area: Issues and PRs related to the Calamari Runtime A-runtime Area: Issues and PRs related to Runtimes P-low Priority: Low
Milestone

Comments

@Garandor
Copy link
Contributor

Garandor commented Mar 25, 2022

Parity introduced a new versioning mechanism for its pallets, whereas it now has a (purely numeric) StorageVersion.
paritytech/substrate#9165

The pallets must be migrated to use the new mechanism and parity has created a helper function to do so:
https://paritytech.github.io/substrate/master/frame_support/migrations/fn.migrate_from_pallet_version_to_storage_version.html

ATTN: Instead of migrating the old PalletVersion number, parity's migration helper hard sets the storage version to whatever is set to be the StorageVersion in current code ( instead of what is on the chain )
-> let version = <T as GetStorageVersion>::current_storage_version();
Care must be taken to ensure that all migrations were applied to the pallets before this migration is executed

This must be applied during one of the next runtime upgrades and we should adapt our own pallets to use the same mechansim as well

@Garandor Garandor added A-calamari Area: Issues and PRs related to the Calamari Runtime A-runtime Area: Issues and PRs related to Runtimes P-low Priority: Low labels Mar 25, 2022
@Garandor Garandor mentioned this issue Jun 9, 2022
10 tasks
@Garandor Garandor added this to the v3.2.1 milestone Jun 9, 2022
@Garandor Garandor self-assigned this Jun 14, 2022
@Garandor Garandor modified the milestones: v3.2.1, Future Jul 5, 2022
@Garandor Garandor modified the milestones: Future, v3.3.0 Jul 14, 2022
@flame4
Copy link
Contributor

flame4 commented Jul 26, 2022

Here append a official storage migration tracking doc by alex: https://github.com/apopiak/substrate-migrations

@ghzlatarev ghzlatarev linked a pull request Aug 3, 2022 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-calamari Area: Issues and PRs related to the Calamari Runtime A-runtime Area: Issues and PRs related to Runtimes P-low Priority: Low
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants