-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Use #[pallet::storage_version] for pallet staking #12728
Conversation
b592459
to
b3b1090
Compare
bot rebase |
…-migration-versioning
Rebased |
|
||
/// Alias to the old storage item for keeping versions. Outdated since v12. | ||
#[storage_alias] | ||
type StorageVersion<T: Config> = StorageValue<Pallet<T>, ObsoleteReleases, ValueQuery>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be scoped in v13?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its used in all migrations prior to v13. May be we should get rid of old migrations (unless you see a reason to keep them) and keep it scoped only in v13?
@@ -60,8 +60,12 @@ pub mod pallet { | |||
|
|||
use super::*; | |||
|
|||
/// The current storage version. | |||
const STORAGE_VERSION: StorageVersion = StorageVersion::new(13); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically we could have started from 0 as well, but whatever :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically yes :). But may be still nice to convey this is the 13th migration. 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheers. has my blessing if try-runtime has been tested once.
In the companion, now there should be a test that runs in CI and checks try-runtime actually https://github.com/paritytech/polkadot/blob/5b844f8aeb47df6275dc5afe7be78cabf18c659a/runtime/polkadot/src/lib.rs#L2418
Please be wary about the migration label, it is important ;) For example, this job is skipped because of the label: https://gitlab.parity.io/parity/mirrors/polkadot/-/jobs/2098421
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 (code-wise; don't know enough to reason about business logic)
bot rebase |
…-migration-versioning
Rebased |
* delete releases * use standard pallet storage version * migrate to standard storage version for staking * not compiling * keep old releases enum around for decoding * fix releases * rename old releases * retriggering ci * fix migration comments * doc update Co-authored-by: parity-processbot <>
* delete releases * use standard pallet storage version * migrate to standard storage version for staking * not compiling * keep old releases enum around for decoding * fix releases * rename old releases * retriggering ci * fix migration comments * doc update Co-authored-by: parity-processbot <>
Changes how staking pallet maintains versioning to the new standard #[pallet::storage_version].
Fixes #12041.
polkadot companion: paritytech/polkadot#6365.