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

Use XCM benchmarks from pallet_xcm_benchmarks #182

@hbulgarini

Description

@hbulgarini

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions