You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: llms.txt
+50-2Lines changed: 50 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -27873,7 +27873,7 @@ These features are available in runtimes built from **`stable2503-5` or later**.
27873
27873
27874
27874
- On newer runtimes, the same topic is preserved throughout a multi-hop transfer. This ensures consistent correlation of the `message_id` between origin and destination, even across multiple chains.
27875
27875
27876
-
## Define a Scenario: DOT to Hydration Transfer
27876
+
## Define a Scenario: XCM Flow with Implicit `SetTopic`
27877
27877
27878
27878
We will examine the full lifecycle of a cross-chain message from Polkadot Asset Hub to Hydration, using the `limited_reserve_transfer_assets` extrinsic.
27879
27879
@@ -28146,7 +28146,9 @@ During execution, the runtime adds a `SetTopic` instruction automatically. This
28146
28146
</pre>
28147
28147
</div>
28148
28148
28149
-
This forwarded message is then processed on Hydration, where the `message_id` is emitted in the `MessageQueue.Processed` event.
28149
+
This forwarded message is then processed on Hydration, where the `id` is emitted in the `MessageQueue.Processed` event.
28150
+
28151
+
> Note: The value of `SetTopic` generated during a dry-run may differ from the one in the actual execution.
28150
28152
28151
28153
### Track the Message Across Chains
28152
28154
@@ -28175,6 +28177,52 @@ These two fields now match on new runtimes (`stable2503-5` or later).
28175
28177
<span data-ty>✅ Processed Message ID matched.</span>
28176
28178
</div>
28177
28179
28180
+
## Define a Scenario: Multi-Hop XCM with Manual `SetTopic`
28181
+
28182
+
In complex XCM flows, such as multi-hop transfers that span multiple parachains, you may want to use `SetTopic` to **consistently trace the message across all involved chains**.
28183
+
28184
+
* **Origin chain**: Polkadot Asset Hub
28185
+
* **Destination chain**: Hydration
28186
+
* **Topic assignment**: Manually set via `SetTopic` instruction
28187
+
* **Goal**: Transfer DOT and trace the XCM using the manually assigned `message_id`
28188
+
28189
+
Setting a `SetTopic` is optional. If you don't explicitly define one, the runtime will automatically generate a topic ID based on the message content (see [XCM Flow with Implicit `SetTopic`](#define-a-scenario-xcm-flow-with-implicit-settopic)). If you require custom end-to-end traceability, you may use `SetTopic` to assign `message_id`.
28190
+
28191
+
This pattern is demonstrated in [`multi-hop-with-set-topic.ts`](../src/multi-hop-with-set-topic.ts), where DOT is sent from Asset Hub, swapped on Hydration, and returned—**all using the same manually assigned `message_id`** for complete traceability.
📦 Finalised on Polkadot Asset Hub in block #9294993: 0xa4e15ad6eae7fcd837f7a7c02a1925165bd97597fbe1ceb74adc17d3cbcf34bd
28219
+
📣 Last message Sent on Polkadot Asset Hub: 0x836c6039763718fd3db4e22484fc4bacd7ddf1c74b6067d15b297ea72d8ecf89
28220
+
✅ Sent message ID matched.
28221
+
📦 Finalised on Hydration in block #8377216: 0x6bb6e7d69c2d574f8646f3c739d872ab832850a44659ea9401249dbe11a4c447
28222
+
📣 Last message Processed on Hydration: 0x836c6039763718fd3db4e22484fc4bacd7ddf1c74b6067d15b297ea72d8ecf89
28223
+
✅ Processed Message ID matched.
28224
+
```
28225
+
28178
28226
## Workaround for Older Runtimes
28179
28227
28180
28228
* On **older runtimes** (prior to `stable2503-5`), the `message_id` seen in downstream `Processed` events is **not the original topic hash**, but rather a **derived `forwarded_id`**.
Copy file name to clipboardExpand all lines: tutorials/interoperability/xcm-observability.md
+50-2Lines changed: 50 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ These features are available in runtimes built from **`stable2503-5` or later**.
53
53
54
54
- On newer runtimes, the same topic is preserved throughout a multi-hop transfer. This ensures consistent correlation of the `message_id` between origin and destination, even across multiple chains.
55
55
56
-
## Define a Scenario: DOT to Hydration Transfer
56
+
## Define a Scenario: XCM Flow with Implicit `SetTopic`
57
57
58
58
We will examine the full lifecycle of a cross-chain message from Polkadot Asset Hub to Hydration, using the `limited_reserve_transfer_assets` extrinsic.
59
59
@@ -115,7 +115,9 @@ During execution, the runtime adds a `SetTopic` instruction automatically. This
## Define a Scenario: Multi-Hop XCM with Manual `SetTopic`
142
+
143
+
In complex XCM flows, such as multi-hop transfers that span multiple parachains, you may want to use `SetTopic` to **consistently trace the message across all involved chains**.
144
+
145
+
***Origin chain**: Polkadot Asset Hub
146
+
***Destination chain**: Hydration
147
+
***Topic assignment**: Manually set via `SetTopic` instruction
148
+
***Goal**: Transfer DOT and trace the XCM using the manually assigned `message_id`
149
+
150
+
Setting a `SetTopic` is optional. If you don't explicitly define one, the runtime will automatically generate a topic ID based on the message content (see [XCM Flow with Implicit `SetTopic`](#define-a-scenario-xcm-flow-with-implicit-settopic)). If you require custom end-to-end traceability, you may use `SetTopic` to assign `message_id`.
151
+
152
+
This pattern is demonstrated in [`multi-hop-with-set-topic.ts`](../src/multi-hop-with-set-topic.ts), where DOT is sent from Asset Hub, swapped on Hydration, and returned—**all using the same manually assigned `message_id`** for complete traceability.
📦 Finalised on Polkadot Asset Hub in block #9294993: 0xa4e15ad6eae7fcd837f7a7c02a1925165bd97597fbe1ceb74adc17d3cbcf34bd
180
+
📣 Last message Sent on Polkadot Asset Hub: 0x836c6039763718fd3db4e22484fc4bacd7ddf1c74b6067d15b297ea72d8ecf89
181
+
✅ Sent message ID matched.
182
+
📦 Finalised on Hydration in block #8377216: 0x6bb6e7d69c2d574f8646f3c739d872ab832850a44659ea9401249dbe11a4c447
183
+
📣 Last message Processed on Hydration: 0x836c6039763718fd3db4e22484fc4bacd7ddf1c74b6067d15b297ea72d8ecf89
184
+
✅ Processed Message ID matched.
185
+
```
186
+
139
187
## Workaround for Older Runtimes
140
188
141
189
* On **older runtimes** (prior to `stable2503-5`), the `message_id` seen in downstream `Processed` events is **not the original topic hash**, but rather a **derived `forwarded_id`**.
0 commit comments