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

Use 2D weights in XCM v3 #6134

Merged
merged 50 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
caa5199
Depend upon sp-core instead of sp-runtime
KiChjang Oct 7, 2022
77d4a08
Make sp-io a dev-dependency
KiChjang Oct 8, 2022
1673d5b
Use 2D weights in XCM v3
KiChjang Oct 10, 2022
7c80bd7
cargo fmt
KiChjang Oct 11, 2022
b84def2
Add XCM pallet migration to runtimes
KiChjang Oct 11, 2022
813357c
Merge branch 'gav-xcm-v3' into kckyeung/xcm-v3-2d-weights
KiChjang Oct 11, 2022
5b3ffde
Use from_parts
KiChjang Oct 11, 2022
127f400
cargo fmt
KiChjang Oct 11, 2022
fb2e50b
Fixes
KiChjang Oct 11, 2022
a6f6d87
cargo fmt
KiChjang Oct 11, 2022
c52747c
Remove XCMWeight import
KiChjang Oct 11, 2022
6fe03c4
Fixes
KiChjang Oct 11, 2022
c83c81a
Fixes
KiChjang Oct 11, 2022
f1c4667
Fixes
KiChjang Oct 12, 2022
7534813
Fixes
KiChjang Oct 12, 2022
7b23243
Use translate in migration
KiChjang Oct 12, 2022
8c4f853
Increase max upward message size in tests
KiChjang Oct 12, 2022
77486f5
Fix doc test
KiChjang Oct 13, 2022
1101e1b
Remove most uses of from_ref_time
KiChjang Oct 31, 2022
5d70367
cargo fmt
KiChjang Nov 1, 2022
d854e73
Fixes
KiChjang Nov 1, 2022
39bc6cf
Fixes
KiChjang Nov 1, 2022
2f735b2
Add extrinsic benchmarking to XCM pallet
KiChjang Nov 5, 2022
7060420
cargo fmt
KiChjang Nov 5, 2022
555ed04
Merge remote-tracking branch 'origin/gav-xcm-v3' into kckyeung/xcm-v3…
KiChjang Nov 5, 2022
40361c3
Fixes
KiChjang Nov 5, 2022
51c9201
Use old syntax
KiChjang Nov 5, 2022
969ae7e
cargo fmt
KiChjang Nov 5, 2022
320af8e
Fixes
KiChjang Nov 5, 2022
feeae24
Remove hardcoded weights
KiChjang Nov 6, 2022
c28d974
Add XCM pallet to benchmarks
KiChjang Nov 6, 2022
e7238a6
Use successful origin
KiChjang Nov 6, 2022
16850be
Fix weird type parameter compilation issue
KiChjang Nov 8, 2022
9c6f427
Fixes
KiChjang Nov 8, 2022
59005e9
".git/.scripts/bench-bot.sh" runtime westend-dev pallet_xcm
Nov 8, 2022
02d25a3
".git/.scripts/bench-bot.sh" runtime rococo-dev pallet_xcm
Nov 8, 2022
1fb3985
".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_xcm
Nov 8, 2022
8872f95
".git/.scripts/bench-bot.sh" runtime polkadot-dev pallet_xcm
Nov 8, 2022
719e47c
Use benchmarked XCM pallet weights
KiChjang Nov 9, 2022
c3f0d33
Fixes
KiChjang Nov 9, 2022
eb89ff3
Fixes
KiChjang Nov 9, 2022
ad82b69
Use override instead of skip
KiChjang Nov 9, 2022
3b22c2e
Fixes
KiChjang Nov 9, 2022
0da0af1
Fixes
KiChjang Nov 9, 2022
32d5916
Fixes
KiChjang Nov 9, 2022
a5620b4
Fixes
KiChjang Nov 9, 2022
239be7c
".git/.scripts/bench-bot.sh" runtime polkadot-dev pallet_xcm
Nov 9, 2022
e46060d
Fixes
KiChjang Nov 10, 2022
e86a080
".git/.scripts/bench-bot.sh" runtime polkadot-dev pallet_xcm
Nov 10, 2022
9a1ec5a
".git/.scripts/bench-bot.sh" runtime westend-dev pallet_xcm
Nov 10, 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
5 changes: 4 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ fn default_parachains_host_configuration(
max_upward_queue_count: 8,
max_upward_queue_size: 1024 * 1024,
max_downward_message_size: 1024 * 1024,
ump_service_total_weight: Weight::from_ref_time(100_000_000_000)
.set_proof_size(MAX_POV_SIZE as u64),
ump_service_total_weight: Weight::from_parts(100_000_000_000, MAX_POV_SIZE as u64),
max_upward_message_size: 50 * 1024,
max_upward_message_num_per_candidate: 5,
hrmp_sender_deposit: 0,
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ mod tests {
weight.base_extrinsic = Weight::from_ref_time(100);
})
.for_class(DispatchClass::non_mandatory(), |weight| {
weight.max_total = Some(Weight::from_ref_time(1024).set_proof_size(u64::MAX));
weight.max_total = Some(Weight::from_parts(1024, u64::MAX));
})
.build_or_panic();
pub BlockLength: limits::BlockLength = limits::BlockLength::max(2 * 1024);
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ parameter_types! {
pub const BlockHashCount: u32 = 250;
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
Weight::from_ref_time(4 * 1024 * 1024).set_proof_size(u64::MAX),
Weight::from_parts(4 * 1024 * 1024, u64::MAX),
);
}

