penpal_runtime/
lib.rs

1// Copyright (C) Parity Technologies (UK) Ltd.
2// This file is part of Cumulus.
3
4// Cumulus is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8
9// Cumulus is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License
15// along with Cumulus.  If not, see <http://www.gnu.org/licenses/>.
16
17//! The PenPal runtime is designed as a test runtime that can be created with an arbitrary `ParaId`,
18//! such that multiple instances of the parachain can be on the same parent relay. Ensure that you
19//! have enough nodes running to support this or you will get scheduling errors.
20//!
21//! The PenPal runtime's primary use is for testing interactions between System parachains and
22//! other chains that are not trusted teleporters.
23
24#![cfg_attr(not(feature = "std"), no_std)]
25// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
26#![recursion_limit = "256"]
27
28// Make the WASM binary available.
29#[cfg(feature = "std")]
30include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
31
32mod weights;
33pub mod xcm_config;
34
35extern crate alloc;
36
37use alloc::{vec, vec::Vec};
38use assets_common::{
39	local_and_foreign_assets::{LocalFromLeft, TargetFromLeft},
40	AssetIdForTrustBackedAssetsConvert,
41};
42use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
43use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
44use frame_support::{
45	construct_runtime, derive_impl,
46	dispatch::DispatchClass,
47	genesis_builder_helper::{build_state, get_preset},
48	ord_parameter_types,
49	pallet_prelude::Weight,
50	parameter_types,
51	traits::{
52		tokens::{fungible, fungibles, imbalance::ResolveAssetTo},
53		AsEnsureOriginWithArg, ConstBool, ConstU128, ConstU32, ConstU64, ConstU8, Everything,
54		TransformOrigin,
55	},
56	weights::{
57		constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, FeePolynomial, WeightToFee as _,
58		WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial,
59	},
60	PalletId,
61};
62use frame_system::{
63	limits::{BlockLength, BlockWeights},
64	EnsureRoot, EnsureSigned, EnsureSignedBy,
65};
66use parachains_common::{
67	impls::{AssetsToBlockAuthor, NonZeroIssuance},
68	message_queue::{NarrowOriginToSibling, ParaIdToSibling},
69};
70use smallvec::smallvec;
71use sp_api::impl_runtime_apis;
72pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;
73use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
74use sp_runtime::{
75	create_runtime_str, generic, impl_opaque_keys,
76	traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT},
77	transaction_validity::{TransactionSource, TransactionValidity},
78	ApplyExtrinsicResult,
79};
80pub use sp_runtime::{traits::ConvertInto, MultiAddress, Perbill, Permill};
81#[cfg(feature = "std")]
82use sp_version::NativeVersion;
83use sp_version::RuntimeVersion;
84use xcm_config::{ForeignAssetsAssetId, XcmOriginToTransactDispatchOrigin};
85
86#[cfg(any(feature = "std", test))]
87pub use sp_runtime::BuildStorage;
88
89use parachains_common::{AccountId, Signature};
90use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
91use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};
92use xcm::{
93	latest::prelude::{AssetId as AssetLocationId, BodyId},
94	Version as XcmVersion, VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm,
95};
96use xcm_runtime_apis::{
97	dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects},
98	fees::Error as XcmPaymentApiError,
99};
100
101/// Balance of an account.
102pub type Balance = u128;
103
104/// Index of a transaction in the chain.
105pub type Nonce = u32;
106
107/// A hash of some data used by the chain.
108pub type Hash = sp_core::H256;
109
110/// An index to a block.
111pub type BlockNumber = u32;
112
113/// The address format for describing accounts.
114pub type Address = MultiAddress<AccountId, ()>;
115
116/// Block header type as expected by this runtime.
117pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
118
119/// Block type as expected by this runtime.
120pub type Block = generic::Block<Header, UncheckedExtrinsic>;
121
122/// A Block signed with a Justification
123pub type SignedBlock = generic::SignedBlock<Block>;
124
125/// BlockId type as expected by this runtime.
126pub type BlockId = generic::BlockId<Block>;
127
128// Id used for identifying assets.
129pub type AssetId = u32;
130
131/// The SignedExtension to the basic transaction logic.
132pub type SignedExtra = (
133	frame_system::CheckNonZeroSender<Runtime>,
134	frame_system::CheckSpecVersion<Runtime>,
135	frame_system::CheckTxVersion<Runtime>,
136	frame_system::CheckGenesis<Runtime>,
137	frame_system::CheckEra<Runtime>,
138	frame_system::CheckNonce<Runtime>,
139	frame_system::CheckWeight<Runtime>,
140	pallet_asset_tx_payment::ChargeAssetTxPayment<Runtime>,
141);
142
143/// Unchecked extrinsic type as expected by this runtime.
144pub type UncheckedExtrinsic =
145	generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
146
147pub type Migrations = (
148	pallet_balances::migration::MigrateToTrackInactive<Runtime, xcm_config::CheckingAccount>,
149	pallet_collator_selection::migration::v1::MigrateToV1<Runtime>,
150);
151
152/// Executive: handles dispatch to the various modules.
153pub type Executive = frame_executive::Executive<
154	Runtime,
155	Block,
156	frame_system::ChainContext<Runtime>,
157	Runtime,
158	AllPalletsWithSystem,
159	Migrations,
160>;
161
162/// Handles converting a weight scalar to a fee value, based on the scale and granularity of the
163/// node's balance type.
164///
165/// This should typically create a mapping between the following ranges:
166///   - `[0, MAXIMUM_BLOCK_WEIGHT]`
167///   - `[Balance::min, Balance::max]`
168///
169/// Yet, it can be used for any other sort of change to weight-fee. Some examples being:
170///   - Setting it to `0` will essentially disable the weight fee.
171///   - Setting it to `1` will cause the literal `#[weight = x]` values to be charged.
172pub struct WeightToFee;
173impl frame_support::weights::WeightToFee for WeightToFee {
174	type Balance = Balance;
175
176	fn weight_to_fee(weight: &Weight) -> Self::Balance {
177		let time_poly: FeePolynomial<Balance> = RefTimeToFee::polynomial().into();
178		let proof_poly: FeePolynomial<Balance> = ProofSizeToFee::polynomial().into();
179
180		// Take the maximum instead of the sum to charge by the more scarce resource.
181		time_poly.eval(weight.ref_time()).max(proof_poly.eval(weight.proof_size()))
182	}
183}
184
185/// Maps the reference time component of `Weight` to a fee.
186pub struct RefTimeToFee;
187impl WeightToFeePolynomial for RefTimeToFee {
188	type Balance = Balance;
189	fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
190		let p = MILLIUNIT / 10;
191		let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time());
192
193		smallvec![WeightToFeeCoefficient {
194			degree: 1,
195			negative: false,
196			coeff_frac: Perbill::from_rational(p % q, q),
197			coeff_integer: p / q,
198		}]
199	}
200}
201
202/// Maps the proof size component of `Weight` to a fee.
203pub struct ProofSizeToFee;
204impl WeightToFeePolynomial for ProofSizeToFee {
205	type Balance = Balance;
206	fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
207		// Map 10kb proof to 1 CENT.
208		let p = MILLIUNIT / 10;
209		let q = 10_000;
210
211		smallvec![WeightToFeeCoefficient {
212			degree: 1,
213			negative: false,
214			coeff_frac: Perbill::from_rational(p % q, q),
215			coeff_integer: p / q,
216		}]
217	}
218}
219/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
220/// the specifics of the runtime. They can then be made to be agnostic over specific formats
221/// of data like extrinsics, allowing for them to continue syncing the network through upgrades
222/// to even the core data structures.
223pub mod opaque {
224	use super::*;
225	use sp_runtime::{generic, traits::BlakeTwo256};
226
227	pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;
228	/// Opaque block header type.
229	pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
230	/// Opaque block type.
231	pub type Block = generic::Block<Header, UncheckedExtrinsic>;
232	/// Opaque block identifier type.
233	pub type BlockId = generic::BlockId<Block>;
234}
235
236impl_opaque_keys! {
237	pub struct SessionKeys {
238		pub aura: Aura,
239	}
240}
241
242#[sp_version::runtime_version]
243pub const VERSION: RuntimeVersion = RuntimeVersion {
244	spec_name: create_runtime_str!("penpal-parachain"),
245	impl_name: create_runtime_str!("penpal-parachain"),
246	authoring_version: 1,
247	spec_version: 1,
248	impl_version: 0,
249	apis: RUNTIME_API_VERSIONS,
250	transaction_version: 1,
251	state_version: 1,
252};
253
254/// This determines the average expected block time that we are targeting.
255/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`.
256/// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked
257/// up by `pallet_aura` to implement `fn slot_duration()`.
258///
259/// Change this to adjust the block time.
260pub const MILLISECS_PER_BLOCK: u64 = 12000;
261
262// NOTE: Currently it is not possible to change the slot duration after the chain has started.
263//       Attempting to do so will brick block production.
264pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;
265
266// Time is measured by number of blocks.
267pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
268pub const HOURS: BlockNumber = MINUTES * 60;
269pub const DAYS: BlockNumber = HOURS * 24;
270
271// Unit = the base number of indivisible units for balances
272pub const UNIT: Balance = 1_000_000_000_000;
273pub const MILLIUNIT: Balance = 1_000_000_000;
274pub const MICROUNIT: Balance = 1_000_000;
275
276/// The existential deposit. Set to 1/10 of the Connected Relay Chain.
277pub const EXISTENTIAL_DEPOSIT: Balance = MILLIUNIT;
278
279/// We assume that ~5% of the block weight is consumed by `on_initialize` handlers. This is
280/// used to limit the maximal weight of a single extrinsic.
281const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5);
282
283/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used by
284/// `Operational` extrinsics.
285const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
286
287/// We allow for 0.5 of a second of compute with a 12 second average block time.
288const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
289	WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),
290	cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64,
291);
292
293/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included
294/// into the relay chain.
295const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1;
296/// How many parachain blocks are processed by the relay chain per parent. Limits the
297/// number of blocks authored per slot.
298const BLOCK_PROCESSING_VELOCITY: u32 = 1;
299/// Relay chain slot duration, in milliseconds.
300const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000;
301
302/// The version information used to identify this runtime when compiled natively.
303#[cfg(feature = "std")]
304pub fn native_version() -> NativeVersion {
305	NativeVersion { runtime_version: VERSION, can_author_with: Default::default() }
306}
307
308parameter_types! {
309	pub const Version: RuntimeVersion = VERSION;
310
311	// This part is copied from Substrate's `bin/node/runtime/src/lib.rs`.
312	//  The `RuntimeBlockLength` and `RuntimeBlockWeights` exist here because the
313	// `DeletionWeightLimit` and `DeletionQueueDepth` depend on those to parameterize
314	// the lazy contract deletion.
315	pub RuntimeBlockLength: BlockLength =
316		BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
317	pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()
318		.base_block(BlockExecutionWeight::get())
319		.for_class(DispatchClass::all(), |weights| {
320			weights.base_extrinsic = ExtrinsicBaseWeight::get();
321		})
322		.for_class(DispatchClass::Normal, |weights| {
323			weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
324		})
325		.for_class(DispatchClass::Operational, |weights| {
326			weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);
327			// Operational transactions have some extra reserved space, so that they
328			// are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.
329			weights.reserved = Some(
330				MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT
331			);
332		})
333		.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
334		.build_or_panic();
335	pub const SS58Prefix: u16 = 42;
336}
337
338// Configure FRAME pallets to include in runtime.
339
340#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
341impl frame_system::Config for Runtime {
342	/// The identifier used to distinguish between accounts.
343	type AccountId = AccountId;
344	/// The aggregated dispatch type that is available for extrinsics.
345	type RuntimeCall = RuntimeCall;
346	/// The lookup mechanism to get account ID from whatever is passed in dispatchers.
347	type Lookup = AccountIdLookup<AccountId, ()>;
348	/// The index type for storing how many extrinsics an account has signed.
349	type Nonce = Nonce;
350	/// The type for hashing blocks and tries.
351	type Hash = Hash;
352	/// The hashing algorithm used.
353	type Hashing = BlakeTwo256;
354	/// The block type.
355	type Block = Block;
356	/// The ubiquitous event type.
357	type RuntimeEvent = RuntimeEvent;
358	/// The ubiquitous origin type.
359	type RuntimeOrigin = RuntimeOrigin;
360	/// Maximum number of block number to block hash mappings to keep (oldest pruned first).
361	type BlockHashCount = BlockHashCount;
362	/// Runtime version.
363	type Version = Version;
364	/// Converts a module to an index of this module in the runtime.
365	type PalletInfo = PalletInfo;
366	/// The data to be stored in an account.
367	type AccountData = pallet_balances::AccountData<Balance>;
368	/// What to do if a new account is created.
369	type OnNewAccount = ();
370	/// What to do if an account is fully reaped from the system.
371	type OnKilledAccount = ();
372	/// The weight of database operations that the runtime can invoke.
373	type DbWeight = RocksDbWeight;
374	/// The basic call filter to use in dispatchable.
375	type BaseCallFilter = Everything;
376	/// Weight information for the extrinsics of this pallet.
377	type SystemWeightInfo = ();
378	/// Block & extrinsics weights: base values and limits.
379	type BlockWeights = RuntimeBlockWeights;
380	/// The maximum length of a block (in bytes).
381	type BlockLength = RuntimeBlockLength;
382	/// This is used as an identifier of the chain. 42 is the generic substrate prefix.
383	type SS58Prefix = SS58Prefix;
384	/// The action to take on a Runtime Upgrade
385	type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
386	type MaxConsumers = frame_support::traits::ConstU32<16>;
387}
388
389impl pallet_timestamp::Config for Runtime {
390	/// A timestamp: milliseconds since the unix epoch.
391	type Moment = u64;
392	type OnTimestampSet = Aura;
393	type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>;
394	type WeightInfo = ();
395}
396
397impl pallet_authorship::Config for Runtime {
398	type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Aura>;
399	type EventHandler = (CollatorSelection,);
400}
401
402parameter_types! {
403	pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT;
404}
405
406impl pallet_balances::Config for Runtime {
407	type MaxLocks = ConstU32<50>;
408	/// The type for recording an account's balance.
409	type Balance = Balance;
410	/// The ubiquitous event type.
411	type RuntimeEvent = RuntimeEvent;
412	type DustRemoval = ();
413	type ExistentialDeposit = ExistentialDeposit;
414	type AccountStore = System;
415	type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>;
416	type MaxReserves = ConstU32<50>;
417	type ReserveIdentifier = [u8; 8];
418	type RuntimeHoldReason = RuntimeHoldReason;
419	type RuntimeFreezeReason = RuntimeFreezeReason;
420	type FreezeIdentifier = ();
421	type MaxFreezes = ConstU32<0>;
422}
423
424parameter_types! {
425	/// Relay Chain `TransactionByteFee` / 10
426	pub const TransactionByteFee: Balance = 10 * MICROUNIT;
427}
428
429impl pallet_transaction_payment::Config for Runtime {
430	type RuntimeEvent = RuntimeEvent;
431	type OnChargeTransaction = pallet_transaction_payment::FungibleAdapter<Balances, ()>;
432	type WeightToFee = WeightToFee;
433	type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
434	type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
435	type OperationalFeeMultiplier = ConstU8<5>;
436}
437
438parameter_types! {
439	pub const AssetDeposit: Balance = 0;
440	pub const AssetAccountDeposit: Balance = 0;
441	pub const ApprovalDeposit: Balance = 0;
442	pub const AssetsStringLimit: u32 = 50;
443	pub const MetadataDepositBase: Balance = 0;
444	pub const MetadataDepositPerByte: Balance = 0;
445}
446
447// /// We allow root and the Relay Chain council to execute privileged asset operations.
448// pub type AssetsForceOrigin =
449// 	EnsureOneOf<EnsureRoot<AccountId>, EnsureXcm<IsMajorityOfBody<KsmLocation, ExecutiveBody>>>;
450
451pub type TrustBackedAssetsInstance = pallet_assets::Instance1;
452
453impl pallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
454	type RuntimeEvent = RuntimeEvent;
455	type Balance = Balance;
456	type AssetId = AssetId;
457	type AssetIdParameter = codec::Compact<AssetId>;
458	type Currency = Balances;
459	type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
460	type ForceOrigin = EnsureRoot<AccountId>;
461	type AssetDeposit = AssetDeposit;
462	type MetadataDepositBase = MetadataDepositBase;
463	type MetadataDepositPerByte = MetadataDepositPerByte;
464	type ApprovalDeposit = ApprovalDeposit;
465	type StringLimit = AssetsStringLimit;
466	type Freezer = ();
467	type Extra = ();
468	type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
469	type CallbackHandle = ();
470	type AssetAccountDeposit = AssetAccountDeposit;
471	type RemoveItemsLimit = frame_support::traits::ConstU32<1000>;
472	#[cfg(feature = "runtime-benchmarks")]
473	type BenchmarkHelper = ();
474}
475
476parameter_types! {
477	// we just reuse the same deposits
478	pub const ForeignAssetsAssetDeposit: Balance = AssetDeposit::get();
479	pub const ForeignAssetsAssetAccountDeposit: Balance = AssetAccountDeposit::get();
480	pub const ForeignAssetsApprovalDeposit: Balance = ApprovalDeposit::get();
481	pub const ForeignAssetsAssetsStringLimit: u32 = AssetsStringLimit::get();
482	pub const ForeignAssetsMetadataDepositBase: Balance = MetadataDepositBase::get();
483	pub const ForeignAssetsMetadataDepositPerByte: Balance = MetadataDepositPerByte::get();
484}
485
486/// Another pallet assets instance to store foreign assets from bridgehub.
487pub type ForeignAssetsInstance = pallet_assets::Instance2;
488impl pallet_assets::Config<ForeignAssetsInstance> for Runtime {
489	type RuntimeEvent = RuntimeEvent;
490	type Balance = Balance;
491	type AssetId = ForeignAssetsAssetId;
492	type AssetIdParameter = ForeignAssetsAssetId;
493	type Currency = Balances;
494	type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
495	type ForceOrigin = EnsureRoot<AccountId>;
496	type AssetDeposit = ForeignAssetsAssetDeposit;
497	type MetadataDepositBase = ForeignAssetsMetadataDepositBase;
498	type MetadataDepositPerByte = ForeignAssetsMetadataDepositPerByte;
499	type ApprovalDeposit = ForeignAssetsApprovalDeposit;
500	type StringLimit = ForeignAssetsAssetsStringLimit;
501	type Freezer = ();
502	type Extra = ();
503	type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
504	type CallbackHandle = ();
505	type AssetAccountDeposit = ForeignAssetsAssetAccountDeposit;
506	type RemoveItemsLimit = frame_support::traits::ConstU32<1000>;
507	#[cfg(feature = "runtime-benchmarks")]
508	type BenchmarkHelper = xcm_config::XcmBenchmarkHelper;
509}
510
511parameter_types! {
512	pub const AssetConversionPalletId: PalletId = PalletId(*b"py/ascon");
513	pub const LiquidityWithdrawalFee: Permill = Permill::from_percent(0);
514}
515
516ord_parameter_types! {
517	pub const AssetConversionOrigin: sp_runtime::AccountId32 =
518		AccountIdConversion::<sp_runtime::AccountId32>::into_account_truncating(&AssetConversionPalletId::get());
519}
520
521pub type AssetsForceOrigin = EnsureRoot<AccountId>;
522
523pub type PoolAssetsInstance = pallet_assets::Instance3;
524impl pallet_assets::Config<PoolAssetsInstance> for Runtime {
525	type RuntimeEvent = RuntimeEvent;
526	type Balance = Balance;
527	type RemoveItemsLimit = ConstU32<1000>;
528	type AssetId = u32;
529	type AssetIdParameter = u32;
530	type Currency = Balances;
531	type CreateOrigin =
532		AsEnsureOriginWithArg<EnsureSignedBy<AssetConversionOrigin, sp_runtime::AccountId32>>;
533	type ForceOrigin = AssetsForceOrigin;
534	type AssetDeposit = ConstU128<0>;
535	type AssetAccountDeposit = ConstU128<0>;
536	type MetadataDepositBase = ConstU128<0>;
537	type MetadataDepositPerByte = ConstU128<0>;
538	type ApprovalDeposit = ConstU128<0>;
539	type StringLimit = ConstU32<50>;
540	type Freezer = ();
541	type Extra = ();
542	type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
543	type CallbackHandle = ();
544	#[cfg(feature = "runtime-benchmarks")]
545	type BenchmarkHelper = ();
546}
547
548/// Union fungibles implementation for `Assets` and `ForeignAssets`.
549pub type LocalAndForeignAssets = fungibles::UnionOf<
550	Assets,
551	ForeignAssets,
552	LocalFromLeft<
553		AssetIdForTrustBackedAssetsConvert<
554			xcm_config::TrustBackedAssetsPalletLocation,
555			xcm::latest::Location,
556		>,
557		parachains_common::AssetIdForTrustBackedAssets,
558		xcm::latest::Location,
559	>,
560	xcm::latest::Location,
561	AccountId,
562>;
563
564/// Union fungibles implementation for [`LocalAndForeignAssets`] and `Balances`.
565pub type NativeAndAssets = fungible::UnionOf<
566	Balances,
567	LocalAndForeignAssets,
568	TargetFromLeft<xcm_config::RelayLocation, xcm::latest::Location>,
569	xcm::latest::Location,
570	AccountId,
571>;
572
573pub type PoolIdToAccountId = pallet_asset_conversion::AccountIdConverter<
574	AssetConversionPalletId,
575	(xcm::latest::Location, xcm::latest::Location),
576>;
577
578impl pallet_asset_conversion::Config for Runtime {
579	type RuntimeEvent = RuntimeEvent;
580	type Balance = Balance;
581	type HigherPrecisionBalance = sp_core::U256;
582	type AssetKind = xcm::latest::Location;
583	type Assets = NativeAndAssets;
584	type PoolId = (Self::AssetKind, Self::AssetKind);
585	type PoolLocator = pallet_asset_conversion::WithFirstAsset<
586		xcm_config::RelayLocation,
587		AccountId,
588		Self::AssetKind,
589		PoolIdToAccountId,
590	>;
591	type PoolAssetId = u32;
592	type PoolAssets = PoolAssets;
593	type PoolSetupFee = ConstU128<0>; // Asset class deposit fees are sufficient to prevent spam
594	type PoolSetupFeeAsset = xcm_config::RelayLocation;
595	type PoolSetupFeeTarget = ResolveAssetTo<AssetConversionOrigin, Self::Assets>;
596	type LiquidityWithdrawalFee = LiquidityWithdrawalFee;
597	type LPFee = ConstU32<3>;
598	type PalletId = AssetConversionPalletId;
599	type MaxSwapPathLength = ConstU32<3>;
600	type MintMinLiquidity = ConstU128<100>;
601	type WeightInfo = ();
602	#[cfg(feature = "runtime-benchmarks")]
603	type BenchmarkHelper = assets_common::benchmarks::AssetPairFactory<
604		xcm_config::RelayLocation,
605		parachain_info::Pallet<Runtime>,
606		xcm_config::TrustBackedAssetsPalletIndex,
607		xcm::latest::Location,
608	>;
609}
610
611parameter_types! {
612	pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
613	pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
614	pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent;
615}
616
617impl cumulus_pallet_parachain_system::Config for Runtime {
618	type WeightInfo = ();
619	type RuntimeEvent = RuntimeEvent;
620	type OnSystemEvent = ();
621	type SelfParaId = parachain_info::Pallet<Runtime>;
622	type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
623	type ReservedDmpWeight = ReservedDmpWeight;
624	type OutboundXcmpMessageSource = XcmpQueue;
625	type XcmpMessageHandler = XcmpQueue;
626	type ReservedXcmpWeight = ReservedXcmpWeight;
627	type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases;
628	type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<
629		Runtime,
630		RELAY_CHAIN_SLOT_DURATION_MILLIS,
631		BLOCK_PROCESSING_VELOCITY,
632		UNINCLUDED_SEGMENT_CAPACITY,
633	>;
634}
635
636impl parachain_info::Config for Runtime {}
637
638parameter_types! {
639	pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block;
640}
641
642impl pallet_message_queue::Config for Runtime {
643	type RuntimeEvent = RuntimeEvent;
644	type WeightInfo = ();
645	type MessageProcessor = xcm_builder::ProcessXcmMessage<
646		AggregateMessageOrigin,
647		xcm_executor::XcmExecutor<xcm_config::XcmConfig>,
648		RuntimeCall,
649	>;
650	type Size = u32;
651	// The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin:
652	type QueueChangeHandler = NarrowOriginToSibling<XcmpQueue>;
653	type QueuePausedQuery = NarrowOriginToSibling<XcmpQueue>;
654	type HeapSize = sp_core::ConstU32<{ 103 * 1024 }>;
655	type MaxStale = sp_core::ConstU32<8>;
656	type ServiceWeight = MessageQueueServiceWeight;
657	type IdleMaxServiceWeight = MessageQueueServiceWeight;
658}
659
660impl cumulus_pallet_aura_ext::Config for Runtime {}
661
662parameter_types! {
663	/// The asset ID for the asset that we use to pay for message delivery fees.
664	pub FeeAssetId: AssetLocationId = AssetLocationId(xcm_config::RelayLocation::get());
665	/// The base fee for the message delivery fees (3 CENTS).
666	pub const BaseDeliveryFee: u128 = (1_000_000_000_000u128 / 100).saturating_mul(3);
667}
668
669pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
670	FeeAssetId,
671	BaseDeliveryFee,
672	TransactionByteFee,
673	XcmpQueue,
674>;
675
676impl cumulus_pallet_xcmp_queue::Config for Runtime {
677	type RuntimeEvent = RuntimeEvent;
678	type ChannelInfo = ParachainSystem;
679	type VersionWrapper = PolkadotXcm;
680	// Enqueue XCMP messages from siblings for later processing.
681	type XcmpQueue = TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>;
682	type MaxInboundSuspended = ConstU32<1_000>;
683	type MaxActiveOutboundChannels = ConstU32<128>;
684	// Most on-chain HRMP channels are configured to use 102400 bytes of max message size, so we
685	// need to set the page size larger than that until we reduce the channel size on-chain.
686	type MaxPageSize = ConstU32<{ 103 * 1024 }>;
687	type ControllerOrigin = EnsureRoot<AccountId>;
688	type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
689	type WeightInfo = ();
690	type PriceForSiblingDelivery = PriceForSiblingParachainDelivery;
691}
692
693parameter_types! {
694	pub const Period: u32 = 6 * HOURS;
695	pub const Offset: u32 = 0;
696}
697
698impl pallet_session::Config for Runtime {
699	type RuntimeEvent = RuntimeEvent;
700	type ValidatorId = <Self as frame_system::Config>::AccountId;
701	// we don't have stash and controller, thus we don't need the convert as well.
702	type ValidatorIdOf = pallet_collator_selection::IdentityCollator;
703	type ShouldEndSession = pallet_session::PeriodicSessions<Period, Offset>;
704	type NextSessionRotation = pallet_session::PeriodicSessions<Period, Offset>;
705	type SessionManager = CollatorSelection;
706	// Essentially just Aura, but let's be pedantic.
707	type SessionHandler = <SessionKeys as sp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
708	type Keys = SessionKeys;
709	type WeightInfo = ();
710}
711
712impl pallet_aura::Config for Runtime {
713	type AuthorityId = AuraId;
714	type DisabledValidators = ();
715	type MaxAuthorities = ConstU32<100_000>;
716	type AllowMultipleBlocksPerSlot = ConstBool<false>;
717	type SlotDuration = pallet_aura::MinimumPeriodTimesTwo<Self>;
718}
719
720parameter_types! {
721	pub const PotId: PalletId = PalletId(*b"PotStake");
722	pub const SessionLength: BlockNumber = 6 * HOURS;
723	pub const ExecutiveBody: BodyId = BodyId::Executive;
724}
725
726// We allow root only to execute privileged collator selection operations.
727pub type CollatorSelectionUpdateOrigin = EnsureRoot<AccountId>;
728
729impl pallet_collator_selection::Config for Runtime {
730	type RuntimeEvent = RuntimeEvent;
731	type Currency = Balances;
732	type UpdateOrigin = CollatorSelectionUpdateOrigin;
733	type PotId = PotId;
734	type MaxCandidates = ConstU32<100>;
735	type MinEligibleCollators = ConstU32<4>;
736	type MaxInvulnerables = ConstU32<20>;
737	// should be a multiple of session or things will get inconsistent
738	type KickThreshold = Period;
739	type ValidatorId = <Self as frame_system::Config>::AccountId;
740	type ValidatorIdOf = pallet_collator_selection::IdentityCollator;
741	type ValidatorRegistration = Session;
742	type WeightInfo = ();
743}
744
745impl pallet_asset_tx_payment::Config for Runtime {
746	type RuntimeEvent = RuntimeEvent;
747	type Fungibles = Assets;
748	type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter<
749		pallet_assets::BalanceToAssetBalance<
750			Balances,
751			Runtime,
752			ConvertInto,
753			TrustBackedAssetsInstance,
754		>,
755		AssetsToBlockAuthor<Runtime, TrustBackedAssetsInstance>,
756	>;
757}
758
759impl pallet_sudo::Config for Runtime {
760	type RuntimeEvent = RuntimeEvent;
761	type RuntimeCall = RuntimeCall;
762	type WeightInfo = pallet_sudo::weights::SubstrateWeight<Runtime>;
763}
764
765// Create the runtime by composing the FRAME pallets that were previously configured.
766construct_runtime!(
767	pub enum Runtime
768	{
769		// System support stuff.
770		System: frame_system = 0,
771		ParachainSystem: cumulus_pallet_parachain_system = 1,
772		Timestamp: pallet_timestamp = 2,
773		ParachainInfo: parachain_info = 3,
774
775		// Monetary stuff.
776		Balances: pallet_balances = 10,
777		TransactionPayment: pallet_transaction_payment = 11,
778		AssetTxPayment: pallet_asset_tx_payment = 12,
779
780		// Collator support. The order of these 4 are important and shall not change.
781		Authorship: pallet_authorship = 20,
782		CollatorSelection: pallet_collator_selection = 21,
783		Session: pallet_session = 22,
784		Aura: pallet_aura = 23,
785		AuraExt: cumulus_pallet_aura_ext = 24,
786
787		// XCM helpers.
788		XcmpQueue: cumulus_pallet_xcmp_queue = 30,
789		PolkadotXcm: pallet_xcm = 31,
790		CumulusXcm: cumulus_pallet_xcm = 32,
791		MessageQueue: pallet_message_queue = 34,
792
793		// The main stage.
794		Assets: pallet_assets::<Instance1> = 50,
795		ForeignAssets: pallet_assets::<Instance2> = 51,
796		PoolAssets: pallet_assets::<Instance3> = 52,
797		AssetConversion: pallet_asset_conversion = 53,
798
799		Sudo: pallet_sudo = 255,
800	}
801);
802
803#[cfg(feature = "runtime-benchmarks")]
804mod benches {
805	frame_benchmarking::define_benchmarks!(
806		[frame_system, SystemBench::<Runtime>]
807		[pallet_balances, Balances]
808		[pallet_message_queue, MessageQueue]
809		[pallet_session, SessionBench::<Runtime>]
810		[pallet_sudo, Sudo]
811		[pallet_timestamp, Timestamp]
812		[pallet_collator_selection, CollatorSelection]
813		[cumulus_pallet_parachain_system, ParachainSystem]
814		[cumulus_pallet_xcmp_queue, XcmpQueue]
815	);
816}
817
818impl_runtime_apis! {
819	impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {
820		fn slot_duration() -> sp_consensus_aura::SlotDuration {
821			sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration())
822		}
823
824		fn authorities() -> Vec<AuraId> {
825			pallet_aura::Authorities::<Runtime>::get().into_inner()
826		}
827	}
828
829	impl sp_api::Core<Block> for Runtime {
830		fn version() -> RuntimeVersion {
831			VERSION
832		}
833
834		fn execute_block(block: Block) {
835			Executive::execute_block(block)
836		}
837
838		fn initialize_block(header: &<Block as BlockT>::Header) -> sp_runtime::ExtrinsicInclusionMode {
839			Executive::initialize_block(header)
840		}
841	}
842
843	impl sp_api::Metadata<Block> for Runtime {
844		fn metadata() -> OpaqueMetadata {
845			OpaqueMetadata::new(Runtime::metadata().into())
846		}
847
848		fn metadata_at_version(version: u32) -> Option<OpaqueMetadata> {
849			Runtime::metadata_at_version(version)
850		}
851
852		fn metadata_versions() -> alloc::vec::Vec<u32> {
853			Runtime::metadata_versions()
854		}
855	}
856
857	impl sp_block_builder::BlockBuilder<Block> for Runtime {
858		fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
859			Executive::apply_extrinsic(extrinsic)
860		}
861
862		fn finalize_block() -> <Block as BlockT>::Header {
863			Executive::finalize_block()
864		}
865
866		fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {
867			data.create_extrinsics()
868		}
869
870		fn check_inherents(
871			block: Block,
872			data: sp_inherents::InherentData,
873		) -> sp_inherents::CheckInherentsResult {
874			data.check_extrinsics(&block)
875		}
876	}
877
878	impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {
879		fn validate_transaction(
880			source: TransactionSource,
881			tx: <Block as BlockT>::Extrinsic,
882			block_hash: <Block as BlockT>::Hash,
883		) -> TransactionValidity {
884			Executive::validate_transaction(source, tx, block_hash)
885		}
886	}
887
888	impl sp_offchain::OffchainWorkerApi<Block> for Runtime {
889		fn offchain_worker(header: &<Block as BlockT>::Header) {
890			Executive::offchain_worker(header)
891		}
892	}
893
894	impl sp_session::SessionKeys<Block> for Runtime {
895		fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
896			SessionKeys::generate(seed)
897		}
898
899		fn decode_session_keys(
900			encoded: Vec<u8>,
901		) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {
902			SessionKeys::decode_into_raw_public_keys(&encoded)
903		}
904	}
905
906	impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
907		fn account_nonce(account: AccountId) -> Nonce {
908			System::account_nonce(account)
909		}
910	}
911
912	impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {
913		fn query_info(
914			uxt: <Block as BlockT>::Extrinsic,
915			len: u32,
916		) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo<Balance> {
917			TransactionPayment::query_info(uxt, len)
918		}
919		fn query_fee_details(
920			uxt: <Block as BlockT>::Extrinsic,
921			len: u32,
922		) -> pallet_transaction_payment::FeeDetails<Balance> {
923			TransactionPayment::query_fee_details(uxt, len)
924		}
925		fn query_weight_to_fee(weight: Weight) -> Balance {
926			TransactionPayment::weight_to_fee(weight)
927		}
928		fn query_length_to_fee(length: u32) -> Balance {
929			TransactionPayment::length_to_fee(length)
930		}
931	}
932
933	impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
934		for Runtime
935	{
936		fn query_call_info(
937			call: RuntimeCall,
938			len: u32,
939		) -> pallet_transaction_payment::RuntimeDispatchInfo<Balance> {
940			TransactionPayment::query_call_info(call, len)
941		}
942		fn query_call_fee_details(
943			call: RuntimeCall,
944			len: u32,
945		) -> pallet_transaction_payment::FeeDetails<Balance> {
946			TransactionPayment::query_call_fee_details(call, len)
947		}
948		fn query_weight_to_fee(weight: Weight) -> Balance {
949			TransactionPayment::weight_to_fee(weight)
950		}
951		fn query_length_to_fee(length: u32) -> Balance {
952			TransactionPayment::length_to_fee(length)
953		}
954	}
955
956	impl cumulus_primitives_core::CollectCollationInfo<Block> for Runtime {
957		fn collect_collation_info(header: &<Block as BlockT>::Header) -> cumulus_primitives_core::CollationInfo {
958			ParachainSystem::collect_collation_info(header)
959		}
960	}
961
962	impl xcm_runtime_apis::fees::XcmPaymentApi<Block> for Runtime {
963		fn query_acceptable_payment_assets(xcm_version: xcm::Version) -> Result<Vec<VersionedAssetId>, XcmPaymentApiError> {
964			let acceptable_assets = vec![AssetLocationId(xcm_config::RelayLocation::get())];
965			PolkadotXcm::query_acceptable_payment_assets(xcm_version, acceptable_assets)
966		}
967
968		fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result<u128, XcmPaymentApiError> {
969			match asset.try_as::<AssetLocationId>() {
970				Ok(asset_id) if asset_id.0 == xcm_config::RelayLocation::get() => {
971					// for native token
972					Ok(WeightToFee::weight_to_fee(&weight))
973				},
974				Ok(asset_id) => {
975					log::trace!(target: "xcm::xcm_runtime_apis", "query_weight_to_asset_fee - unhandled asset_id: {asset_id:?}!");
976					Err(XcmPaymentApiError::AssetNotFound)
977				},
978				Err(_) => {
979					log::trace!(target: "xcm::xcm_runtime_apis", "query_weight_to_asset_fee - failed to convert asset: {asset:?}!");
980					Err(XcmPaymentApiError::VersionedConversionFailed)
981				}
982			}
983		}
984
985		fn query_xcm_weight(message: VersionedXcm<()>) -> Result<Weight, XcmPaymentApiError> {
986			PolkadotXcm::query_xcm_weight(message)
987		}
988
989		fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>) -> Result<VersionedAssets, XcmPaymentApiError> {
990			PolkadotXcm::query_delivery_fees(destination, message)
991		}
992	}
993
994	impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime {
995		fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> {
996			PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version)
997		}
998
999		fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> {
1000			PolkadotXcm::dry_run_xcm::<Runtime, xcm_config::XcmRouter, RuntimeCall, xcm_config::XcmConfig>(origin_location, xcm)
1001		}
1002	}
1003
1004	#[cfg(feature = "try-runtime")]
1005	impl frame_try_runtime::TryRuntime<Block> for Runtime {
1006		fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) {
1007			let weight = Executive::try_runtime_upgrade(checks).unwrap();
1008			(weight, RuntimeBlockWeights::get().max_block)
1009		}
1010
1011		fn execute_block(
1012			block: Block,
1013			state_root_check: bool,
1014			signature_check: bool,
1015			select: frame_try_runtime::TryStateSelect,
1016		) -> Weight {
1017			// NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to
1018			// have a backtrace here.
1019			Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap()
1020		}
1021	}
1022
1023	#[cfg(feature = "runtime-benchmarks")]
1024	impl frame_benchmarking::Benchmark<Block> for Runtime {
1025		fn benchmark_metadata(extra: bool) -> (
1026			Vec<frame_benchmarking::BenchmarkList>,
1027			Vec<frame_support::traits::StorageInfo>,
1028		) {
1029			use frame_benchmarking::{Benchmarking, BenchmarkList};
1030			use frame_support::traits::StorageInfoTrait;
1031			use frame_system_benchmarking::Pallet as SystemBench;
1032			use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
1033
1034			let mut list = Vec::<BenchmarkList>::new();
1035			list_benchmarks!(list, extra);
1036
1037			let storage_info = AllPalletsWithSystem::storage_info();
1038			(list, storage_info)
1039		}
1040
1041		fn dispatch_benchmark(
1042			config: frame_benchmarking::BenchmarkConfig
1043		) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
1044			use frame_benchmarking::{Benchmarking, BenchmarkBatch};
1045			use sp_storage::TrackedStorageKey;
1046
1047			use frame_system_benchmarking::Pallet as SystemBench;
1048			impl frame_system_benchmarking::Config for Runtime {}
1049
1050			use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
1051			impl cumulus_pallet_session_benchmarking::Config for Runtime {}
1052
1053			let whitelist: Vec<TrackedStorageKey> = vec![
1054				// Block Number
1055				hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),
1056				// Total Issuance
1057				hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),
1058				// Execution Phase
1059				hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),
1060				// Event Count
1061				hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),
1062				// System Events
1063				hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),
1064			];
1065
1066			let mut batches = Vec::<BenchmarkBatch>::new();
1067			let params = (&config, &whitelist);
1068			add_benchmarks!(params, batches);
1069
1070			if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
1071			Ok(batches)
1072		}
1073	}
1074
1075	impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
1076		fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
1077			build_state::<RuntimeGenesisConfig>(config)
1078		}
1079
1080		fn get_preset(id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
1081			get_preset::<RuntimeGenesisConfig>(id, |_| None)
1082		}
1083
1084		fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
1085			vec![]
1086		}
1087	}
1088}
1089
1090cumulus_pallet_parachain_system::register_validate_block! {
1091	Runtime = Runtime,
1092	BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,
1093}