diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs index 1e166e66d12f8..d5507aebc0353 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs @@ -185,6 +185,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type SingleBlockMigrations = Migrations; } impl cumulus_pallet_weight_reclaim::Config for Runtime { @@ -1236,7 +1237,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; #[cfg(feature = "runtime-benchmarks")] diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 53d13d57a6679..f707e83be1ac5 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -200,6 +200,7 @@ impl frame_system::Config for Runtime { type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; type MultiBlockMigrator = MultiBlockMigrations; + type SingleBlockMigrations = Migrations; } impl cumulus_pallet_weight_reclaim::Config for Runtime { @@ -1571,7 +1572,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; #[cfg(feature = "runtime-benchmarks")] diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index af2398fde74bb..545473565810b 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -239,7 +239,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; impl_opaque_keys! { @@ -324,6 +323,7 @@ impl frame_system::Config for Runtime { /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type SingleBlockMigrations = Migrations; } impl cumulus_pallet_weight_reclaim::Config for Runtime { diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs index 55cbfe8e84cdb..88f49f47949c6 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs @@ -229,7 +229,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; impl_opaque_keys! { @@ -314,6 +313,7 @@ impl frame_system::Config for Runtime { /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type SingleBlockMigrations = Migrations; } impl cumulus_pallet_weight_reclaim::Config for Runtime { diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs index efc6867e9ba83..a4983f96e55fb 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs @@ -192,6 +192,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type SingleBlockMigrations = Migrations; } impl cumulus_pallet_weight_reclaim::Config for Runtime { @@ -808,7 +809,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; #[cfg(feature = "runtime-benchmarks")] diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs index ad9748bd1960b..dedf3532c7877 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs @@ -145,7 +145,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; impl_opaque_keys! { @@ -228,6 +227,7 @@ impl frame_system::Config for Runtime { /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = ConstU32<16>; + type SingleBlockMigrations = Migrations; } impl cumulus_pallet_weight_reclaim::Config for Runtime { diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs b/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs index de1af39c20da8..53fae462c0ed0 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs @@ -145,7 +145,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; impl_opaque_keys! { @@ -228,6 +227,7 @@ impl frame_system::Config for Runtime { /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = ConstU32<16>; + type SingleBlockMigrations = Migrations; } impl cumulus_pallet_weight_reclaim::Config for Runtime { diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs index 57120f1e3af98..5be85498ab439 100644 --- a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs @@ -132,7 +132,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; impl_opaque_keys! { @@ -203,6 +202,7 @@ impl frame_system::Config for Runtime { type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = ConstU32<16>; type MultiBlockMigrator = MultiBlockMigrations; + type SingleBlockMigrations = Migrations; } impl cumulus_pallet_weight_reclaim::Config for Runtime { diff --git a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs index 99745186e788b..f08f2db83fd01 100644 --- a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs @@ -135,7 +135,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; impl_opaque_keys! { @@ -206,6 +205,7 @@ impl frame_system::Config for Runtime { type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = ConstU32<16>; type MultiBlockMigrator = MultiBlockMigrations; + type SingleBlockMigrations = Migrations; } impl cumulus_pallet_weight_reclaim::Config for Runtime { diff --git a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs index 6ef89faac7d64..17795f5f95c3a 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs @@ -193,7 +193,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; /// Handles converting a weight scalar to a fee value, based on the scale and granularity of the @@ -395,6 +394,7 @@ impl frame_system::Config for Runtime { /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type SingleBlockMigrations = Migrations; } impl pallet_timestamp::Config for Runtime { diff --git a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs index e4e37a876e064..4eab1261a0780 100644 --- a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -226,6 +226,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type SingleBlockMigrations = RemoveCollectiveFlip; } impl cumulus_pallet_weight_reclaim::Config for Runtime { @@ -694,7 +695,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - RemoveCollectiveFlip, >; pub struct RemoveCollectiveFlip; diff --git a/cumulus/parachains/runtimes/testing/yet-another-parachain/src/lib.rs b/cumulus/parachains/runtimes/testing/yet-another-parachain/src/lib.rs index 2fdfbbd07b0a1..40be27f4aee4a 100644 --- a/cumulus/parachains/runtimes/testing/yet-another-parachain/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/yet-another-parachain/src/lib.rs @@ -214,6 +214,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type SingleBlockMigrations = RemoveCollectiveFlip; } impl cumulus_pallet_weight_reclaim::Config for Runtime { @@ -488,7 +489,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - RemoveCollectiveFlip, >; pub struct RemoveCollectiveFlip; diff --git a/cumulus/test/runtime/src/lib.rs b/cumulus/test/runtime/src/lib.rs index 40226df701903..501b994098fbf 100644 --- a/cumulus/test/runtime/src/lib.rs +++ b/cumulus/test/runtime/src/lib.rs @@ -276,6 +276,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type SingleBlockMigrations = TestOnRuntimeUpgrade; } impl cumulus_pallet_weight_reclaim::Config for Runtime { @@ -463,7 +464,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - TestOnRuntimeUpgrade, >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; diff --git a/docs/sdk/src/reference_docs/frame_runtime_upgrades_and_migrations.rs b/docs/sdk/src/reference_docs/frame_runtime_upgrades_and_migrations.rs index 065cbee25709b..3c0c79aff3892 100644 --- a/docs/sdk/src/reference_docs/frame_runtime_upgrades_and_migrations.rs +++ b/docs/sdk/src/reference_docs/frame_runtime_upgrades_and_migrations.rs @@ -59,8 +59,8 @@ //! //! ### Scheduling the Single Block Migrations to Run Next Runtime Upgrade //! -//! Schedule migrations to run next runtime upgrade passing them as a generic parameter to your -//! [`Executive`](frame_executive) pallet: +//! Schedule migrations to run next runtime upgrade passing them as a parameter to your +//! [`Config`](frame_system) pallet: //! //! ```ignore //! /// Tuple of migrations (structs that implement `OnRuntimeUpgrade`) @@ -69,14 +69,9 @@ //! MyCustomMigration, //! // ...more migrations here //! ); -//! pub type Executive = frame_executive::Executive< -//! Runtime, -//! Block, -//! frame_system::ChainContext, -//! Runtime, -//! AllPalletsWithSystem, -//! Migrations, // <-- pass your migrations to Executive here -//! >; +//! impl frame_system::Config for Runtime { +//! type SingleBlockMigrations = Migrations; +//! } //! ``` //! //! ### Ensuring Single Block Migration Safety diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index e1bda9195fdee..586b989075ce1 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -235,6 +235,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type MaxConsumers = frame_support::traits::ConstU32<16>; type MultiBlockMigrator = MultiBlockMigrations; + type SingleBlockMigrations = Migrations; } parameter_types! { @@ -1807,7 +1808,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 1156f14502aa5..4d3eeab7d0f4f 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -225,6 +225,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type MaxConsumers = frame_support::traits::ConstU32<16>; type MultiBlockMigrator = MultiBlockMigrations; + type SingleBlockMigrations = Migrations; } parameter_types! { @@ -2104,7 +2105,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; diff --git a/prdoc/pr_9638.prdoc b/prdoc/pr_9638.prdoc new file mode 100644 index 0000000000000..e4b3cc2ea71d2 --- /dev/null +++ b/prdoc/pr_9638.prdoc @@ -0,0 +1,39 @@ +title: Deprecate `OnRuntimeUpgrade` parameter in `frame_executive::Executive` struct. +doc: +- audience: Runtime Dev + description: |- + Deprecate `OnRuntimeUpgrade` parameter in `frame_executive::Executive` struct. + +crates: +- name: frame-executive + bump: major +- name: frame-support + bump: patch +- name: westend-runtime + bump: patch +- name: rococo-runtime + bump: patch +- name: asset-hub-rococo-runtime + bump: patch +- name: asset-hub-westend-runtime + bump: patch +- name: bridge-hub-rococo-runtime + bump: patch +- name: bridge-hub-westend-runtime + bump: patch +- name: collectives-westend-runtime + bump: patch +- name: coretime-rococo-runtime + bump: patch +- name: coretime-westend-runtime + bump: patch +- name: people-rococo-runtime + bump: patch +- name: people-westend-runtime + bump: patch +- name: penpal-runtime + bump: patch +- name: rococo-parachain-runtime + bump: patch +- name: yet-another-parachain-runtime + bump: patch \ No newline at end of file diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index f03eebeeecc3c..90e4a069f72cc 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -364,6 +364,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = ConstU16<42>; type MaxConsumers = ConstU32<16>; type MultiBlockMigrator = MultiBlockMigrations; + type SingleBlockMigrations = Migrations; } impl pallet_insecure_randomness_collective_flip::Config for Runtime {} @@ -2874,7 +2875,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; // We don't have a limit in the Relay Chain. diff --git a/substrate/frame/executive/README.md b/substrate/frame/executive/README.md index 6151232ecaf1b..1ae88c0264079 100644 --- a/substrate/frame/executive/README.md +++ b/substrate/frame/executive/README.md @@ -44,28 +44,4 @@ pub type Executive = executive::Executive< >; ``` -### Custom `OnRuntimeUpgrade` logic - -You can add custom logic that should be called in your runtime on a runtime upgrade. This is done by setting an optional -generic parameter. The custom logic will be called before the on runtime upgrade logic of all modules is called. - -```rust -struct CustomOnRuntimeUpgrade; -impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - // Do whatever you want. - frame_support::weights::Weight::zero() - } -} - -pub type Executive = executive::Executive< - Runtime, - Block, - Context, - Runtime, - AllPalletsWithSystem, - CustomOnRuntimeUpgrade, ->; -``` - License: Apache-2.0 diff --git a/substrate/frame/executive/src/lib.rs b/substrate/frame/executive/src/lib.rs index ac25bd573c3eb..5f05400896e64 100644 --- a/substrate/frame/executive/src/lib.rs +++ b/substrate/frame/executive/src/lib.rs @@ -79,44 +79,6 @@ //! /// Executive: handles dispatch to the various modules. //! pub type Executive = executive::Executive; //! ``` -//! -//! ### Custom `OnRuntimeUpgrade` logic -//! -//! You can add custom logic that should be called in your runtime on a runtime upgrade. This is -//! done by setting an optional generic parameter. The custom logic will be called before -//! the on runtime upgrade logic of all modules is called. -//! -//! ``` -//! # use sp_runtime::generic; -//! # use frame_executive as executive; -//! # pub struct UncheckedExtrinsic {}; -//! # pub struct Header {}; -//! # type Context = frame_system::ChainContext; -//! # pub type Block = generic::Block; -//! # pub type Balances = u64; -//! # pub type AllPalletsWithSystem = u64; -//! # pub enum Runtime {}; -//! # use sp_runtime::transaction_validity::{ -//! # TransactionValidity, UnknownTransaction, TransactionSource, -//! # }; -//! # use sp_runtime::traits::ValidateUnsigned; -//! # impl ValidateUnsigned for Runtime { -//! # type Call = (); -//! # -//! # fn validate_unsigned(_source: TransactionSource, _call: &Self::Call) -> TransactionValidity { -//! # UnknownTransaction::NoUnsignedValidator.into() -//! # } -//! # } -//! struct CustomOnRuntimeUpgrade; -//! impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { -//! fn on_runtime_upgrade() -> frame_support::weights::Weight { -//! // Do whatever you want. -//! frame_support::weights::Weight::zero() -//! } -//! } -//! -//! pub type Executive = executive::Executive; -//! ``` #[cfg(doc)] #[cfg_attr(doc, aquamarine::aquamarine)] @@ -230,15 +192,19 @@ impl core::fmt::Debug for ExecutiveError { /// - `UnsignedValidator`: The unsigned transaction validator of the runtime. /// - `AllPalletsWithSystem`: Tuple that contains all pallets including frame system pallet. Will be /// used to call hooks e.g. `on_initialize`. -/// - `OnRuntimeUpgrade`: Custom logic that should be called after a runtime upgrade. Modules are -/// already called by `AllPalletsWithSystem`. It will be called before all modules will be called. +/// - [**DEPRECATED** `OnRuntimeUpgrade`]: This parameter is deprecated and will be removed after +/// September 2026. Use type `SingleBlockMigrations` in frame_system::Config instead. +#[allow(deprecated)] pub struct Executive< System, Block, Context, UnsignedValidator, AllPalletsWithSystem, - OnRuntimeUpgrade = (), + #[deprecated( + note = "`OnRuntimeUpgrade` parameter in Executive is deprecated, will be removed after September 2026. \ + Use type `SingleBlockMigrations` in frame_system::Config instead." + )] OnRuntimeUpgrade = (), >( PhantomData<( System, @@ -250,6 +216,10 @@ pub struct Executive< )>, ); +/// TODO: The `OnRuntimeUpgrade` generic parameter in `Executive` is deprecated and will be +/// removed in a future version. Once removed, this `#[allow(deprecated)]` attribute +/// can be safely deleted. +#[allow(deprecated)] impl< System: frame_system::Config + IsInherent, Block: traits::Block< @@ -288,6 +258,10 @@ where } } +/// TODO: The `OnRuntimeUpgrade` generic parameter in `Executive` is deprecated and will be +/// removed in a future version. Once removed, this `#[allow(deprecated)]` attribute +/// can be safely deleted. +#[allow(deprecated)] #[cfg(feature = "try-runtime")] impl< System: frame_system::Config + IsInherent, @@ -493,6 +467,10 @@ where } } +/// TODO: The `OnRuntimeUpgrade` generic parameter in `Executive` is deprecated and will be +/// removed in a future version. Once removed, this `#[allow(deprecated)]` attribute +/// can be safely deleted. +#[allow(deprecated)] impl< System: frame_system::Config + IsInherent, Block: traits::Block< diff --git a/substrate/frame/executive/src/tests.rs b/substrate/frame/executive/src/tests.rs index 6863aa1a4fc1d..268a7472a51c9 100644 --- a/substrate/frame/executive/src/tests.rs +++ b/substrate/frame/executive/src/tests.rs @@ -501,6 +501,10 @@ impl OnRuntimeUpgrade for CustomOnRuntimeUpgrade { } } +/// TODO: The `OnRuntimeUpgrade` generic parameter in `Executive` is deprecated and will be +/// removed in a future version. Once removed, this `#[allow(deprecated)]` attribute +/// can be safely deleted. +#[allow(deprecated)] type Executive = super::Executive< Runtime, Block, diff --git a/substrate/frame/staking-async/runtimes/parachain/src/lib.rs b/substrate/frame/staking-async/runtimes/parachain/src/lib.rs index 9a597c2de584e..4a6084c62ef80 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/lib.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/lib.rs @@ -188,6 +188,7 @@ impl frame_system::Config for Runtime { type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; type MultiBlockMigrator = MultiBlockMigrations; + type SingleBlockMigrations = Migrations; } impl cumulus_pallet_weight_reclaim::Config for Runtime { @@ -1244,7 +1245,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; #[cfg(feature = "runtime-benchmarks")] diff --git a/substrate/frame/staking-async/runtimes/rc/src/lib.rs b/substrate/frame/staking-async/runtimes/rc/src/lib.rs index 52c1beb89cbfe..c7136f81e8338 100644 --- a/substrate/frame/staking-async/runtimes/rc/src/lib.rs +++ b/substrate/frame/staking-async/runtimes/rc/src/lib.rs @@ -270,6 +270,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type MaxConsumers = frame_support::traits::ConstU32<16>; type MultiBlockMigrator = MultiBlockMigrations; + type SingleBlockMigrations = Migrations; } parameter_types! { @@ -2052,7 +2053,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - Migrations, >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; diff --git a/substrate/frame/support/src/migrations.rs b/substrate/frame/support/src/migrations.rs index 3fdf8d6edc958..b001a003d0131 100644 --- a/substrate/frame/support/src/migrations.rs +++ b/substrate/frame/support/src/migrations.rs @@ -299,13 +299,9 @@ pub fn migrate_from_pallet_version_to_storage_version< /// AnyOtherMigrations... /// ); /// -/// pub type Executive = frame_executive::Executive< -/// Runtime, -/// Block, -/// frame_system::ChainContext, -/// Runtime, -/// Migrations -/// >; +/// impl frame_system::Config for Runtime { +/// type SingleBlockMigrations = Migrations; +/// } /// ``` /// /// WARNING: `RemovePallet` has no guard rails preventing it from bricking the chain if the @@ -410,13 +406,9 @@ impl, DbWeight: Get> frame_support::traits /// AnyOtherMigrations... /// ); /// -/// pub type Executive = frame_executive::Executive< -/// Runtime, -/// Block, -/// frame_system::ChainContext, -/// Runtime, -/// Migrations -/// >; +/// impl frame_system::Config for Runtime { +/// type SingleBlockMigrations = Migrations; +/// } /// ``` /// /// WARNING: `RemoveStorage` has no guard rails preventing it from bricking the chain if the diff --git a/substrate/frame/support/test/tests/pallet.rs b/substrate/frame/support/test/tests/pallet.rs index 7de37f1c98150..ff6c5b85e8759 100644 --- a/substrate/frame/support/test/tests/pallet.rs +++ b/substrate/frame/support/test/tests/pallet.rs @@ -2410,6 +2410,10 @@ fn post_runtime_upgrade_detects_storage_version_issues() { AllPalletsWithSystem, >; + /// TODO: The `OnRuntimeUpgrade` generic parameter in `Executive` is deprecated and will be + /// removed in a future version. Once removed, this `#[allow(deprecated)]` attribute + /// can be safely deleted. + #[allow(deprecated)] type ExecutiveWithUpgrade = frame_executive::Executive< Runtime, Block, @@ -2419,6 +2423,10 @@ fn post_runtime_upgrade_detects_storage_version_issues() { CustomUpgrade, >; + /// TODO: The `OnRuntimeUpgrade` generic parameter in `Executive` is deprecated and will be + /// removed in a future version. Once removed, this `#[allow(deprecated)]` attribute + /// can be safely deleted. + #[allow(deprecated)] type ExecutiveWithUpgradePallet4 = frame_executive::Executive< Runtime, Block,