Runtime Descriptions
XCM Executor
Branch/Release: release-polkadot-v1.10.0
Purpose
XcmExecutor is responsible for executing XCM messages locally.
XcmExecutor is usually the assignment for pallet_xcm::Config::XcmExecutor and is thereby used to execute XCM in that pallet.
Note
XcmExecutoris not a pallet, but rather it is astructtype parameterized by aConfigtrait. The inner config is thetrait Configwhich parameterizes the outer configstruct XcmExecutor<Config>. Both the inner and outer configs are configured in the runtime.
Inner Config
The inner trait Config used to parameterize XcmExecutor has the following associated types.
- Handlers:
XcmSender-- How to send an onward XCM message. Type must implement the traitSendXcm.AssetTransactor-- How to withdraw and deposit an asset. Type must implement the traitTransactAsset.Trader-- The means of purchasing weight credit for XCM execution. Type must implement the traitWeightTrader.ResponseHandler-- What to do when a response of a query is found. Type must implement the traitOnResponse.AssetTrap-- The general asset trap handler for when assets are left in the Holding Register at the end of execution. Type must implement the traitDropAssets.AssetLocker-- Handler for asset locking. Type must implement the traitAssetLock.AssetExchanger-- Handler for exchanging assets. Type must implement the traitAssetExchange.AssetClaims-- The handler for when there is an instruction to claim assets. Type must implement the traitClaimAssets.SubscriptionService-- The handler for version subscription requests. Type must implement the traitVersionChangeNotifier.FeeManager-- Configure the fees. Type must implement the traitFeeManager.MessageExporter-- The method of exporting a message. Type must implement the traitExportXcm.CallDispatcher-- The call dispatcher used by XCM. Type must implement the traitCallDispatcher<Self::RuntimeCall>.HrmpNewChannelOpenRequestHandler-- Allows optional logic execution for theHrmpNewChannelOpenRequestXCM notification.HrmpChannelAcceptedHandler-- Allows optional logic execution for theHrmpChannelAcceptedXCM notification.HrmpChannelClosingHandler-- Allows optional logic execution for theHrmpChannelClosingXCM notification.
- Filters:
IsReserve-- Combinations of (Asset, Location) pairs which we trust as reserves. Type must implement the traitContainsPair<MultiAsset, MultiLocation>.IsTeleporter-- Combinations of (Asset, Location) pairs which we trust as teleporters. Type must implement the traitContainsPair<MultiAsset, MultiLocation>.Aliasers-- A list of (Origin, Target) pairs allowing a given Origin to be substituted with its corresponding Target pair. Type must implement the traitContainsPair<MultiLocation, MultiLocation>.Barrier-- Whether or not to execute the XCM at all. Type must implementShouldExecute.UniversalAliases-- The origin locations and specific universal junctions to which they are allowed to elevate themselves. Type must implement the traitContains<(MultiLocation, Junction)>.SafeCallFilter-- The safe call filter forTransact. Use this type to explicitly whitelist calls that cannot undergo recursion. Type must implement the traitContains<Self::RuntimeCall>.
- Converters:
OriginConverter-- How to get a call origin from aOriginKindvalue. Type must implement the traitConvertOrigin<<Self::RuntimeCall as Dispatchable>::RuntimeOrigin>.
- Accessors:
Weigher-- The means of determining an XCM message's weight. Type must implement the traitWeightBounds<Self::RuntimeCall>.PalletInstancesInfo-- Information on all pallets. Type must implement the traitPalletsInfoAccess.
- Constants:
UniversalLocation-- This chain's Universal Location. Type must implement the traitGet<InteriorMultiLocation>.MaxAssetsIntoHolding-- The maximum number of assets we target to have in the Holding Register at any one time. Type must implement the traitGet<u32>.
- Common configs:
RuntimeCall
Outer Config
The outer struct XcmExecutor<Config> configures the following fields:
holding-- Assets allowed in the holding register. Type must beAssets.holding_limit-- The maximum number of assets in the holding register. Type must beusize.context-- Type must beXcmContext.trader-- Type must beConfig::Traderwhich must implement the traitWeightTrader.error-- The most recent error result and instruction index into the fragment in which it occurred, if any. Type must beOption<(u32, XcmError)>.total_surplus-- Type must beWeight.total_refunded-- Type must beWeight.error_handler-- Type must beXcm<Config::RuntimeCall>.error_handler_weight-- Type must beWeight.appendix-- Type must beXcm<Config::RuntimeCall>.appendix_weight-- Type must beWeight.transact_status-- Type must beMaybeErrorCode.fees_mode-- Type must beFeesMode.