Improve handling of unset `StorageVersion`
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
Ouch… https://substrate.stackexchange.com/questions/7396
Can we merge this soon please?
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.
It works now on Polkadot. Did we fix that version mismatch in pallet Historical?
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?
bot rebase
Rebased