1#![cfg_attr(not(feature = "std"), no_std)]
17#![recursion_limit = "256"]
19
20#[cfg(feature = "std")]
22include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
23
24#[cfg(feature = "std")]
28pub mod fast_runtime_binary {
29 include!(concat!(env!("OUT_DIR"), "/fast_runtime_binary.rs"));
30}
31
32mod coretime;
33mod genesis_config_presets;
34mod weights;
35pub mod xcm_config;
36
37extern crate alloc;
38
39use alloc::{vec, vec::Vec};
40use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
41use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;
42use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
43use frame_support::{
44 construct_runtime, derive_impl,
45 dispatch::DispatchClass,
46 genesis_builder_helper::{build_state, get_preset},
47 parameter_types,
48 traits::{
49 ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter, TransformOrigin,
50 },
51 weights::{ConstantMultiplier, Weight},
52 PalletId,
53};
54use frame_system::{
55 limits::{BlockLength, BlockWeights},
56 EnsureRoot,
57};
58use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
59use parachains_common::{
60 impls::DealWithFees,
61 message_queue::{NarrowOriginToSibling, ParaIdToSibling},
62 AccountId, AuraId, Balance, BlockNumber, Hash, Header, Nonce, Signature,
63 AVERAGE_ON_INITIALIZE_RATIO, NORMAL_DISPATCH_RATIO,
64};
65use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
66use sp_api::impl_runtime_apis;
67use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
68#[cfg(any(feature = "std", test))]
69pub use sp_runtime::BuildStorage;
70use sp_runtime::{
71 generic, impl_opaque_keys,
72 traits::{BlakeTwo256, Block as BlockT, BlockNumberProvider},
73 transaction_validity::{TransactionSource, TransactionValidity},
74 ApplyExtrinsicResult, Debug, DispatchError, MultiAddress, MultiSignature, MultiSigner, Perbill,
75 Percent,
76};
77use sp_session::OpaqueGeneratedSessionKeys;
78#[cfg(feature = "std")]
79use sp_version::NativeVersion;
80use sp_version::RuntimeVersion;
81use testnet_parachains_constants::westend::{consensus::*, currency::*, fee::WeightToFee, time::*};
82use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};
83use xcm::{prelude::*, Version as XcmVersion};
84use xcm_config::{
85 FellowshipLocation, GovernanceLocation, TokenRelayLocation, XcmConfig,
86 XcmOriginToTransactDispatchOrigin,
87};
88use xcm_runtime_apis::{
89 dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects},
90 fees::Error as XcmPaymentApiError,
91};
92
93pub type Address = MultiAddress<AccountId, ()>;
95
96pub type Block = generic::Block<Header, UncheckedExtrinsic>;
98
99pub type SignedBlock = generic::SignedBlock<Block>;
101
102pub type BlockId = generic::BlockId<Block>;
104
105pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim<
107 Runtime,
108 (
109 frame_system::AuthorizeCall<Runtime>,
110 frame_system::CheckNonZeroSender<Runtime>,
111 frame_system::CheckSpecVersion<Runtime>,
112 frame_system::CheckTxVersion<Runtime>,
113 frame_system::CheckGenesis<Runtime>,
114 frame_system::CheckEra<Runtime>,
115 frame_system::CheckNonce<Runtime>,
116 frame_system::CheckWeight<Runtime>,
117 pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
118 frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
119 ),
120>;
121
122pub type UncheckedExtrinsic =
124 generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, TxExtension>;
125
126pub type Migrations = (
128 pallet_collator_selection::migration::v2::MigrationToV2<Runtime>,
129 cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4<Runtime>,
130 cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5<Runtime>,
131 cumulus_pallet_xcmp_queue::migration::v6::MigrateV5ToV6<Runtime>,
132 cumulus_pallet_xcmp_queue::migration::v7::MigrateV6ToV7<Runtime>,
133 pallet_broker::migration::MigrateV0ToV1<Runtime>,
134 pallet_broker::migration::MigrateV1ToV2<Runtime>,
135 pallet_broker::migration::MigrateV2ToV3<Runtime>,
136 pallet_broker::migration::MigrateV3ToV4<Runtime, BrokerMigrationV4BlockConversion>,
137 pallet_session::migrations::v1::MigrateV0ToV1<
138 Runtime,
139 pallet_session::migrations::v1::InitOffenceSeverity<Runtime>,
140 >,
141 pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
143 cumulus_pallet_aura_ext::migration::MigrateV0ToV1<Runtime>,
144);
145
146pub type Executive = frame_executive::Executive<
148 Runtime,
149 Block,
150 frame_system::ChainContext<Runtime>,
151 Runtime,
152 AllPalletsWithSystem,
153>;
154
155impl_opaque_keys! {
156 pub struct SessionKeys {
157 pub aura: Aura,
158 }
159}
160
161#[sp_version::runtime_version]
162pub const VERSION: RuntimeVersion = RuntimeVersion {
163 spec_name: alloc::borrow::Cow::Borrowed("coretime-westend"),
164 impl_name: alloc::borrow::Cow::Borrowed("coretime-westend"),
165 authoring_version: 1,
166 spec_version: 1_022_002,
167 impl_version: 0,
168 apis: RUNTIME_API_VERSIONS,
169 transaction_version: 2,
170 system_version: 1,
171};
172
173#[cfg(feature = "std")]
175pub fn native_version() -> NativeVersion {
176 NativeVersion { runtime_version: VERSION, can_author_with: Default::default() }
177}
178
179parameter_types! {
180 pub const Version: RuntimeVersion = VERSION;
181 pub RuntimeBlockLength: BlockLength = BlockLength::builder()
182 .max_length(5 * 1024 * 1024)
183 .modify_max_length_for_class(DispatchClass::Normal, |m| {
184 *m = NORMAL_DISPATCH_RATIO * *m
185 })
186 .build();
187 pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()
188 .base_block(BlockExecutionWeight::get())
189 .for_class(DispatchClass::all(), |weights| {
190 weights.base_extrinsic = ExtrinsicBaseWeight::get();
191 })
192 .for_class(DispatchClass::Normal, |weights| {
193 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
194 })
195 .for_class(DispatchClass::Operational, |weights| {
196 weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);
197 weights.reserved = Some(
200 MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT
201 );
202 })
203 .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
204 .build_or_panic();
205 pub const SS58Prefix: u8 = 42;
206}
207
208#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig)]
210impl frame_system::Config for Runtime {
211 type AccountId = AccountId;
213 type Nonce = Nonce;
215 type Hash = Hash;
217 type Block = Block;
219 type BlockHashCount = BlockHashCount;
221 type Version = Version;
223 type AccountData = pallet_balances::AccountData<Balance>;
225 type DbWeight = RocksDbWeight;
227 type SystemWeightInfo = weights::frame_system::WeightInfo<Runtime>;
229 type ExtensionsWeightInfo = weights::frame_system_extensions::WeightInfo<Runtime>;
231 type BlockWeights = RuntimeBlockWeights;
233 type BlockLength = RuntimeBlockLength;
235 type SS58Prefix = SS58Prefix;
236 type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
238 type MaxConsumers = ConstU32<16>;
239 type SingleBlockMigrations = Migrations;
240}
241
242impl cumulus_pallet_weight_reclaim::Config for Runtime {
243 type WeightInfo = weights::cumulus_pallet_weight_reclaim::WeightInfo<Runtime>;
244}
245
246impl pallet_timestamp::Config for Runtime {
247 type Moment = u64;
249 type OnTimestampSet = Aura;
250 type MinimumPeriod = ConstU64<0>;
251 type WeightInfo = weights::pallet_timestamp::WeightInfo<Runtime>;
252}
253
254impl pallet_authorship::Config for Runtime {
255 type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Aura>;
256 type EventHandler = (CollatorSelection,);
257}
258
259parameter_types! {
260 pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT;
261}
262
263impl pallet_balances::Config for Runtime {
264 type Balance = Balance;
265 type DustRemoval = DapSatellite;
266 type RuntimeEvent = RuntimeEvent;
267 type ExistentialDeposit = ExistentialDeposit;
268 type AccountStore = System;
269 type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>;
270 type MaxLocks = ConstU32<50>;
271 type MaxReserves = ConstU32<50>;
272 type ReserveIdentifier = [u8; 8];
273 type RuntimeHoldReason = RuntimeHoldReason;
274 type RuntimeFreezeReason = RuntimeFreezeReason;
275 type FreezeIdentifier = ();
276 type MaxFreezes = ConstU32<0>;
277 type DoneSlashHandler = ();
278}
279
280parameter_types! {
281 pub const TransactionByteFee: Balance = MILLICENTS;
283 pub const DapSatelliteFeePercent: Percent = Percent::from_percent(100);
285}
286
287pub type DealWithFeesSatellite =
288 pallet_dap_satellite::DealWithFeesSplit<Runtime, DapSatelliteFeePercent, DealWithFees<Runtime>>;
289
290impl pallet_transaction_payment::Config for Runtime {
291 type RuntimeEvent = RuntimeEvent;
292 type OnChargeTransaction =
293 pallet_transaction_payment::FungibleAdapter<Balances, DealWithFeesSatellite>;
294 type OperationalFeeMultiplier = ConstU8<5>;
295 type WeightToFee = WeightToFee;
296 type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
297 type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
298 type WeightInfo = weights::pallet_transaction_payment::WeightInfo<Runtime>;
299}
300
301parameter_types! {
302 pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
303 pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
304 pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent;
305}
306
307impl cumulus_pallet_parachain_system::Config for Runtime {
308 type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo<Runtime>;
309 type RuntimeEvent = RuntimeEvent;
310 type OnSystemEvent = ();
311 type SelfParaId = parachain_info::Pallet<Runtime>;
312 type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
313 type OutboundXcmpMessageSource = XcmpQueue;
314 type ReservedDmpWeight = ReservedDmpWeight;
315 type XcmpMessageHandler = XcmpQueue;
316 type ReservedXcmpWeight = ReservedXcmpWeight;
317 type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases;
318 type ConsensusHook = ConsensusHook;
319 type RelayParentOffset = ConstU32<0>;
320}
321
322type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<
323 Runtime,
324 RELAY_CHAIN_SLOT_DURATION_MILLIS,
325 BLOCK_PROCESSING_VELOCITY,
326 UNINCLUDED_SEGMENT_CAPACITY,
327>;
328
329parameter_types! {
330 pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block;
331}
332
333impl pallet_message_queue::Config for Runtime {
334 type RuntimeEvent = RuntimeEvent;
335 type WeightInfo = weights::pallet_message_queue::WeightInfo<Runtime>;
336 #[cfg(feature = "runtime-benchmarks")]
337 type MessageProcessor = pallet_message_queue::mock_helpers::NoopMessageProcessor<
338 cumulus_primitives_core::AggregateMessageOrigin,
339 >;
340 #[cfg(not(feature = "runtime-benchmarks"))]
341 type MessageProcessor = xcm_builder::ProcessXcmMessage<
342 AggregateMessageOrigin,
343 xcm_executor::XcmExecutor<xcm_config::XcmConfig>,
344 RuntimeCall,
345 >;
346 type Size = u32;
347 type QueueChangeHandler = NarrowOriginToSibling<XcmpQueue>;
349 type QueuePausedQuery = NarrowOriginToSibling<XcmpQueue>;
350 type HeapSize = sp_core::ConstU32<{ 103 * 1024 }>;
351 type MaxStale = sp_core::ConstU32<8>;
352 type ServiceWeight = MessageQueueServiceWeight;
353 type IdleMaxServiceWeight = MessageQueueServiceWeight;
354}
355
356impl parachain_info::Config for Runtime {}
357
358impl cumulus_pallet_aura_ext::Config for Runtime {}
359
360parameter_types! {
361 pub const FellowsBodyId: BodyId = BodyId::Technical;
363}
364
365pub type RootOrFellows = EitherOfDiverse<
367 EnsureRoot<AccountId>,
368 EnsureXcm<IsVoiceOfBody<FellowshipLocation, FellowsBodyId>>,
369>;
370
371parameter_types! {
372 pub FeeAssetId: AssetId = AssetId(TokenRelayLocation::get());
374 pub const BaseDeliveryFee: u128 = CENTS.saturating_mul(3);
376}
377
378pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
379 FeeAssetId,
380 BaseDeliveryFee,
381 TransactionByteFee,
382 XcmpQueue,
383>;
384
385impl cumulus_pallet_xcmp_queue::Config for Runtime {
386 type RuntimeEvent = RuntimeEvent;
387 type ChannelInfo = ParachainSystem;
388 type VersionWrapper = PolkadotXcm;
389 type XcmpQueue = TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>;
390 type MaxInboundSuspended = ConstU32<1_000>;
391 type MaxActiveOutboundChannels = ConstU32<128>;
392 type MaxPageSize = ConstU32<{ 103 * 1024 }>;
395 type ControllerOrigin = RootOrFellows;
396 type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
397 type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
398 type PriceForSiblingDelivery = PriceForSiblingParachainDelivery;
399}
400
401impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime {
402 type ChannelList = ParachainSystem;
404}
405
406pub const PERIOD: u32 = 6 * HOURS;
407pub const OFFSET: u32 = 0;
408
409impl pallet_session::Config for Runtime {
410 type RuntimeEvent = RuntimeEvent;
411 type ValidatorId = <Self as frame_system::Config>::AccountId;
412 type ValidatorIdOf = pallet_collator_selection::IdentityCollator;
414 type ShouldEndSession = pallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
415 type NextSessionRotation = pallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
416 type SessionManager = CollatorSelection;
417 type SessionHandler = <SessionKeys as sp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
419 type Keys = SessionKeys;
420 type DisablingStrategy = ();
421 type WeightInfo = weights::pallet_session::WeightInfo<Runtime>;
422 type Currency = Balances;
423 type KeyDeposit = ();
424}
425
426impl pallet_aura::Config for Runtime {
427 type AuthorityId = AuraId;
428 type DisabledValidators = ();
429 type MaxAuthorities = ConstU32<100_000>;
430 type AllowMultipleBlocksPerSlot = ConstBool<true>;
431 type SlotDuration = ConstU64<SLOT_DURATION>;
432}
433
434parameter_types! {
435 pub const PotId: PalletId = PalletId(*b"PotStake");
436 pub const SessionLength: BlockNumber = 6 * HOURS;
437 pub const StakingAdminBodyId: BodyId = BodyId::Defense;
439}
440
441pub type CollatorSelectionUpdateOrigin = EitherOfDiverse<
443 EnsureRoot<AccountId>,
444 EnsureXcm<IsVoiceOfBody<GovernanceLocation, StakingAdminBodyId>>,
445>;
446
447impl pallet_collator_selection::Config for Runtime {
448 type RuntimeEvent = RuntimeEvent;
449 type Currency = Balances;
450 type UpdateOrigin = CollatorSelectionUpdateOrigin;
451 type PotId = PotId;
452 type MaxCandidates = ConstU32<100>;
453 type MinEligibleCollators = ConstU32<4>;
454 type MaxInvulnerables = ConstU32<20>;
455 type KickThreshold = ConstU32<PERIOD>;
457 type ValidatorId = <Self as frame_system::Config>::AccountId;
458 type ValidatorIdOf = pallet_collator_selection::IdentityCollator;
459 type ValidatorRegistration = Session;
460 type WeightInfo = weights::pallet_collator_selection::WeightInfo<Runtime>;
461}
462
463parameter_types! {
464 pub const DepositBase: Balance = deposit(1, 88);
466 pub const DepositFactor: Balance = deposit(0, 32);
468}
469
470impl pallet_multisig::Config for Runtime {
471 type RuntimeEvent = RuntimeEvent;
472 type RuntimeCall = RuntimeCall;
473 type Currency = Balances;
474 type DepositBase = DepositBase;
475 type DepositFactor = DepositFactor;
476 type MaxSignatories = ConstU32<100>;
477 type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
478 type BlockNumberProvider = frame_system::Pallet<Runtime>;
479}
480
481#[derive(
483 Copy,
484 Clone,
485 Eq,
486 PartialEq,
487 Ord,
488 PartialOrd,
489 Encode,
490 Decode,
491 DecodeWithMemTracking,
492 Debug,
493 MaxEncodedLen,
494 scale_info::TypeInfo,
495)]
496pub enum ProxyType {
497 Any,
499 NonTransfer,
501 CancelProxy,
503 Broker,
505 CoretimeRenewer,
507 OnDemandPurchaser,
509 Collator,
511}
512impl Default for ProxyType {
513 fn default() -> Self {
514 Self::Any
515 }
516}
517
518impl InstanceFilter<RuntimeCall> for ProxyType {
519 fn filter(&self, c: &RuntimeCall) -> bool {
520 match self {
521 ProxyType::Any => true,
522 ProxyType::NonTransfer => !matches!(
523 c,
524 RuntimeCall::Balances { .. } |
525 RuntimeCall::Broker(pallet_broker::Call::purchase { .. }) |
527 RuntimeCall::Broker(pallet_broker::Call::renew { .. }) |
528 RuntimeCall::Broker(pallet_broker::Call::transfer { .. }) |
529 RuntimeCall::Broker(pallet_broker::Call::purchase_credit { .. }) |
530 RuntimeCall::Broker(pallet_broker::Call::pool { .. }) |
532 RuntimeCall::Broker(pallet_broker::Call::assign { .. })
534 ),
535 ProxyType::CancelProxy => matches!(
536 c,
537 RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) |
538 RuntimeCall::Utility { .. } |
539 RuntimeCall::Multisig { .. }
540 ),
541 ProxyType::Broker => {
542 matches!(
543 c,
544 RuntimeCall::Broker { .. } |
545 RuntimeCall::Utility { .. } |
546 RuntimeCall::Multisig { .. }
547 )
548 },
549 ProxyType::CoretimeRenewer => {
550 matches!(
551 c,
552 RuntimeCall::Broker(pallet_broker::Call::renew { .. }) |
553 RuntimeCall::Utility { .. } |
554 RuntimeCall::Multisig { .. }
555 )
556 },
557 ProxyType::OnDemandPurchaser => {
558 matches!(
559 c,
560 RuntimeCall::Broker(pallet_broker::Call::purchase_credit { .. }) |
561 RuntimeCall::Utility { .. } |
562 RuntimeCall::Multisig { .. }
563 )
564 },
565 ProxyType::Collator => matches!(
566 c,
567 RuntimeCall::CollatorSelection { .. } |
568 RuntimeCall::Utility { .. } |
569 RuntimeCall::Multisig { .. }
570 ),
571 }
572 }
573
574 fn is_superset(&self, o: &Self) -> bool {
575 match (self, o) {
576 (x, y) if x == y => true,
577 (ProxyType::Any, _) => true,
578 (_, ProxyType::Any) => false,
579 (ProxyType::Broker, ProxyType::CoretimeRenewer) => true,
580 (ProxyType::Broker, ProxyType::OnDemandPurchaser) => true,
581 (ProxyType::NonTransfer, ProxyType::Collator) => true,
582 _ => false,
583 }
584 }
585}
586
587parameter_types! {
588 pub const ProxyDepositBase: Balance = deposit(1, 40);
590 pub const ProxyDepositFactor: Balance = deposit(0, 33);
592 pub const MaxProxies: u16 = 32;
593 pub const AnnouncementDepositBase: Balance = deposit(1, 48);
595 pub const AnnouncementDepositFactor: Balance = deposit(0, 66);
596 pub const MaxPending: u16 = 32;
597}
598
599impl pallet_proxy::Config for Runtime {
600 type RuntimeEvent = RuntimeEvent;
601 type RuntimeCall = RuntimeCall;
602 type Currency = Balances;
603 type ProxyType = ProxyType;
604 type ProxyDepositBase = ProxyDepositBase;
605 type ProxyDepositFactor = ProxyDepositFactor;
606 type MaxProxies = MaxProxies;
607 type WeightInfo = weights::pallet_proxy::WeightInfo<Runtime>;
608 type MaxPending = MaxPending;
609 type CallHasher = BlakeTwo256;
610 type AnnouncementDepositBase = AnnouncementDepositBase;
611 type AnnouncementDepositFactor = AnnouncementDepositFactor;
612 type BlockNumberProvider = frame_system::Pallet<Runtime>;
613}
614
615impl pallet_utility::Config for Runtime {
616 type RuntimeEvent = RuntimeEvent;
617 type RuntimeCall = RuntimeCall;
618 type PalletsOrigin = OriginCaller;
619 type WeightInfo = weights::pallet_utility::WeightInfo<Runtime>;
620}
621
622impl pallet_sudo::Config for Runtime {
623 type RuntimeCall = RuntimeCall;
624 type RuntimeEvent = RuntimeEvent;
625 type WeightInfo = pallet_sudo::weights::SubstrateWeight<Runtime>;
626}
627
628parameter_types! {
629 pub const DapSatellitePalletId: PalletId = PalletId(*b"dap/satl");
630}
631
632impl pallet_dap_satellite::Config for Runtime {
633 type Currency = Balances;
634 type PalletId = DapSatellitePalletId;
635}
636
637pub struct BrokerMigrationV4BlockConversion;
638
639impl pallet_broker::migration::v4::BlockToRelayHeightConversion<Runtime>
640 for BrokerMigrationV4BlockConversion
641{
642 fn convert_block_number_to_relay_height(input_block_number: u32) -> u32 {
643 let relay_height = pallet_broker::RCBlockNumberProviderOf::<
644 <Runtime as pallet_broker::Config>::Coretime,
645 >::current_block_number();
646 let parachain_block_number = frame_system::Pallet::<Runtime>::block_number();
647 let offset = relay_height - parachain_block_number * 2;
648 offset + input_block_number * 2
649 }
650
651 fn convert_block_length_to_relay_length(input_block_length: u32) -> u32 {
652 input_block_length * 2
653 }
654}
655
656pub type MetaTxExtension = (
657 pallet_verify_signature::VerifySignature<Runtime>,
658 pallet_meta_tx::MetaTxMarker<Runtime>,
659 frame_system::CheckNonZeroSender<Runtime>,
660 frame_system::CheckSpecVersion<Runtime>,
661 frame_system::CheckTxVersion<Runtime>,
662 frame_system::CheckGenesis<Runtime>,
663 frame_system::CheckEra<Runtime>,
664 frame_system::CheckNonce<Runtime>,
665 frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
666);
667
668impl pallet_meta_tx::Config for Runtime {
669 type WeightInfo = weights::pallet_meta_tx::WeightInfo<Runtime>;
670 type RuntimeEvent = RuntimeEvent;
671 #[cfg(not(feature = "runtime-benchmarks"))]
672 type Extension = MetaTxExtension;
673 #[cfg(feature = "runtime-benchmarks")]
674 type Extension = pallet_meta_tx::WeightlessExtension<Runtime>;
675}
676
677impl pallet_verify_signature::Config for Runtime {
678 type Signature = MultiSignature;
679 type AccountIdentifier = MultiSigner;
680 type WeightInfo = weights::pallet_verify_signature::WeightInfo<Runtime>;
681 #[cfg(feature = "runtime-benchmarks")]
682 type BenchmarkHelper = ();
683}
684
685construct_runtime!(
687 pub enum Runtime
688 {
689 System: frame_system = 0,
691 ParachainSystem: cumulus_pallet_parachain_system = 1,
692 Timestamp: pallet_timestamp = 3,
693 ParachainInfo: parachain_info = 4,
694 WeightReclaim: cumulus_pallet_weight_reclaim = 5,
695
696 Balances: pallet_balances = 10,
698 TransactionPayment: pallet_transaction_payment = 11,
699 DapSatellite: pallet_dap_satellite = 12,
700
701 Authorship: pallet_authorship = 20,
703 CollatorSelection: pallet_collator_selection = 21,
704 Session: pallet_session = 22,
705 Aura: pallet_aura = 23,
706 AuraExt: cumulus_pallet_aura_ext = 24,
707
708 XcmpQueue: cumulus_pallet_xcmp_queue = 30,
710 PolkadotXcm: pallet_xcm = 31,
711 CumulusXcm: cumulus_pallet_xcm = 32,
712 MessageQueue: pallet_message_queue = 34,
713
714 Utility: pallet_utility = 40,
716 Multisig: pallet_multisig = 41,
717 Proxy: pallet_proxy = 42,
718 MetaTx: pallet_meta_tx = 43,
719 VerifySignature: pallet_verify_signature = 44,
720
721 Broker: pallet_broker = 50,
723
724 Sudo: pallet_sudo = 100,
726 }
727);
728
729#[cfg(feature = "runtime-benchmarks")]
730mod benches {
731 frame_benchmarking::define_benchmarks!(
732 [frame_system, SystemBench::<Runtime>]
733 [cumulus_pallet_parachain_system, ParachainSystem]
734 [pallet_timestamp, Timestamp]
735 [pallet_balances, Balances]
736 [pallet_broker, Broker]
737 [pallet_collator_selection, CollatorSelection]
738 [pallet_session, SessionBench::<Runtime>]
739 [cumulus_pallet_xcmp_queue, XcmpQueue]
740 [pallet_xcm, PalletXcmExtrinsicsBenchmark::<Runtime>]
741 [pallet_message_queue, MessageQueue]
742 [pallet_multisig, Multisig]
743 [pallet_proxy, Proxy]
744 [pallet_utility, Utility]
745 [pallet_meta_tx, MetaTx]
746 [pallet_verify_signature, VerifySignature]
747 [pallet_xcm_benchmarks::fungible, XcmBalances]
749 [pallet_xcm_benchmarks::generic, XcmGeneric]
750 [cumulus_pallet_weight_reclaim, WeightReclaim]
751 );
752}
753
754impl_runtime_apis! {
755 impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {
756 fn slot_duration() -> sp_consensus_aura::SlotDuration {
757 sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION)
758 }
759
760 fn authorities() -> Vec<AuraId> {
761 pallet_aura::Authorities::<Runtime>::get().into_inner()
762 }
763 }
764
765 impl cumulus_primitives_core::RelayParentOffsetApi<Block> for Runtime {
766 fn relay_parent_offset() -> u32 {
767 0
768 }
769 }
770
771 impl cumulus_primitives_aura::AuraUnincludedSegmentApi<Block> for Runtime {
772 fn can_build_upon(
773 included_hash: <Block as BlockT>::Hash,
774 slot: cumulus_primitives_aura::Slot,
775 ) -> bool {
776 ConsensusHook::can_build_upon(included_hash, slot)
777 }
778 }
779
780 impl sp_api::Core<Block> for Runtime {
781 fn version() -> RuntimeVersion {
782 VERSION
783 }
784
785 fn execute_block(block: <Block as BlockT>::LazyBlock) {
786 Executive::execute_block(block)
787 }
788
789 fn initialize_block(header: &<Block as BlockT>::Header) -> sp_runtime::ExtrinsicInclusionMode {
790 Executive::initialize_block(header)
791 }
792 }
793
794 impl sp_api::Metadata<Block> for Runtime {
795 fn metadata() -> OpaqueMetadata {
796 OpaqueMetadata::new(Runtime::metadata().into())
797 }
798
799 fn metadata_at_version(version: u32) -> Option<OpaqueMetadata> {
800 Runtime::metadata_at_version(version)
801 }
802
803 fn metadata_versions() -> alloc::vec::Vec<u32> {
804 Runtime::metadata_versions()
805 }
806 }
807
808 impl sp_block_builder::BlockBuilder<Block> for Runtime {
809 fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
810 Executive::apply_extrinsic(extrinsic)
811 }
812
813 fn finalize_block() -> <Block as BlockT>::Header {
814 Executive::finalize_block()
815 }
816
817 fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {
818 data.create_extrinsics()
819 }
820
821 fn check_inherents(
822 block: <Block as BlockT>::LazyBlock,
823 data: sp_inherents::InherentData,
824 ) -> sp_inherents::CheckInherentsResult {
825 data.check_extrinsics(&block)
826 }
827 }
828
829 impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {
830 fn validate_transaction(
831 source: TransactionSource,
832 tx: <Block as BlockT>::Extrinsic,
833 block_hash: <Block as BlockT>::Hash,
834 ) -> TransactionValidity {
835 Executive::validate_transaction(source, tx, block_hash)
836 }
837 }
838
839 impl sp_offchain::OffchainWorkerApi<Block> for Runtime {
840 fn offchain_worker(header: &<Block as BlockT>::Header) {
841 Executive::offchain_worker(header)
842 }
843 }
844
845 impl sp_session::SessionKeys<Block> for Runtime {
846 fn generate_session_keys(owner: Vec<u8>, seed: Option<Vec<u8>>) -> OpaqueGeneratedSessionKeys {
847 SessionKeys::generate(&owner, seed).into()
848 }
849
850 fn decode_session_keys(
851 encoded: Vec<u8>,
852 ) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {
853 SessionKeys::decode_into_raw_public_keys(&encoded)
854 }
855 }
856
857 impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
858 fn account_nonce(account: AccountId) -> Nonce {
859 System::account_nonce(account)
860 }
861 }
862
863 impl pallet_broker::runtime_api::BrokerApi<Block, Balance> for Runtime {
864 fn sale_price() -> Result<Balance, DispatchError> {
865 Broker::current_price()
866 }
867 }
868
869 impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {
870 fn query_info(
871 uxt: <Block as BlockT>::Extrinsic,
872 len: u32,
873 ) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo<Balance> {
874 TransactionPayment::query_info(uxt, len)
875 }
876 fn query_fee_details(
877 uxt: <Block as BlockT>::Extrinsic,
878 len: u32,
879 ) -> pallet_transaction_payment::FeeDetails<Balance> {
880 TransactionPayment::query_fee_details(uxt, len)
881 }
882 fn query_weight_to_fee(weight: Weight) -> Balance {
883 TransactionPayment::weight_to_fee(weight)
884 }
885 fn query_length_to_fee(length: u32) -> Balance {
886 TransactionPayment::length_to_fee(length)
887 }
888 }
889
890 impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
891 for Runtime
892 {
893 fn query_call_info(
894 call: RuntimeCall,
895 len: u32,
896 ) -> pallet_transaction_payment::RuntimeDispatchInfo<Balance> {
897 TransactionPayment::query_call_info(call, len)
898 }
899 fn query_call_fee_details(
900 call: RuntimeCall,
901 len: u32,
902 ) -> pallet_transaction_payment::FeeDetails<Balance> {
903 TransactionPayment::query_call_fee_details(call, len)
904 }
905 fn query_weight_to_fee(weight: Weight) -> Balance {
906 TransactionPayment::weight_to_fee(weight)
907 }
908 fn query_length_to_fee(length: u32) -> Balance {
909 TransactionPayment::length_to_fee(length)
910 }
911 }
912
913 impl xcm_runtime_apis::fees::XcmPaymentApi<Block> for Runtime {
914 fn query_acceptable_payment_assets(xcm_version: xcm::Version) -> Result<Vec<VersionedAssetId>, XcmPaymentApiError> {
915 let acceptable_assets = vec![AssetId(xcm_config::TokenRelayLocation::get())];
916 PolkadotXcm::query_acceptable_payment_assets(xcm_version, acceptable_assets)
917 }
918
919 fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result<u128, XcmPaymentApiError> {
920 type Trader = <XcmConfig as xcm_executor::Config>::Trader;
921 PolkadotXcm::query_weight_to_asset_fee::<Trader>(weight, asset)
922 }
923
924 fn query_xcm_weight(message: VersionedXcm<()>) -> Result<Weight, XcmPaymentApiError> {
925 PolkadotXcm::query_xcm_weight(message)
926 }
927
928 fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>, asset_id: VersionedAssetId) -> Result<VersionedAssets, XcmPaymentApiError> {
929 type AssetExchanger = <XcmConfig as xcm_executor::Config>::AssetExchanger;
930 PolkadotXcm::query_delivery_fees::<AssetExchanger>(destination, message, asset_id)
931 }
932 }
933
934 impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime {
935 fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> {
936 PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, OriginCaller, RuntimeCall>(origin, call, result_xcms_version)
937 }
938
939 fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> {
940 PolkadotXcm::dry_run_xcm::<xcm_config::XcmRouter>(origin_location, xcm)
941 }
942 }
943
944 impl xcm_runtime_apis::conversions::LocationToAccountApi<Block, AccountId> for Runtime {
945 fn convert_location(location: VersionedLocation) -> Result<
946 AccountId,
947 xcm_runtime_apis::conversions::Error
948 > {
949 xcm_runtime_apis::conversions::LocationToAccountHelper::<
950 AccountId,
951 xcm_config::LocationToAccountId,
952 >::convert_location(location)
953 }
954 }
955
956 impl xcm_runtime_apis::trusted_query::TrustedQueryApi<Block> for Runtime {
957 fn is_trusted_reserve(asset: VersionedAsset, location: VersionedLocation) -> xcm_runtime_apis::trusted_query::XcmTrustedQueryResult {
958 PolkadotXcm::is_trusted_reserve(asset, location)
959 }
960 fn is_trusted_teleporter(asset: VersionedAsset, location: VersionedLocation) -> xcm_runtime_apis::trusted_query::XcmTrustedQueryResult {
961 PolkadotXcm::is_trusted_teleporter(asset, location)
962 }
963 }
964
965 impl xcm_runtime_apis::authorized_aliases::AuthorizedAliasersApi<Block> for Runtime {
966 fn authorized_aliasers(target: VersionedLocation) -> Result<
967 Vec<xcm_runtime_apis::authorized_aliases::OriginAliaser>,
968 xcm_runtime_apis::authorized_aliases::Error
969 > {
970 PolkadotXcm::authorized_aliasers(target)
971 }
972 fn is_authorized_alias(origin: VersionedLocation, target: VersionedLocation) -> Result<
973 bool,
974 xcm_runtime_apis::authorized_aliases::Error
975 > {
976 PolkadotXcm::is_authorized_alias(origin, target)
977 }
978 }
979
980 impl cumulus_primitives_core::CollectCollationInfo<Block> for Runtime {
981 fn collect_collation_info(header: &<Block as BlockT>::Header) -> cumulus_primitives_core::CollationInfo {
982 ParachainSystem::collect_collation_info(header)
983 }
984 }
985
986 #[cfg(feature = "try-runtime")]
987 impl frame_try_runtime::TryRuntime<Block> for Runtime {
988 fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) {
989 let weight = Executive::try_runtime_upgrade(checks).unwrap();
990 (weight, RuntimeBlockWeights::get().max_block)
991 }
992
993 fn execute_block(
994 block: <Block as BlockT>::LazyBlock,
995 state_root_check: bool,
996 signature_check: bool,
997 select: frame_try_runtime::TryStateSelect,
998 ) -> Weight {
999 Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap()
1002 }
1003 }
1004
1005 #[cfg(feature = "runtime-benchmarks")]
1006 impl frame_benchmarking::Benchmark<Block> for Runtime {
1007 fn benchmark_metadata(extra: bool) -> (
1008 Vec<frame_benchmarking::BenchmarkList>,
1009 Vec<frame_support::traits::StorageInfo>,
1010 ) {
1011 use frame_benchmarking::BenchmarkList;
1012 use frame_support::traits::StorageInfoTrait;
1013 use frame_system_benchmarking::Pallet as SystemBench;
1014 use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
1015 use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
1016
1017 type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
1021 type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::<Runtime>;
1022
1023 let mut list = Vec::<BenchmarkList>::new();
1024 list_benchmarks!(list, extra);
1025
1026 let storage_info = AllPalletsWithSystem::storage_info();
1027 (list, storage_info)
1028 }
1029
1030 #[allow(non_local_definitions)]
1031 fn dispatch_benchmark(
1032 config: frame_benchmarking::BenchmarkConfig
1033 ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, alloc::string::String> {
1034 use frame_benchmarking::{BenchmarkBatch, BenchmarkError};
1035 use sp_storage::TrackedStorageKey;
1036 use codec::Encode;
1037
1038 use frame_system_benchmarking::Pallet as SystemBench;
1039 impl frame_system_benchmarking::Config for Runtime {
1040 fn setup_set_code_requirements(code: &alloc::vec::Vec<u8>) -> Result<(), BenchmarkError> {
1041 ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
1042 Ok(())
1043 }
1044
1045 fn verify_set_code() {
1046 System::assert_last_event(cumulus_pallet_parachain_system::Event::<Runtime>::ValidationFunctionStored.into());
1047 }
1048 }
1049
1050 use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
1051 impl cumulus_pallet_session_benchmarking::Config for Runtime {
1052 fn generate_session_keys_and_proof(owner: Self::AccountId) -> (Self::Keys, Vec<u8>) {
1053 let keys = SessionKeys::generate(&owner.encode(), None);
1054 (keys.keys, keys.proof.encode())
1055 }
1056 }
1057
1058 use xcm::latest::prelude::*;
1059 use xcm_config::TokenRelayLocation;
1060 use testnet_parachains_constants::westend::locations::{AssetHubParaId, AssetHubLocation};
1061
1062 use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
1063 impl pallet_xcm::benchmarking::Config for Runtime {
1064 type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper<
1065 xcm_config::XcmConfig,
1066 ExistentialDepositAsset,
1067 PriceForSiblingParachainDelivery,
1068 AssetHubParaId,
1069 ParachainSystem,
1070 >;
1071
1072 fn reachable_dest() -> Option<Location> {
1073 Some(AssetHubLocation::get())
1074 }
1075
1076 fn teleportable_asset_and_dest() -> Option<(Asset, Location)> {
1077 Some((
1079 Asset {
1080 fun: Fungible(ExistentialDeposit::get()),
1081 id: AssetId(TokenRelayLocation::get())
1082 },
1083 AssetHubLocation::get(),
1084 ))
1085 }
1086
1087 fn reserve_transferable_asset_and_dest() -> Option<(Asset, Location)> {
1088 let core = 0;
1092 let begin = 0;
1093 let end = 42;
1094
1095 let region_id = pallet_broker::Pallet::<Runtime>::issue(core, begin, pallet_broker::CoreMask::complete(), end, None, None);
1096 Some((
1097 Asset {
1098 fun: NonFungible(Index(region_id.into())),
1099 id: AssetId(xcm_config::BrokerPalletLocation::get())
1100 },
1101 AssetHubLocation::get(),
1102 ))
1103 }
1104
1105 fn set_up_complex_asset_transfer() -> Option<(Assets, u32, Location, alloc::boxed::Box<dyn FnOnce()>)> {
1106 let native_location = Parent.into();
1107 let dest = AssetHubLocation::get();
1108
1109 pallet_xcm::benchmarking::helpers::native_teleport_as_asset_transfer::<Runtime>(
1110 native_location,
1111 dest,
1112 )
1113 }
1114
1115 fn get_asset() -> Asset {
1116 Asset {
1117 id: AssetId(TokenRelayLocation::get()),
1118 fun: Fungible(ExistentialDeposit::get()),
1119 }
1120 }
1121 }
1122
1123 parameter_types! {
1124 pub ExistentialDepositAsset: Option<Asset> = Some((
1125 TokenRelayLocation::get(),
1126 ExistentialDeposit::get()
1127 ).into());
1128 }
1129
1130 impl pallet_xcm_benchmarks::Config for Runtime {
1131 type XcmConfig = xcm_config::XcmConfig;
1132
1133 type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper<
1134 xcm_config::XcmConfig,
1135 ExistentialDepositAsset,
1136 PriceForSiblingParachainDelivery,
1137 AssetHubParaId,
1138 ParachainSystem,
1139 >;
1140
1141 type AccountIdConverter = xcm_config::LocationToAccountId;
1142 fn valid_destination() -> Result<Location, BenchmarkError> {
1143 Ok(AssetHubLocation::get())
1144 }
1145 fn worst_case_holding(_depositable_count: u32) -> xcm_executor::AssetsInHolding {
1146 use pallet_xcm_benchmarks::MockCredit;
1147 let mut holding = xcm_executor::AssetsInHolding::new();
1149 holding.fungible.insert(
1150 AssetId(TokenRelayLocation::get()),
1151 alloc::boxed::Box::new(MockCredit(1_000_000 * UNITS)),
1152 );
1153 holding
1154 }
1155 }
1156
1157 parameter_types! {
1158 pub TrustedTeleporter: Option<(Location, Asset)> = Some((
1159 AssetHubLocation::get(),
1160 Asset { fun: Fungible(UNITS), id: AssetId(TokenRelayLocation::get()) },
1161 ));
1162 pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None;
1163 pub const TrustedReserve: Option<(Location, Asset)> = None;
1164 }
1165
1166 impl pallet_xcm_benchmarks::fungible::Config for Runtime {
1167 type TransactAsset = Balances;
1168
1169 type CheckedAccount = CheckedAccount;
1170 type TrustedTeleporter = TrustedTeleporter;
1171 type TrustedReserve = TrustedReserve;
1172
1173 fn get_asset() -> Asset {
1174 Asset {
1175 id: AssetId(TokenRelayLocation::get()),
1176 fun: Fungible(UNITS),
1177 }
1178 }
1179 }
1180
1181 impl pallet_xcm_benchmarks::generic::Config for Runtime {
1182 type RuntimeCall = RuntimeCall;
1183 type TransactAsset = Balances;
1184
1185 fn worst_case_response() -> (u64, Response) {
1186 (0u64, Response::Version(Default::default()))
1187 }
1188
1189 fn worst_case_asset_exchange() -> Result<(Assets, Assets), BenchmarkError> {
1190 Err(BenchmarkError::Skip)
1191 }
1192
1193 fn universal_alias() -> Result<(Location, Junction), BenchmarkError> {
1194 Err(BenchmarkError::Skip)
1195 }
1196
1197 fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> {
1198 Ok((AssetHubLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
1199 }
1200
1201 fn subscribe_origin() -> Result<Location, BenchmarkError> {
1202 Ok(AssetHubLocation::get())
1203 }
1204
1205 fn claimable_asset() -> Result<(Location, Location, Assets), BenchmarkError> {
1206 let origin = AssetHubLocation::get();
1207 let assets: Assets = (AssetId(TokenRelayLocation::get()), 1_000 * UNITS).into();
1208 let ticket = Location { parents: 0, interior: Here };
1209 Ok((origin, ticket, assets))
1210 }
1211
1212 fn worst_case_for_trader() -> Result<(Asset, WeightLimit), BenchmarkError> {
1213 Ok((Asset {
1214 id: AssetId(TokenRelayLocation::get()),
1215 fun: Fungible(1_000_000 * UNITS),
1216 }, WeightLimit::Limited(Weight::from_parts(5000, 5000))))
1217 }
1218
1219 fn unlockable_asset() -> Result<(Location, Location, Asset), BenchmarkError> {
1220 Err(BenchmarkError::Skip)
1221 }
1222
1223 fn export_message_origin_and_destination(
1224 ) -> Result<(Location, NetworkId, InteriorLocation), BenchmarkError> {
1225 Err(BenchmarkError::Skip)
1226 }
1227
1228 fn alias_origin() -> Result<(Location, Location), BenchmarkError> {
1229 let origin = Location::new(1, [Parachain(1000)]);
1230 let target = Location::new(1, [Parachain(1000), AccountId32 { id: [128u8; 32], network: None }]);
1231 Ok((origin, target))
1232 }
1233 }
1234
1235 type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
1236 type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::<Runtime>;
1237
1238 use frame_support::traits::WhitelistedStorageKeys;
1239 let whitelist: Vec<TrackedStorageKey> = AllPalletsWithSystem::whitelisted_storage_keys();
1240
1241 let mut batches = Vec::<BenchmarkBatch>::new();
1242 let params = (&config, &whitelist);
1243 add_benchmarks!(params, batches);
1244
1245 Ok(batches)
1246 }
1247 }
1248
1249 impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
1250 fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
1251 build_state::<RuntimeGenesisConfig>(config)
1252 }
1253
1254 fn get_preset(id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
1255 get_preset::<RuntimeGenesisConfig>(id, &genesis_config_presets::get_preset)
1256 }
1257
1258 fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
1259 genesis_config_presets::preset_names()
1260 }
1261 }
1262
1263 impl cumulus_primitives_core::GetParachainInfo<Block> for Runtime {
1264 fn parachain_id() -> ParaId {
1265 ParachainInfo::parachain_id()
1266 }
1267 }
1268
1269 impl cumulus_primitives_core::TargetBlockRate<Block> for Runtime {
1270 fn target_block_rate() -> u32 {
1271 1
1272 }
1273 }
1274}
1275
1276cumulus_pallet_parachain_system::register_validate_block! {
1277 Runtime = Runtime,
1278 BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,
1279}