Expand Down
4 changes: 1 addition & 3 deletions runtime/common/src/paras_registrar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,7 @@ mod tests {
parameter_types! {
pub const BlockHashCount: u32 = 250;
pub BlockWeights: limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
Weight::from_ref_time(1024).set_proof_size(u64::MAX),
);
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, u64::MAX));
pub BlockLength: limits::BlockLength =
limits::BlockLength::max_with_normal_ratio(4 * 1024 * 1024, NORMAL_RATIO);
}
Expand Down
3 changes: 3 additions & 0 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1479,6 +1479,8 @@ pub type Executive = frame_executive::Executive<
// "Properly migrate weights to v2" <https://github.com/paritytech/polkadot/pull/6091>
parachains_configuration::migration::v3::MigrateToV3<Runtime>,
pallet_election_provider_multi_phase::migrations::v1::MigrateToV1<Runtime>,
// "Use 2D weights in XCM v3" <https://github.com/paritytech/polkadot/pull/6134>
pallet_xcm::migration::v1::MigrateToV1<Runtime>,
),
>;
/// The payload being signed in the transactions.
Expand Down Expand Up @@ -1545,6 +1547,7 @@ mod benches {
[pallet_vesting, Vesting]
[pallet_whitelist, Whitelist]
// XCM
[pallet_xcm, XcmPallet]
[pallet_xcm_benchmarks::fungible, pallet_xcm_benchmarks::fungible::Pallet::<Runtime>]
[pallet_xcm_benchmarks::generic, pallet_xcm_benchmarks::generic::Pallet::<Runtime>]
);
Expand Down
1 change: 1 addition & 0 deletions runtime/kusama/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub mod pallet_treasury;
pub mod pallet_utility;
pub mod pallet_vesting;
pub mod pallet_whitelist;
pub mod pallet_xcm;
pub mod runtime_common_auctions;
pub mod runtime_common_claims;
pub mod runtime_common_crowdloan;
Expand Down
111 changes: 111 additions & 0 deletions runtime/kusama/src/weights/pallet_xcm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.

// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_xcm`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-11-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024

// Executed Command:
// /home/benchbot/cargo_target_dir/production/polkadot
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/polkadot/.git/.artifacts/bench.json
// --pallet=pallet_xcm
// --chain=kusama-dev
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;

/// Weight functions for `pallet_xcm`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Storage: XcmPallet SupportedVersion (r:1 w:0)
// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
// Storage: XcmPallet SafeXcmVersion (r:1 w:0)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Storage: Dmp DownwardMessageQueues (r:1 w:1)
fn send() -> Weight {
// Minimum execution time: 32_807 nanoseconds.
Weight::from_ref_time(33_383_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
fn teleport_assets() -> Weight {
// Minimum execution time: 28_036 nanoseconds.
Weight::from_ref_time(28_386_000 as u64)
}
fn reserve_transfer_assets() -> Weight {
// Minimum execution time: 26_239 nanoseconds.
Weight::from_ref_time(27_146_000 as u64)
}
fn execute() -> Weight {
// Minimum execution time: 14_327 nanoseconds.
Weight::from_ref_time(14_693_000 as u64)
}
// Storage: XcmPallet SupportedVersion (r:0 w:1)
fn force_xcm_version() -> Weight {
// Minimum execution time: 13_854 nanoseconds.
Weight::from_ref_time(14_658_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: XcmPallet SafeXcmVersion (r:0 w:1)
fn force_default_xcm_version() -> Weight {
// Minimum execution time: 3_786 nanoseconds.
Weight::from_ref_time(3_986_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: XcmPallet VersionNotifiers (r:1 w:1)
// Storage: XcmPallet QueryCounter (r:1 w:1)
// Storage: XcmPallet SupportedVersion (r:1 w:0)
// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
// Storage: XcmPallet SafeXcmVersion (r:1 w:0)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Storage: Dmp DownwardMessageQueues (r:1 w:1)
// Storage: XcmPallet Queries (r:0 w:1)
fn force_subscribe_version_notify() -> Weight {
// Minimum execution time: 37_959 nanoseconds.
Weight::from_ref_time(38_689_000 as u64)
.saturating_add(T::DbWeight::get().reads(7 as u64))
.saturating_add(T::DbWeight::get().writes(6 as u64))
}
// Storage: XcmPallet VersionNotifiers (r:1 w:1)
// Storage: XcmPallet SupportedVersion (r:1 w:0)
// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
// Storage: XcmPallet SafeXcmVersion (r:1 w:0)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Storage: Dmp DownwardMessageQueues (r:1 w:1)
// Storage: XcmPallet Queries (r:0 w:1)
fn force_unsubscribe_version_notify() -> Weight {
// Minimum execution time: 41_213 nanoseconds.
Weight::from_ref_time(41_668_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
}
Loading