Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Remove Executed Migrations #7495

Merged
merged 17 commits into from
Jul 19, 2023
1 change: 0 additions & 1 deletion runtime/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub mod impls;
pub mod paras_registrar;
pub mod paras_sudo_wrapper;
pub mod purchase;
pub mod session;
pub mod slot_range;
pub mod slots;
pub mod traits;
Expand Down
70 changes: 0 additions & 70 deletions runtime/common/src/session/migration.rs

This file was deleted.

17 changes: 0 additions & 17 deletions runtime/common/src/session/mod.rs

This file was deleted.

70 changes: 1 addition & 69 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1521,40 +1521,12 @@ impl Get<Perbill> for NominationPoolsMigrationV4OldPallet {
///
/// This contains the combined migrations of the last 10 releases. It allows to skip runtime
/// upgrades in case governance decides to do so. THE ORDER IS IMPORTANT.
pub type Migrations = (
migrations::V0940,
migrations::V0941,
migrations::V0942,
migrations::V0943,
migrations::Unreleased,
);
pub type Migrations = (migrations::Unreleased,);

/// The runtime migrations per release.
#[allow(deprecated, missing_docs)]
pub mod migrations {
use super::*;
use frame_support::traits::{GetStorageVersion, OnRuntimeUpgrade, StorageVersion};

pub type V0940 = (
pallet_nomination_pools::migration::v4::MigrateToV4<
Runtime,
NominationPoolsMigrationV4OldPallet,
>,
pallet_nomination_pools::migration::v5::MigrateToV5<Runtime>,
);
pub type V0941 = (); // Node only release - no migrations.
pub type V0942 = (
parachains_configuration::migration::v5::MigrateToV5<Runtime>,
pallet_offences::migration::v1::MigrateToV1<Runtime>,
runtime_common::session::migration::ClearOldSessionStorage<Runtime>,
);

pub type V0943 = (
SetStorageVersions,
// Remove UMP dispatch queue <https://github.com/paritytech/polkadot/pull/6271>
parachains_configuration::migration::v6::MigrateToV6<Runtime>,
ump_migrations::UpdateUmpLimits,
);

/// Unreleased migrations. Add new ones here:
pub type Unreleased = (
Expand All @@ -1567,46 +1539,6 @@ pub mod migrations {
pallet_im_online::migration::v1::Migration<Runtime>,
parachains_configuration::migration::v7::MigrateToV7<Runtime>,
);

/// Migrations that set `StorageVersion`s we missed to set.
pub struct SetStorageVersions;

impl OnRuntimeUpgrade for SetStorageVersions {
fn on_runtime_upgrade() -> Weight {
// The `NisCounterpartBalances` pallet was added to the chain after/with the migration.
// So, the migration never needed to be executed, but we also did not set the proper `StorageVersion`.
let storage_version = NisCounterpartBalances::on_chain_storage_version();
if storage_version < 1 {
StorageVersion::new(1).put::<NisCounterpartBalances>();
}

// Was missed as part of: `runtime_common::session::migration::ClearOldSessionStorage<Runtime>`.
let storage_version = Historical::on_chain_storage_version();
if storage_version < 1 {
StorageVersion::new(1).put::<Historical>();
}

RocksDbWeight::get().reads_writes(2, 2)
}
}
}

/// Helpers to configure the ump migrations.
pub mod ump_migrations {
use runtime_parachains::configuration::migration_ump;

pub const MAX_UPWARD_QUEUE_SIZE: u32 = 4 * 1024 * 1024;
pub const MAX_UPWARD_QUEUE_COUNT: u32 = 699050;
pub const MAX_UPWARD_MESSAGE_SIZE: u32 = (1 << 16) - 5; // Checked in test `max_upward_message_size`.
pub const MAX_UPWARD_MESSAGE_NUM_PER_CANDIDATE: u32 = 128;

pub type UpdateUmpLimits = migration_ump::latest::ScheduleConfigUpdate<
super::Runtime,
MAX_UPWARD_QUEUE_SIZE,
MAX_UPWARD_QUEUE_COUNT,
MAX_UPWARD_MESSAGE_SIZE,
MAX_UPWARD_MESSAGE_NUM_PER_CANDIDATE,
>;
}

/// Unchecked extrinsic type as expected by this runtime.
Expand Down
8 changes: 0 additions & 8 deletions runtime/kusama/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,3 @@ fn nominator_limit() {
fn call_size() {
RuntimeCall::assert_size_under(230);
}

#[test]
fn max_upward_message_size() {
assert_eq!(
ump_migrations::MAX_UPWARD_MESSAGE_SIZE,
pallet_message_queue::MaxMessageLenOf::<Runtime>::get()
);
}
1 change: 0 additions & 1 deletion runtime/parachains/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ mod tests;
mod benchmarking;

pub mod migration;
pub mod migration_ump;

pub use pallet::*;

Expand Down
3 changes: 0 additions & 3 deletions runtime/parachains/src/configuration/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,5 @@

//! A module that is responsible for migration of storage.

use primitives::ExecutorParams;

pub mod v5;
pub mod v6;
pub mod v7;
Loading