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

Commit

Permalink
Nomination Pools migration v5: RewardPool fix (#6957)
Browse files Browse the repository at this point in the history
* pools migration v5

* Allow deprecated

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

* Keep old migrations around

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

* update lockfile for {"substrate"}

* use master Cargo.lock

* revert Cargo.lock master

* clippy: remove unused parentheses

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

* Fix parachain config migration

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

* Make tests work

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: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
  • Loading branch information
Ross Bulat and ggwpez authored Mar 27, 2023
1 parent 03ed777 commit cfc9c83
Show file tree
Hide file tree
Showing 7 changed files with 204 additions and 189 deletions.
366 changes: 183 additions & 183 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1475,12 +1475,17 @@ impl Get<Perbill> for NominationPoolsMigrationV4OldPallet {

/// All migrations that will run on the next runtime upgrade.
///
/// Should be cleared after every release.
/// This contains the combined migrations of the last 10 releases. It allows to skip runtime
/// upgrades in case governance decides to do so.
#[allow(deprecated)]
pub type Migrations = (
// 0.9.40
pallet_nomination_pools::migration::v4::MigrateToV4<
Runtime,
NominationPoolsMigrationV4OldPallet,
>,
// Unreleased - add new migrations here:
pallet_nomination_pools::migration::v5::MigrateToV5<Runtime>,
parachains_configuration::migration::v5::MigrateToV5<Runtime>,
);

Expand Down
2 changes: 1 addition & 1 deletion runtime/parachains/src/configuration/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub mod v5 {
fn pre_upgrade() -> Result<Vec<u8>, &'static str> {
log::trace!(target: crate::configuration::LOG_TARGET, "Running pre_upgrade()");

ensure!(StorageVersion::get::<Pallet<T>>() == 3, "The migration requires version 3");
ensure!(StorageVersion::get::<Pallet<T>>() == 4, "The migration requires version 4");
Ok(Vec::new())
}

Expand Down
6 changes: 5 additions & 1 deletion runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1412,12 +1412,16 @@ impl Get<Perbill> for NominationPoolsMigrationV4OldPallet {

/// All migrations that will run on the next runtime upgrade.
///
/// Should be cleared after every release.
/// This contains the combined migrations of the last 10 releases. It allows to skip runtime upgrades in case governance decides to do so.
#[allow(deprecated)]
pub type Migrations = (
// 0.9.40
pallet_nomination_pools::migration::v4::MigrateToV4<
Runtime,
NominationPoolsMigrationV4OldPallet,
>,
// Unreleased - add new migrations here:
pallet_nomination_pools::migration::v5::MigrateToV5<Runtime>,
parachains_configuration::migration::v5::MigrateToV5<Runtime>,
);

Expand Down
3 changes: 2 additions & 1 deletion runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,8 @@ pub type UncheckedExtrinsic =

/// All migrations that will run on the next runtime upgrade.
///
/// Should be cleared after every release.
/// This contains the combined migrations of the last 10 releases. It allows to skip runtime
/// upgrades in case governance decides to do so.
pub type Migrations = parachains_configuration::migration::v5::MigrateToV5<Runtime>;

/// Executive: handles dispatch to the various modules.
Expand Down
2 changes: 1 addition & 1 deletion runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl pallet_indices::Config for Runtime {
}

parameter_types! {
pub storage ExistentialDeposit: Balance = 1 * CENTS;
pub const ExistentialDeposit: Balance = 1 * CENTS;
pub storage MaxLocks: u32 = 50;
pub const MaxReserves: u32 = 50;
}
Expand Down
7 changes: 6 additions & 1 deletion runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,13 +1207,18 @@ impl Get<Perbill> for NominationPoolsMigrationV4OldPallet {

/// All migrations that will run on the next runtime upgrade.
///
/// Should be cleared after every release.
/// This contains the combined migrations of the last 10 releases. It allows to skip runtime
/// upgrades in case governance decides to do so.
#[allow(deprecated)]
pub type Migrations = (
// 0.9.40
clean_state_migration::CleanMigrate,
pallet_nomination_pools::migration::v4::MigrateToV4<
Runtime,
NominationPoolsMigrationV4OldPallet,
>,
// Unreleased - add new migrations here:
pallet_nomination_pools::migration::v5::MigrateToV5<Runtime>,
parachains_configuration::migration::v5::MigrateToV5<Runtime>,
);

Expand Down

0 comments on commit cfc9c83

Please sign in to comment.