penpal_runtime/
xcm_config.rs

1// This file is part of Cumulus.
2// SPDX-License-Identifier: Unlicense
3
4// This is free and unencumbered software released into the public domain.
5
6// Anyone is free to copy, modify, publish, use, compile, sell, or
7// distribute this software, either in source code form or as a compiled
8// binary, for any purpose, commercial or non-commercial, and by any
9// means.
10
11// In jurisdictions that recognize copyright laws, the author or authors
12// of this software dedicate any and all copyright interest in the
13// software to the public domain. We make this dedication for the benefit
14// of the public at large and to the detriment of our heirs and
15// successors. We intend this dedication to be an overt act of
16// relinquishment in perpetuity of all present and future rights to this
17// software under copyright law.
18
19// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22// IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25// OTHER DEALINGS IN THE SOFTWARE.
26
27// For more information, please refer to <http://unlicense.org/>
28
29//! Holds the XCM specific configuration that would otherwise be in lib.rs
30//!
31//! This configuration dictates how the Penpal chain will communicate with other chains.
32//!
33//! One of the main uses of the penpal chain will be to be a benefactor of reserve asset transfers
34//! with Asset Hub as the reserve. At present no derivative tokens are minted on receipt of a
35//! `ReserveAssetTransferDeposited` message but that will but the intension will be to support this
36//! soon.
37use super::{
38	AccountId, AllPalletsWithSystem, AssetId as AssetIdPalletAssets, Assets, Authorship, Balance,
39	Balances, CollatorSelection, ForeignAssets, ForeignAssetsInstance, NonZeroIssuance,
40	ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent,
41	RuntimeHoldReason, RuntimeOrigin, WeightToFee, XcmpQueue,
42};
43use crate::{BaseDeliveryFee, FeeAssetId, TransactionByteFee};
44use assets_common::TrustBackedAssetsAsLocation;
45use core::marker::PhantomData;
46use frame_support::{
47	parameter_types,
48	traits::{
49		fungible::HoldConsideration, tokens::imbalance::ResolveAssetTo, ConstU32, Contains,
50		ContainsPair, Equals, Everything, EverythingBut, Get, LinearStoragePrice, Nothing,
51		PalletInfoAccess,
52	},
53	weights::Weight,
54};
55use frame_system::EnsureRoot;
56use pallet_xcm::{AuthorizedAliasers, XcmPassthrough};
57use parachains_common::{
58	xcm_config::{AssetFeeAsExistentialDepositMultiplier, ConcreteAssetFromSystem},
59	TREASURY_PALLET_ID,
60};
61use polkadot_parachain_primitives::primitives::Sibling;
62use polkadot_runtime_common::{impls::ToAuthor, xcm_sender::ExponentialPrice};
63use sp_runtime::traits::{AccountIdConversion, ConvertInto, Identity, TryConvertInto};
64use testnet_parachains_constants::westend::currency::deposit;
65use xcm::latest::{prelude::*, WESTEND_GENESIS_HASH};
66use xcm_builder::{
67	AccountId32Aliases, AliasChildLocation, AliasOriginRootUsingFilter,
68	AllowHrmpNotificationsFromRelayChain, AllowKnownQueryResponses, AllowSubscriptionsFrom,
69	AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, ConvertedConcreteId,
70	DescribeAllTerminal, DescribeFamily, DescribeTerminus, EnsureXcmOrigin,
71	ExternalConsensusLocationsConverterFor, FixedWeightBounds, FrameTransactionalProcessor,
72	FungibleAdapter, FungiblesAdapter, HashedDescription, IsConcrete, LocalMint, NativeAsset,
73	NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SendXcmFeeToAccount,
74	SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
75	SignedToAccountId32, SingleAssetExchangeAdapter, SovereignSignedViaLocation, StartsWith,
76	TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WithComputedOrigin, WithUniqueTopic,
77	XcmFeeManagerFromComponents,
78};
79use xcm_executor::{traits::JustTry, XcmExecutor};
80
81parameter_types! {
82	pub const RelayLocation: Location = Location::parent();
83	// Local native currency which is stored in `pallet_balances`
84	pub const PenpalNativeCurrency: Location = Location::here();
85	// The Penpal runtime is utilized for testing with various environment setups.
86	// This storage item allows us to customize the `NetworkId` where Penpal is deployed.
87	// By default, it is set to `Westend Network` and can be changed using `System::set_storage`.
88	pub storage RelayNetworkId: NetworkId = NetworkId::ByGenesis(WESTEND_GENESIS_HASH);
89	pub RelayNetwork: Option<NetworkId> = Some(RelayNetworkId::get());
90	pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into();
91	pub UniversalLocation: InteriorLocation = [
92		GlobalConsensus(RelayNetworkId::get()),
93		Parachain(ParachainInfo::parachain_id().into())
94	].into();
95	pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating();
96	pub StakingPot: AccountId = CollatorSelection::account_id();
97	pub TrustBackedAssetsPalletIndex: u8 = <Assets as PalletInfoAccess>::index() as u8;
98	pub TrustBackedAssetsPalletLocation: Location =
99		PalletInstance(TrustBackedAssetsPalletIndex::get()).into();
100}
101
102/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used
103/// when determining ownership of accounts for asset transacting and when attempting to use XCM
104/// `Transact` in order to determine the dispatch Origin.
105pub type LocationToAccountId = (
106	// The parent (Relay-chain) origin converts to the parent `AccountId`.
107	ParentIsPreset<AccountId>,
108	// Sibling parachain origins convert to AccountId via the `ParaId::into`.
109	SiblingParachainConvertsVia<Sibling, AccountId>,
110	// Straight up local `AccountId32` origins just alias directly to `AccountId`.
111	AccountId32Aliases<RelayNetwork, AccountId>,
112	// Foreign locations alias into accounts according to a hash of their standard description.
113	HashedDescription<AccountId, (DescribeTerminus, DescribeFamily<DescribeAllTerminal>)>,
114	// Different global consensus locations sovereign accounts.
115	ExternalConsensusLocationsConverterFor<UniversalLocation, AccountId>,
116);
117
118/// Means for transacting assets on this chain.
119pub type FungibleTransactor = FungibleAdapter<
120	// Use this currency:
121	Balances,
122	// Use this currency when it is a fungible asset matching the given location or name:
123	IsConcrete<PenpalNativeCurrency>,
124	// Do a simple punn to convert an AccountId32 Location into a native chain account ID:
125	LocationToAccountId,
126	// Our chain's account ID type (we can't get away without mentioning it explicitly):
127	AccountId,
128	// We don't track any teleports.
129	(),
130>;
131
132/// Means for transacting assets besides the native currency on this chain.
133pub type FungiblesTransactor = FungiblesAdapter<
134	// Use this fungibles implementation:
135	Assets,
136	// Use this currency when it is a fungible asset matching the given location or name:
137	(
138		ConvertedConcreteId<
139			AssetIdPalletAssets,
140			Balance,
141			AsPrefixedGeneralIndex<AssetsPalletLocation, AssetIdPalletAssets, JustTry>,
142			JustTry,
143		>,
144		ConvertedConcreteId<
145			AssetIdPalletAssets,
146			Balance,
147			AsPrefixedGeneralIndex<
148				SystemAssetHubAssetsPalletLocation,
149				AssetIdPalletAssets,
150				JustTry,
151			>,
152			JustTry,
153		>,
154	),
155	// Convert an XCM Location into a local account id:
156	LocationToAccountId,
157	// Our chain's account ID type (we can't get away without mentioning it explicitly):
158	AccountId,
159	// We only want to allow teleports of known assets. We use non-zero issuance as an indication
160	// that this asset is known.
161	LocalMint<NonZeroIssuance<AccountId, Assets>>,
162	// The account to use for tracking teleports.
163	CheckingAccount,
164>;
165
166// Using the latest `Location`, we don't need to worry about migrations for Penpal.
167pub type ForeignAssetsAssetId = Location;
168pub type ForeignAssetsConvertedConcreteId = xcm_builder::MatchedConvertedConcreteId<
169	Location,
170	Balance,
171	EverythingBut<(
172		// Here we rely on fact that something like this works:
173		// assert!(Location::new(1,
174		// [Parachain(100)]).starts_with(&Location::parent()));
175		// assert!([Parachain(100)].into().starts_with(&Here));
176		StartsWith<assets_common::matching::LocalLocationPattern>,
177	)>,
178	Identity,
179	TryConvertInto,
180>;
181
182/// Means for transacting foreign assets from different global consensus.
183pub type ForeignFungiblesTransactor = FungiblesAdapter<
184	// Use this fungibles implementation:
185	ForeignAssets,
186	// Use this currency when it is a fungible asset matching the given location or name:
187	ForeignAssetsConvertedConcreteId,
188	// Convert an XCM Location into a local account id:
189	LocationToAccountId,
190	// Our chain's account ID type (we can't get away without mentioning it explicitly):
191	AccountId,
192	// We don't need to check teleports here.
193	NoChecking,
194	// The account to use for tracking teleports.
195	CheckingAccount,
196>;
197
198/// Means for transacting assets on this chain.
199pub type AssetTransactors = (FungibleTransactor, ForeignFungiblesTransactor, FungiblesTransactor);
200
201/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,
202/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can
203/// biases the kind of local `Origin` it will become.
204pub type XcmOriginToTransactDispatchOrigin = (
205	// Sovereign account converter; this attempts to derive an `AccountId` from the origin location
206	// using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for
207	// foreign chains who want to have a local sovereign account on this chain which they control.
208	SovereignSignedViaLocation<LocationToAccountId, RuntimeOrigin>,
209	// Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when
210	// recognized.
211	RelayChainAsNative<RelayChainOrigin, RuntimeOrigin>,
212	// Native converter for sibling Parachains; will convert to a `SiblingPara` origin when
213	// recognized.
214	SiblingParachainAsNative<cumulus_pallet_xcm::Origin, RuntimeOrigin>,
215	// Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a
216	// transaction from the Root origin.
217	ParentAsSuperuser<RuntimeOrigin>,
218	// Native signed account converter; this just converts an `AccountId32` origin into a normal
219	// `RuntimeOrigin::Signed` origin of the same 32-byte value.
220	SignedAccountId32AsNative<RelayNetwork, RuntimeOrigin>,
221	// Xcm origins can be represented natively under the Xcm pallet's Xcm origin.
222	XcmPassthrough<RuntimeOrigin>,
223);
224
225parameter_types! {
226	pub const RootLocation: Location = Location::here();
227	// One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate.
228	pub UnitWeightCost: Weight = Weight::from_parts(1_000_000_000, 64 * 1024);
229	pub const MaxInstructions: u32 = 100;
230	pub const MaxAssetsIntoHolding: u32 = 64;
231	pub XcmAssetFeesReceiver: Option<AccountId> = Authorship::author();
232}
233
234pub struct ParentOrParentsExecutivePlurality;
235impl Contains<Location> for ParentOrParentsExecutivePlurality {
236	fn contains(location: &Location) -> bool {
237		matches!(location.unpack(), (1, []) | (1, [Plurality { id: BodyId::Executive, .. }]))
238	}
239}
240
241pub type Barrier = TrailingSetTopicAsId<(
242	TakeWeightCredit,
243	// Expected responses are OK.
244	AllowKnownQueryResponses<PolkadotXcm>,
245	// Allow XCMs with some computed origins to pass through.
246	WithComputedOrigin<
247		(
248			// If the message is one that immediately attempts to pay for execution, then
249			// allow it.
250			AllowTopLevelPaidExecutionFrom<Everything>,
251			// Subscriptions for version tracking are OK.
252			AllowSubscriptionsFrom<Everything>,
253			// HRMP notifications from the relay chain are OK.
254			AllowHrmpNotificationsFromRelayChain,
255		),
256		UniversalLocation,
257		ConstU32<8>,
258	>,
259)>;
260
261/// Type alias to conveniently refer to `frame_system`'s `Config::AccountId`.
262pub type AccountIdOf<R> = <R as frame_system::Config>::AccountId;
263
264/// Asset filter that allows all assets from a certain location matching asset id.
265pub struct AssetPrefixFrom<Prefix, Origin>(PhantomData<(Prefix, Origin)>);
266impl<Prefix, Origin> ContainsPair<Asset, Location> for AssetPrefixFrom<Prefix, Origin>
267where
268	Prefix: Get<Location>,
269	Origin: Get<Location>,
270{
271	fn contains(asset: &Asset, origin: &Location) -> bool {
272		let loc = Origin::get();
273		&loc == origin &&
274			matches!(asset, Asset { id: AssetId(asset_loc), fun: Fungible(_a) }
275			if asset_loc.starts_with(&Prefix::get()))
276	}
277}
278
279type AssetsFrom<T> = AssetPrefixFrom<T, T>;
280
281// This asset can be added to AH as Asset and reserved transfer between Penpal and AH
282pub const RESERVABLE_ASSET_ID: u32 = 1;
283// This asset can be added to AH as ForeignAsset and teleported between Penpal and AH
284pub const TELEPORTABLE_ASSET_ID: u32 = 2;
285
286pub const ASSETS_PALLET_ID: u8 = 50;
287pub const ASSET_HUB_ID: u32 = 1000;
288
289pub const USDT_ASSET_ID: u128 = 1984;
290
291parameter_types! {
292	/// The location that this chain recognizes as the Relay network's Asset Hub.
293	pub SystemAssetHubLocation: Location = Location::new(1, [Parachain(ASSET_HUB_ID)]);
294	// the Relay Chain's Asset Hub's Assets pallet index
295	pub SystemAssetHubAssetsPalletLocation: Location =
296		Location::new(1, [Parachain(ASSET_HUB_ID), PalletInstance(ASSETS_PALLET_ID)]);
297	pub AssetsPalletLocation: Location =
298		Location::new(0, [PalletInstance(ASSETS_PALLET_ID)]);
299	pub CheckingAccount: AccountId = PolkadotXcm::check_account();
300	pub LocalTeleportableToAssetHub: Location = Location::new(
301		0,
302		[PalletInstance(ASSETS_PALLET_ID), GeneralIndex(TELEPORTABLE_ASSET_ID.into())]
303	);
304	pub LocalReservableFromAssetHub: Location = Location::new(
305		1,
306		[Parachain(ASSET_HUB_ID), PalletInstance(ASSETS_PALLET_ID), GeneralIndex(RESERVABLE_ASSET_ID.into())]
307	);
308	pub UsdtFromAssetHub: Location = Location::new(
309		1,
310		[Parachain(ASSET_HUB_ID), PalletInstance(ASSETS_PALLET_ID), GeneralIndex(USDT_ASSET_ID)],
311	);
312
313	/// The Penpal runtime is utilized for testing with various environment setups.
314	/// This storage item provides the opportunity to customize testing scenarios
315	/// by configuring the trusted asset from the `SystemAssetHub`.
316	///
317	/// By default, it is configured as a `SystemAssetHubLocation` and can be modified using `System::set_storage`.
318	pub storage CustomizableAssetFromSystemAssetHub: Location = SystemAssetHubLocation::get();
319}
320
321/// Accepts asset with ID `AssetLocation` and is coming from `Origin` chain.
322pub struct AssetFromChain<AssetLocation, Origin>(PhantomData<(AssetLocation, Origin)>);
323impl<AssetLocation: Get<Location>, Origin: Get<Location>> ContainsPair<Asset, Location>
324	for AssetFromChain<AssetLocation, Origin>
325{
326	fn contains(asset: &Asset, origin: &Location) -> bool {
327		log::trace!(target: "xcm::contains", "AssetFromChain asset: {:?}, origin: {:?}", asset, origin);
328		*origin == Origin::get() &&
329			matches!(asset.id.clone(), AssetId(id) if id == AssetLocation::get())
330	}
331}
332
333pub type TrustedReserves = (
334	NativeAsset,
335	ConcreteAssetFromSystem<RelayLocation>,
336	AssetsFrom<SystemAssetHubLocation>,
337	AssetPrefixFrom<CustomizableAssetFromSystemAssetHub, SystemAssetHubLocation>,
338);
339pub type TrustedTeleporters =
340	(AssetFromChain<LocalTeleportableToAssetHub, SystemAssetHubLocation>,);
341
342/// Defines origin aliasing rules for this chain.
343///
344/// - Allow any origin to alias into a child sub-location (equivalent to DescendOrigin),
345/// - Allow AssetHub root to alias into anything,
346/// - Allow origins explicitly authorized by the alias target location.
347pub type TrustedAliasers = (
348	AliasChildLocation,
349	AliasOriginRootUsingFilter<SystemAssetHubLocation, Everything>,
350	AuthorizedAliasers<Runtime>,
351);
352
353pub type WaivedLocations = Equals<RootLocation>;
354/// `AssetId`/`Balance` converter for `TrustBackedAssets`.
355pub type TrustBackedAssetsConvertedConcreteId =
356	assets_common::TrustBackedAssetsConvertedConcreteId<AssetsPalletLocation, Balance>;
357
358/// Asset converter for pool assets.
359/// Used to convert assets in pools to the asset required for fee payment.
360/// The pool must be between the first asset and the one required for fee payment.
361/// This type allows paying fees with any asset in a pool with the asset required for fee payment.
362pub type PoolAssetsExchanger = SingleAssetExchangeAdapter<
363	crate::AssetConversion,
364	crate::NativeAndAssets,
365	(
366		TrustBackedAssetsAsLocation<
367			TrustBackedAssetsPalletLocation,
368			Balance,
369			xcm::latest::Location,
370		>,
371		ForeignAssetsConvertedConcreteId,
372	),
373	AccountId,
374>;
375
376pub struct XcmConfig;
377impl xcm_executor::Config for XcmConfig {
378	type RuntimeCall = RuntimeCall;
379	type XcmSender = XcmRouter;
380	type XcmEventEmitter = PolkadotXcm;
381	// How to withdraw and deposit an asset.
382	type AssetTransactor = AssetTransactors;
383	type OriginConverter = XcmOriginToTransactDispatchOrigin;
384	type IsReserve = TrustedReserves;
385	// no teleport trust established with other chains
386	type IsTeleporter = TrustedTeleporters;
387	type UniversalLocation = UniversalLocation;
388	type Barrier = Barrier;
389	type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
390	type Trader = (
391		UsingComponents<WeightToFee, RelayLocation, AccountId, Balances, ToAuthor<Runtime>>,
392		cumulus_primitives_utility::SwapFirstAssetTrader<
393			RelayLocation,
394			crate::AssetConversion,
395			WeightToFee,
396			crate::NativeAndAssets,
397			(
398				TrustBackedAssetsAsLocation<
399					TrustBackedAssetsPalletLocation,
400					Balance,
401					xcm::latest::Location,
402				>,
403				ForeignAssetsConvertedConcreteId,
404			),
405			ResolveAssetTo<StakingPot, crate::NativeAndAssets>,
406			AccountId,
407		>,
408	);
409	type ResponseHandler = PolkadotXcm;
410	type AssetTrap = PolkadotXcm;
411	type AssetClaims = PolkadotXcm;
412	type SubscriptionService = PolkadotXcm;
413	type PalletInstancesInfo = AllPalletsWithSystem;
414	type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
415	type AssetLocker = ();
416	type AssetExchanger = PoolAssetsExchanger;
417	type FeeManager = XcmFeeManagerFromComponents<
418		WaivedLocations,
419		SendXcmFeeToAccount<Self::AssetTransactor, TreasuryAccount>,
420	>;
421	type MessageExporter = ();
422	type UniversalAliases = Nothing;
423	type CallDispatcher = RuntimeCall;
424	type SafeCallFilter = Everything;
425	type Aliasers = TrustedAliasers;
426	type TransactionalProcessor = FrameTransactionalProcessor;
427	type HrmpNewChannelOpenRequestHandler = ();
428	type HrmpChannelAcceptedHandler = ();
429	type HrmpChannelClosingHandler = ();
430	type XcmRecorder = PolkadotXcm;
431}
432
433/// Multiplier used for dedicated `TakeFirstAssetTrader` with `ForeignAssets` instance.
434pub type ForeignAssetFeeAsExistentialDepositMultiplierFeeCharger =
435	AssetFeeAsExistentialDepositMultiplier<
436		Runtime,
437		WeightToFee,
438		pallet_assets::BalanceToAssetBalance<Balances, Runtime, ConvertInto, ForeignAssetsInstance>,
439		ForeignAssetsInstance,
440	>;
441
442/// Converts a local signed origin into an XCM location. Forms the basis for local origins
443/// sending/executing XCMs.
444pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;
445
446pub type PriceForParentDelivery =
447	ExponentialPrice<FeeAssetId, BaseDeliveryFee, TransactionByteFee, ParachainSystem>;
448
449/// The means for routing XCM messages which are not for local execution into the right message
450/// queues.
451pub type XcmRouter = WithUniqueTopic<(
452	// Two routers - use UMP to communicate with the relay chain:
453	cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm, PriceForParentDelivery>,
454	// ..and XCMP to communicate with the sibling chains.
455	XcmpQueue,
456)>;
457
458parameter_types! {
459	pub const DepositPerItem: Balance = deposit(1, 0);
460	pub const DepositPerByte: Balance = deposit(0, 1);
461	pub const AuthorizeAliasHoldReason: RuntimeHoldReason = RuntimeHoldReason::PolkadotXcm(pallet_xcm::HoldReason::AuthorizeAlias);
462}
463
464impl pallet_xcm::Config for Runtime {
465	type RuntimeEvent = RuntimeEvent;
466	type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
467	type XcmRouter = XcmRouter;
468	type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
469	type XcmExecuteFilter = Everything;
470	type XcmExecutor = XcmExecutor<XcmConfig>;
471	type XcmTeleportFilter = Everything;
472	type XcmReserveTransferFilter = Everything;
473	type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
474	type UniversalLocation = UniversalLocation;
475	type RuntimeOrigin = RuntimeOrigin;
476	type RuntimeCall = RuntimeCall;
477
478	const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
479	// ^ Override for AdvertisedXcmVersion default
480	type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
481	type Currency = Balances;
482	type CurrencyMatcher = ();
483	type TrustedLockers = ();
484	type SovereignAccountOf = LocationToAccountId;
485	type MaxLockers = ConstU32<8>;
486	type WeightInfo = pallet_xcm::TestWeightInfo;
487	type AdminOrigin = EnsureRoot<AccountId>;
488	type MaxRemoteLockConsumers = ConstU32<0>;
489	type RemoteLockConsumerIdentifier = ();
490	// xcm_executor::Config::Aliasers also uses pallet_xcm::AuthorizedAliasers.
491	type AuthorizedAliasConsideration = HoldConsideration<
492		AccountId,
493		Balances,
494		AuthorizeAliasHoldReason,
495		LinearStoragePrice<DepositPerItem, DepositPerByte, Balance>,
496	>;
497}
498
499impl cumulus_pallet_xcm::Config for Runtime {
500	type RuntimeEvent = RuntimeEvent;
501	type XcmExecutor = XcmExecutor<XcmConfig>;
502}
503
504/// Simple conversion of `u32` into an `AssetId` for use in benchmarking.
505pub struct XcmBenchmarkHelper;
506#[cfg(feature = "runtime-benchmarks")]
507impl pallet_assets::BenchmarkHelper<ForeignAssetsAssetId> for XcmBenchmarkHelper {
508	fn create_asset_id_parameter(id: u32) -> ForeignAssetsAssetId {
509		Location::new(1, [Parachain(id)])
510	}
511}