1

Do I need to run a pallet storage migrations even when I'm just adding the pallet to the runtime for the first time?

This question came up because while testing the upgrade using the try-runtime cli, for pallets that where recently added but the storage version is greater than zero I get the following error On chain storage version StorageVersion(0) doesn't match current storage version StorageVersion(4).

Thanks

1 Answer 1

2

It varies depending on the pallet. For certain pallets, you must configure the genesis data.

If there is no genesis data that needs to be set, you can disregard the migration and manually set the storage version.

Refer to https://github.com/darwinia-network/darwinia/blame/96d48b943b903e941132b7fbb69a7c40cfd4573a/runtime/crab/src/migration.rs#L47-L51 for more information.

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.