pallet_session_validator_management/migrations/
mod.rs

1//! Implements storage migrations of `pallet-session-validator-management`.
2//!
3//! **Important:** It is crucial to run the migrations when upgrading runtime
4//! to a version containing this pallet's storage version. Failing to do so
5//! WILL break the chain and require a wipe or a rollback.
6//!
7//! To schedule a migration, add it to the `Executive` definition for your
8//! runtime like this:
9//!
10//! ```rust, ignore
11//! pub type Migrations = (
12//! 	pallet_session_validator_management::migrations::v1::LegacyToV1Migration<Runtime>,
13//!     // ...
14//! );
15//! /// Executive: handles dispatch to the various modules.
16//! pub type Executive = frame_executive::Executive<
17//! 	Runtime,
18//! 	Block,
19//! 	ChainContext,
20//! 	Runtime,
21//! 	AllPalletsWithSystem,
22//! 	Migrations,
23//! >;
24//! ```
25//!
26//! Each migration will be run only once, for the storage version for which it is
27//! defined, and will update the storage version number.
28//!
29//! ## V1 (v1.6.0+)
30//!
31//! ### Changes
32//!
33//! This version changes the type used to store committee member information
34//! from a tuple `(T::AuthorityId, T::AuthorityKeys)` to a generic type
35//! `T::CommitteeMember`. This type can be arbitrary within normal
36//! constraints of Substrate runtime types and must implement the
37//! `CommitteeMember` trait. If your runtime uses `authority-selection-inherents`
38//! to select its committee, use the `CommitteeMember` type provided by this crate.
39//! A `CommitteeMember` implementation for the legacy `(T::AuthorityId, T::AuthorityKeys)`
40//! type is also provided and can be used.
41//!
42//! ### Migration from Legacy
43//!
44//! Migration logic is provided by the `migrations::v1::LegacyToV1Migration` migration.
45//! It assumes that the types `T::AuthorityId` and `T::AuthorityKeys` do not change as
46//! part of the same runtime upgrade. The only requirement for the new type
47//! `T::CommitteeMember` is to implement the trait `From<(T::AuthorityId, T::AuthorityKeys)>`.
48
49pub mod v0;
50pub mod v1;