Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ce2d375
Allow to set a worst case buy execution fee asset and weight
girazoki Jan 17, 2024
e58b767
Merge remote-tracking branch 'origin/master' into girazoki-worst-case…
girazoki Feb 19, 2024
0b426c7
add prdoc
girazoki Feb 19, 2024
c982b26
remove default impl
girazoki Feb 19, 2024
04d2623
Merge remote-tracking branch 'origin/master' into girazoki-worst-case…
girazoki Mar 17, 2025
b9b9b11
reopen and merging back
girazoki Mar 17, 2025
bb54f66
adapt pr number
girazoki Mar 17, 2025
ddafc1e
generate worst case for all cases, and include it as part of fee asset
girazoki Mar 24, 2025
aebfc30
add limited weight for benchmarks
girazoki Mar 25, 2025
b8dc917
remove non-used
girazoki Mar 25, 2025
d8492ce
sanitize prdoc
girazoki Mar 26, 2025
5e63326
fmt
girazoki Mar 26, 2025
c8c4cc0
adapt prdoc
girazoki Mar 28, 2025
a45f7f7
prdoc cleanup again
girazoki Mar 28, 2025
2df61db
Merge branch 'master' into girazoki-worst-case-buy-execution-weight
girazoki Mar 31, 2025
a53f3d2
Merge branch 'master' into girazoki-worst-case-buy-execution-weight
bkontur Apr 4, 2025
f6d3d25
Merge branch 'master' into girazoki-worst-case-buy-execution-weight
bkontur Apr 9, 2025
87003ac
apply patch benches
girazoki Apr 9, 2025
561ad07
Merge remote-tracking branch 'origin/master' into girazoki-worst-case…
girazoki Apr 11, 2025
992f9d4
add alias origin from master
girazoki Apr 11, 2025
2c378d7
add alias origin to bridgehub westend
girazoki Apr 11, 2025
0f24113
increased fees westend
girazoki Apr 11, 2025
a1d3021
Update prdoc/pr_7944.prdoc
bkontur Apr 11, 2025
3f7af65
Merge branch 'master' into girazoki-worst-case-buy-execution-weight
bkontur Apr 11, 2025
47937bb
Merge branch 'master' into girazoki-worst-case-buy-execution-weight
bkontur Apr 14, 2025
bd0bfef
Merge branch 'master' into girazoki-worst-case-buy-execution-weight
girazoki Apr 22, 2025
dd35f0b
Merge branch 'master' into girazoki-worst-case-buy-execution-weight
acatangiu Apr 22, 2025
5d34856
modify worst_case_trader
girazoki Apr 22, 2025
7bddc0e
fix signature
girazoki Apr 22, 2025
0d29ca9
fix
girazoki Apr 22, 2025
0312304
fix again
girazoki Apr 23, 2025
b110b36
Merge branch 'master' into girazoki-worst-case-buy-execution-weight
bkontur Apr 23, 2025
f4a6a22
Update prdoc/pr_7944.prdoc
bkontur Apr 23, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
#[cfg(feature = "runtime-benchmarks")]
use xcm::latest::prelude::{
Asset, Assets as XcmAssets, Fungible, Here, InteriorLocation, Junction, Junction::*, Location,
NetworkId, NonFungible, Parent, ParentThen, Response, XCM_VERSION,
NetworkId, NonFungible, Parent, ParentThen, Response, WeightLimit, XCM_VERSION,
};
use xcm::{
latest::prelude::{AssetId, BodyId},
Expand Down Expand Up @@ -1989,11 +1989,11 @@ impl_runtime_apis! {
Ok((origin, ticket, assets))
}

fn fee_asset() -> Result<Asset, BenchmarkError> {
Ok(Asset {
fn worst_case_for_trader() -> Result<(Asset, WeightLimit), BenchmarkError> {
Ok((Asset {
id: AssetId(TokenLocation::get()),
fun: Fungible(1_000_000 * UNITS),
})
}, WeightLimit::Limited(Weight::from_parts(5000, 5000))))
}

fn unlockable_asset() -> Result<(Location, Location, Asset), BenchmarkError> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ use frame_support::traits::PalletInfoAccess;
#[cfg(feature = "runtime-benchmarks")]
use xcm::latest::prelude::{
Asset, Assets as XcmAssets, Fungible, Here, InteriorLocation, Junction, Junction::*, Location,
NetworkId, NonFungible, Parent, ParentThen, Response, XCM_VERSION,
NetworkId, NonFungible, Parent, ParentThen, Response, WeightLimit, XCM_VERSION,
};

use xcm_runtime_apis::{
Expand Down Expand Up @@ -2260,11 +2260,11 @@ impl_runtime_apis! {
Ok((origin, ticket, assets))
}

fn fee_asset() -> Result<Asset, BenchmarkError> {
Ok(Asset {
fn worst_case_for_trader() -> Result<(Asset, WeightLimit), BenchmarkError> {
Ok((Asset {
id: AssetId(WestendLocation::get()),
fun: Fungible(1_000 * UNITS),
})
}, WeightLimit::Limited(Weight::from_parts(5000, 5000))))
}

fn unlockable_asset() -> Result<(Location, Location, Asset), BenchmarkError> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
//! Autogenerated weights for `pallet_xcm_benchmarks::generic`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2025-03-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2025-04-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `3c24194516f3`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `0af6a34749d7`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024

// Executed Command:
Expand Down Expand Up @@ -66,87 +66,91 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `212`
// Estimated: `6196`
// Minimum execution time: 100_738_000 picoseconds.
Weight::from_parts(102_746_000, 6196)
// Minimum execution time: 103_614_000 picoseconds.
Weight::from_parts(107_306_000, 6196)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(3))
}
// Storage: `System::Account` (r:1 w:1)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
pub fn buy_execution() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 653_000 picoseconds.
Weight::from_parts(721_000, 0)
// Estimated: `3593`
// Minimum execution time: 7_998_000 picoseconds.
Weight::from_parts(8_489_000, 3593)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: `System::Account` (r:1 w:1)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
pub fn pay_fees() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 6_108_000 picoseconds.
Weight::from_parts(6_562_000, 3593)
// Minimum execution time: 6_293_000 picoseconds.
Weight::from_parts(6_672_000, 3593)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
pub fn asset_claimer() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 658_000 picoseconds.
Weight::from_parts(706_000, 0)
// Minimum execution time: 782_000 picoseconds.
Weight::from_parts(839_000, 0)
}
// Storage: `PolkadotXcm::Queries` (r:1 w:0)
// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`)
pub fn query_response() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3465`
// Minimum execution time: 5_712_000 picoseconds.
Weight::from_parts(5_871_000, 3465)
// Minimum execution time: 5_635_000 picoseconds.
Weight::from_parts(5_973_000, 3465)
.saturating_add(T::DbWeight::get().reads(1))
}
pub fn transact() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_836_000 picoseconds.
Weight::from_parts(7_253_000, 0)
// Minimum execution time: 7_331_000 picoseconds.
Weight::from_parts(7_532_000, 0)
}
pub fn refund_surplus() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_778_000 picoseconds.
Weight::from_parts(2_969_000, 0)
// Minimum execution time: 2_839_000 picoseconds.
Weight::from_parts(3_034_000, 0)
}
pub fn set_error_handler() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 651_000 picoseconds.
Weight::from_parts(717_000, 0)
// Minimum execution time: 747_000 picoseconds.
Weight::from_parts(802_000, 0)
}
pub fn set_appendix() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 654_000 picoseconds.
Weight::from_parts(715_000, 0)
// Minimum execution time: 727_000 picoseconds.
Weight::from_parts(787_000, 0)
}
pub fn clear_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 635_000 picoseconds.
Weight::from_parts(688_000, 0)
// Minimum execution time: 717_000 picoseconds.
Weight::from_parts(771_000, 0)
}
pub fn descend_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 708_000 picoseconds.
Weight::from_parts(742_000, 0)
// Minimum execution time: 757_000 picoseconds.
Weight::from_parts(822_000, 0)
}
// Storage: `Benchmark::Override` (r:0 w:0)
// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`)
Expand All @@ -161,8 +165,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 694_000 picoseconds.
Weight::from_parts(731_000, 0)
// Minimum execution time: 735_000 picoseconds.
Weight::from_parts(788_000, 0)
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
Expand All @@ -180,8 +184,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `212`
// Estimated: `6196`
// Minimum execution time: 67_336_000 picoseconds.
Weight::from_parts(69_034_000, 6196)
// Minimum execution time: 68_640_000 picoseconds.
Weight::from_parts(70_050_000, 6196)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(3))
}
Expand All @@ -191,17 +195,17 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `23`
// Estimated: `3488`
// Minimum execution time: 8_830_000 picoseconds.
Weight::from_parts(9_038_000, 3488)
// Minimum execution time: 8_891_000 picoseconds.
Weight::from_parts(9_210_000, 3488)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
pub fn trap() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_234_000 picoseconds.
Weight::from_parts(3_353_000, 0)
// Minimum execution time: 3_247_000 picoseconds.
Weight::from_parts(3_479_000, 0)
}
// Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1)
// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
Expand All @@ -217,8 +221,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `42`
// Estimated: `3507`
// Minimum execution time: 22_885_000 picoseconds.
Weight::from_parts(23_427_000, 3507)
// Minimum execution time: 22_866_000 picoseconds.
Weight::from_parts(23_629_000, 3507)
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
Expand All @@ -228,44 +232,44 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_729_000 picoseconds.
Weight::from_parts(2_904_000, 0)
// Minimum execution time: 2_928_000 picoseconds.
Weight::from_parts(3_033_000, 0)
.saturating_add(T::DbWeight::get().writes(1))
}
pub fn burn_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 23_298_000 picoseconds.
Weight::from_parts(23_607_000, 0)
// Minimum execution time: 23_095_000 picoseconds.
Weight::from_parts(23_613_000, 0)
}
pub fn expect_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_698_000 picoseconds.
Weight::from_parts(6_845_000, 0)
// Minimum execution time: 6_766_000 picoseconds.
Weight::from_parts(6_918_000, 0)
}
pub fn expect_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_110_000 picoseconds.
Weight::from_parts(3_347_000, 0)
// Minimum execution time: 3_339_000 picoseconds.
Weight::from_parts(3_560_000, 0)
}
pub fn expect_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_211_000 picoseconds.
Weight::from_parts(3_368_000, 0)
// Minimum execution time: 3_337_000 picoseconds.
Weight::from_parts(3_543_000, 0)
}
pub fn expect_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 759_000 picoseconds.
Weight::from_parts(853_000, 0)
// Minimum execution time: 875_000 picoseconds.
Weight::from_parts(944_000, 0)
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
Expand All @@ -283,17 +287,17 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `212`
// Estimated: `6196`
// Minimum execution time: 73_562_000 picoseconds.
Weight::from_parts(76_153_000, 6196)
// Minimum execution time: 74_710_000 picoseconds.
Weight::from_parts(77_414_000, 6196)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(3))
}
pub fn expect_pallet() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_209_000 picoseconds.
Weight::from_parts(5_363_000, 0)
// Minimum execution time: 5_491_000 picoseconds.
Weight::from_parts(5_699_000, 0)
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
Expand All @@ -311,31 +315,31 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `212`
// Estimated: `6196`
// Minimum execution time: 67_567_000 picoseconds.
Weight::from_parts(69_822_000, 6196)
// Minimum execution time: 68_452_000 picoseconds.
Weight::from_parts(70_643_000, 6196)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(3))
}
pub fn clear_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 696_000 picoseconds.
Weight::from_parts(747_000, 0)
// Minimum execution time: 760_000 picoseconds.
Weight::from_parts(832_000, 0)
}
pub fn set_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 631_000 picoseconds.
Weight::from_parts(685_000, 0)
// Minimum execution time: 727_000 picoseconds.
Weight::from_parts(778_000, 0)
}
pub fn clear_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 617_000 picoseconds.
Weight::from_parts(689_000, 0)
// Minimum execution time: 729_000 picoseconds.
Weight::from_parts(776_000, 0)
}
// Storage: `System::Account` (r:1 w:1)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
Expand All @@ -349,8 +353,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `498`
// Estimated: `4273`
// Minimum execution time: 81_324_000 picoseconds.
Weight::from_parts(83_920_000, 4273)
// Minimum execution time: 83_321_000 picoseconds.
Weight::from_parts(86_103_000, 4273)
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
Expand All @@ -360,29 +364,29 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `69`
// Estimated: `1489`
// Minimum execution time: 5_200_000 picoseconds.
Weight::from_parts(5_384_000, 1489)
// Minimum execution time: 5_230_000 picoseconds.
Weight::from_parts(5_429_000, 1489)
.saturating_add(T::DbWeight::get().reads(1))
}
pub fn set_fees_mode() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 642_000 picoseconds.
Weight::from_parts(691_000, 0)
// Minimum execution time: 737_000 picoseconds.
Weight::from_parts(780_000, 0)
}
pub fn unpaid_execution() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 666_000 picoseconds.
Weight::from_parts(718_000, 0)
// Minimum execution time: 759_000 picoseconds.
Weight::from_parts(825_000, 0)
}
pub fn alias_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 676_000 picoseconds.
Weight::from_parts(738_000, 0)
// Minimum execution time: 780_000 picoseconds.
Weight::from_parts(854_000, 0)
}
}
Loading
Loading