Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4ad7282
deprecate OnRuntimeUpgrade parameter in Executive struct
RomarQ Sep 3, 2025
8709a26
Merge branch 'master' into rq/deprecate-single-block-migrations-from-…
RomarQ Sep 3, 2025
a613498
add prdoc
RomarQ Sep 3, 2025
f308a10
deprecate OnRuntimeUpgrade parameter in Executive struct
RomarQ Sep 3, 2025
9a11b2c
fix prdoc
RomarQ Sep 3, 2025
429bfb0
allow deprecation warnings
RomarQ Sep 3, 2025
8763974
allow deprecation in test
RomarQ Sep 3, 2025
09aea25
fix deprecation warning
RomarQ Sep 3, 2025
010aa6d
Merge branch 'master' into rq/deprecate-single-block-migrations-from-…
RomarQ Sep 3, 2025
1cd9920
add TODO for removing #[allow(deprecated)] when the generic type is r…
RomarQ Sep 4, 2025
3a4d536
Merge branch 'master' into rq/deprecate-single-block-migrations-from-…
RomarQ Sep 4, 2025
07c7ad7
Merge branch 'master' into rq/deprecate-single-block-migrations-from-…
RomarQ Sep 5, 2025
26092d8
Merge branch 'master' into rq/deprecate-single-block-migrations-from-…
RomarQ Sep 8, 2025
e549018
Merge branch 'master' into rq/deprecate-single-block-migrations-from-…
RomarQ Sep 10, 2025
7b4fb98
Merge branch 'master' into rq/deprecate-single-block-migrations-from-…
RomarQ Sep 11, 2025
2a5ce00
update prdoc
RomarQ Sep 11, 2025
c9a4320
Revert "update prdoc"
RomarQ Sep 11, 2025
debffe8
update prdoc
RomarQ Sep 11, 2025
b2f1e7e
Merge branch 'master' into rq/deprecate-single-block-migrations-from-…
RomarQ Sep 11, 2025
44a0d04
Merge branch 'master' into rq/deprecate-single-block-migrations-from-…
RomarQ Sep 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ impl frame_system::Config for Runtime {
type SS58Prefix = SS58Prefix;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type SingleBlockMigrations = Migrations;
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
Expand Down Expand Up @@ -1236,7 +1237,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;

#[cfg(feature = "runtime-benchmarks")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ impl frame_system::Config for Runtime {
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type MultiBlockMigrator = MultiBlockMigrations;
type SingleBlockMigrations = Migrations;
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
Expand Down Expand Up @@ -1571,7 +1572,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;

#[cfg(feature = "runtime-benchmarks")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;

impl_opaque_keys! {
Expand Down Expand Up @@ -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<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type SingleBlockMigrations = Migrations;
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;

impl_opaque_keys! {
Expand Down Expand Up @@ -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<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type SingleBlockMigrations = Migrations;
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ impl frame_system::Config for Runtime {
type SS58Prefix = SS58Prefix;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type SingleBlockMigrations = Migrations;
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
Expand Down Expand Up @@ -808,7 +809,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;

#[cfg(feature = "runtime-benchmarks")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;

impl_opaque_keys! {
Expand Down Expand Up @@ -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<Self>;
type MaxConsumers = ConstU32<16>;
type SingleBlockMigrations = Migrations;
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;

impl_opaque_keys! {
Expand Down Expand Up @@ -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<Self>;
type MaxConsumers = ConstU32<16>;
type SingleBlockMigrations = Migrations;
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;

impl_opaque_keys! {
Expand Down Expand Up @@ -203,6 +202,7 @@ impl frame_system::Config for Runtime {
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = ConstU32<16>;
type MultiBlockMigrator = MultiBlockMigrations;
type SingleBlockMigrations = Migrations;
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;

impl_opaque_keys! {
Expand Down Expand Up @@ -206,6 +205,7 @@ impl frame_system::Config for Runtime {
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = ConstU32<16>;
type MultiBlockMigrator = MultiBlockMigrations;
type SingleBlockMigrations = Migrations;
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
Expand Down
2 changes: 1 addition & 1 deletion cumulus/parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;

/// Handles converting a weight scalar to a fee value, based on the scale and granularity of the
Expand Down Expand Up @@ -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<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type SingleBlockMigrations = Migrations;
}

impl pallet_timestamp::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ impl frame_system::Config for Runtime {
type SS58Prefix = SS58Prefix;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type SingleBlockMigrations = RemoveCollectiveFlip;
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
Expand Down Expand Up @@ -694,7 +695,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
RemoveCollectiveFlip,
>;

pub struct RemoveCollectiveFlip;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ impl frame_system::Config for Runtime {
type SS58Prefix = SS58Prefix;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type SingleBlockMigrations = RemoveCollectiveFlip;
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
Expand Down Expand Up @@ -488,7 +489,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
RemoveCollectiveFlip,
>;

pub struct RemoveCollectiveFlip;
Expand Down
2 changes: 1 addition & 1 deletion cumulus/test/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ impl frame_system::Config for Runtime {
type SS58Prefix = SS58Prefix;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type SingleBlockMigrations = TestOnRuntimeUpgrade;
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
Expand Down Expand Up @@ -463,7 +464,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
TestOnRuntimeUpgrade,
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<RuntimeCall, TxExtension>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand All @@ -69,14 +69,9 @@
//! MyCustomMigration,
//! // ...more migrations here
//! );
//! pub type Executive = frame_executive::Executive<
//! Runtime,
//! Block,
//! frame_system::ChainContext<Runtime>,
//! Runtime,
//! AllPalletsWithSystem,
//! Migrations, // <-- pass your migrations to Executive here
//! >;
//! impl frame_system::Config for Runtime {
//! type SingleBlockMigrations = Migrations;
//! }
//! ```
//!
//! ### Ensuring Single Block Migration Safety
Expand Down
2 changes: 1 addition & 1 deletion polkadot/runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down Expand Up @@ -1807,7 +1808,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<RuntimeCall, TxExtension>;
Expand Down
2 changes: 1 addition & 1 deletion polkadot/runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down Expand Up @@ -2104,7 +2105,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<RuntimeCall, TxExtension>;
Expand Down
39 changes: 39 additions & 0 deletions prdoc/pr_9638.prdoc
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion substrate/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down Expand Up @@ -2874,7 +2875,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;

// We don't have a limit in the Relay Chain.
Expand Down
24 changes: 0 additions & 24 deletions substrate/frame/executive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading
Loading