Ensure all StorageVersions on Rococo/Westend are correct and migration hooks pass (#7251)

* set fastunstake storage version

* fix configration migration hooks

* set missing rococo versions

* remove child bounties version set

* future proof this configuration migration

* simplify rococo migration

* simplify westend version migration

* typo

* restore missing comments

* set configuration storage version correctly

* remove redundant preupgrade version check

* fix version checks

* remove redundant comment
This commit is contained in:
Liam Aharon
2023-05-23 18:47:27 +10:00
committed by GitHub
parent 2b6f0b0194
commit 418e95d4c8
6 changed files with 118 additions and 22 deletions
+17
View File
@@ -1281,6 +1281,8 @@ pub type Migrations =
/// The runtime migrations per release.
#[allow(deprecated, missing_docs)]
pub mod migrations {
use frame_support::traits::{GetStorageVersion, OnRuntimeUpgrade, StorageVersion};
use super::*;
pub type V0940 = (
@@ -1297,8 +1299,23 @@ pub mod migrations {
pallet_offences::migration::v1::MigrateToV1<Runtime>,
);
/// Migrations that set `StorageVersion`s we missed to set.
pub struct SetStorageVersions;
impl OnRuntimeUpgrade for SetStorageVersions {
fn on_runtime_upgrade() -> Weight {
if FastUnstake::on_chain_storage_version() < 1 {
StorageVersion::new(1).put::<FastUnstake>();
return RocksDbWeight::get().reads_writes(1, 1)
}
RocksDbWeight::get().reads(1)
}
}
/// Unreleased migrations. Add new ones here:
pub type Unreleased = (
SetStorageVersions,
// Remove UMP dispatch queue <https://github.com/paritytech/polkadot/pull/6271>
parachains_configuration::migration::v6::MigrateToV6<Runtime>,
ump_migrations::UpdateUmpLimits,