2

From my understanding how the runtime store its state adding an extra storage variable like

  pub Verified (get fn is_verified): map hasher(blake2_128_concat) us64 => ();

to a pallet that already has storage state like

  pub Member (get fn membership_info): map hasher(blake2_128_concat) u64 => Member;

With Member being say a struct containing various fields.

This Should Not require a runtime upgrade. But if I decide to add a boolean flag to the Member data structure then a runtime upgrade is required. Am I correct in all of this?

1 Answer 1

2

Yes you are correct.

Adding new storage types do not require any migrations. However, they are also not present in the storage. So, if you require that a storage item is set to a certain value, you need a migration to initialize the value.

If you are changing the Member struct by adding or removing a value, you are changing its encoded format and require a migration to fix up all storage items.

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.