diff --git a/Cargo.lock b/Cargo.lock index f3f93b568e..a2f6cb7c4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -612,7 +612,7 @@ dependencies = [ [[package]] name = "basilisk-runtime" -version = "106.0.0" +version = "107.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", diff --git a/runtime/basilisk/Cargo.toml b/runtime/basilisk/Cargo.toml index 0370d279f7..4928bd06f2 100644 --- a/runtime/basilisk/Cargo.toml +++ b/runtime/basilisk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "basilisk-runtime" -version = "106.0.0" +version = "107.0.0" authors = ["GalacticCouncil"] edition = "2021" homepage = "https://github.com/galacticcouncil/Basilisk-node" diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index 503a2aa318..3ce27124cb 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -94,7 +94,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("basilisk"), impl_name: create_runtime_str!("basilisk"), authoring_version: 1, - spec_version: 106, + spec_version: 107, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -257,18 +257,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsReversedWithSystemFirst, - ( - pallet_preimage::migration::v1::Migration, - pallet_democracy::migrations::v1::Migration, - pallet_multisig::migrations::v1::MigrateToV1, - pallet_xcm::migration::v1::MigrateToV1, - DmpQueue, - XcmpQueue, - ParachainSystem, - migrations::OnRuntimeUpgradeMigration, - migrations::MigrateRegistryLocationToV3, - migrations::XcmRateLimitMigration, - ), + (migrations::OnRuntimeUpgradeMigration,), >; impl_runtime_apis! { diff --git a/runtime/basilisk/src/migrations.rs b/runtime/basilisk/src/migrations.rs index 555c116aa0..8430130a35 100644 --- a/runtime/basilisk/src/migrations.rs +++ b/runtime/basilisk/src/migrations.rs @@ -1,112 +1,23 @@ use super::*; -use frame_support::{ - log, migration::storage_key_iter, pallet_prelude::*, traits::OnRuntimeUpgrade, weights::Weight, StoragePrefixedMap, -}; -use pallet_asset_registry::{AssetLocations, LocationAssets}; -use polkadot_xcm::v3::MultiLocation; +use frame_support::{traits::OnRuntimeUpgrade, weights::Weight}; pub struct OnRuntimeUpgradeMigration; impl OnRuntimeUpgrade for OnRuntimeUpgradeMigration { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, &'static str> { - frame_support::log::info!("PreMigrate Duster Pallet start"); - pallet_duster::migration::v1::pre_migrate::(); - frame_support::log::info!("PreMigrate Duster Pallet end"); + // TODO: include migrations for transaction pause and collator rewards pallets in the next release + // (not in the 106 release, because we don't use the latest pallet versions there). Ok(vec![]) } fn on_runtime_upgrade() -> Weight { - let mut weight: Weight = Weight::zero(); - - frame_support::log::info!("Migrate Scheduler Pallet to v4 start"); - weight = weight.saturating_add(Scheduler::migrate_v1_to_v4()); - frame_support::log::info!("Migrate Scheduler Pallet to v4 end"); - - frame_support::log::info!("Migrate Duster Pallet to v1 start"); - weight = weight.saturating_add(pallet_duster::migration::v1::migrate::( - get_all_module_accounts(), - TreasuryAccount::get(), - TreasuryAccount::get(), - )); - frame_support::log::info!("Migrate Duster Pallet to v1 end"); - - weight - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(_state: Vec) -> Result<(), &'static str> { - frame_support::log::info!("PostMigrate Duster Pallet start"); - pallet_duster::migration::v1::post_migrate::(); - frame_support::log::info!("PostMigrate Duster Pallet end"); - Ok(()) - } -} - -#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo)] -pub struct AssetLocationV2(pub polkadot_xcm::v2::MultiLocation); - -pub struct MigrateRegistryLocationToV3(PhantomData); -impl OnRuntimeUpgrade for MigrateRegistryLocationToV3 -where - AssetLocation: Into, -{ - fn on_runtime_upgrade() -> Weight { - log::info!( - target: "runtime::asset-registry", - "MigrateRegistryLocationToV3::on_runtime_upgrade: migrating asset locations to v3" - ); - - let mut weight: Weight = Weight::zero(); - - AssetLocations::::translate(|_asset_id, old_location: AssetLocationV2| { - weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); - let new_multi_loc: MultiLocation = old_location.0.try_into().expect("xcm::v1::MultiLocation"); - let new_location: T::AssetNativeLocation = AssetLocation(new_multi_loc).into(); - Some(new_location) - }); - - let module_prefix = LocationAssets::::module_prefix(); - let storage_prefix = LocationAssets::::storage_prefix(); - let old_data = storage_key_iter::(module_prefix, storage_prefix) - .drain() - .collect::>(); - for (old_location, asset_id) in old_data { - weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); - let new_multi_loc: MultiLocation = old_location.0.try_into().expect("xcm::v1::MultiLocation"); - let new_location: T::AssetNativeLocation = AssetLocation(new_multi_loc).into(); - LocationAssets::::insert(new_location, asset_id); - } - weight - } -} - -pub struct XcmRateLimitMigration; -impl OnRuntimeUpgrade for XcmRateLimitMigration { - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { - frame_support::log::info!("PreMigrate Asset Registry Pallet start"); - pallet_asset_registry::migration::v1::pre_migrate::(); - frame_support::log::info!("PreMigrate Asset Registry Pallet end"); - - Ok(vec![]) - } - - fn on_runtime_upgrade() -> Weight { - log::info!( - target: "runtime::asset-registry", - "XcmRateLimitMigration::on_runtime_upgrade: migrating asset details to include xcm rate limit" - ); - - pallet_asset_registry::migration::v1::migrate::() + Weight::zero() } #[cfg(feature = "try-runtime")] fn post_upgrade(_state: Vec) -> Result<(), &'static str> { - frame_support::log::info!("PostMigrate Asset Registry Pallet start"); - pallet_asset_registry::migration::v1::post_migrate::(); - frame_support::log::info!("PostMigrate Asset Registry Pallet end"); Ok(()) } }