Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Added measured benchmarks for pallet_xcm #1968

Merged
merged 32 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
393a384
Fix
bkontur Dec 7, 2022
38a5f8b
Fix
bkontur Dec 7, 2022
317e1bf
Fixes for transact benchmark
bkontur Dec 7, 2022
52823de
Fixes add pallet_xcm to benchmarks
bkontur Dec 7, 2022
a460dd9
Merge remote-tracking branch 'origin/gav-xcm-v3' into bko-gav-xcm-v3
bkontur Dec 8, 2022
47056cd
Revert remark_with_event
bkontur Dec 8, 2022
ba344bf
Merge remote-tracking branch 'origin/gav-xcm-v3' into bko-gav-xcm-v3
bkontur Dec 8, 2022
e35c329
".git/.scripts/bench-bot.sh" xcm statemine assets pallet_xcm_benchmar…
Dec 8, 2022
d62e8c5
Fixes
bkontur Dec 8, 2022
9aa5042
TMP
bkontur Dec 8, 2022
77657c0
Fix for reserve_asset_deposited
bkontur Dec 8, 2022
f614a7e
".git/.scripts/bench-bot.sh" pallet statemine assets pallet_xcm
Dec 8, 2022
6287858
Fix
bkontur Dec 8, 2022
80dfab7
".git/.scripts/bench-bot.sh" pallet statemint assets pallet_xcm
Dec 8, 2022
7bfda25
Fix
bkontur Dec 8, 2022
44dad8d
".git/.scripts/bench-bot.sh" pallet westmint assets pallet_xcm
Dec 8, 2022
8ddbd0d
Fix westmint
bkontur Dec 8, 2022
d2670bc
".git/.scripts/bench-bot.sh" xcm statemine assets pallet_xcm_benchmar…
Dec 8, 2022
1523742
Fix
bkontur Dec 8, 2022
c1686a9
".git/.scripts/bench-bot.sh" xcm westmint assets pallet_xcm_benchmark…
Dec 8, 2022
9b9e921
".git/.scripts/bench-bot.sh" xcm statemint assets pallet_xcm_benchmar…
Dec 8, 2022
abdb3a2
Merge remote-tracking branch 'origin/gav-xcm-v3' into bko-gav-xcm-v3
bkontur Dec 11, 2022
3ea9f04
Merge branch 'gav-xcm-v3' into bko-gav-xcm-v3
bkontur Dec 11, 2022
8d35b89
".git/.scripts/bench-bot.sh" pallet collectives-polkadot collectives …
Dec 11, 2022
8b13dfa
Fix for collectives
bkontur Dec 11, 2022
c73b509
".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pal…
Dec 11, 2022
93cb91e
".git/.scripts/bench-bot.sh" pallet bridge-hub-rococo bridge-hubs pal…
Dec 11, 2022
5227e17
Fixes for bridge-hubs
bkontur Dec 11, 2022
32b9b86
Merge remote-tracking branch 'origin/gav-xcm-v3' into bko-gav-xcm-v3
bkontur Dec 13, 2022
c5ea372
Fixes - return back Weightless
bkontur Dec 13, 2022
3cdf1d2
Merge remote-tracking branch 'origin/gav-xcm-v3' into bko-gav-xcm-v3
bkontur Dec 13, 2022
b67450b
Fix - removed MigrateToTrackInactive for contracts-rococo
bkontur Dec 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pallets/dmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ pub mod pallet {
messages_processed: &mut u8,
) -> Weight {
let mut used = Weight::zero();
'page: while page_index.begin_used < page_index.end_used {
while page_index.begin_used < page_index.end_used {
let page = Pages::<T>::take(page_index.begin_used);
for (i, &(sent_at, ref data)) in page.iter().enumerate() {
if *messages_processed >= MAX_MESSAGES_PER_BLOCK {
Expand Down
2 changes: 1 addition & 1 deletion pallets/xcmp-queue/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use frame_system::RawOrigin;

benchmarks! {
set_config_with_u32 {}: update_resume_threshold(RawOrigin::Root, 100)
set_config_with_weight {}: update_weight_restrict_decay(RawOrigin::Root, 3_000_000)
set_config_with_weight {}: update_weight_restrict_decay(RawOrigin::Root, Weight::from_ref_time(3_000_000))
}

impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test);
5 changes: 3 additions & 2 deletions parachains/runtimes/assets/statemine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ mod benches {
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_xcmp_queue, XcmpQueue]
// XCM
[pallet_xcm, PolkadotXcm]
// NOTE: Make sure you point to the individual modules below.
[pallet_xcm_benchmarks::fungible, XcmBalances]
[pallet_xcm_benchmarks::generic, XcmGeneric]
Expand Down Expand Up @@ -853,7 +854,7 @@ impl_runtime_apis! {
impl cumulus_pallet_session_benchmarking::Config for Runtime {}

use xcm::latest::prelude::*;
use xcm_config::KsmLocation;
use xcm_config::{LocalCheckAccount, KsmLocation};
use pallet_xcm_benchmarks::asset_instance_from;

impl pallet_xcm_benchmarks::Config for Runtime {
Expand Down Expand Up @@ -902,7 +903,7 @@ impl_runtime_apis! {
impl pallet_xcm_benchmarks::fungible::Config for Runtime {
type TransactAsset = Balances;

type CheckedAccount = CheckedAccount;
type CheckedAccount = LocalCheckAccount;
type TrustedTeleporter = TrustedTeleporter;

fn get_multi_asset() -> MultiAsset {
Expand Down
13 changes: 9 additions & 4 deletions parachains/runtimes/assets/statemine/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ use xcm_builder::{
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex,
ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FungiblesAdapter, IsConcrete, LocalMint,
NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds,
MintLocation, NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
WeightInfoBounds,
};
use xcm_executor::{
traits::{JustTry, WithOriginFilter},
Expand All @@ -54,6 +55,8 @@ parameter_types! {
pub AssetsPalletLocation: MultiLocation =
PalletInstance(<Assets as PalletInfoAccess>::index() as u8).into();
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
/// The check account that is allowed to mint assets locally.
pub LocalCheckAccount: (AccountId, MintLocation) = (CheckingAccount::get(), MintLocation::Local);
}

/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
Expand Down Expand Up @@ -158,7 +161,9 @@ match_types! {
frame_system::Call::set_heap_pages { .. } |
frame_system::Call::set_code { .. } |
frame_system::Call::set_code_without_checks { .. } |
frame_system::Call::kill_prefix { .. }
frame_system::Call::kill_prefix { .. } |
// Used by pallet_xcm_benchmarks for transact
frame_system::Call::remark_with_event { .. }
bkontur marked this conversation as resolved.
Show resolved Hide resolved
) |
RuntimeCall::ParachainSystem(..) |
RuntimeCall::Timestamp(..) |
Expand Down
5 changes: 3 additions & 2 deletions parachains/runtimes/assets/statemint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ mod benches {
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_xcmp_queue, XcmpQueue]
// XCM
[pallet_xcm, PolkadotXcm]
// NOTE: Make sure you point to the individual modules below.
[pallet_xcm_benchmarks::fungible, XcmBalances]
[pallet_xcm_benchmarks::generic, XcmGeneric]
Expand Down Expand Up @@ -866,7 +867,7 @@ impl_runtime_apis! {
impl cumulus_pallet_session_benchmarking::Config for Runtime {}

use xcm::latest::prelude::*;
use xcm_config::DotLocation;
use xcm_config::{DotLocation, LocalCheckAccount};
use pallet_xcm_benchmarks::asset_instance_from;

impl pallet_xcm_benchmarks::Config for Runtime {
Expand Down Expand Up @@ -914,7 +915,7 @@ impl_runtime_apis! {
impl pallet_xcm_benchmarks::fungible::Config for Runtime {
type TransactAsset = Balances;

type CheckedAccount = CheckedAccount;
type CheckedAccount = LocalCheckAccount;
type TrustedTeleporter = TrustedTeleporter;

fn get_multi_asset() -> MultiAsset {
Expand Down
13 changes: 9 additions & 4 deletions parachains/runtimes/assets/statemint/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ use xcm_builder::{
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex,
ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FungiblesAdapter, IsConcrete, LocalMint,
NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds,
MintLocation, NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
WeightInfoBounds,
};
use xcm_executor::{
traits::{JustTry, WithOriginFilter},
Expand All @@ -54,6 +55,8 @@ parameter_types! {
pub AssetsPalletLocation: MultiLocation =
PalletInstance(<Assets as PalletInfoAccess>::index() as u8).into();
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
/// The check account that is allowed to mint assets locally.
pub LocalCheckAccount: (AccountId, MintLocation) = (CheckingAccount::get(), MintLocation::Local);
}

/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
Expand Down Expand Up @@ -158,7 +161,9 @@ match_types! {
frame_system::Call::set_heap_pages { .. } |
frame_system::Call::set_code { .. } |
frame_system::Call::set_code_without_checks { .. } |
frame_system::Call::kill_prefix { .. }
frame_system::Call::kill_prefix { .. } |
// Used by pallet_xcm_benchmarks for transact
frame_system::Call::remark_with_event { .. }
) |
RuntimeCall::ParachainSystem(..) |
RuntimeCall::Timestamp(..) |
Expand Down
5 changes: 3 additions & 2 deletions parachains/runtimes/assets/westmint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ mod benches {
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_xcmp_queue, XcmpQueue]
// XCM
[pallet_xcm, PolkadotXcm]
// NOTE: Make sure you point to the individual modules below.
[pallet_xcm_benchmarks::fungible, XcmBalances]
[pallet_xcm_benchmarks::generic, XcmGeneric]
Expand Down Expand Up @@ -825,7 +826,7 @@ impl_runtime_apis! {
impl cumulus_pallet_session_benchmarking::Config for Runtime {}

use xcm::latest::prelude::*;
use xcm_config::WestendLocation;
use xcm_config::{LocalCheckAccount, WestendLocation};
use pallet_xcm_benchmarks::asset_instance_from;

impl pallet_xcm_benchmarks::Config for Runtime {
Expand Down Expand Up @@ -874,7 +875,7 @@ impl_runtime_apis! {
impl pallet_xcm_benchmarks::fungible::Config for Runtime {
type TransactAsset = Balances;

type CheckedAccount = CheckedAccount;
type CheckedAccount = LocalCheckAccount;
type TrustedTeleporter = TrustedTeleporter;

fn get_multi_asset() -> MultiAsset {
Expand Down
13 changes: 9 additions & 4 deletions parachains/runtimes/assets/westmint/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ use xcm_builder::{
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex,
ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FungiblesAdapter, IsConcrete, LocalMint,
NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds,
MintLocation, NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
WeightInfoBounds,
};
use xcm_executor::{
traits::{JustTry, WithOriginFilter},
Expand All @@ -54,6 +55,8 @@ parameter_types! {
pub AssetsPalletLocation: MultiLocation =
PalletInstance(<Assets as PalletInfoAccess>::index() as u8).into();
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
/// The check account that is allowed to mint assets locally.
pub LocalCheckAccount: (AccountId, MintLocation) = (CheckingAccount::get(), MintLocation::Local);
}

/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
Expand Down Expand Up @@ -154,7 +157,9 @@ match_types! {
frame_system::Call::set_heap_pages { .. } |
frame_system::Call::set_code { .. } |
frame_system::Call::set_code_without_checks { .. } |
frame_system::Call::kill_prefix { .. }
frame_system::Call::kill_prefix { .. } |
// Used by pallet_xcm_benchmarks for transact
frame_system::Call::remark_with_event { .. }
) |
RuntimeCall::ParachainSystem(..) |
RuntimeCall::Timestamp(..) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ mod benches {
[pallet_timestamp, Timestamp]
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_xcm, PolkadotXcm]
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ mod benches {
[pallet_timestamp, Timestamp]
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_xcm, PolkadotXcm]
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ mod benches {
[cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_alliance, Alliance]
[pallet_collective, AllianceMotion]
[pallet_xcm, PolkadotXcm]
);
}

Expand Down
1 change: 1 addition & 0 deletions parachains/runtimes/contracts/contracts-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ mod benches {
[pallet_timestamp, Timestamp]
[pallet_collator_selection, CollatorSelection]
[pallet_contracts, Contracts]
[pallet_xcm, PolkadotXcm]
);
}

Expand Down