Skip to content

Commit 1f3c2ba

Browse files
committed
edits
1 parent 48e2974 commit 1f3c2ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+693
-409
lines changed

develop/interoperability/intro-to-xcm.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,30 @@ The following is a simplified XCM message demonstrating a token transfer from Al
5555
The message consists of three instructions described as follows:
5656
5757
- **[WithdrawAsset](https://github.com/polkadot-fellows/xcm-format?tab=readme-ov-file#withdrawasset){target=\_blank}**: Transfers a specified number of tokens from Alice's account to a holding register.
58-
```rust
59-
--8<-- 'code/develop/interoperability/intro-to-xcm/XCM-first-look.rs:2:2'
60-
```
58+
59+
```rust
60+
--8<-- 'code/develop/interoperability/intro-to-xcm/XCM-first-look.rs:2:2'
61+
```
62+
6163
- **`Here`**: The native parachain token.
6264
- **`amount`**: The number of tokens that are transferred.
6365
6466
The first instruction takes as an input the MultiAsset that should be withdrawn. The MultiAsset describes the native parachain token with the `Here` keyword. The `amount` parameter is the number of tokens that are transferred. The withdrawal account depends on the origin of the message. In this example the origin of the message is Alice. The `WithdrawAsset` instruction moves `amount` number of native tokens from Alice's account into the holding register.
6567

6668
- **[BuyExecution](https://github.com/polkadot-fellows/xcm-format?tab=readme-ov-file#buyexecution){target=\_blank}**: Allocates fees to cover the execution [weight](/polkadot-protocol/glossary/#weight){target=\_blank} of the XCM instructions.
67-
```rust
68-
--8<-- 'code/develop/interoperability/intro-to-xcm/XCM-first-look.rs:3:6'
69-
```
69+
70+
```rust
71+
--8<-- 'code/develop/interoperability/intro-to-xcm/XCM-first-look.rs:3:6'
72+
```
7073
7174
- **`fees`**: Describes the asset in the holding register that should be used to pay for the weight.
7275
- **`weight_limit`**: Defines the maximum fees that can be used to buy weight.
7376
7477
- **[DepositAsset](https://github.com/polkadot-fellows/xcm-format?tab=readme-ov-file#depositasset){target=\_blank}**: Moves the remaining tokens from the holding register to Bob’s account.
75-
```rust
76-
--8<-- 'code/develop/interoperability/intro-to-xcm/XCM-first-look.rs:7:16'
77-
```
78+
79+
```rust
80+
--8<-- 'code/develop/interoperability/intro-to-xcm/XCM-first-look.rs:7:16'
81+
```
7882
7983
- **`All`**: The wildcard for the asset(s) to be deposited. In this case, all assets in the holding register should be deposited.
8084

develop/interoperability/send-messages.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,18 @@ For further details about the XCM configuration, see the [XCM Configuration](/de
2020
Where the [XCM format](https://github.com/polkadot-fellows/xcm-format){target=\_blank} defines a set of instructions used to construct XCVM programs, `pallet-xcm` defines a set of extrinsics that can be utilized to build XCVM programs, either to target the local or external chains. The `pallet-xcm` functionality is divided into three categories:
2121

2222
- **Primitive**: Dispatchable functions to execute XCM locally.
23-
2423
- **High-level**: Functions for asset transfers between chains.
25-
2624
- **Version negotiation-specific**: Functions for managing XCM version compability.
2725

2826
### Key Roles of the XCM Pallet
2927

3028
The XCM pallet plays a central role in managing cross-chain messages, with its primary responsibilities including:
3129

3230
- **Execute XCM messages**: Interacts with the XCM executor to validate and execute messages, adhering to predefined security and filter criteria.
33-
3431
- **Send messages across chains**: Allows authorized origins to send XCM messages, enabling controlled cross-chain communication.
35-
3632
- **Reserve-based transfers and teleports**: Supports asset movement between chains, governed by filters that restrict operations to authorized origins.
37-
3833
- **XCM version negotiation**: Ensures compatibility by selecting the appropriate XCM version for inter-chain communication.
39-
4034
- **Asset trapping and recovery**: Manages trapped assets, enabling safe reallocation or recovery when issues occur during cross-chain transfers.
41-
4235
- **Support for XCVM operations**: Oversees state and configuration requirements necessary for executing cross-consensus programs within the XCVM framework.
4336

4437
## Primary Extrinsics of the XCM Pallet

develop/interoperability/xcm-channels.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ To view the current values of these parameters in the Polkadot network:
3636
![](/images/develop/interoperability/xcm-channels/xcm-channels-1.webp)
3737

3838
2. Query the chain configuration parameters. The result will display the current settings for all the Polkadot network parameters, including the HRMP channel settings.
39+
3940
1. Select **`configuration`**.
4041
2. Choose the **`activeConfig()`** call.
4142
3. Click the **+** button to execute the query.

develop/interoperability/xcm-config.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Each type is explained below, along with an overview of some of its implementati
2828
Each configuration item is explained below, detailing the associated type’s purpose and role in the XCM executor. Many of these types have predefined solutions available in the `xcm-builder`. Therefore, the available configuration items are:
2929
3030
- **[`RuntimeCall`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.RuntimeCall){target=\_blank}**: Defines the runtime's callable functions, created via the [`frame::runtime`](https://paritytech.github.io/polkadot-sdk/master/frame_support/attr.runtime.html){target=\_blank} macro. It represents an enum listing the callable functions of all implemented pallets.
31+
3132
```rust
3233
type RuntimeCall: Parameter + Dispatchable<PostInfo = PostDispatchInfo> + GetDispatchInfo
3334
```
@@ -38,35 +39,43 @@ Each configuration item is explained below, detailing the associated type’s pu
3839
- **`GetDispatchInfo`**: Provides weight details, determining how long execution takes.
3940

4041
- **[`XcmSender`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.XcmSender){target=\_blank}**: Implements the [`SendXcm`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm/v4/trait.SendXcm.html){target=\_blank} trait, specifying how the executor sends XCMs using transport layers (e.g., UMP for relay chains or XCMP for sibling chains). If a runtime lacks certain transport layers, such as [HRMP](https://wiki.polkadot.network/learn/learn-xcm-transport/#hrmp-xcmp-lite){target=\_blank} (or [XCMP](https://wiki.polkadot.network/learn/learn-xcm-transport/#xcmp-cross-consensus-message-passing-design-summary){target=\_blank}).
42+
4143
```rust
4244
type XcmSender: SendXcm;
4345
```
46+
4447
- **[`AssetTransactor`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.AssetTransactor){target=\_blank}**: Implements the [`TransactAsset`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/traits/trait.TransactAsset.html){target=\_blank} trait, handling the conversion and transfer of MultiAssets between accounts or registers. It can be configured to support native tokens, fungibles, and non-fungibles or multiple tokens using pre-defined adapters like [`FungibleAdapter`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_builder/struct.FungibleAdapter.html){target=\_blank} or custom solutions.
48+
4549
```rust
4650
type AssetTransactor: TransactAsset;
4751
```
4852

4953
- **[`OriginConverter`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.OriginConverter){target=\_blank}**: Implements the [`ConvertOrigin`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/traits/trait.ConvertOrigin.html){target=\_blank} trait to map `MultiLocation` origins to `RuntimeOrigin`. Multiple implementations can be combined, and [`OriginKind`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_builder/test_utils/enum.OriginKind.html){target=\_blank} is used to resolve conflicts. Pre-defined converters like [`SovereignSignedViaLocation`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_builder/struct.SovereignSignedViaLocation.html){target=\_blank} and [`SignedAccountId32AsNative`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_builder/struct.SignedAccountId32AsNative.html){target=\_blank} handle sovereign and local accounts respectively.
54+
5055
```rust
5156
type OriginConverter: ConvertOrigin<<Self::RuntimeCall as Dispatchable>::RuntimeOrigin>;
5257
```
5358

5459
- **[`IsReserve`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.IsReserve){target=\_blank}**: Specifies trusted `<MultiAsset, MultiLocation>` pairs for depositing reserve assets. Using the unit type `()` blocks reserve deposits. The [`NativeAsset`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_builder/struct.NativeAsset.html){target=\_blank} struct is an example of a reserve implementation.
60+
5561
```rust
5662
type IsReserve: ContainsPair<MultiAsset, MultiLocation>;
5763
```
5864

5965
- **[`IsTeleporter`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.IsTeleporter){target=\_blank}**: Defines trusted `<MultiAsset, MultiLocation>` pairs for teleporting assets to the chain. Using `()` blocks the [`ReceiveTeleportedAssets`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_builder/test_utils/enum.Instruction.html#variant.ReceiveTeleportedAsset){target=\_blank} instruction. The [`NativeAsset`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_builder/struct.NativeAsset.html){target=\_blank} struct can act as an implementation.
66+
6067
```rust
6168
type IsTeleporter: ContainsPair<MultiAsset, MultiLocation>;
6269
```
6370

6471
- **[`Aliasers`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.Aliasers){target=\_blank}**: A list of `(Origin, Target)` pairs enabling each `Origin` to be replaced with its corresponding `Target`.
72+
6573
```rust
6674
type Aliasers: ContainsPair<Location, Location>;
6775
```
6876

6977
- **[`UniversalLocation`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.UniversalLocation){target=\_blank}**: Specifies the runtime's location in the consensus universe.
78+
7079
```rust
7180
type UniversalLocation: Get<InteriorMultiLocation>;
7281
```
@@ -77,104 +86,128 @@ Each configuration item is explained below, detailing the associated type’s pu
7786
- **`X2(GlobalConsensus(NetworkId**: :Polkadot), Parachain(1000))` for Statemint
7887

7988
- **[`Barrier`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.Barrier){target=\_blank}**: Implements the [`ShouldExecute`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/traits/trait.ShouldExecute.html){target=\_blank} trait, functioning as a firewall for XCM execution. Multiple barriers can be combined in a tuple, where execution halts if one succeeds.
89+
8090
```rust
8191
type Barrier: ShouldExecute;
8292
```
8393

8494
- **[`Weigher`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.Weigher){target=\_blank}**: Calculates the weight of XCMs and instructions, enforcing limits and refunding unused weight. Common solutions include [`FixedWeightBounds`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_builder/struct.FixedWeightBounds.html){target=\_blank}, which uses a base weight and limits on instructions.
95+
8596
```rust
8697
type Weigher: WeightBounds<Self::RuntimeCall>;
8798
```
8899

89100
- **[`Trader`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.Trader){target=\_blank}**: Manages asset-based weight purchases and refunds for `BuyExecution` instructions. The [`UsingComponents`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_builder/struct.UsingComponents.html){target=\_blank} trader is a common implementation.
101+
90102
```rust
91103
type Trader: WeightTrader;
92104
```
93105

94106
- **[`ResponseHandler`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.ResponseHandler){target=\_blank}**: Handles `QueryResponse` instructions, implementing the [`OnResponse`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/traits/trait.OnResponse.html){target=\_blank} trait. FRAME systems typically use the pallet-xcm implementation.
107+
95108
```rust
96109
type ResponseHandler: OnResponse;
97110
```
98111

99112
- **[`AssetTrap`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.AssetTrap){target=\_blank}**: Handles leftover assets in the holding register after XCM execution, allowing them to be claimed via `ClaimAsset`. If unsupported, assets are burned.
113+
100114
```rust
101115
type AssetTrap: DropAssets;
102116
```
103117

104118
- **[`AssetClaims`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.AssetClaims){target=\_blank}**: Facilitates the claiming of trapped assets during the execution of the `ClaimAsset` instruction. Commonly implemented via pallet-xcm.
119+
105120
```rust
106121
type AssetClaims: ClaimAssets;
107122
```
108123

109124
- **[`AssetLocker`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.AssetLocker){target=\_blank}**: Handles the locking and unlocking of assets. Can be omitted using `()` if asset locking is unnecessary.
125+
110126
```rust
111127
type AssetLocker: AssetLock;
112128
```
113129

114130
- **[`AssetExchanger`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.AssetExchanger){target=\_blank}**: Implements the [`AssetExchange`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/traits/trait.AssetExchange.html){target=\_blank} trait to manage asset exchanges during the `ExchangeAsset` instruction. The unit type `()` disables this functionality.
131+
115132
```rust
116133
type AssetExchanger: AssetExchange;
117134
```
118135

119136
- **[`SubscriptionService`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.SubscriptionService){target=\_blank}**: Manages `(Un)SubscribeVersion` instructions and returns the XCM version via `QueryResponse`. Typically implemented by pallet-xcm.
137+
120138
```rust
121139
type SubscriptionService: VersionChangeNotifier;
122140
```
123141

124142
- **[`PalletInstancesInfo`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.PalletInstancesInfo){target=\_blank}**: Provides runtime pallet information for `QueryPallet` and `ExpectPallet` instructions. FRAME-specific systems often use this, or it can be disabled with `()`.
143+
125144
```rust
126145
type PalletInstancesInfo: PalletsInfoAccess;
127146
```
147+
128148
<!-- I think `Holding Register` should be linked to https://wiki.polkadot.network/docs/learn/xcm/reference-glossary#holding-register, but since we will have our own glossary, I’m putting this as a TODO -->
129149
- **[`MaxAssetsIntoHolding`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.MaxAssetsIntoHolding){target=\_blank}**: Limits the number of assets in the [Holding register](https://wiki.polkadot.network/learn/learn-xcm/#holding-register){target=\_blank}. At most, twice this limit can be held under worst-case conditions.
150+
130151
```rust
131152
type MaxAssetsIntoHolding: Get<u32>;
132153
```
133154

134155
- **[`FeeManager`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.FeeManager){target=\_blank}**: Manages fees for XCM instructions, determining whether fees should be paid, waived, or handled in specific ways. Fees can be waived entirely using `()`.
156+
135157
```rust
136158
type FeeManager: FeeManager;
137159
```
138160

139161
- **[`MessageExporter`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.MessageExporter){target=\_blank}**: Implements the [`ExportXcm`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/traits/trait.ExportXcm.html){target=\_blank} trait, enabling XCMs export to other consensus systems. It can spoof origins for use in bridges. Use `()` to disable exporting.
162+
140163
```rust
141164
type MessageExporter: ExportXcm;
142165
```
143166

144167
- **[`UniversalAliases`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.UniversalAliases){target=\_blank}**: Lists origin locations and universal junctions allowed to elevate themselves in the `UniversalOrigin` instruction. Using `Nothing` prevents origin aliasing.
168+
145169
```rust
146170
type UniversalAliases: Contains<(MultiLocation, Junction)>;
147171
```
148172

149173
- **[`CallDispatcher`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.CallDispatcher){target=\_blank}**: Dispatches calls from the `Transact` instruction, adapting the origin or modifying the call as needed. Can default to `RuntimeCall`.
174+
150175
```rust
151176
type CallDispatcher: CallDispatcher<Self::RuntimeCall>;
152177
```
153178

154179
- **[`SafeCallFilter`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.SafeCallFilter){target=\_blank}**: Whitelists calls permitted in the `Transact` instruction. Using `Everything` allows all calls, though this is temporary until proof size weights are accounted for.
180+
155181
```rust
156182
type SafeCallFilter: Contains<Self::RuntimeCall>;
157183
```
158184

159185
- **[`TransactionalProcessor`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.TransactionalProcessor){target=\_blank}**: Implements the [`ProccessTransaction`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/traits/trait.ProcessTransaction.html){target=\_blank} trait. It ensures that XCM instructions are executed atomically, meaning they either fully succeed or fully fail without any partial effects. This type allows for non-transactional XCM instruction processing by setting the `()` type.
186+
160187
```rust
161188
type TransactionalProcessor: ProcessTransaction;
162189
```
163190

164191
- **[`HrmpNewChannelOpenRequestHandler`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.HrmpNewChannelOpenRequestHandler){target=\_blank}**: Enables optional logic execution in response to the `HrmpNewChannelOpenRequest` XCM notification.
192+
165193
```rust
166194
type HrmpNewChannelOpenRequestHandler: HandleHrmpNewChannelOpenRequest;
167195
```
168196

169197
- **[`HrmpChannelAcceptedHandler`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.HrmpChannelAcceptedHandler){target=\_blank}**: Enables optional logic execution in response to the `HrmpChannelAccepted` XCM notification.
198+
170199
```rust
171200
type HrmpChannelAcceptedHandler: HandleHrmpChannelAccepted;
172201
```
202+
173203
- **[`HrmpChannelClosingHandler`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.HrmpChannelClosingHandler){target=\_blank}**: Enables optional logic execution in response to the `HrmpChannelClosing` XCM notification.
204+
174205
```rust
175206
type HrmpChannelClosingHandler: HandleHrmpChannelClosing;
176207
```
208+
177209
- **[`XcmRecorder`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/trait.Config.html#associatedtype.XcmRecorder){target=\_blank}**: Allows tracking of the most recently executed XCM, primarily for use with dry-run runtime APIs.
210+
178211
```rust
179212
type XcmRecorder: RecordXcm;
180213
```

develop/interoperability/xcm-runtime-apis.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ This API allows a dry-run of any extrinsic and obtaining the outcome if it fails
9090
- **`Unimplemented`**: An API part is unsupported.
9191
- **`VersionedConversionFailed`**: Converting a versioned data structure from one version to another failed.
9292

93-
---
94-
9593
??? interface "Example"
9694

9795
This example demonstrates how to simulate a cross-chain asset transfer from the Paseo network to the Pop Network using a [reserve transfer](https://wiki.polkadot.network/docs/learn/xcm/journey/transfers-reserve){target=\_blank} mechanism. Instead of executing the actual transfer, the code shows how to test and verify the transaction's behavior through a dry run before performing it on the live network.

0 commit comments

Comments
 (0)