Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare migration from rococo to paseo #240

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Changes from all commits
Commits
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
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
Moliholy marked this conversation as resolved.
Show resolved Hide resolved
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
Loading