Skip to content

Commit ef9329b

Browse files
Update wording on manual SetTopic (#1002)
* Update wording for custom SetTopic * Update wording for custom SetTopic * Update wording for custom SetTopic
1 parent 5551dd3 commit ef9329b

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

develop/interoperability/xcm-observability.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Matching these IDs allows you to correlate an origin message with its destinatio
4848

4949
- The runtime automatically appends a `SetTopic` instruction if one is missing at the end of an XCM.
5050
- When using high-level extrinsics such as `limited_reserve_transfer_assets`, you do not need to set a topic manually; the runtime handles it for you.
51-
- If you manually craft an XCM (e.g., via [`execute`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pallet/struct.Pallet.html#method.execute){target=\_blank} or [`send`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pallet/struct.Pallet.html#method.send){target=\_blank}), you can supply your own `SetTopic`, but it must be the final instruction to be respected.
51+
- When manually crafting an XCM via [`execute`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pallet/struct.Pallet.html#method.execute){target=\_blank} or [`send`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pallet/struct.Pallet.html#method.send){target=\_blank}), you can include a `SetTopic` as the final instruction; otherwise, `WithUniqueTopic` will append its own unique ID, overriding earlier `SetTopic` instructions.
5252
- In multi-hop XCM flows, manually setting the topic ensures consistent tracing across all hops. Any remote XCM calls embedded inside the XCM must also include a `SetTopic` at the end to preserve the same `message_id` throughout the cross-chain flow.
5353

5454
## Message Lifecycle
@@ -99,6 +99,8 @@ Tools and indexers tracing messages across mixed runtime versions should check b
9999
--8<-- 'code/develop/interoperability/xcm-observability/forward-id-for.ts'
100100
```
101101

102+
> Note: `@noble/hashes` and `polkadot-api` are required dependencies for this code to work.
103+
102104
## Failure Event Handling
103105

104106
When an XCM fails, the transaction rolls back and no explicit failure event is emitted on-chain. The following are some ways to check for XCM failure:

llms-full.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3163,7 +3163,7 @@ Doc-Content: https://docs.polkadot.com/develop/interoperability/xcm-observabilit
31633163
--- BEGIN CONTENT ---
31643164
---
31653165
title: XCM Observability
3166-
description: This conceptual overview of XCM observability in Polkadot covers message correlation, tracing, and debugging features in modern runtimes.
3166+
description: A conceptual overview of XCM observability in Polkadot covers message correlation, tracing, and debugging features in modern runtimes.
31673167
---
31683168

31693169
# XCM Observability
@@ -3211,7 +3211,7 @@ Matching these IDs allows you to correlate an origin message with its destinatio
32113211

32123212
- The runtime automatically appends a `SetTopic` instruction if one is missing at the end of an XCM.
32133213
- When using high-level extrinsics such as `limited_reserve_transfer_assets`, you do not need to set a topic manually; the runtime handles it for you.
3214-
- If you manually craft an XCM (e.g., via [`execute`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pallet/struct.Pallet.html#method.execute){target=\_blank} or [`send`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pallet/struct.Pallet.html#method.send){target=\_blank}), you can supply your own `SetTopic`, but it must be the final instruction to be respected.
3214+
- When manually crafting an XCM via [`execute`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pallet/struct.Pallet.html#method.execute){target=\_blank} or [`send`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pallet/struct.Pallet.html#method.send){target=\_blank}), you can include a `SetTopic` as the final instruction; otherwise, `WithUniqueTopic` will append its own unique ID, overriding earlier `SetTopic` instructions.
32153215
- In multi-hop XCM flows, manually setting the topic ensures consistent tracing across all hops. Any remote XCM calls embedded inside the XCM must also include a `SetTopic` at the end to preserve the same `message_id` throughout the cross-chain flow.
32163216

32173217
## Message Lifecycle
@@ -3293,6 +3293,8 @@ if (forwardedIdHex === expectedForwardedId) {
32933293
}
32943294
```
32953295

3296+
> Note: `@noble/hashes` and `polkadot-api` are required dependencies for this code to work.
3297+
32963298
## Failure Event Handling
32973299

32983300
When an XCM fails, the transaction rolls back and no explicit failure event is emitted on-chain. The following are some ways to check for XCM failure:
@@ -31110,7 +31112,7 @@ Before you begin, ensure you have the following:
3111031112
wget https://github.com/polkadot-fellows/runtimes/releases/download/v1.6.0/asset-hub-polkadot_runtime-v1006000.compact.compressed.wasm -O wasms/asset-hub-polkadot_v1.6.0.wasm
3111131113
```
3111231114

31113-
4. Download the config for Polkadot Hub:
31115+
4. Download the config file for Polkadot Hub:
3111431116

3111531117
```bash
3111631118
mkdir -p configs
@@ -31148,7 +31150,7 @@ Before you begin, ensure you have the following:
3114831150

3114931151
```bash
3115031152
npm install --save-dev typescript @types/node tsx
31151-
npm install polkadot-api @polkadot-labs/hdkd @polkadot-labs/hdkd-helpers
31153+
npm install polkadot-api @polkadot-labs/hdkd @polkadot-labs/hdkd-helpers
3115231154
npm install @noble/hashes
3115331155
```
3115431156

llms.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
- [Transact](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/interoperability/xcm-guides/from-apps/transact.md): Learn how to execute arbitrary calls on remote chains using the Transact instruction, enabling cross-chain function execution and remote pallet interactions.
2626
- [Transfers](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/interoperability/xcm-guides/from-apps/transfers.md): Learn how to perform cross-chain asset transfers using XCM, including teleport, reserve transfers, and handling different asset types across parachains.
2727
- [XCM Guides](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/interoperability/xcm-guides/index.md): Comprehensive guides for implementing XCM functionality in applications and understanding cross-chain interactions.
28-
- [XCM Observability](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/interoperability/xcm-observability.md): This conceptual overview of XCM observability in Polkadot covers message correlation, tracing, and debugging features in modern runtimes.
28+
- [XCM Observability](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/interoperability/xcm-observability.md): A conceptual overview of XCM observability in Polkadot covers message correlation, tracing, and debugging features in modern runtimes.
2929
- [XCM Runtime APIs](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/interoperability/xcm-runtime-apis.md): Learn about XCM Runtime APIs in Polkadot for cross-chain communication. Explore the APIs to simulate and test XCM messages before execution on the network.
3030
- [Networks](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/networks.md): Explore the Polkadot ecosystem networks and learn the unique purposes of each, tailored for blockchain innovation, testing, and enterprise-grade solutions.
3131
- [Add a Pallet to the Runtime](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/parachains/customize-parachain/add-existing-pallets.md): Learn how to include and configure pallets in a Polkadot SDK-based runtime, from adding dependencies to implementing necessary traits.

tutorials/interoperability/xcm-observability-in-action.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Before you begin, ensure you have the following:
8585

8686
```bash
8787
npm install --save-dev typescript @types/node tsx
88-
npm install polkadot-api @polkadot-labs/hdkd @polkadot-labs/hdkd-helpers
88+
npm install polkadot-api @polkadot-labs/hdkd @polkadot-labs/hdkd-helpers
8989
npm install @noble/hashes
9090
```
9191

0 commit comments

Comments
 (0)