Skip to content

Commit

Permalink
Merge pull request #240 from paritytech/paseo-runtime-upgrade
Browse files Browse the repository at this point in the history
Prepare migration from rococo to paseo
  • Loading branch information
Moliholy authored Sep 24, 2024
2 parents 2e1ae24 + 68d8dd1 commit f0caefe
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion runtime/testnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,21 @@ pub type UncheckedExtrinsic =
pub type CheckedExtrinsic =
fp_self_contained::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra, H160>;

pub struct PrepareForMove;
impl frame_support::traits::OnRuntimeUpgrade for PrepareForMove {
fn on_runtime_upgrade() -> Weight {
// This is taken from https://hackmd.io/@bkchr/BkorHJMaA
cumulus_pallet_parachain_system::LastHrmpMqcHeads::<Runtime>::kill();
cumulus_pallet_parachain_system::LastDmqMqcHead::<Runtime>::kill();

// This is taken from https://github.com/paseo-network/support/blob/main/docs/rococo_migration.md#2-migrate-state-and-history
cumulus_pallet_parachain_system::LastRelayChainBlockNumber::<Runtime>::kill();

// Weight negligible as the block will always fail to build
Weight::zero()
}
}

/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Runtime,
Expand All @@ -114,6 +129,7 @@ pub type Executive = frame_executive::Executive<
(
pallet_collator_selection::migration::v2::MigrationToV2<Runtime>,
cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5<Runtime>,
PrepareForMove,
),
>;

Expand Down Expand Up @@ -234,7 +250,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("muse"),
impl_name: create_runtime_str!("muse"),
authoring_version: 1,
spec_version: 1016,
spec_version: 1017,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down

0 comments on commit f0caefe

Please sign in to comment.