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

Commit f92237b

Browse files
muharemEgorPopelyaev
authored andcommitted
Collectives: xcm base weights (#2550)
1 parent 48cc5ab commit f92237b

File tree

1 file changed

+7
-4
lines changed
  • parachains/runtimes/collectives/collectives-polkadot/src

1 file changed

+7
-4
lines changed

parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,11 @@ pub type XcmOriginToTransactDispatchOrigin = (
101101
);
102102

103103
parameter_types! {
104-
// One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate.
105-
pub UnitWeightCost: Weight = Weight::from_parts(1_000_000_000, 64 * 1024);
104+
/// The amount of weight an XCM operation takes. This is a safe overestimate.
105+
pub const BaseXcmWeight: Weight = Weight::from_parts(1_000_000_000, 1024);
106+
/// A temporary weight value for each XCM instruction.
107+
/// NOTE: This should be removed after we account for PoV weights.
108+
pub const TempFixedXcmWeight: Weight = Weight::from_parts(1_000_000_000, 0);
106109
pub const MaxInstructions: u32 = 100;
107110
pub const MaxAssetsIntoHolding: u32 = 64;
108111
// Fellows pluralistic body.
@@ -229,7 +232,7 @@ impl xcm_executor::Config for XcmConfig {
229232
type IsTeleporter = ConcreteNativeAssetFrom<DotLocation>;
230233
type UniversalLocation = UniversalLocation;
231234
type Barrier = Barrier;
232-
type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
235+
type Weigher = FixedWeightBounds<TempFixedXcmWeight, RuntimeCall, MaxInstructions>;
233236
type Trader =
234237
UsingComponents<WeightToFee, DotLocation, AccountId, Balances, ToStakingPot<Runtime>>;
235238
type ResponseHandler = PolkadotXcm;
@@ -280,7 +283,7 @@ impl pallet_xcm::Config for Runtime {
280283
type XcmExecutor = XcmExecutor<XcmConfig>;
281284
type XcmTeleportFilter = Everything;
282285
type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location.
283-
type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
286+
type Weigher = FixedWeightBounds<BaseXcmWeight, RuntimeCall, MaxInstructions>;
284287
type UniversalLocation = UniversalLocation;
285288
type RuntimeOrigin = RuntimeOrigin;
286289
type RuntimeCall = RuntimeCall;

0 commit comments

Comments
 (0)