Remove Executed Migrations (#7495)

* Polkadot is at .42

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Kusama is on .43

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Westend is at .43

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Rococo is at .42

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make UMP limits migration more idempotentish

Already 100% idempotent per design, but not it wont try to schedule
an unneeded upgrade. Note that the case that the new upgrade is
already scheduled is not checked. In that case it will still upgrade
the same thing again, but should be no problem.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Clippy

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Delete old migration code

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove old tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Polkadot is at .43

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove a ton of shit

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove more

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove unused code

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Rococo is NOT yet at .43, but remove anyway

Rococo is the only runtime that is not yet at .43, but keeping
the migration code just for it is not worth it since devops
can just apply it at any time.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove old test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
This commit is contained in:
Oliver Tale-Yazdi
2023-07-19 13:04:11 +02:00
committed by GitHub
parent a1eadbff3b
commit 3bbb336ea7
14 changed files with 7 additions and 1340 deletions
+1 -69
View File
@@ -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 = (
@@ -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.
-8
View File
@@ -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()
);
}