diff --git a/.github/workflows/check-migrations.yml b/.github/workflows/check-migrations.yml index 5a27f61c34..54241845ac 100644 --- a/.github/workflows/check-migrations.yml +++ b/.github/workflows/check-migrations.yml @@ -98,7 +98,7 @@ jobs: echo "Flags: $EXTRA_FLAGS" - ./try-runtime \ + RUST_LOG=runtime=DEBUG ./try-runtime \ --runtime $RUNTIME_BLOB_PATH \ on-runtime-upgrade --checks=pre-and-post \ $EXTRA_FLAGS \ diff --git a/CHANGELOG.md b/CHANGELOG.md index aa688224a6..c57fa0ef99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). 0022-adopt-encointer-runtime.md) ([polkadot-fellows/runtimes#80](https://github.com/polkadot-fellows/runtimes/pull/80)) - Feature for enabling debug prints in the Polkadot and Kusama runtime ([polkadot-fellows/runtimes#85](https://github.com/polkadot-fellows/runtimes/pull/85)) - Added new "Wish for Change" track ([polkadot-fellows/runtimes#184](https://github.com/polkadot-fellows/runtimes/pull/184)) -- Enable Coretime and on-demand on Kusama ([polkadot-fellows/runtimes#159](https://github.com/polkadot-fellows/runtimes/pull/159) +- Enable Coretime and on-demand on Kusama ([polkadot-fellows/runtimes#159](https://github.com/polkadot-fellows/runtimes/pull/159)) +- Refund any leases that are not migrated to Coretime (have holes in them/have not yet started) ([polkadot-fellows/runtimes#206](https://github.com/polkadot-fellows/runtimes/pull/206)) +- Enable Elastic Scaling node side feature for Kusama ([polkadot-fellows/runtimes#205](https://github.com/polkadot-fellows/runtimes/pull/205)) +- Cancel Parachain Auctions ([polkadot-fellows/runtimes#215](https://github.com/polkadot-fellows/runtimes/pull/215)) ### Changed @@ -23,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Deprecate the `xcm::body::TREASURER_INDEX` constant and use the standard `Treasury` variant from the `xcm::BodyId` type instead ([polkadot-fellows/runtimes#149](https://github.com/polkadot-fellows/runtimes/pull/149)) - Bump parachains runtime API to v9 in Kusama to enable the `node_features` function [polkadot-fellows/runtimes#194](https://github.com/polkadot-fellows/runtimes/pull/194) - Bump parachains runtime API to v10 in Kusama to enable the `approval-voting-params` function [polkadot-fellows/runtimes#204](https://github.com/polkadot-fellows/runtimes/pull/204) +- Use Relay Chain's Treasury Pallet account as a destination for XCM fees on System Parachain ([polkadot-fellows/runtimes#191](https://github.com/polkadot-fellows/runtimes/pull/191)) ### Removed diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index d1dcbfb245..e8e1a0b0a0 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -1265,7 +1265,7 @@ impl parachains_paras::Config for Runtime { type QueueFootprinter = ParaInclusion; type NextSessionRotation = Babe; type OnNewHead = Registrar; - type AssignCoretime = (); + type AssignCoretime = CoretimeAssignmentProvider; } parameter_types! { @@ -1745,6 +1745,11 @@ pub type Migrations = (migrations::Unreleased, migrations::Permanent); #[allow(deprecated, missing_docs)] pub mod migrations { use super::*; + use frame_support::traits::OnRuntimeUpgrade; + use frame_system::RawOrigin; + use pallet_scheduler::WeightInfo as SchedulerWeightInfo; + use runtime_common::auctions::WeightInfo as AuctionsWeightInfo; + use runtime_parachains::configuration::WeightInfo; #[cfg(feature = "try-runtime")] use sp_core::crypto::ByteArray; @@ -1759,8 +1764,19 @@ pub mod migrations { if lease.is_empty() { return None } - // Lease not yet started, ignore: + // Lease not yet started/or having holes, refund (coretime can't handle this): if lease.iter().any(Option::is_none) { + if let Err(err) = slots::Pallet::::clear_all_leases( + frame_system::RawOrigin::Root.into(), + para, + ) { + log::error!( + target: "runtime", + "Clearing lease for para: {:?} failed, with error: {:?}", + para, + err + ); + }; return None } let (index, _) = @@ -1769,6 +1785,18 @@ pub mod migrations { } } + /// Enable the elastic scaling node side feature. + /// + /// This is required for Coretime to ensure the relay chain processes parachains that are + /// assigned to multiple cores. + pub struct EnableElasticScalingNodeFeature; + impl OnRuntimeUpgrade for EnableElasticScalingNodeFeature { + fn on_runtime_upgrade() -> Weight { + let _ = Configuration::set_node_feature(RawOrigin::Root.into(), 1, true); + weights::runtime_parachains_configuration::WeightInfo::::set_node_feature() + } + } + parameter_types! { pub const ImOnlinePalletName: &'static str = "ImOnline"; } @@ -1778,7 +1806,7 @@ pub mod migrations { pub struct UpgradeSessionKeys; const UPGRADE_SESSION_KEYS_FROM_SPEC: u32 = 1001002; - impl frame_support::traits::OnRuntimeUpgrade for UpgradeSessionKeys { + impl OnRuntimeUpgrade for UpgradeSessionKeys { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { if System::last_runtime_upgrade_spec_version() > UPGRADE_SESSION_KEYS_FROM_SPEC { @@ -1849,6 +1877,41 @@ pub mod migrations { } } + /// Cancel all ongoing auctions. + /// + /// Any leases that come into existence after coretime was launched will not be served. Yet, + /// any ongoing auctions must be cancelled. + /// + /// Safety: + /// + /// - After coretime is launched, there are no auctions anymore. So if this forgotten to + /// be removed after the runtime upgrade, running this again on the next one is harmless. + /// - I am assuming scheduler `TaskName`s are unique, so removal of the scheduled entry + /// multiple times should also be fine. + pub struct CancelAuctions; + impl OnRuntimeUpgrade for CancelAuctions { + fn on_runtime_upgrade() -> Weight { + if let Err(err) = Auctions::cancel_auction(frame_system::RawOrigin::Root.into()) { + log::debug!(target: "runtime", "Cancelling auctions failed: {:?}", err); + } + // Cancel scheduled auction as well: + if let Err(err) = Scheduler::cancel_named( + pallet_custom_origins::Origin::AuctionAdmin.into(), + [ + 0x5c, 0x68, 0xbf, 0x0c, 0x2d, 0x11, 0x04, 0x91, 0x6b, 0xa5, 0xa4, 0xde, 0xe6, + 0xb8, 0x14, 0xe8, 0x2b, 0x27, 0x93, 0x78, 0x4c, 0xb6, 0xe7, 0x69, 0x04, 0x00, + 0x1a, 0x59, 0x49, 0xc1, 0x63, 0xb1, + ], + ) { + log::debug!(target: "runtime", "Cancelling scheduled auctions failed: {:?}", err); + } + weights::runtime_common_auctions::WeightInfo::::cancel_auction() + .saturating_add(weights::pallet_scheduler::WeightInfo::::cancel_named( + ::MaxScheduledPerBlock::get(), + )) + } + } + /// Unreleased migrations. Add new ones here: pub type Unreleased = ( pallet_nomination_pools::migration::versioned::V7ToV8, @@ -1865,6 +1928,7 @@ pub mod migrations { crate::xcm_config::XcmRouter, GetLegacyLeaseImpl, >, + EnableElasticScalingNodeFeature, // Upgrade `SessionKeys` to exclude `ImOnline` UpgradeSessionKeys, // Remove `im-online` pallet on-chain storage @@ -1872,6 +1936,7 @@ pub mod migrations { ImOnlinePalletName, ::DbWeight, >, + CancelAuctions, ); /// Migrations/checks that do not need to be versioned and can run on every update. diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs index 96ac90bc43..cb4a71067f 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs @@ -49,7 +49,10 @@ use xcm_builder::{ TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount, }; -use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; +use xcm_executor::{ + traits::{ConvertLocation, WithOriginFilter}, + XcmExecutor, +}; parameter_types! { pub const KsmLocation: Location = Location::parent(); @@ -73,6 +76,11 @@ parameter_types! { pub const FellowshipLocation: Location = Location::parent(); pub RelayTreasuryLocation: Location = (Parent, PalletInstance(kusama_runtime_constants::TREASURY_PALLET_ID)).into(); pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating(); + // Test [`crate::tests::treasury_pallet_account_not_none`] ensures that the result of location + // conversion is not `None`. + pub RelayTreasuryPalletAccount: AccountId = + LocationToAccountId::convert_location(&RelayTreasuryLocation::get()) + .unwrap_or(TreasuryAccount::get()); } /// Type for specifying how a `Location` can be converted into an `AccountId`. This is used @@ -562,7 +570,7 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type FeeManager = XcmFeeManagerFromComponents< WaivedLocations, - XcmFeeToAccount, + XcmFeeToAccount, >; type MessageExporter = (); type UniversalAliases = bridging::to_polkadot::UniversalAliases; diff --git a/system-parachains/asset-hubs/asset-hub-kusama/tests/tests.rs b/system-parachains/asset-hubs/asset-hub-kusama/tests/tests.rs index 602b8e23be..3c8c204a0a 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/tests/tests.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/tests/tests.rs @@ -21,8 +21,8 @@ use asset_hub_kusama_runtime::{ xcm_config::{ bridging::{self, XcmBridgeHubRouterFeeAssetId}, AssetFeeAsExistentialDepositMultiplierFeeCharger, CheckingAccount, - ForeignCreatorsSovereignAccountOf, KsmLocation, LocationToAccountId, TreasuryAccount, - TrustBackedAssetsPalletLocation, XcmConfig, + ForeignCreatorsSovereignAccountOf, KsmLocation, LocationToAccountId, RelayTreasuryLocation, + RelayTreasuryPalletAccount, TrustBackedAssetsPalletLocation, XcmConfig, }, AllPalletsWithoutSystem, AssetDeposit, Assets, Balances, ExistentialDeposit, ForeignAssets, ForeignAssetsInstance, MetadataDepositBase, MetadataDepositPerByte, ParachainSystem, @@ -717,7 +717,7 @@ fn limited_reserve_transfer_assets_for_native_asset_to_asset_hub_polkadot_works( bridging_to_asset_hub_polkadot, WeightLimit::Unlimited, Some(XcmBridgeHubRouterFeeAssetId::get()), - Some(TreasuryAccount::get()), + Some(RelayTreasuryPalletAccount::get()), ) } @@ -923,3 +923,11 @@ fn change_xcm_bridge_hub_router_byte_fee_by_governance_works() { }, ) } + +#[test] +fn treasury_pallet_account_not_none() { + assert_eq!( + RelayTreasuryPalletAccount::get(), + LocationToAccountId::convert_location(&RelayTreasuryLocation::get()).unwrap() + ) +} diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs index d94d36d976..5bd37b32db 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs @@ -50,7 +50,10 @@ use xcm_builder::{ TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount, }; -use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; +use xcm_executor::{ + traits::{ConvertLocation, WithOriginFilter}, + XcmExecutor, +}; parameter_types! { pub const DotLocation: Location = Location::parent(); @@ -66,6 +69,11 @@ parameter_types! { pub const GovernanceLocation: Location = Location::parent(); pub RelayTreasuryLocation: Location = (Parent, PalletInstance(polkadot_runtime_constants::TREASURY_PALLET_ID)).into(); pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating(); + // Test [`crate::tests::treasury_pallet_account_not_none`] ensures that the result of location + // conversion is not `None`. + pub RelayTreasuryPalletAccount: AccountId = + LocationToAccountId::convert_location(&RelayTreasuryLocation::get()) + .unwrap_or(TreasuryAccount::get()); } /// Type for specifying how a `Location` can be converted into an `AccountId`. This is used @@ -527,7 +535,7 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type FeeManager = XcmFeeManagerFromComponents< WaivedLocations, - XcmFeeToAccount, + XcmFeeToAccount, >; type MessageExporter = (); type UniversalAliases = bridging::to_kusama::UniversalAliases; diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/tests/tests.rs b/system-parachains/asset-hubs/asset-hub-polkadot/tests/tests.rs index 5ffc407a30..08949a1157 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/tests/tests.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/tests/tests.rs @@ -21,8 +21,8 @@ use asset_hub_polkadot_runtime::{ xcm_config::{ bridging::{self, XcmBridgeHubRouterFeeAssetId}, AssetFeeAsExistentialDepositMultiplierFeeCharger, CheckingAccount, DotLocation, - ForeignCreatorsSovereignAccountOf, LocationToAccountId, TreasuryAccount, - TrustBackedAssetsPalletLocation, XcmConfig, + ForeignCreatorsSovereignAccountOf, LocationToAccountId, RelayTreasuryLocation, + RelayTreasuryPalletAccount, TrustBackedAssetsPalletLocation, XcmConfig, }, AllPalletsWithoutSystem, AssetDeposit, Assets, Balances, ExistentialDeposit, ForeignAssets, ForeignAssetsInstance, MetadataDepositBase, MetadataDepositPerByte, ParachainSystem, @@ -731,7 +731,7 @@ fn limited_reserve_transfer_assets_for_native_asset_to_asset_hub_kusama_works() bridging_to_asset_hub_kusama, WeightLimit::Unlimited, Some(XcmBridgeHubRouterFeeAssetId::get()), - Some(TreasuryAccount::get()), + Some(RelayTreasuryPalletAccount::get()), ) } @@ -935,3 +935,11 @@ fn change_xcm_bridge_hub_router_byte_fee_by_governance_works() { }, ) } + +#[test] +fn treasury_pallet_account_not_none() { + assert_eq!( + RelayTreasuryPalletAccount::get(), + LocationToAccountId::convert_location(&RelayTreasuryLocation::get()).unwrap() + ) +} diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index 8e0d5a9562..828904565b 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -49,7 +49,10 @@ use xcm_builder::{ TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount, }; -use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; +use xcm_executor::{ + traits::{ConvertLocation, WithOriginFilter}, + XcmExecutor, +}; parameter_types! { pub const KsmRelayLocation: Location = Location::parent(); @@ -63,6 +66,11 @@ parameter_types! { pub const FellowshipLocation: Location = Location::parent(); pub RelayTreasuryLocation: Location = (Parent, PalletInstance(kusama_runtime_constants::TREASURY_PALLET_ID)).into(); pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating(); + // Test [`crate::tests::treasury_pallet_account_not_none`] ensures that the result of location + // conversion is not `None`. + pub RelayTreasuryPalletAccount: AccountId = + LocationToAccountId::convert_location(&RelayTreasuryLocation::get()) + .unwrap_or(TreasuryAccount::get()); } /// Type for specifying how a `Location` can be converted into an `AccountId`. This is used @@ -266,7 +274,7 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type FeeManager = XcmFeeManagerFromComponents< WaivedLocations, - XcmFeeToAccount, + XcmFeeToAccount, >; type MessageExporter = ToBridgeHubPolkadotHaulBlobExporter; type UniversalAliases = Nothing; @@ -326,3 +334,11 @@ impl cumulus_pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } + +#[test] +fn treasury_pallet_account_not_none() { + assert_eq!( + RelayTreasuryPalletAccount::get(), + LocationToAccountId::convert_location(&RelayTreasuryLocation::get()).unwrap() + ) +} diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs index b0856de882..74e0f4c4a2 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs @@ -23,7 +23,10 @@ use bridge_hub_kusama_runtime::{ RequiredStakeForStakeAndSlash, WithBridgeHubPolkadotMessageBridge, WithBridgeHubPolkadotMessagesInstance, XCM_LANE_FOR_ASSET_HUB_KUSAMA_TO_ASSET_HUB_POLKADOT, }, - xcm_config::{KsmRelayLocation, RelayNetwork, XcmConfig}, + xcm_config::{ + KsmRelayLocation, LocationToAccountId, RelayNetwork, RelayTreasuryLocation, + RelayTreasuryPalletAccount, XcmConfig, + }, AllPalletsWithoutSystem, BridgeRejectObsoleteHeadersAndMessages, Executive, ExistentialDeposit, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, SessionKeys, SignedExtra, TransactionPayment, UncheckedExtrinsic, SLOT_DURATION, @@ -42,6 +45,7 @@ use system_parachains_constants::kusama::{ consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, fee::WeightToFee, }; use xcm::latest::prelude::*; +use xcm_executor::traits::ConvertLocation; // Para id of sibling chain used in tests. pub const SIBLING_PARACHAIN_ID: u32 = 1000; @@ -360,6 +364,14 @@ pub fn can_calculate_fee_for_complex_message_confirmation_transaction() { ) } +#[test] +fn treasury_pallet_account_not_none() { + assert_eq!( + RelayTreasuryPalletAccount::get(), + LocationToAccountId::convert_location(&RelayTreasuryLocation::get()).unwrap() + ) +} + use sp_runtime::Perbill; // TODO:(PR#159): remove when `polkadot-sdk@1.8.0` bump (https://github.com/polkadot-fellows/runtimes/issues/186) diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs index 2051bca78e..c28e8b89ab 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs @@ -50,7 +50,10 @@ use xcm_builder::{ TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount, }; -use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; +use xcm_executor::{ + traits::{ConvertLocation, WithOriginFilter}, + XcmExecutor, +}; parameter_types! { pub const DotRelayLocation: Location = Location::parent(); @@ -64,6 +67,11 @@ parameter_types! { pub const GovernanceLocation: Location = Location::parent(); pub RelayTreasuryLocation: Location = (Parent, PalletInstance(polkadot_runtime_constants::TREASURY_PALLET_ID)).into(); pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating(); + // Test [`crate::tests::treasury_pallet_account_not_none`] ensures that the result of location + // conversion is not `None`. + pub RelayTreasuryPalletAccount: AccountId = + LocationToAccountId::convert_location(&RelayTreasuryLocation::get()) + .unwrap_or(TreasuryAccount::get()); } /// Type for specifying how a `Location` can be converted into an `AccountId`. This is used @@ -285,7 +293,7 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type FeeManager = XcmFeeManagerFromComponents< WaivedLocations, - XcmFeeToAccount, + XcmFeeToAccount, >; type MessageExporter = ToBridgeHubKusamaHaulBlobExporter; type UniversalAliases = Nothing; diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/tests/tests.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/tests/tests.rs index e1081d3eee..0f03bd3415 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/tests/tests.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/tests/tests.rs @@ -24,7 +24,10 @@ use bridge_hub_polkadot_runtime::{ WithBridgeHubKusamaMessageBridge, WithBridgeHubKusamaMessagesInstance, XCM_LANE_FOR_ASSET_HUB_POLKADOT_TO_ASSET_HUB_KUSAMA, }, - xcm_config::{DotRelayLocation, RelayNetwork, XcmConfig}, + xcm_config::{ + DotRelayLocation, LocationToAccountId, RelayNetwork, RelayTreasuryLocation, + RelayTreasuryPalletAccount, XcmConfig, + }, AllPalletsWithoutSystem, BridgeRejectObsoleteHeadersAndMessages, Executive, ExistentialDeposit, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, SessionKeys, SignedExtra, TransactionPayment, UncheckedExtrinsic, SLOT_DURATION, @@ -43,6 +46,7 @@ use system_parachains_constants::polkadot::{ consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, fee::WeightToFee, }; use xcm::latest::prelude::*; +use xcm_executor::traits::ConvertLocation; // Para id of sibling chain used in tests. pub const SIBLING_PARACHAIN_ID: u32 = 1000; @@ -361,6 +365,14 @@ pub fn can_calculate_fee_for_complex_message_confirmation_transaction() { ) } +#[test] +fn treasury_pallet_account_not_none() { + assert_eq!( + RelayTreasuryPalletAccount::get(), + LocationToAccountId::convert_location(&RelayTreasuryLocation::get()).unwrap() + ) +} + // TODO:(PR#159): remove when `polkadot-sdk@1.8.0` bump (https://github.com/polkadot-fellows/runtimes/issues/186) /// A helper function for comparing the actual value of a fee constant with its estimated value. The /// estimated value can be overestimated (`overestimate_in_percent`), and if the difference to the diff --git a/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs b/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs index e6ebbd8687..d81523c75a 100644 --- a/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs +++ b/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs @@ -47,7 +47,10 @@ use xcm_builder::{ UsingComponents, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount, }; -use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; +use xcm_executor::{ + traits::{ConvertLocation, WithOriginFilter}, + XcmExecutor, +}; parameter_types! { pub const RootLocation: Location = Location::here(); @@ -61,6 +64,11 @@ parameter_types! { pub RelayTreasuryLocation: Location = (Parent, PalletInstance(polkadot_runtime_constants::TREASURY_PALLET_ID)).into(); pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating(); pub const TreasurerBodyId: BodyId = BodyId::Treasury; + // Test [`treasury_pallet_account_not_none`] ensures that the result of location conversion is + // not `None`. + pub RelayTreasuryPalletAccount: AccountId = + LocationToAccountId::convert_location(&RelayTreasuryLocation::get()) + .unwrap_or(TreasuryAccount::get()); } /// Type for specifying how a `Location` can be converted into an `AccountId`. This is used @@ -294,7 +302,7 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type FeeManager = XcmFeeManagerFromComponents< WaivedLocations, - XcmFeeToAccount, + XcmFeeToAccount, >; type MessageExporter = (); type UniversalAliases = Nothing; @@ -353,3 +361,11 @@ impl cumulus_pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } + +#[test] +fn treasury_pallet_account_not_none() { + assert_eq!( + RelayTreasuryPalletAccount::get(), + LocationToAccountId::convert_location(&RelayTreasuryLocation::get()).unwrap() + ) +} diff --git a/system-parachains/encointer/Cargo.toml b/system-parachains/encointer/Cargo.toml index 5a2c3bc633..cb97fdbdb7 100644 --- a/system-parachains/encointer/Cargo.toml +++ b/system-parachains/encointer/Cargo.toml @@ -19,20 +19,29 @@ scale-info = { version = "2.10.0", default-features = false, features = [ ] } smallvec = "1.13.1" -# encointer deps -encointer-balances-tx-payment = { default-features = false, version = "6.0.0" } -encointer-balances-tx-payment-rpc-runtime-api = { default-features = false, version = "6.0.0" } -encointer-primitives = { default-features = false, version = "6.0.2" } -pallet-encointer-balances = { default-features = false, version = "6.0.0" } -pallet-encointer-bazaar = { default-features = false, version = "6.0.0" } -pallet-encointer-bazaar-rpc-runtime-api = { default-features = false, version = "6.0.0" } -pallet-encointer-ceremonies = { default-features = false, version = "6.0.0" } -pallet-encointer-ceremonies-rpc-runtime-api = { default-features = false, version = "6.0.0" } -pallet-encointer-communities = { default-features = false, version = "6.0.0" } -pallet-encointer-communities-rpc-runtime-api = { default-features = false, version = "6.0.0" } -pallet-encointer-faucet = { default-features = false, version = "6.0.0" } -pallet-encointer-reputation-commitments = { default-features = false, version = "6.0.0" } -pallet-encointer-scheduler = { default-features = false, version = "6.0.0" } + +# Encointer pallet versioning follows these rules: +# --------------------------------------------------------------------------------------------- +# * major: per polkadot-sdk minor version, always breaking: i.e . +# * polkadot-sdk-v1.7.0 => encointer-* 6.x.x +# * polkadot-sdk-v1.8.0 => encointer-* 7.x.x +# * minor: possibly breaking changes in encointer protocol. may require storage migration. i.e +# * encointer-* 6.1.x (must not be automatically updated from 6.0.x) +# * patch: ad-lib +# +encointer-balances-tx-payment = { default-features = false, version = "~6.0.0" } +encointer-balances-tx-payment-rpc-runtime-api = { default-features = false, version = "~6.0.0" } +encointer-primitives = { default-features = false, version = "~6.0.2" } +pallet-encointer-balances = { default-features = false, version = "~6.0.0" } +pallet-encointer-bazaar = { default-features = false, version = "~6.0.0" } +pallet-encointer-bazaar-rpc-runtime-api = { default-features = false, version = "~6.0.0" } +pallet-encointer-ceremonies = { default-features = false, version = "~6.0.0" } +pallet-encointer-ceremonies-rpc-runtime-api = { default-features = false, version = "~6.0.0" } +pallet-encointer-communities = { default-features = false, version = "~6.0.0" } +pallet-encointer-communities-rpc-runtime-api = { default-features = false, version = "~6.0.0" } +pallet-encointer-faucet = { default-features = false, version = "~6.0.0" } +pallet-encointer-reputation-commitments = { default-features = false, version = "~6.0.0" } +pallet-encointer-scheduler = { default-features = false, version = "~6.0.0" } # Substrate