From 8dc0a2db9a5df4844351f258ab5dd83b0f499b13 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Sun, 25 Aug 2024 11:20:33 +0200 Subject: [PATCH 1/4] Fix encointer benchmarks + nits --- system-parachains/coretime/coretime-kusama/src/lib.rs | 4 ++-- .../coretime/coretime-polkadot/src/lib.rs | 4 ++-- system-parachains/encointer/src/lib.rs | 4 ++-- system-parachains/encointer/src/xcm_config.rs | 10 +++++++--- system-parachains/people/people-kusama/src/lib.rs | 2 +- system-parachains/people/people-polkadot/src/lib.rs | 2 +- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/system-parachains/coretime/coretime-kusama/src/lib.rs b/system-parachains/coretime/coretime-kusama/src/lib.rs index 4efe55b25f..08177d041f 100644 --- a/system-parachains/coretime/coretime-kusama/src/lib.rs +++ b/system-parachains/coretime/coretime-kusama/src/lib.rs @@ -951,10 +951,10 @@ impl_runtime_apis! { } fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { - // Relay/native token can be teleported between AH and Relay. + // Relay/native token can be teleported between Coretime and Relay. Some(( Asset { - fun: Fungible(SYSTEM_PARA_EXISTENTIAL_DEPOSIT), + fun: Fungible(ExistentialDeposit::get()), id: AssetId(Parent.into()) }, Parent.into(), diff --git a/system-parachains/coretime/coretime-polkadot/src/lib.rs b/system-parachains/coretime/coretime-polkadot/src/lib.rs index 6aac18b627..7b1cdf1ce2 100644 --- a/system-parachains/coretime/coretime-polkadot/src/lib.rs +++ b/system-parachains/coretime/coretime-polkadot/src/lib.rs @@ -937,10 +937,10 @@ impl_runtime_apis! { } fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { - // Relay/native token can be teleported between AH and Relay. + // Relay/native token can be teleported between Coretime and Relay. Some(( Asset { - fun: Fungible(SYSTEM_PARA_EXISTENTIAL_DEPOSIT), + fun: Fungible(ExistentialDeposit::get()), id: AssetId(Parent.into()) }, Parent.into(), diff --git a/system-parachains/encointer/src/lib.rs b/system-parachains/encointer/src/lib.rs index 779b55f986..96263d6a0d 100644 --- a/system-parachains/encointer/src/lib.rs +++ b/system-parachains/encointer/src/lib.rs @@ -1126,10 +1126,10 @@ impl_runtime_apis! { } fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { - // Relay/native token can be teleported between People and Relay. + // Relay/native token can be teleported between Encointer and Relay. Some(( Asset { - fun: Fungible(SYSTEM_PARA_EXISTENTIAL_DEPOSIT), + fun: Fungible(ExistentialDeposit::get()), id: AssetId(Parent.into()) }, Parent.into(), diff --git a/system-parachains/encointer/src/xcm_config.rs b/system-parachains/encointer/src/xcm_config.rs index b18e6780df..14648df9c9 100644 --- a/system-parachains/encointer/src/xcm_config.rs +++ b/system-parachains/encointer/src/xcm_config.rs @@ -35,8 +35,8 @@ use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyReserveTransferToRelayChain, - DenyThenTry, DescribeTerminus, EnsureXcmOrigin, FixedWeightBounds, FrameTransactionalProcessor, - FungibleAdapter, HashedDescription, IsConcrete, NativeAsset, ParentAsSuperuser, ParentIsPreset, + DenyThenTry, DescribeTerminus, EnsureXcmOrigin, FrameTransactionalProcessor, FungibleAdapter, + HashedDescription, IsConcrete, NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, @@ -167,7 +167,11 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = TrustedTeleporters; type UniversalLocation = UniversalLocation; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = WeightInfoBounds< + crate::weights::xcm::EncointerKusamaXcmWeight, + RuntimeCall, + MaxInstructions, + >; type Trader = UsingComponents< WeightToFee, KsmLocation, diff --git a/system-parachains/people/people-kusama/src/lib.rs b/system-parachains/people/people-kusama/src/lib.rs index 651473abcb..3076b5da04 100644 --- a/system-parachains/people/people-kusama/src/lib.rs +++ b/system-parachains/people/people-kusama/src/lib.rs @@ -915,7 +915,7 @@ impl_runtime_apis! { // Relay/native token can be teleported between People and Relay. Some(( Asset { - fun: Fungible(SYSTEM_PARA_EXISTENTIAL_DEPOSIT), + fun: Fungible(ExistentialDeposit::get()), id: AssetId(Parent.into()) }, Parent.into(), diff --git a/system-parachains/people/people-polkadot/src/lib.rs b/system-parachains/people/people-polkadot/src/lib.rs index 3333957713..791b0738c1 100644 --- a/system-parachains/people/people-polkadot/src/lib.rs +++ b/system-parachains/people/people-polkadot/src/lib.rs @@ -880,7 +880,7 @@ impl_runtime_apis! { // Relay/native token can be teleported between People and Relay. Some(( Asset { - fun: Fungible(SYSTEM_PARA_EXISTENTIAL_DEPOSIT), + fun: Fungible(ExistentialDeposit::get()), id: AssetId(Parent.into()) }, Parent.into(), From 1137d4eb58f0705539fdf90f78b664c6629902f7 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Sun, 25 Aug 2024 11:24:17 +0200 Subject: [PATCH 2/4] Set `IsReserve` to `()` for encointer --- system-parachains/encointer/src/xcm_config.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system-parachains/encointer/src/xcm_config.rs b/system-parachains/encointer/src/xcm_config.rs index 14648df9c9..d1cddcc958 100644 --- a/system-parachains/encointer/src/xcm_config.rs +++ b/system-parachains/encointer/src/xcm_config.rs @@ -36,10 +36,10 @@ use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyReserveTransferToRelayChain, DenyThenTry, DescribeTerminus, EnsureXcmOrigin, FrameTransactionalProcessor, FungibleAdapter, - HashedDescription, IsConcrete, NativeAsset, ParentAsSuperuser, ParentIsPreset, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, + HashedDescription, IsConcrete, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, + UsingComponents, WeightInfoBounds, WithComputedOrigin, }; use xcm_executor::XcmExecutor; @@ -163,7 +163,7 @@ impl xcm_executor::Config for XcmConfig { type XcmRecorder = (); type AssetTransactor = FungibleTransactor; type OriginConverter = XcmOriginToTransactDispatchOrigin; - type IsReserve = NativeAsset; + type IsReserve = (); type IsTeleporter = TrustedTeleporters; type UniversalLocation = UniversalLocation; type Barrier = Barrier; From e063eb79f184348d0af739fe5945bf5c908f683c Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Sun, 25 Aug 2024 11:24:37 +0200 Subject: [PATCH 3/4] Revert fmt back --- system-parachains/encointer/src/lib.rs | 768 ++++++++++++------------- 1 file changed, 384 insertions(+), 384 deletions(-) diff --git a/system-parachains/encointer/src/lib.rs b/system-parachains/encointer/src/lib.rs index 96263d6a0d..3654899cfe 100644 --- a/system-parachains/encointer/src/lib.rs +++ b/system-parachains/encointer/src/lib.rs @@ -41,33 +41,33 @@ use core::marker::PhantomData; use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use encointer_balances_tx_payment::{ - AccountIdOf, AssetBalanceOf, AssetIdOf, BalanceToCommunityBalance, + AccountIdOf, AssetBalanceOf, AssetIdOf, BalanceToCommunityBalance, }; pub use encointer_primitives::{ - balances::{BalanceEntry, BalanceType, Demurrage}, - bazaar::{BusinessData, BusinessIdentifier, OfferingData}, - ceremonies::{AggregatedAccountData, CeremonyIndexType, CeremonyInfo, CommunityReputation}, - common::PalletString, - communities::{CommunityIdentifier, Location}, - scheduler::CeremonyPhaseType, + balances::{BalanceEntry, BalanceType, Demurrage}, + bazaar::{BusinessData, BusinessIdentifier, OfferingData}, + ceremonies::{AggregatedAccountData, CeremonyIndexType, CeremonyInfo, CommunityReputation}, + common::PalletString, + communities::{CommunityIdentifier, Location}, + scheduler::CeremonyPhaseType, }; use frame_support::{ - construct_runtime, - dispatch::DispatchClass, - genesis_builder_helper::{build_state, get_preset}, - parameter_types, - traits::{ - fungibles::{Balanced, Credit}, - tokens::{imbalance::ResolveTo, ConversionToAssetBalance}, - ConstBool, ConstU64, Contains, EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter, - TransformOrigin, - }, - weights::{ConstantMultiplier, Weight, WeightToFee as _}, - PalletId, + construct_runtime, + dispatch::DispatchClass, + genesis_builder_helper::{build_state, get_preset}, + parameter_types, + traits::{ + fungibles::{Balanced, Credit}, + tokens::{imbalance::ResolveTo, ConversionToAssetBalance}, + ConstBool, ConstU64, Contains, EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter, + TransformOrigin, + }, + weights::{ConstantMultiplier, Weight, WeightToFee as _}, + PalletId, }; use frame_system::{ - limits::{BlockLength, BlockWeights}, - EnsureRoot, + limits::{BlockLength, BlockWeights}, + EnsureRoot, }; use pallet_asset_tx_payment::HandleCredit; pub use pallet_encointer_balances::Call as EncointerBalancesCall; @@ -80,8 +80,8 @@ pub use pallet_encointer_scheduler::Call as EncointerSchedulerCall; use pallet_xcm::{EnsureXcm, IsMajorityOfBody}; use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling}; pub use parachains_common::{ - impls::DealWithFees, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, BlockNumber, - Hash, Header, Nonce, Signature, + impls::DealWithFees, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, BlockNumber, + Hash, Header, Nonce, Signature, }; use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use sp_api::impl_runtime_apis; @@ -89,28 +89,28 @@ use sp_core::{crypto::KeyTypeId, ConstU32, OpaqueMetadata}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, Verify}, - transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, Perbill, RuntimeDebug, + create_runtime_str, generic, impl_opaque_keys, + traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, Verify}, + transaction_validity::{TransactionSource, TransactionValidity}, + ApplyExtrinsicResult, Perbill, RuntimeDebug, }; use sp_std::prelude::*; #[cfg(feature = "std")] use sp_version::NativeVersion; use sp_version::RuntimeVersion; use system_parachains_constants::{ - kusama::{consensus::*, currency::*, fee::WeightToFee}, - AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, - SLOT_DURATION, + kusama::{consensus::*, currency::*, fee::WeightToFee}, + AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, + SLOT_DURATION, }; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; use xcm::{ - latest::prelude::{AssetId as XcmAssetId, BodyId}, - VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm, + latest::prelude::{AssetId as XcmAssetId, BodyId}, + VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm, }; use xcm_runtime_apis::{ - dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects}, - fees::Error as XcmPaymentApiError, + dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects}, + fees::Error as XcmPaymentApiError, }; use xcm_config::{KsmLocation, StakingPot, XcmOriginToTransactDispatchOrigin}; @@ -130,20 +130,20 @@ impl_opaque_keys! { /// This runtime version. #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("encointer-parachain"), - impl_name: create_runtime_str!("encointer-parachain"), - authoring_version: 1, - spec_version: 1_003_000, - impl_version: 1, - apis: RUNTIME_API_VERSIONS, - transaction_version: 4, - state_version: 0, + spec_name: create_runtime_str!("encointer-parachain"), + impl_name: create_runtime_str!("encointer-parachain"), + authoring_version: 1, + spec_version: 1_003_000, + impl_version: 1, + apis: RUNTIME_API_VERSIONS, + transaction_version: 4, + state_version: 0, }; /// The version information used to identify this runtime when compiled natively. #[cfg(feature = "std")] pub fn native_version() -> NativeVersion { - NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } + NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } } parameter_types! { @@ -160,69 +160,69 @@ parameter_types! { /// The type used to represent the kinds of proxying allowed. #[derive( - Copy, - Clone, - Eq, - PartialEq, - Ord, - PartialOrd, - Encode, - Decode, - RuntimeDebug, - scale_info::TypeInfo, - MaxEncodedLen, + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + Encode, + Decode, + RuntimeDebug, + scale_info::TypeInfo, + MaxEncodedLen, )] pub enum ProxyType { - Any, - NonTransfer, - BazaarEdit, + Any, + NonTransfer, + BazaarEdit, } impl Default for ProxyType { - fn default() -> Self { - Self::Any - } + fn default() -> Self { + Self::Any + } } impl InstanceFilter for ProxyType { - fn filter(&self, c: &RuntimeCall) -> bool { - match self { - ProxyType::Any => true, - ProxyType::NonTransfer => - !matches!(c, RuntimeCall::Balances { .. } | RuntimeCall::EncointerBalances { .. }), - ProxyType::BazaarEdit => matches!( + fn filter(&self, c: &RuntimeCall) -> bool { + match self { + ProxyType::Any => true, + ProxyType::NonTransfer => + !matches!(c, RuntimeCall::Balances { .. } | RuntimeCall::EncointerBalances { .. }), + ProxyType::BazaarEdit => matches!( c, RuntimeCall::EncointerBazaar(EncointerBazaarCall::create_offering { .. }) | RuntimeCall::EncointerBazaar(EncointerBazaarCall::update_offering { .. }) | RuntimeCall::EncointerBazaar(EncointerBazaarCall::delete_offering { .. }) ), - } - } - - fn is_superset(&self, o: &Self) -> bool { - match (self, o) { - (x, y) if x == y => true, - (ProxyType::Any, _) => true, - (_, ProxyType::Any) => false, - (ProxyType::NonTransfer, ProxyType::BazaarEdit) => true, - _ => false, - } - } + } + } + + fn is_superset(&self, o: &Self) -> bool { + match (self, o) { + (x, y) if x == y => true, + (ProxyType::Any, _) => true, + (_, ProxyType::Any) => false, + (ProxyType::NonTransfer, ProxyType::BazaarEdit) => true, + _ => false, + } + } } impl pallet_proxy::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type Currency = Balances; - type ProxyType = ProxyType; - type ProxyDepositBase = ProxyDepositBase; - type ProxyDepositFactor = ProxyDepositFactor; - type MaxProxies = MaxProxies; - type WeightInfo = weights::pallet_proxy::WeightInfo; - type MaxPending = MaxPending; - type CallHasher = BlakeTwo256; - type AnnouncementDepositBase = AnnouncementDepositBase; - type AnnouncementDepositFactor = AnnouncementDepositFactor; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type Currency = Balances; + type ProxyType = ProxyType; + type ProxyDepositBase = ProxyDepositBase; + type ProxyDepositFactor = ProxyDepositFactor; + type MaxProxies = MaxProxies; + type WeightInfo = weights::pallet_proxy::WeightInfo; + type MaxPending = MaxPending; + type CallHasher = BlakeTwo256; + type AnnouncementDepositBase = AnnouncementDepositBase; + type AnnouncementDepositFactor = AnnouncementDepositFactor; } parameter_types! { @@ -253,43 +253,43 @@ parameter_types! { pub struct BaseFilter; impl Contains for BaseFilter { - fn contains(_c: &RuntimeCall) -> bool { - true - } + fn contains(_c: &RuntimeCall) -> bool { + true + } } // Configure FRAME pallets to include in runtime. impl frame_system::Config for Runtime { - type BaseCallFilter = BaseFilter; - // The block type. - type Block = generic::Block; - type BlockWeights = RuntimeBlockWeights; - type BlockLength = RuntimeBlockLength; - type AccountId = AccountId; - type RuntimeCall = RuntimeCall; - type RuntimeTask = RuntimeTask; - type Lookup = AccountIdLookup; - type Nonce = Nonce; - type Hash = Hash; - type Hashing = BlakeTwo256; - type RuntimeEvent = RuntimeEvent; - type RuntimeOrigin = RuntimeOrigin; - type BlockHashCount = BlockHashCount; - type DbWeight = RocksDbWeight; - type Version = Version; - type PalletInfo = PalletInfo; - type OnNewAccount = (); - type OnKilledAccount = (); - type AccountData = pallet_balances::AccountData; - type SystemWeightInfo = weights::frame_system::WeightInfo; - type SS58Prefix = SS58Prefix; - type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; - type MaxConsumers = frame_support::traits::ConstU32<16>; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); + type BaseCallFilter = BaseFilter; + // The block type. + type Block = generic::Block; + type BlockWeights = RuntimeBlockWeights; + type BlockLength = RuntimeBlockLength; + type AccountId = AccountId; + type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; + type Lookup = AccountIdLookup; + type Nonce = Nonce; + type Hash = Hash; + type Hashing = BlakeTwo256; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type BlockHashCount = BlockHashCount; + type DbWeight = RocksDbWeight; + type Version = Version; + type PalletInfo = PalletInfo; + type OnNewAccount = (); + type OnKilledAccount = (); + type AccountData = pallet_balances::AccountData; + type SystemWeightInfo = weights::frame_system::WeightInfo; + type SS58Prefix = SS58Prefix; + type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; + type MaxConsumers = frame_support::traits::ConstU32<16>; + type SingleBlockMigrations = (); + type MultiBlockMigrator = (); + type PreInherents = (); + type PostInherents = (); + type PostTransactions = (); } parameter_types! { @@ -297,11 +297,11 @@ parameter_types! { } impl pallet_timestamp::Config for Runtime { - /// A timestamp: milliseconds since the unix epoch. - type Moment = Moment; - type OnTimestampSet = EncointerScheduler; - type MinimumPeriod = MinimumPeriod; - type WeightInfo = weights::pallet_timestamp::WeightInfo; + /// A timestamp: milliseconds since the unix epoch. + type Moment = Moment; + type OnTimestampSet = EncointerScheduler; + type MinimumPeriod = MinimumPeriod; + type WeightInfo = weights::pallet_timestamp::WeightInfo; } parameter_types! { @@ -311,21 +311,21 @@ parameter_types! { } impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; - /// The type for recording an account's balance. - type Balance = Balance; - /// The ubiquitous event type. - type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = weights::pallet_balances::WeightInfo; - type MaxReserves = MaxReserves; - type ReserveIdentifier = [u8; 8]; - type RuntimeHoldReason = (); - type RuntimeFreezeReason = RuntimeFreezeReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; + type MaxLocks = MaxLocks; + /// The type for recording an account's balance. + type Balance = Balance; + /// The ubiquitous event type. + type RuntimeEvent = RuntimeEvent; + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = weights::pallet_balances::WeightInfo; + type MaxReserves = MaxReserves; + type ReserveIdentifier = [u8; 8]; + type RuntimeHoldReason = (); + type RuntimeFreezeReason = RuntimeFreezeReason; + type FreezeIdentifier = (); + type MaxFreezes = ConstU32<0>; } parameter_types! { @@ -335,20 +335,20 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type OnChargeTransaction = - pallet_transaction_payment::FungibleAdapter>; - type WeightToFee = WeightToFee; - type LengthToFee = ConstantMultiplier; - type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; - type OperationalFeeMultiplier = OperationalFeeMultiplier; + type RuntimeEvent = RuntimeEvent; + type OnChargeTransaction = + pallet_transaction_payment::FungibleAdapter>; + type WeightToFee = WeightToFee; + type LengthToFee = ConstantMultiplier; + type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; + type OperationalFeeMultiplier = OperationalFeeMultiplier; } impl pallet_utility::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type PalletsOrigin = OriginCaller; - type WeightInfo = weights::pallet_utility::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type PalletsOrigin = OriginCaller; + type WeightInfo = weights::pallet_utility::WeightInfo; } parameter_types! { @@ -358,16 +358,16 @@ parameter_types! { } impl pallet_scheduler::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeOrigin = RuntimeOrigin; - type PalletsOrigin = OriginCaller; - type RuntimeCall = RuntimeCall; - type MaximumWeight = MaximumSchedulerWeight; - type ScheduleOrigin = MoreThanHalfCouncil; - type MaxScheduledPerBlock = MaxScheduledPerBlock; - type WeightInfo = pallet_scheduler::weights::SubstrateWeight; - type OriginPrivilegeCmp = EqualPrivilegeOnly; - type Preimages = (); + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type PalletsOrigin = OriginCaller; + type RuntimeCall = RuntimeCall; + type MaximumWeight = MaximumSchedulerWeight; + type ScheduleOrigin = MoreThanHalfCouncil; + type MaxScheduledPerBlock = MaxScheduledPerBlock; + type WeightInfo = pallet_scheduler::weights::SubstrateWeight; + type OriginPrivilegeCmp = EqualPrivilegeOnly; + type Preimages = (); } parameter_types! { @@ -377,24 +377,24 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type OnSystemEvent = (); - type SelfParaId = parachain_info::Pallet; - type DmpQueue = frame_support::traits::EnqueueWithOrigin; - type ReservedDmpWeight = ReservedDmpWeight; - type OutboundXcmpMessageSource = XcmpQueue; - type XcmpMessageHandler = XcmpQueue; - type ReservedXcmpWeight = ReservedXcmpWeight; - type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; - type ConsensusHook = ConsensusHook; - type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type OnSystemEvent = (); + type SelfParaId = parachain_info::Pallet; + type DmpQueue = frame_support::traits::EnqueueWithOrigin; + type ReservedDmpWeight = ReservedDmpWeight; + type OutboundXcmpMessageSource = XcmpQueue; + type XcmpMessageHandler = XcmpQueue; + type ReservedXcmpWeight = ReservedXcmpWeight; + type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; + type ConsensusHook = ConsensusHook; + type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo; } type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< - Runtime, - RELAY_CHAIN_SLOT_DURATION_MILLIS, - BLOCK_PROCESSING_VELOCITY, - UNINCLUDED_SEGMENT_CAPACITY, + Runtime, + RELAY_CHAIN_SLOT_DURATION_MILLIS, + BLOCK_PROCESSING_VELOCITY, + UNINCLUDED_SEGMENT_CAPACITY, >; impl pallet_insecure_randomness_collective_flip::Config for Runtime {} @@ -413,34 +413,34 @@ parameter_types! { } pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice< - FeeAssetId, - ToSiblingBaseDeliveryFee, - TransactionByteFee, - XcmpQueue, + FeeAssetId, + ToSiblingBaseDeliveryFee, + TransactionByteFee, + XcmpQueue, >; impl cumulus_pallet_xcmp_queue::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type ChannelInfo = ParachainSystem; - type VersionWrapper = PolkadotXcm; - type XcmpQueue = TransformOrigin; - type MaxActiveOutboundChannels = ConstU32<128>; - // Most on-chain HRMP channels are configured to use 102400 bytes of max message size, so we - // need to set the page size larger than that until we reduce the channel size on-chain. - type MaxPageSize = ConstU32<{ 103 * 1024 }>; - type MaxInboundSuspended = sp_core::ConstU32<1_000>; - type ControllerOrigin = EitherOfDiverse< - EnsureRoot, - EnsureXcm>, - >; - type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; - type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; - type PriceForSiblingDelivery = PriceForSiblingParachainDelivery; + type RuntimeEvent = RuntimeEvent; + type ChannelInfo = ParachainSystem; + type VersionWrapper = PolkadotXcm; + type XcmpQueue = TransformOrigin; + type MaxActiveOutboundChannels = ConstU32<128>; + // Most on-chain HRMP channels are configured to use 102400 bytes of max message size, so we + // need to set the page size larger than that until we reduce the channel size on-chain. + type MaxPageSize = ConstU32<{ 103 * 1024 }>; + type MaxInboundSuspended = sp_core::ConstU32<1_000>; + type ControllerOrigin = EitherOfDiverse< + EnsureRoot, + EnsureXcm>, + >; + type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; + type PriceForSiblingDelivery = PriceForSiblingParachainDelivery; } impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime { - // This must be the same as the `ChannelInfo` from the `Config`: - type ChannelList = ParachainSystem; + // This must be the same as the `ChannelInfo` from the `Config`: + type ChannelList = ParachainSystem; } parameter_types! { @@ -449,26 +449,26 @@ parameter_types! { } impl pallet_message_queue::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = weights::pallet_message_queue::WeightInfo; - #[cfg(feature = "runtime-benchmarks")] - type MessageProcessor = pallet_message_queue::mock_helpers::NoopMessageProcessor< - cumulus_primitives_core::AggregateMessageOrigin, - >; - #[cfg(not(feature = "runtime-benchmarks"))] - type MessageProcessor = xcm_builder::ProcessXcmMessage< - AggregateMessageOrigin, - xcm_executor::XcmExecutor, - RuntimeCall, - >; - type Size = u32; - // The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin: - type QueueChangeHandler = NarrowOriginToSibling; - type QueuePausedQuery = NarrowOriginToSibling; - type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>; - type MaxStale = sp_core::ConstU32<8>; - type ServiceWeight = MessageQueueServiceWeight; - type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = weights::pallet_message_queue::WeightInfo; + #[cfg(feature = "runtime-benchmarks")] + type MessageProcessor = pallet_message_queue::mock_helpers::NoopMessageProcessor< + cumulus_primitives_core::AggregateMessageOrigin, + >; + #[cfg(not(feature = "runtime-benchmarks"))] + type MessageProcessor = xcm_builder::ProcessXcmMessage< + AggregateMessageOrigin, + xcm_executor::XcmExecutor, + RuntimeCall, + >; + type Size = u32; + // The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin: + type QueueChangeHandler = NarrowOriginToSibling; + type QueuePausedQuery = NarrowOriginToSibling; + type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>; + type MaxStale = sp_core::ConstU32<8>; + type ServiceWeight = MessageQueueServiceWeight; + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } parameter_types! { @@ -488,69 +488,69 @@ parameter_types! { } impl pallet_encointer_scheduler::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type OnCeremonyPhaseChange = EncointerCeremonies; - type MomentsPerDay = MomentsPerDay; - type CeremonyMaster = MoreThanHalfCouncil; - type WeightInfo = weights::pallet_encointer_scheduler::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type OnCeremonyPhaseChange = EncointerCeremonies; + type MomentsPerDay = MomentsPerDay; + type CeremonyMaster = MoreThanHalfCouncil; + type WeightInfo = weights::pallet_encointer_scheduler::WeightInfo; } impl pallet_encointer_ceremonies::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Public = ::Signer; - type Signature = Signature; - type RandomnessSource = RandomnessCollectiveFlip; - type MeetupSizeTarget = MeetupSizeTarget; - type MeetupMinSize = MeetupMinSize; - type MeetupNewbieLimitDivider = MeetupNewbieLimitDivider; - type CeremonyMaster = MoreThanHalfCouncil; - type WeightInfo = weights::pallet_encointer_ceremonies::WeightInfo; - type MaxAttestations = ConstU32<100>; + type RuntimeEvent = RuntimeEvent; + type Public = ::Signer; + type Signature = Signature; + type RandomnessSource = RandomnessCollectiveFlip; + type MeetupSizeTarget = MeetupSizeTarget; + type MeetupMinSize = MeetupMinSize; + type MeetupNewbieLimitDivider = MeetupNewbieLimitDivider; + type CeremonyMaster = MoreThanHalfCouncil; + type WeightInfo = weights::pallet_encointer_ceremonies::WeightInfo; + type MaxAttestations = ConstU32<100>; } impl pallet_encointer_communities::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type CommunityMaster = MoreThanHalfCouncil; - type TrustableForNonDestructiveAction = MoreThanHalfCouncil; - type WeightInfo = weights::pallet_encointer_communities::WeightInfo; - type MaxCommunityIdentifiers = ConstU32<10000>; - type MaxBootstrappers = ConstU32<10000>; - type MaxLocationsPerGeohash = ConstU32<10000>; - type MaxCommunityIdentifiersPerGeohash = ConstU32<10000>; + type RuntimeEvent = RuntimeEvent; + type CommunityMaster = MoreThanHalfCouncil; + type TrustableForNonDestructiveAction = MoreThanHalfCouncil; + type WeightInfo = weights::pallet_encointer_communities::WeightInfo; + type MaxCommunityIdentifiers = ConstU32<10000>; + type MaxBootstrappers = ConstU32<10000>; + type MaxLocationsPerGeohash = ConstU32<10000>; + type MaxCommunityIdentifiersPerGeohash = ConstU32<10000>; } impl pallet_encointer_balances::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type DefaultDemurrage = DefaultDemurrage; - type ExistentialDeposit = EncointerExistentialDeposit; - type CeremonyMaster = MoreThanHalfCouncil; - type WeightInfo = weights::pallet_encointer_balances::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type DefaultDemurrage = DefaultDemurrage; + type ExistentialDeposit = EncointerExistentialDeposit; + type CeremonyMaster = MoreThanHalfCouncil; + type WeightInfo = weights::pallet_encointer_balances::WeightInfo; } impl pallet_encointer_bazaar::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = weights::pallet_encointer_bazaar::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = weights::pallet_encointer_bazaar::WeightInfo; } impl pallet_encointer_reputation_commitments::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = weights::pallet_encointer_reputation_commitments::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = weights::pallet_encointer_reputation_commitments::WeightInfo; } impl pallet_encointer_faucet::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type ControllerOrigin = EnsureRoot; - type Currency = Balances; - type PalletId = FaucetPalletId; - type WeightInfo = weights::pallet_encointer_faucet::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type ControllerOrigin = EnsureRoot; + type Currency = Balances; + type PalletId = FaucetPalletId; + type WeightInfo = weights::pallet_encointer_faucet::WeightInfo; } impl pallet_aura::Config for Runtime { - type AuthorityId = AuraId; - type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; - type AllowMultipleBlocksPerSlot = ConstBool; - type SlotDuration = ConstU64; + type AuthorityId = AuraId; + type DisabledValidators = (); + type MaxAuthorities = MaxAuthorities; + type AllowMultipleBlocksPerSlot = ConstBool; + type SlotDuration = ConstU64; } parameter_types! { @@ -561,37 +561,37 @@ parameter_types! { } type MoreThanHalfCouncil = EitherOfDiverse< - EnsureRoot, - pallet_collective::EnsureProportionMoreThan, + EnsureRoot, + pallet_collective::EnsureProportionMoreThan, >; pub type CouncilCollective = pallet_collective::Instance1; impl pallet_collective::Config for Runtime { - type RuntimeOrigin = RuntimeOrigin; - type Proposal = RuntimeCall; - type RuntimeEvent = RuntimeEvent; - type MotionDuration = CouncilMotionDuration; - type MaxProposals = CouncilMaxProposals; - type DefaultVote = pallet_collective::PrimeDefaultVote; - type MaxMembers = CouncilMaxMembers; - type WeightInfo = weights::pallet_collective::WeightInfo; - type SetMembersOrigin = MoreThanHalfCouncil; - type MaxProposalWeight = MaxProposalWeight; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type MotionDuration = CouncilMotionDuration; + type MaxProposals = CouncilMaxProposals; + type DefaultVote = pallet_collective::PrimeDefaultVote; + type MaxMembers = CouncilMaxMembers; + type WeightInfo = weights::pallet_collective::WeightInfo; + type SetMembersOrigin = MoreThanHalfCouncil; + type MaxProposalWeight = MaxProposalWeight; } // support for collective pallet impl pallet_membership::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type AddOrigin = MoreThanHalfCouncil; - type RemoveOrigin = MoreThanHalfCouncil; - type SwapOrigin = MoreThanHalfCouncil; - type ResetOrigin = MoreThanHalfCouncil; - type PrimeOrigin = MoreThanHalfCouncil; - type MembershipInitialized = Collective; - type MembershipChanged = Collective; - type MaxMembers = CouncilMaxMembers; - type WeightInfo = weights::pallet_membership::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type AddOrigin = MoreThanHalfCouncil; + type RemoveOrigin = MoreThanHalfCouncil; + type SwapOrigin = MoreThanHalfCouncil; + type ResetOrigin = MoreThanHalfCouncil; + type PrimeOrigin = MoreThanHalfCouncil; + type MembershipInitialized = Collective; + type MembershipChanged = Collective; + type MaxMembers = CouncilMaxMembers; + type WeightInfo = weights::pallet_membership::WeightInfo; } /// A `HandleCredit` implementation that naively transfers the fees to the block author. @@ -599,64 +599,64 @@ impl pallet_membership::Config for Runtime { pub struct AssetsToBlockAuthor(PhantomData); impl HandleCredit, pallet_encointer_balances::Pallet> -for AssetsToBlockAuthor + for AssetsToBlockAuthor where - R: pallet_authorship::Config + pallet_encointer_balances::Config, - AccountIdOf: From - + Into - + From<[u8; 32]>, + R: pallet_authorship::Config + pallet_encointer_balances::Config, + AccountIdOf: From + + Into + + From<[u8; 32]>, { - fn handle_credit(credit: Credit, pallet_encointer_balances::Pallet>) { - if let Some(author) = pallet_authorship::Pallet::::author() { - // This only affects fees paid in CC! - - // We will only grant 50% of CC fees to the current block author - // reasoning: If you send 100% to the author, then the author can attempt to increase - // the fee rate by making transactions up to the block limit at zero cost - // (since they pocket the fees). - // In the future, fees might be collected in community treasuries instead of being - // "burned" to dead account 0x00 = 5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM - // See: https://forum.polkadot.network/t/towards-encointer-self-sustainability/4195 - - let half_amount = credit.peek() / 2; - let community_pot = AccountIdOf::::from([0u8; 32]); - - let (author_credit, community_credit) = credit.split(half_amount); - // In case of error: Will drop the result triggering the `OnDrop` of the imbalance. - let _ = pallet_encointer_balances::Pallet::::resolve(&author, author_credit); - let _ = - pallet_encointer_balances::Pallet::::resolve(&community_pot, community_credit); - } - } + fn handle_credit(credit: Credit, pallet_encointer_balances::Pallet>) { + if let Some(author) = pallet_authorship::Pallet::::author() { + // This only affects fees paid in CC! + + // We will only grant 50% of CC fees to the current block author + // reasoning: If you send 100% to the author, then the author can attempt to increase + // the fee rate by making transactions up to the block limit at zero cost + // (since they pocket the fees). + // In the future, fees might be collected in community treasuries instead of being + // "burned" to dead account 0x00 = 5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM + // See: https://forum.polkadot.network/t/towards-encointer-self-sustainability/4195 + + let half_amount = credit.peek() / 2; + let community_pot = AccountIdOf::::from([0u8; 32]); + + let (author_credit, community_credit) = credit.split(half_amount); + // In case of error: Will drop the result triggering the `OnDrop` of the imbalance. + let _ = pallet_encointer_balances::Pallet::::resolve(&author, author_credit); + let _ = + pallet_encointer_balances::Pallet::::resolve(&community_pot, community_credit); + } + } } // Allow fee payment in community currency impl pallet_asset_tx_payment::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Fungibles = pallet_encointer_balances::Pallet; - type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter< - encointer_balances_tx_payment::BalanceToCommunityBalance, - AssetsToBlockAuthor, - >; + type RuntimeEvent = RuntimeEvent; + type Fungibles = pallet_encointer_balances::Pallet; + type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter< + encointer_balances_tx_payment::BalanceToCommunityBalance, + AssetsToBlockAuthor, + >; } impl pallet_authorship::Config for Runtime { - type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type EventHandler = (CollatorSelection,); + type FindAuthor = pallet_session::FindAccountFromAuthorIndex; + type EventHandler = (CollatorSelection,); } impl pallet_session::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type ValidatorId = ::AccountId; - // we don't have stash and controller, thus we don't need the convert as well. - type ValidatorIdOf = pallet_collator_selection::IdentityCollator; - type ShouldEndSession = pallet_session::PeriodicSessions; - type NextSessionRotation = pallet_session::PeriodicSessions; - type SessionManager = CollatorSelection; - // Essentially just Aura, but let's be pedantic. - type SessionHandler = ::KeyTypeIdProviders; - type Keys = SessionKeys; - type WeightInfo = weights::pallet_session::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type ValidatorId = ::AccountId; + // we don't have stash and controller, thus we don't need the convert as well. + type ValidatorIdOf = pallet_collator_selection::IdentityCollator; + type ShouldEndSession = pallet_session::PeriodicSessions; + type NextSessionRotation = pallet_session::PeriodicSessions; + type SessionManager = CollatorSelection; + // Essentially just Aura, but let's be pedantic. + type SessionHandler = ::KeyTypeIdProviders; + type Keys = SessionKeys; + type WeightInfo = weights::pallet_session::WeightInfo; } parameter_types! { @@ -665,19 +665,19 @@ parameter_types! { } impl pallet_collator_selection::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Currency = Balances; - type UpdateOrigin = MoreThanHalfCouncil; - type PotId = PotId; - type MaxCandidates = ConstU32<100>; - type MinEligibleCollators = ConstU32<4>; - type MaxInvulnerables = ConstU32<20>; - // should be a multiple of session or things will get inconsistent - type KickThreshold = Period; - type ValidatorId = ::AccountId; - type ValidatorIdOf = pallet_collator_selection::IdentityCollator; - type ValidatorRegistration = Session; - type WeightInfo = weights::pallet_collator_selection::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type UpdateOrigin = MoreThanHalfCouncil; + type PotId = PotId; + type MaxCandidates = ConstU32<100>; + type MinEligibleCollators = ConstU32<4>; + type MaxInvulnerables = ConstU32<20>; + // should be a multiple of session or things will get inconsistent + type KickThreshold = Period; + type ValidatorId = ::AccountId; + type ValidatorIdOf = pallet_collator_selection::IdentityCollator; + type ValidatorRegistration = Session; + type WeightInfo = weights::pallet_collator_selection::WeightInfo; } construct_runtime! { @@ -737,43 +737,43 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. pub type SignedExtra = ( - frame_system::CheckNonZeroSender, - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_asset_tx_payment::ChargeAssetTxPayment, - frame_metadata_hash_extension::CheckMetadataHash, + frame_system::CheckNonZeroSender, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_asset_tx_payment::ChargeAssetTxPayment, + frame_metadata_hash_extension::CheckMetadataHash, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = -generic::UncheckedExtrinsic; + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Migrations to apply on runtime upgrade. pub type Migrations = ( - // unreleased and/or un-applied - cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, - // permanent - pallet_xcm::migration::MigrateToLatestXcmVersion, + // unreleased and/or un-applied + cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, + // permanent + pallet_xcm::migration::MigrateToLatestXcmVersion, ); /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - AllPalletsWithSystem, - Migrations, + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPalletsWithSystem, + Migrations, >; #[cfg(feature = "runtime-benchmarks")] mod benches { - frame_benchmarking::define_benchmarks!( + frame_benchmarking::define_benchmarks!( [frame_system, SystemBench::] [pallet_balances, Balances] [pallet_collective, Collective] @@ -1292,31 +1292,31 @@ cumulus_pallet_parachain_system::register_validate_block! { /// but it avoids potential collisions caused by different versions of crates. #[cfg(feature = "std")] pub fn aura_config_for_chain_spec(seeds: &[&str]) -> AuraConfig { - use sp_core::{ - crypto::{Pair, Public}, - sr25519, - }; - fn get_from_seed(seed: &str) -> ::Public { - TPublic::Pair::from_string(&format!("//{}", seed), None) - .expect("static values are valid; qed") - .public() - } - - AuraConfig { - authorities: seeds.iter().map(|s| get_from_seed::(s).into()).collect(), - } + use sp_core::{ + crypto::{Pair, Public}, + sr25519, + }; + fn get_from_seed(seed: &str) -> ::Public { + TPublic::Pair::from_string(&format!("//{}", seed), None) + .expect("static values are valid; qed") + .public() + } + + AuraConfig { + authorities: seeds.iter().map(|s| get_from_seed::(s).into()).collect(), + } } #[test] fn test_ed_is_one_tenth_of_relay() { - let relay_ed = kusama_runtime_constants::currency::EXISTENTIAL_DEPOSIT; - let encointer_ed = ExistentialDeposit::get(); - assert_eq!(relay_ed / 10, encointer_ed); + let relay_ed = kusama_runtime_constants::currency::EXISTENTIAL_DEPOSIT; + let encointer_ed = ExistentialDeposit::get(); + assert_eq!(relay_ed / 10, encointer_ed); } #[test] fn test_transasction_byte_fee_is_one_tenth_of_relay() { - let relay_tbf = ::kusama_runtime_constants::fee::TRANSACTION_BYTE_FEE; - let parachain_tbf = TransactionByteFee::get(); - assert_eq!(relay_tbf / 10, parachain_tbf); + let relay_tbf = ::kusama_runtime_constants::fee::TRANSACTION_BYTE_FEE; + let parachain_tbf = TransactionByteFee::get(); + assert_eq!(relay_tbf / 10, parachain_tbf); } From 774a2766a005d319350f10069fe202c9735db521 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Sun, 25 Aug 2024 11:45:25 +0200 Subject: [PATCH 4/4] Fresh weights --- .../encointer/src/weights/pallet_xcm.rs | 128 +++++++------ .../xcm/pallet_xcm_benchmarks_fungible.rs | 76 ++++---- .../xcm/pallet_xcm_benchmarks_generic.rs | 174 +++++++++--------- 3 files changed, 188 insertions(+), 190 deletions(-) diff --git a/system-parachains/encointer/src/weights/pallet_xcm.rs b/system-parachains/encointer/src/weights/pallet_xcm.rs index a7dc349ad8..72d2f393e6 100644 --- a/system-parachains/encointer/src/weights/pallet_xcm.rs +++ b/system-parachains/encointer/src/weights/pallet_xcm.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-08-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./people-kusama-chain-spec.json")`, DB CACHE: 1024 +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./encointer-kusama-chain-spec.json")`, DB CACHE: 1024 // Executed Command: // ./target/production/polkadot-parachain // benchmark // pallet -// --chain=./people-kusama-chain-spec.json +// --chain=./encointer-kusama-chain-spec.json // --steps=50 // --repeat=20 // --pallet=pallet_xcm // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./people-kusama-weights/ +// --output=./encointer-kusama-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -61,11 +61,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn send() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 26_490_000 picoseconds. - Weight::from_parts(27_351_000, 0) - .saturating_add(Weight::from_parts(0, 3539)) + // Measured: `38` + // Estimated: `3503` + // Minimum execution time: 23_281_000 picoseconds. + Weight::from_parts(24_070_000, 0) + .saturating_add(Weight::from_parts(0, 3503)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -79,21 +79,19 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn teleport_assets() -> Weight { // Proof Size summary in bytes: - // Measured: `158` - // Estimated: `3623` - // Minimum execution time: 118_051_000 picoseconds. - Weight::from_parts(120_021_000, 0) - .saturating_add(Weight::from_parts(0, 3623)) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `70` + // Estimated: `3535` + // Minimum execution time: 89_931_000 picoseconds. + Weight::from_parts(90_891_000, 0) + .saturating_add(Weight::from_parts(0, 3535)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Benchmark::Override` (r:0 w:0) /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -119,8 +117,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_330_000 picoseconds. - Weight::from_parts(11_620_000, 0) + // Minimum execution time: 11_250_000 picoseconds. + Weight::from_parts(11_690_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `PolkadotXcm::SupportedVersion` (r:0 w:1) @@ -129,8 +127,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_461_000 picoseconds. - Weight::from_parts(7_800_000, 0) + // Minimum execution time: 7_690_000 picoseconds. + Weight::from_parts(7_970_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -140,8 +138,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_560_000 picoseconds. - Weight::from_parts(2_760_000, 0) + // Minimum execution time: 2_540_000 picoseconds. + Weight::from_parts(2_680_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -165,11 +163,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 33_160_000 picoseconds. - Weight::from_parts(33_840_000, 0) - .saturating_add(Weight::from_parts(0, 3539)) + // Measured: `38` + // Estimated: `3503` + // Minimum execution time: 29_910_000 picoseconds. + Weight::from_parts(30_870_000, 0) + .saturating_add(Weight::from_parts(0, 3503)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -191,11 +189,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: - // Measured: `292` - // Estimated: `3757` - // Minimum execution time: 35_550_000 picoseconds. - Weight::from_parts(36_270_000, 0) - .saturating_add(Weight::from_parts(0, 3757)) + // Measured: `220` + // Estimated: `3685` + // Minimum execution time: 31_700_000 picoseconds. + Weight::from_parts(32_411_000, 0) + .saturating_add(Weight::from_parts(0, 3685)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -205,8 +203,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_610_000 picoseconds. - Weight::from_parts(2_730_000, 0) + // Minimum execution time: 2_580_000 picoseconds. + Weight::from_parts(2_680_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -216,8 +214,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `89` // Estimated: `13454` - // Minimum execution time: 21_851_000 picoseconds. - Weight::from_parts(22_081_000, 0) + // Minimum execution time: 22_350_000 picoseconds. + Weight::from_parts(22_750_000, 0) .saturating_add(Weight::from_parts(0, 13454)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -228,8 +226,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `93` // Estimated: `13458` - // Minimum execution time: 21_340_000 picoseconds. - Weight::from_parts(21_860_000, 0) + // Minimum execution time: 22_510_000 picoseconds. + Weight::from_parts(22_980_000, 0) .saturating_add(Weight::from_parts(0, 13458)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -238,11 +236,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn already_notified_target() -> Weight { // Proof Size summary in bytes: - // Measured: `106` - // Estimated: `15946` - // Minimum execution time: 24_150_000 picoseconds. - Weight::from_parts(24_631_000, 0) - .saturating_add(Weight::from_parts(0, 15946)) + // Measured: `142` + // Estimated: `15982` + // Minimum execution time: 24_530_000 picoseconds. + Weight::from_parts(25_150_000, 0) + .saturating_add(Weight::from_parts(0, 15982)) .saturating_add(T::DbWeight::get().reads(6)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) @@ -261,11 +259,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn notify_current_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `142` - // Estimated: `6082` - // Minimum execution time: 31_860_000 picoseconds. - Weight::from_parts(32_640_000, 0) - .saturating_add(Weight::from_parts(0, 6082)) + // Measured: `106` + // Estimated: `6046` + // Minimum execution time: 28_711_000 picoseconds. + Weight::from_parts(29_071_000, 0) + .saturating_add(Weight::from_parts(0, 6046)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -275,8 +273,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `10993` - // Minimum execution time: 14_480_000 picoseconds. - Weight::from_parts(14_730_000, 0) + // Minimum execution time: 14_220_000 picoseconds. + Weight::from_parts(14_490_000, 0) .saturating_add(Weight::from_parts(0, 10993)) .saturating_add(T::DbWeight::get().reads(4)) } @@ -286,8 +284,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `13465` - // Minimum execution time: 21_261_000 picoseconds. - Weight::from_parts(21_861_000, 0) + // Minimum execution time: 22_361_000 picoseconds. + Weight::from_parts(22_951_000, 0) .saturating_add(Weight::from_parts(0, 13465)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -308,11 +306,11 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: - // Measured: `142` - // Estimated: `13507` - // Minimum execution time: 42_790_000 picoseconds. - Weight::from_parts(43_401_000, 0) - .saturating_add(Weight::from_parts(0, 13507)) + // Measured: `106` + // Estimated: `13471` + // Minimum execution time: 39_030_000 picoseconds. + Weight::from_parts(39_890_000, 0) + .saturating_add(Weight::from_parts(0, 13471)) .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -324,8 +322,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `32` // Estimated: `1517` - // Minimum execution time: 4_430_000 picoseconds. - Weight::from_parts(4_560_000, 0) + // Minimum execution time: 5_530_000 picoseconds. + Weight::from_parts(5_680_000, 0) .saturating_add(Weight::from_parts(0, 1517)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -336,8 +334,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7669` // Estimated: `11134` - // Minimum execution time: 30_880_000 picoseconds. - Weight::from_parts(31_310_000, 0) + // Minimum execution time: 31_281_000 picoseconds. + Weight::from_parts(31_880_000, 0) .saturating_add(Weight::from_parts(0, 11134)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -348,8 +346,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `90` // Estimated: `3555` - // Minimum execution time: 43_750_000 picoseconds. - Weight::from_parts(44_740_000, 0) + // Minimum execution time: 44_540_000 picoseconds. + Weight::from_parts(45_361_000, 0) .saturating_add(Weight::from_parts(0, 3555)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/system-parachains/encointer/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/system-parachains/encointer/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 36ed3f35e5..ac710e1bbb 100644 --- a/system-parachains/encointer/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/system-parachains/encointer/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-08-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./people-kusama-chain-spec.json")`, DB CACHE: 1024 +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./encointer-kusama-chain-spec.json")`, DB CACHE: 1024 // Executed Command: // ./target/production/polkadot-parachain // benchmark // pallet -// --chain=./people-kusama-chain-spec.json +// --chain=./encointer-kusama-chain-spec.json // --steps=50 // --repeat=20 // --pallet=pallet_xcm_benchmarks::fungible // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./people-kusama-weights/xcm/pallet_xcm_benchmarks_fungible.rs +// --output=./encointer-kusama-weights/xcm/pallet_xcm_benchmarks_fungible.rs // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -53,8 +53,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 32_730_000 picoseconds. - Weight::from_parts(33_090_000, 0) + // Minimum execution time: 34_451_000 picoseconds. + Weight::from_parts(35_150_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -65,13 +65,13 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `153` // Estimated: `6196` - // Minimum execution time: 45_710_000 picoseconds. - Weight::from_parts(46_210_000, 0) + // Minimum execution time: 46_240_000 picoseconds. + Weight::from_parts(46_801_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: `System::Account` (r:3 w:3) + /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -89,13 +89,13 @@ impl WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub(crate) fn transfer_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `311` - // Estimated: `8799` - // Minimum execution time: 113_961_000 picoseconds. - Weight::from_parts(115_301_000, 0) - .saturating_add(Weight::from_parts(0, 8799)) - .saturating_add(T::DbWeight::get().reads(10)) - .saturating_add(T::DbWeight::get().writes(5)) + // Measured: `223` + // Estimated: `6196` + // Minimum execution time: 88_740_000 picoseconds. + Weight::from_parts(89_621_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `Benchmark::Override` (r:0 w:0) /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -117,7 +117,7 @@ impl WeightInfo { /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:2 w:2) + /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -125,20 +125,20 @@ impl WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub(crate) fn initiate_reserve_withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `259` - // Estimated: `6196` - // Minimum execution time: 77_341_000 picoseconds. - Weight::from_parts(78_541_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `171` + // Estimated: `3636` + // Minimum execution time: 51_920_000 picoseconds. + Weight::from_parts(52_600_000, 0) + .saturating_add(Weight::from_parts(0, 3636)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } pub(crate) fn receive_teleported_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_830_000 picoseconds. - Weight::from_parts(3_150_000, 0) + // Minimum execution time: 2_800_000 picoseconds. + Weight::from_parts(2_910_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `System::Account` (r:1 w:1) @@ -147,8 +147,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `52` // Estimated: `3593` - // Minimum execution time: 25_390_000 picoseconds. - Weight::from_parts(26_020_000, 0) + // Minimum execution time: 26_310_000 picoseconds. + Weight::from_parts(26_950_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -171,11 +171,11 @@ impl WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub(crate) fn deposit_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `158` - // Estimated: `3623` - // Minimum execution time: 63_550_000 picoseconds. - Weight::from_parts(64_760_000, 0) - .saturating_add(Weight::from_parts(0, 3623)) + // Measured: `122` + // Estimated: `3593` + // Minimum execution time: 58_930_000 picoseconds. + Weight::from_parts(59_740_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -195,11 +195,11 @@ impl WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub(crate) fn initiate_teleport() -> Weight { // Proof Size summary in bytes: - // Measured: `106` - // Estimated: `3571` - // Minimum execution time: 27_631_000 picoseconds. - Weight::from_parts(28_170_000, 0) - .saturating_add(Weight::from_parts(0, 3571)) + // Measured: `70` + // Estimated: `3535` + // Minimum execution time: 24_680_000 picoseconds. + Weight::from_parts(25_380_000, 0) + .saturating_add(Weight::from_parts(0, 3535)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/system-parachains/encointer/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/system-parachains/encointer/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index d57045018c..87f6f4471b 100644 --- a/system-parachains/encointer/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/system-parachains/encointer/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-08-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./people-kusama-chain-spec.json")`, DB CACHE: 1024 +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./encointer-kusama-chain-spec.json")`, DB CACHE: 1024 // Executed Command: // ./target/production/polkadot-parachain // benchmark // pallet -// --chain=./people-kusama-chain-spec.json +// --chain=./encointer-kusama-chain-spec.json // --steps=50 // --repeat=20 // --pallet=pallet_xcm_benchmarks::generic // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./people-kusama-weights/xcm/pallet_xcm_benchmarks_generic.rs +// --output=./encointer-kusama-weights/xcm/pallet_xcm_benchmarks_generic.rs // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -57,7 +57,7 @@ impl WeightInfo { /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:2 w:2) + /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -65,20 +65,20 @@ impl WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub(crate) fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `259` - // Estimated: `6196` - // Minimum execution time: 76_200_000 picoseconds. - Weight::from_parts(77_141_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `171` + // Estimated: `3636` + // Minimum execution time: 50_490_000 picoseconds. + Weight::from_parts(51_180_000, 0) + .saturating_add(Weight::from_parts(0, 3636)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } pub(crate) fn buy_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 720_000 picoseconds. - Weight::from_parts(790_000, 0) + // Minimum execution time: 800_000 picoseconds. + Weight::from_parts(850_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `PolkadotXcm::Queries` (r:1 w:0) @@ -87,8 +87,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `32` // Estimated: `3497` - // Minimum execution time: 7_340_000 picoseconds. - Weight::from_parts(7_560_000, 0) + // Minimum execution time: 8_240_000 picoseconds. + Weight::from_parts(8_670_000, 0) .saturating_add(Weight::from_parts(0, 3497)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -96,56 +96,56 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_280_000 picoseconds. - Weight::from_parts(7_500_000, 0) + // Minimum execution time: 7_470_000 picoseconds. + Weight::from_parts(7_740_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_560_000 picoseconds. - Weight::from_parts(1_670_000, 0) + // Minimum execution time: 1_520_000 picoseconds. + Weight::from_parts(1_640_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 750_000 picoseconds. - Weight::from_parts(820_000, 0) + // Minimum execution time: 780_000 picoseconds. + Weight::from_parts(850_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 760_000 picoseconds. - Weight::from_parts(820_000, 0) + // Minimum execution time: 790_000 picoseconds. + Weight::from_parts(860_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 670_000 picoseconds. - Weight::from_parts(770_000, 0) + // Minimum execution time: 740_000 picoseconds. + Weight::from_parts(810_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 740_000 picoseconds. - Weight::from_parts(820_000, 0) + // Minimum execution time: 780_000 picoseconds. + Weight::from_parts(860_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 710_000 picoseconds. - Weight::from_parts(760_000, 0) + // Minimum execution time: 790_000 picoseconds. + Weight::from_parts(860_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) @@ -158,7 +158,7 @@ impl WeightInfo { /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:2 w:2) + /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -166,13 +166,13 @@ impl WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub(crate) fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `259` - // Estimated: `6196` - // Minimum execution time: 71_911_000 picoseconds. - Weight::from_parts(72_991_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `171` + // Estimated: `3636` + // Minimum execution time: 47_301_000 picoseconds. + Weight::from_parts(48_181_000, 0) + .saturating_add(Weight::from_parts(0, 3636)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) /// Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -180,8 +180,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `90` // Estimated: `3555` - // Minimum execution time: 10_660_000 picoseconds. - Weight::from_parts(10_990_000, 0) + // Minimum execution time: 11_660_000 picoseconds. + Weight::from_parts(11_970_000, 0) .saturating_add(Weight::from_parts(0, 3555)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -190,8 +190,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 700_000 picoseconds. - Weight::from_parts(760_000, 0) + // Minimum execution time: 720_000 picoseconds. + Weight::from_parts(800_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1) @@ -210,11 +210,11 @@ impl WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub(crate) fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `74` - // Estimated: `3539` - // Minimum execution time: 26_870_000 picoseconds. - Weight::from_parts(27_340_000, 0) - .saturating_add(Weight::from_parts(0, 3539)) + // Measured: `38` + // Estimated: `3503` + // Minimum execution time: 23_680_000 picoseconds. + Weight::from_parts(24_430_000, 0) + .saturating_add(Weight::from_parts(0, 3503)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -224,8 +224,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_060_000 picoseconds. - Weight::from_parts(3_200_000, 0) + // Minimum execution time: 3_061_000 picoseconds. + Weight::from_parts(3_280_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -233,40 +233,40 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_250_000 picoseconds. - Weight::from_parts(1_350_000, 0) + // Minimum execution time: 1_180_000 picoseconds. + Weight::from_parts(1_310_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 860_000 picoseconds. - Weight::from_parts(890_000, 0) + // Minimum execution time: 930_000 picoseconds. + Weight::from_parts(970_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 720_000 picoseconds. - Weight::from_parts(760_000, 0) + // Minimum execution time: 780_000 picoseconds. + Weight::from_parts(830_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 740_000 picoseconds. - Weight::from_parts(780_000, 0) + // Minimum execution time: 720_000 picoseconds. + Weight::from_parts(800_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 940_000 picoseconds. - Weight::from_parts(1_000_000, 0) + // Minimum execution time: 980_000 picoseconds. + Weight::from_parts(1_030_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) @@ -279,7 +279,7 @@ impl WeightInfo { /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:2 w:2) + /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -287,20 +287,20 @@ impl WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub(crate) fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `259` - // Estimated: `6196` - // Minimum execution time: 77_161_000 picoseconds. - Weight::from_parts(77_781_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `171` + // Estimated: `3636` + // Minimum execution time: 52_550_000 picoseconds. + Weight::from_parts(53_500_000, 0) + .saturating_add(Weight::from_parts(0, 3636)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } pub(crate) fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_940_000 picoseconds. - Weight::from_parts(4_070_000, 0) + // Minimum execution time: 4_870_000 picoseconds. + Weight::from_parts(5_040_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) @@ -313,7 +313,7 @@ impl WeightInfo { /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:2 w:2) + /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -321,52 +321,52 @@ impl WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub(crate) fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `259` - // Estimated: `6196` - // Minimum execution time: 71_961_000 picoseconds. - Weight::from_parts(73_231_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `171` + // Estimated: `3636` + // Minimum execution time: 47_010_000 picoseconds. + Weight::from_parts(47_791_000, 0) + .saturating_add(Weight::from_parts(0, 3636)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } pub(crate) fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 760_000 picoseconds. - Weight::from_parts(820_000, 0) + // Minimum execution time: 830_000 picoseconds. + Weight::from_parts(890_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 710_000 picoseconds. - Weight::from_parts(770_000, 0) + // Minimum execution time: 721_000 picoseconds. + Weight::from_parts(780_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 690_000 picoseconds. - Weight::from_parts(730_000, 0) + // Minimum execution time: 710_000 picoseconds. + Weight::from_parts(750_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 730_000 picoseconds. - Weight::from_parts(780_000, 0) + // Minimum execution time: 750_000 picoseconds. + Weight::from_parts(810_000, 0) .saturating_add(Weight::from_parts(0, 0)) } pub(crate) fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 760_000 picoseconds. - Weight::from_parts(820_000, 0) + // Minimum execution time: 790_000 picoseconds. + Weight::from_parts(870_000, 0) .saturating_add(Weight::from_parts(0, 0)) } }