Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Use XCM benchmarks from pallet_xcm_benchmarks #182

Closed
hbulgarini opened this issue May 22, 2023 · 0 comments · Fixed by #185
Closed

Use XCM benchmarks from pallet_xcm_benchmarks #182

hbulgarini opened this issue May 22, 2023 · 0 comments · Fixed by #185
Assignees
Labels
enhancement New feature or request

Comments

@hbulgarini
Copy link
Contributor

hbulgarini commented May 22, 2023

At the moment we are hardcoding the XCM weights using the FixedWeightBounds with the following configuration:

parameter_types! {
	// One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate.
	pub UnitWeightCost: u64 = 1_000_000_000;
	pub const MaxInstructions: u32 = 100;
}

...

pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
...
    type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
...
}

impl pallet_xcm::Config for XcmConfig {
...
    type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
...
}

We should replace the FixedWeightBounds with WeightInfoBounds and use the weights resulting from the pallet_xcm_benchmarks. From the runtime perspective, there are some changes that are needed over the define_benchmarks! and impl frame_benchmarking::Benchmark<Block> for Runtime . Here is the example for Statemine configuration:

https://github.com/paritytech/cumulus/blob/polkadot-v0.9.37/parachains/runtimes/assets/statemine/src/lib.rs#L850

This change should be back ported into branch xcmv3-dev as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant