diff --git a/runtime/kusama/src/xcm_config.rs b/runtime/kusama/src/xcm_config.rs index 5725f54eddd5..5663725c42a4 100644 --- a/runtime/kusama/src/xcm_config.rs +++ b/runtime/kusama/src/xcm_config.rs @@ -41,8 +41,8 @@ use xcm_builder::{ ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, IsChildSystemParachain, IsConcrete, MintLocation, OriginToPluralityVoice, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, - WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, + SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UniversalWeigherAdapter, + UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, }; use xcm_executor::traits::WithOriginFilter; @@ -406,6 +406,11 @@ impl pallet_xcm::Config for Runtime { RuntimeCall, MaxInstructions, >; + type DestinationWeigher = UniversalWeigherAdapter< + // use local weight for remote message and hope for the best. + WeightInfoBounds, (), MaxInstructions>, + (XcmRouter,), + >; type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; diff --git a/runtime/polkadot/src/xcm_config.rs b/runtime/polkadot/src/xcm_config.rs index b2e09b1453af..1b59f7773b01 100644 --- a/runtime/polkadot/src/xcm_config.rs +++ b/runtime/polkadot/src/xcm_config.rs @@ -44,7 +44,8 @@ use xcm_builder::{ ChildParachainAsNative, ChildParachainConvertsVia, CurrencyAdapter as XcmCurrencyAdapter, IsConcrete, MintLocation, OriginToPluralityVoice, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, - UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, + UniversalWeigherAdapter, UsingComponents, WeightInfoBounds, WithComputedOrigin, + WithUniqueTopic, }; use xcm_executor::traits::WithOriginFilter; @@ -415,6 +416,11 @@ impl pallet_xcm::Config for Runtime { RuntimeCall, MaxInstructions, >; + type DestinationWeigher = UniversalWeigherAdapter< + // use local weight for remote message and hope for the best. + WeightInfoBounds, (), MaxInstructions>, + (XcmRouter,), + >; type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; diff --git a/runtime/rococo/src/xcm_config.rs b/runtime/rococo/src/xcm_config.rs index 75e06391c56b..7b3fa8827c2e 100644 --- a/runtime/rococo/src/xcm_config.rs +++ b/runtime/rococo/src/xcm_config.rs @@ -40,8 +40,8 @@ use xcm_builder::{ ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedWeightBounds, IsChildSystemParachain, IsConcrete, MintLocation, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, - TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, - WithUniqueTopic, + TakeWeightCredit, TrailingSetTopicAsId, UniversalWeigherAdapter, UsingComponents, + WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, }; use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; @@ -351,6 +351,7 @@ pub type LocalOriginToLocation = ( // And a usual Signed origin to be used in XCM as a corresponding AccountId32 SignedToAccountId32, ); + impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; @@ -364,6 +365,11 @@ impl pallet_xcm::Config for Runtime { // transfer. type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; + type DestinationWeigher = UniversalWeigherAdapter< + // use local weight for remote message and hope for the best. + FixedWeightBounds, + (XcmRouter,), + >; type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; diff --git a/runtime/test-runtime/src/xcm_config.rs b/runtime/test-runtime/src/xcm_config.rs index 2113bbae66ad..6cdae3b3778c 100644 --- a/runtime/test-runtime/src/xcm_config.rs +++ b/runtime/test-runtime/src/xcm_config.rs @@ -23,7 +23,7 @@ use frame_system::EnsureRoot; use xcm::latest::prelude::*; use xcm_builder::{ AllowUnpaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, SignedAccountId32AsNative, - SignedToAccountId32, + SignedToAccountId32, UniversalWeigherAdapter, }; use xcm_executor::{ traits::{TransactAsset, WeightTrader}, @@ -132,21 +132,24 @@ impl pallet_xcm::Config for crate::Runtime { // The config types here are entirely configurable, since the only one that is sorely needed // is `XcmExecutor`, which will be used in unit tests located in xcm-executor. type RuntimeEvent = crate::RuntimeEvent; - type ExecuteXcmOrigin = EnsureXcmOrigin; - type UniversalLocation = UniversalLocation; + type Currency = crate::Balances; + type CurrencyMatcher = (); type SendXcmOrigin = EnsureXcmOrigin; - type Weigher = FixedWeightBounds; type XcmRouter = DoNothingRouter; + type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Everything; type XcmExecutor = xcm_executor::XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; + type Weigher = FixedWeightBounds; + type DestinationWeigher = + UniversalWeigherAdapter, ()>; + type UniversalLocation = UniversalLocation; type RuntimeOrigin = crate::RuntimeOrigin; type RuntimeCall = crate::RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; - type Currency = crate::Balances; - type CurrencyMatcher = (); + type AdminOrigin = EnsureRoot; type TrustedLockers = (); type SovereignAccountOf = (); type MaxLockers = frame_support::traits::ConstU32<8>; @@ -155,5 +158,4 @@ impl pallet_xcm::Config for crate::Runtime { type WeightInfo = pallet_xcm::TestWeightInfo; #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; - type AdminOrigin = EnsureRoot; } diff --git a/runtime/westend/src/xcm_config.rs b/runtime/westend/src/xcm_config.rs index a83c38c9f66f..01c0cd1ab3fc 100644 --- a/runtime/westend/src/xcm_config.rs +++ b/runtime/westend/src/xcm_config.rs @@ -39,7 +39,8 @@ use xcm_builder::{ ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, IsChildSystemParachain, IsConcrete, MintLocation, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, + TrailingSetTopicAsId, UniversalWeigherAdapter, UsingComponents, WeightInfoBounds, + WithComputedOrigin, WithUniqueTopic, }; use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; @@ -291,6 +292,11 @@ impl pallet_xcm::Config for Runtime { type XcmReserveTransferFilter = Everything; type Weigher = WeightInfoBounds, RuntimeCall, MaxInstructions>; + type DestinationWeigher = UniversalWeigherAdapter< + // use local weight for remote message and hope for the best. + WeightInfoBounds, (), MaxInstructions>, + (XcmRouter,), + >; type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; diff --git a/xcm/pallet-xcm/src/lib.rs b/xcm/pallet-xcm/src/lib.rs index aefcf30910ed..058fbc3163c5 100644 --- a/xcm/pallet-xcm/src/lib.rs +++ b/xcm/pallet-xcm/src/lib.rs @@ -53,7 +53,7 @@ pub use pallet::*; use xcm_executor::{ traits::{ CheckSuspension, ClaimAssets, ConvertLocation, DropAssets, MatchesFungible, OnResponse, - QueryHandler, QueryResponseStatus, VersionChangeNotifier, WeightBounds, + QueryHandler, QueryResponseStatus, UniversalWeigher, VersionChangeNotifier, WeightBounds, }, Assets, }; @@ -219,6 +219,9 @@ pub mod pallet { /// Means of measuring the weight consumed by an XCM message locally. type Weigher: WeightBounds<::RuntimeCall>; + /// Means of approximating the weight consumed by an XCM program at the destination. + type DestinationWeigher: UniversalWeigher; + /// This chain's Universal Location. type UniversalLocation: Get; @@ -1223,14 +1226,14 @@ impl Pallet { Some(weight_limit) => weight_limit, None => { let fees = fees.clone(); - let mut remote_message = Xcm(vec![ + let remote_message = Xcm(vec![ ReserveAssetDeposited(assets.clone()), ClearOrigin, BuyExecution { fees, weight_limit: Limited(Weight::zero()) }, DepositAsset { assets: Wild(AllCounted(max_assets)), beneficiary }, ]); - // use local weight for remote message and hope for the best. - let remote_weight = T::Weigher::weight(&mut remote_message) + // estimate remote_message weight + let remote_weight = T::DestinationWeigher::weigh(dest, remote_message) .map_err(|()| Error::::UnweighableMessage)?; Limited(remote_weight) }, @@ -1283,14 +1286,14 @@ impl Pallet { Some(weight_limit) => weight_limit, None => { let fees = fees.clone(); - let mut remote_message = Xcm(vec![ + let remote_message = Xcm(vec![ ReceiveTeleportedAsset(assets.clone()), ClearOrigin, BuyExecution { fees, weight_limit: Limited(Weight::zero()) }, DepositAsset { assets: Wild(AllCounted(max_assets)), beneficiary }, ]); - // use local weight for remote message and hope for the best. - let remote_weight = T::Weigher::weight(&mut remote_message) + // estimate remote_message weight + let remote_weight = T::DestinationWeigher::weigh(dest, remote_message) .map_err(|()| Error::::UnweighableMessage)?; Limited(remote_weight) }, diff --git a/xcm/pallet-xcm/src/mock.rs b/xcm/pallet-xcm/src/mock.rs index b56b1af82def..b7867a4a0974 100644 --- a/xcm/pallet-xcm/src/mock.rs +++ b/xcm/pallet-xcm/src/mock.rs @@ -31,8 +31,8 @@ use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, Case, ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, - FixedWeightBounds, IsConcrete, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeWeightCredit, + FixedWeightBounds, IsConcrete, ProvideWeighableInstructions, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UniversalWeigherAdapter, }; use xcm_executor::XcmExecutor; @@ -319,6 +319,13 @@ parameter_types! { pub ReachableDest: Option = Some(Parachain(1000).into()); } +pub struct AdditionalDestinationInstructions; +impl ProvideWeighableInstructions<()> for AdditionalDestinationInstructions { + fn provide_for(_dest: impl Into, _message: &Xcm<()>) -> Vec> { + sp_std::vec![SetTopic([13; 32])] + } +} + impl pallet_xcm::Config for Test { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; @@ -329,6 +336,10 @@ impl pallet_xcm::Config for Test { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; + type DestinationWeigher = UniversalWeigherAdapter< + FixedWeightBounds, + AdditionalDestinationInstructions, + >; type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; diff --git a/xcm/pallet-xcm/src/tests.rs b/xcm/pallet-xcm/src/tests.rs index 6ff9f1d893c8..c3e1f72bf2bd 100644 --- a/xcm/pallet-xcm/src/tests.rs +++ b/xcm/pallet-xcm/src/tests.rs @@ -375,7 +375,11 @@ fn teleport_assets_works() { Xcm(vec![ ReceiveTeleportedAsset((Here, SEND_AMOUNT).into()), ClearOrigin, - buy_limited_execution((Here, SEND_AMOUNT), Weight::from_parts(4000, 4000)), + buy_limited_execution( + (Here, SEND_AMOUNT), + // 4 instruction + AdditionalDestinationInstructions adds 1 instruction + Weight::from_parts(5000, 5000) + ), DepositAsset { assets: AllCounted(1).into(), beneficiary: dest }, ]), )] @@ -508,7 +512,11 @@ fn reserve_transfer_assets_works() { Xcm(vec![ ReserveAssetDeposited((Parent, SEND_AMOUNT).into()), ClearOrigin, - buy_limited_execution((Parent, SEND_AMOUNT), Weight::from_parts(4000, 4000)), + buy_limited_execution( + (Parent, SEND_AMOUNT), + // 4 instruction + AdditionalDestinationInstructions adds 1 instruction + Weight::from_parts(5000, 5000) + ), DepositAsset { assets: AllCounted(1).into(), beneficiary: dest }, ]), )] diff --git a/xcm/xcm-builder/src/lib.rs b/xcm/xcm-builder/src/lib.rs index e3f910409638..4aeb3d083a54 100644 --- a/xcm/xcm-builder/src/lib.rs +++ b/xcm/xcm-builder/src/lib.rs @@ -80,7 +80,8 @@ pub use nonfungibles_adapter::{ mod weight; pub use weight::{ - FixedRateOfFungible, FixedWeightBounds, TakeRevenue, UsingComponents, WeightInfoBounds, + FixedRateOfFungible, FixedWeightBounds, ProvideWeighableInstructions, TakeRevenue, + UniversalWeigherAdapter, UsingComponents, WeightInfoBounds, }; mod matches_token; diff --git a/xcm/xcm-builder/src/routing.rs b/xcm/xcm-builder/src/routing.rs index 39e9eab410bf..7aa729427433 100644 --- a/xcm/xcm-builder/src/routing.rs +++ b/xcm/xcm-builder/src/routing.rs @@ -18,7 +18,7 @@ use frame_system::unique; use parity_scale_codec::Encode; -use sp_std::{marker::PhantomData, result::Result}; +use sp_std::{marker::PhantomData, result::Result, vec, vec::Vec}; use xcm::prelude::*; /// Wrapper router which, if the message does not already end with a `SetTopic` instruction, @@ -61,6 +61,19 @@ impl SendXcm for WithUniqueTopic { } } +/// Implementation of `ProvideWeighableInstructions` for `WithUniqueTopic` which adds additional +/// `SetTopic` instruction. +impl super::ProvideWeighableInstructions + for WithUniqueTopic +{ + fn provide_for( + _dest: impl Into, + message: &Xcm, + ) -> Vec> { + vec![SetTopic(unique(message))] + } +} + pub trait SourceTopic { fn source_topic(entropy: impl Encode) -> XcmHash; } diff --git a/xcm/xcm-builder/src/weight.rs b/xcm/xcm-builder/src/weight.rs index f1c14a4c6517..460329ba2bdf 100644 --- a/xcm/xcm-builder/src/weight.rs +++ b/xcm/xcm-builder/src/weight.rs @@ -24,10 +24,10 @@ use frame_support::{ }; use parity_scale_codec::Decode; use sp_runtime::traits::{SaturatedConversion, Saturating, Zero}; -use sp_std::{marker::PhantomData, result::Result}; +use sp_std::{marker::PhantomData, result::Result, vec, vec::Vec}; use xcm::latest::{prelude::*, Weight}; use xcm_executor::{ - traits::{WeightBounds, WeightTrader}, + traits::{UniversalWeigher, WeightBounds, WeightTrader}, Assets, }; @@ -114,6 +114,42 @@ where } } +/// Adapter for `UniversalWeigher` which can estimate weights for an XCM program, +/// that is executed on destination with possibility to add additional instructions on the way (e.g. +/// SetTopic, UniversalOrigin, ...). +pub struct UniversalWeigherAdapter( + PhantomData<(Weigher, AdditionalInstructions)>, +); +impl, AdditionalInstructions: ProvideWeighableInstructions<()>> + UniversalWeigher for UniversalWeigherAdapter +{ + fn weigh(dest: impl Into, mut message: Xcm<()>) -> Result { + message.0.extend(AdditionalInstructions::provide_for(dest, &message)); + Weigher::weight(&mut message) + } +} + +/// Function trait for generating instruction for (dest, message). +pub trait ProvideWeighableInstructions { + fn provide_for( + dest: impl Into, + message: &Xcm, + ) -> Vec>; +} + +#[impl_trait_for_tuples::impl_for_tuples(30)] +impl ProvideWeighableInstructions for Tuple { + fn provide_for( + dest: impl Into, + message: &Xcm, + ) -> Vec> { + let dest = dest.into(); + let mut res = vec![]; + for_tuples!( #( res.extend_from_slice(&Tuple::provide_for(dest, message)); )* ); + res + } +} + /// Function trait for handling some revenue. Similar to a negative imbalance (credit) handler, but /// for a `MultiAsset`. Sensible implementations will deposit the asset in some known treasury or /// block-author account. diff --git a/xcm/xcm-builder/tests/mock/mod.rs b/xcm/xcm-builder/tests/mock/mod.rs index f799be7e4013..0202e5d51a47 100644 --- a/xcm/xcm-builder/tests/mock/mod.rs +++ b/xcm/xcm-builder/tests/mock/mod.rs @@ -35,7 +35,7 @@ use xcm_builder::{ ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, FixedWeightBounds, IsChildSystemParachain, IsConcrete, MintLocation, RespectSuspension, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UniversalWeigherAdapter, }; pub type AccountId = AccountId32; @@ -224,6 +224,8 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; + type DestinationWeigher = + UniversalWeigherAdapter, ()>; type RuntimeCall = RuntimeCall; type RuntimeOrigin = RuntimeOrigin; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; diff --git a/xcm/xcm-executor/src/traits/mod.rs b/xcm/xcm-executor/src/traits/mod.rs index a9439968fa6c..ab51864bb955 100644 --- a/xcm/xcm-executor/src/traits/mod.rs +++ b/xcm/xcm-executor/src/traits/mod.rs @@ -44,7 +44,7 @@ pub use transact_asset::TransactAsset; mod weight; #[deprecated = "Use `sp_runtime::traits::` instead"] pub use sp_runtime::traits::{Identity, TryConvertInto as JustTry}; -pub use weight::{WeightBounds, WeightTrader}; +pub use weight::{UniversalWeigher, WeightBounds, WeightTrader}; pub mod prelude { pub use super::{ diff --git a/xcm/xcm-simulator/example/src/parachain.rs b/xcm/xcm-simulator/example/src/parachain.rs index 9c4cbe8fcb2d..5bf2690bdba8 100644 --- a/xcm/xcm-simulator/example/src/parachain.rs +++ b/xcm/xcm-simulator/example/src/parachain.rs @@ -43,7 +43,7 @@ use xcm_builder::{ CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, IsConcrete, NativeAsset, NoChecking, NonFungiblesAdapter, ParentIsPreset, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, + SovereignSignedViaLocation, UniversalWeigherAdapter, }; use xcm_executor::{ traits::{ConvertLocation, JustTry}, @@ -429,6 +429,8 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; + type DestinationWeigher = + UniversalWeigherAdapter, ()>; type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; diff --git a/xcm/xcm-simulator/example/src/relay_chain.rs b/xcm/xcm-simulator/example/src/relay_chain.rs index 6f0e92dc91b9..7b48d908f795 100644 --- a/xcm/xcm-simulator/example/src/relay_chain.rs +++ b/xcm/xcm-simulator/example/src/relay_chain.rs @@ -38,7 +38,7 @@ use xcm_builder::{ ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, FixedWeightBounds, IsConcrete, NoChecking, NonFungiblesAdapter, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, + SignedToAccountId32, SovereignSignedViaLocation, UniversalWeigherAdapter, }; use xcm_executor::{traits::JustTry, Config, XcmExecutor}; @@ -214,6 +214,8 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; + type DestinationWeigher = + UniversalWeigherAdapter, ()>; type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; diff --git a/xcm/xcm-simulator/fuzzer/src/parachain.rs b/xcm/xcm-simulator/fuzzer/src/parachain.rs index 3d0b1c82f691..724b8a6effa1 100644 --- a/xcm/xcm-simulator/fuzzer/src/parachain.rs +++ b/xcm/xcm-simulator/fuzzer/src/parachain.rs @@ -41,7 +41,7 @@ use xcm_builder::{ AccountId32Aliases, AllowUnpaidExecutionFrom, CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, IsConcrete, NativeAsset, ParentIsPreset, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, + SovereignSignedViaLocation, UniversalWeigherAdapter, }; use xcm_executor::{Config, XcmExecutor}; @@ -327,6 +327,8 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; + type DestinationWeigher = + UniversalWeigherAdapter, ()>; type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; diff --git a/xcm/xcm-simulator/fuzzer/src/relay_chain.rs b/xcm/xcm-simulator/fuzzer/src/relay_chain.rs index 32f3b8aa83fb..66869e73f537 100644 --- a/xcm/xcm-simulator/fuzzer/src/relay_chain.rs +++ b/xcm/xcm-simulator/fuzzer/src/relay_chain.rs @@ -38,6 +38,7 @@ use xcm_builder::{ ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, FixedWeightBounds, IsConcrete, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, + UniversalWeigherAdapter, }; use xcm_executor::{Config, XcmExecutor}; @@ -178,6 +179,8 @@ impl pallet_xcm::Config for Runtime { type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; + type DestinationWeigher = + UniversalWeigherAdapter, ()>; type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall;