From bfa48c4e921816fc4607a1b4e82d32af4493e3ac Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Fri, 2 Oct 2020 16:03:11 +0200 Subject: [PATCH 1/3] Remove stale upgrades --- runtime/kusama/src/lib.rs | 29 +---------------------------- runtime/polkadot/src/lib.rs | 31 +------------------------------ runtime/westend/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 59 deletions(-) diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index d35445d4954f..ae41fb731ba0 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -897,34 +897,7 @@ impl pallet_proxy::Trait for Runtime { pub struct CustomOnRuntimeUpgrade; impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { fn on_runtime_upgrade() -> frame_support::weights::Weight { - // Update scheduler origin usage - #[derive(Encode, Decode)] - #[allow(non_camel_case_types)] - pub enum OldOriginCaller { - system(frame_system::Origin), - pallet_collective_Instance1( - pallet_collective::Origin - ), - pallet_collective_Instance2( - pallet_collective::Origin - ), - } - - impl Into for OldOriginCaller { - fn into(self) -> OriginCaller { - match self { - OldOriginCaller::system(o) => OriginCaller::system(o), - OldOriginCaller::pallet_collective_Instance1(o) => - OriginCaller::pallet_collective_Instance1(o), - OldOriginCaller::pallet_collective_Instance2(o) => - OriginCaller::pallet_collective_Instance2(o), - } - } - } - - pallet_scheduler::Module::::migrate_origin::(); - - ::MaximumBlockWeight::get() + 0 } } diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index de2c774aa2b8..4e293335cc07 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -902,36 +902,7 @@ impl pallet_proxy::Trait for Runtime { pub struct CustomOnRuntimeUpgrade; impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { fn on_runtime_upgrade() -> frame_support::weights::Weight { - purchase::remove_pallet::(); - - // Update scheduler origin usage - #[derive(Encode, Decode)] - #[allow(non_camel_case_types)] - pub enum OldOriginCaller { - system(frame_system::Origin), - pallet_collective_Instance1( - pallet_collective::Origin - ), - pallet_collective_Instance2( - pallet_collective::Origin - ), - } - - impl Into for OldOriginCaller { - fn into(self) -> OriginCaller { - match self { - OldOriginCaller::system(o) => OriginCaller::system(o), - OldOriginCaller::pallet_collective_Instance1(o) => - OriginCaller::pallet_collective_Instance1(o), - OldOriginCaller::pallet_collective_Instance2(o) => - OriginCaller::pallet_collective_Instance2(o), - } - } - } - - pallet_scheduler::Module::::migrate_origin::(); - - ::MaximumBlockWeight::get() + 0 } } diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 7d74b1900969..8f477d8e2252 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -741,7 +741,7 @@ pub type SignedPayload = generic::SignedPayload; pub struct CustomOnRuntimeUpgrade; impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { fn on_runtime_upgrade() -> frame_support::weights::Weight { - purchase::remove_pallet::() + 0 } } From 45c912e49b8d7fc604dabcb1637d897ef6a5dc15 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Fri, 2 Oct 2020 16:19:37 +0200 Subject: [PATCH 2/3] add back origin migration --- runtime/kusama/src/lib.rs | 29 ++++++++++++++++++++++++++++- runtime/polkadot/src/lib.rs | 29 ++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index ae41fb731ba0..d35445d4954f 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -897,7 +897,34 @@ impl pallet_proxy::Trait for Runtime { pub struct CustomOnRuntimeUpgrade; impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { fn on_runtime_upgrade() -> frame_support::weights::Weight { - 0 + // Update scheduler origin usage + #[derive(Encode, Decode)] + #[allow(non_camel_case_types)] + pub enum OldOriginCaller { + system(frame_system::Origin), + pallet_collective_Instance1( + pallet_collective::Origin + ), + pallet_collective_Instance2( + pallet_collective::Origin + ), + } + + impl Into for OldOriginCaller { + fn into(self) -> OriginCaller { + match self { + OldOriginCaller::system(o) => OriginCaller::system(o), + OldOriginCaller::pallet_collective_Instance1(o) => + OriginCaller::pallet_collective_Instance1(o), + OldOriginCaller::pallet_collective_Instance2(o) => + OriginCaller::pallet_collective_Instance2(o), + } + } + } + + pallet_scheduler::Module::::migrate_origin::(); + + ::MaximumBlockWeight::get() } } diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 4e293335cc07..dbdc397ac8c1 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -902,7 +902,34 @@ impl pallet_proxy::Trait for Runtime { pub struct CustomOnRuntimeUpgrade; impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { fn on_runtime_upgrade() -> frame_support::weights::Weight { - 0 + // Update scheduler origin usage + #[derive(Encode, Decode)] + #[allow(non_camel_case_types)] + pub enum OldOriginCaller { + system(frame_system::Origin), + pallet_collective_Instance1( + pallet_collective::Origin + ), + pallet_collective_Instance2( + pallet_collective::Origin + ), + } + + impl Into for OldOriginCaller { + fn into(self) -> OriginCaller { + match self { + OldOriginCaller::system(o) => OriginCaller::system(o), + OldOriginCaller::pallet_collective_Instance1(o) => + OriginCaller::pallet_collective_Instance1(o), + OldOriginCaller::pallet_collective_Instance2(o) => + OriginCaller::pallet_collective_Instance2(o), + } + } + } + + pallet_scheduler::Module::::migrate_origin::(); + + ::MaximumBlockWeight::get() } } From 29d25edb34413331f674c7d897207da44c6d9b76 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Fri, 2 Oct 2020 16:20:54 +0200 Subject: [PATCH 3/3] remove unused --- runtime/polkadot/src/lib.rs | 2 +- runtime/westend/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index dbdc397ac8c1..dd54513fdfd9 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -25,7 +25,7 @@ use runtime_common::{ impls::{CurrencyToVoteHandler, ToAuthor}, NegativeImbalance, BlockHashCount, MaximumBlockWeight, AvailableBlockRatio, MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, - MaximumExtrinsicWeight, purchase, ParachainSessionKeyPlaceholder, + MaximumExtrinsicWeight, ParachainSessionKeyPlaceholder, }; use sp_std::prelude::*; diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 8f477d8e2252..57ac1542d159 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -28,7 +28,7 @@ use primitives::v1::{ CommittedCandidateReceipt, PersistedValidationData, GroupRotationInfo, ValidationCode, }; use runtime_common::{ - purchase, SlowAdjustingFeeUpdate, + SlowAdjustingFeeUpdate, impls::{CurrencyToVoteHandler, ToAuthor}, BlockHashCount, MaximumBlockWeight, AvailableBlockRatio, MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, MaximumExtrinsicWeight,