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
+47-15Lines changed: 47 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -27877,10 +27877,7 @@ This scenario demonstrates how a `SetTopic` is included or generated, how to ide
27877
27877
27878
27878
### Launch a Fork for Local Testing
27879
27879
27880
-
To illustrate the tracing of XCM, fork the relevant chains locally using Chopsticks.
27881
-
27882
-
* No runtime override or logging configuration is needed
27883
-
* You may use a Chopsticks config file if desired
27880
+
To see XCM tracing in action, fork the relevant chains locally using Chopsticks.
27884
27881
27885
27882
→ See the [Fork a Chain with Chopsticks guide](/tutorials/polkadot-sdk/testing/fork-live-chains/){target=\_blank} for step-by-step instructions.
27886
27883
@@ -28101,7 +28098,7 @@ Run it locally:
28101
28098
npx tsx limited-reserve-transfer-assets.ts
28102
28099
```
28103
28100
28104
-
#### Local XCM (origin chain: Polkadot Asset Hub)
28101
+
#### Local XCM (Origin Chain: Polkadot Asset Hub)
28105
28102
28106
28103
The submitted extrinsic constructs an XCM like the following:
28107
28104
@@ -28117,7 +28114,7 @@ The submitted extrinsic constructs an XCM like the following:
28117
28114
</pre>
28118
28115
</div>
28119
28116
28120
-
#### Forwarded XCM (destination chain: Acala)
28117
+
#### Forwarded XCM (Destination Chain: Acala)
28121
28118
28122
28119
During execution, the runtime adds a `SetTopic` instruction automatically. This topic is carried through to the destination chain and becomes the basis for event correlation:
28123
28120
@@ -28178,21 +28175,56 @@ The runtime automatically inserts a `SetTopic` instruction (if not manually prov
28178
28175
28179
28176
### Failure Event Handling
28180
28177
28181
-
If your XCM fails, you can debug using one of the following:
28178
+
When an XCM fails, the entire execution is **rolled back**, so no failure events are emitted on-chain. However, you can still observe and debug the failure using two main approaches:
28179
+
28180
+
#### View Nested Errors from Indexers
28181
+
28182
+
Most indexers (and API responses) will show **nested dispatch errors** such as:
28183
+
28184
+
<div class="termynal" data-termynal>
28185
+
<pre data-ty>
28186
+
"error": {
28187
+
"type": "Module",
28188
+
"value": {
28189
+
"type": "PolkadotXcm",
28190
+
"value": {
28191
+
"type": "LocalExecutionIncompleteWithError",
28192
+
"value": {
28193
+
"index": 0,
28194
+
"error": {
28195
+
"type": "FailedToTransactAsset"
28196
+
}
28197
+
}
28198
+
}
28199
+
}
28200
+
}
28201
+
</pre>
28202
+
</div>
28203
+
28204
+
This output is available on runtimes from **`stable2506` or later**, and is often sufficient for identifying common issues like missing assets or execution limits.
28205
+
28206
+
#### Use Chopsticks for Full Error Logs
28207
+
28208
+
For deeper analysis:
28182
28209
28183
-
### View Nested Errors
28210
+
* Use Chopsticks to **replay the message with logging enabled**
28211
+
* See exactly **which instruction failed**, and why
28212
+
* View full error chains like `FailedToTransactAsset`, or `AssetNotFound`
28184
28213
28185
-
Most indexers show the outermost error (e.g., `LocalExecutionIncompleteWithError`), which is often enough to understand basic failures.
28214
+
This is especially useful when dealing with:
28186
28215
28187
-
### Use Chopsticks for Full Logs
28216
+
* Multi-hop XCMs
28217
+
* Custom asset locations
28218
+
* Execution mismatches or weight issues
28188
28219
28189
-
With logging enabled, Chopsticks will show:
28220
+
→ For replay setup, see [Replay and Dry Run XCMs Using Chopsticks](/tutorials/interoperability/replay-and-dry-run-xcms/){target=\_blank}.
28190
28221
28191
-
* Which instruction failed
28192
-
* Full error chain (e.g., `FailedToTransactAsset`, `AssetNotFound`)
28193
-
* Precise reason for rollback or halt
28222
+
#### Recommended Debugging Workflow
28194
28223
28195
-
→ Useful for understanding weight failures, malformed assets, or execution mismatches.
28224
+
1. **Start with indexer or API output** to inspect dispatch errors.
28225
+
2. If unclear, **replay using Chopsticks** to trace message steps.
28226
+
3. **Inspect logs** to pinpoint the failing instruction and error.
28227
+
4. Adjust asset location, weight, or execution logic accordingly.
During execution, the runtime adds a `SetTopic` instruction automatically. This topic is carried through to the destination chain and becomes the basis for event correlation:
109
106
@@ -132,21 +129,38 @@ The runtime automatically inserts a `SetTopic` instruction (if not manually prov
132
129
133
130
### Failure Event Handling
134
131
135
-
If your XCM fails, you can debug using one of the following:
132
+
When an XCM fails, the entire execution is **rolled back**, so no failure events are emitted on-chain. However, you can still observe and debug the failure using two main approaches:
133
+
134
+
#### View Nested Errors from Indexers
135
+
136
+
Most indexers (and API responses) will show **nested dispatch errors** such as:
This output is available on runtimes from **`stable2506` or later**, and is often sufficient for identifying common issues like missing assets or execution limits.
141
+
142
+
#### Use Chopsticks for Full Error Logs
143
+
144
+
For deeper analysis:
136
145
137
-
### View Nested Errors
146
+
* Use Chopsticks to **replay the message with logging enabled**
147
+
* See exactly **which instruction failed**, and why
148
+
* View full error chains like `FailedToTransactAsset`, or `AssetNotFound`
138
149
139
-
Most indexers show the outermost error (e.g., `LocalExecutionIncompleteWithError`), which is often enough to understand basic failures.
150
+
This is especially useful when dealing with:
140
151
141
-
### Use Chopsticks for Full Logs
152
+
* Multi-hop XCMs
153
+
* Custom asset locations
154
+
* Execution mismatches or weight issues
142
155
143
-
With logging enabled, Chopsticks will show:
156
+
→ For replay setup, see [Replay and Dry Run XCMs Using Chopsticks](/tutorials/interoperability/replay-and-dry-run-xcms/){target=\_blank}.
144
157
145
-
* Which instruction failed
146
-
* Full error chain (e.g., `FailedToTransactAsset`, `AssetNotFound`)
147
-
* Precise reason for rollback or halt
158
+
#### Recommended Debugging Workflow
148
159
149
-
→ Useful for understanding weight failures, malformed assets, or execution mismatches.
160
+
1.**Start with indexer or API output** to inspect dispatch errors.
161
+
2. If unclear, **replay using Chopsticks** to trace message steps.
162
+
3.**Inspect logs** to pinpoint the failing instruction and error.
163
+
4. Adjust asset location, weight, or execution logic accordingly.
0 commit comments