substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Improve handling of unset `StorageVersion`

Open bkchr opened this issue 2 years ago • 1 comments

When a user is forgetting to set the storage version in a pallet and calls current_storage_version to compare it against the on_chain_storage_version it will now fail to compile the code. Before the pallet macro just returned StorageVersion::default() for current_storage_version leading to potential issues with migrations. Besides that it also checks in post_upgrade that the pallet storage version was upgraded and thus, no migration was missed.

Closes: https://github.com/paritytech/substrate/issues/13062

bkchr avatar Feb 19 '23 22:02 bkchr

Ouch… https://substrate.stackexchange.com/questions/7396
Can we merge this soon please?

ggwpez avatar Feb 28 '23 16:02 ggwpez

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 06 '23 15:04 stale[bot]

It works now on Polkadot. Did we fix that version mismatch in pallet Historical?

ggwpez avatar Apr 28 '23 10:04 ggwpez

It works now on Polkadot. Did we fix that version mismatch in pallet Historical?

Good point. Should have been done as part of https://github.com/paritytech/polkadot/commit/ccffb736933e21829945d0a1ea662edeef7324e8

@gupnik could you please open a pr for your migration to set the storage version to 1 as well?

bkchr avatar Apr 29 '23 10:04 bkchr

bot rebase

bkchr avatar May 04 '23 10:05 bkchr

Rebased