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: tutorials/interoperability/replay-and-dry-run-xcms.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Replay and Dry Run XCMs
3
-
description: Learn how to replay and dry-run XCMs using Chopsticks with full logging enabled. Diagnose issues, trace message flow, and debug complex cross-chain interactions.
3
+
description: Replay and dry-run XCMs using Chopsticks with full logging enabled. Diagnose issues, trace message flow, and debug complex cross-chain interactions.
4
4
---
5
5
6
6
# Replay and Dry Run XCMs Using Chopsticks
@@ -27,7 +27,7 @@ Before you begin, make sure you have:
27
27
28
28
If you haven't forked a chain before, see the [Fork a Chain with Chopsticks guide](/tutorials/polkadot-sdk/testing/fork-live-chains/){target=\_blank} or [Fork a Network Locally using Chopsticks](https://wiki.polkadot.network/learn/learn-guides-test-opengov-proposals/#fork-a-network-locally-using-chopsticks){target=\_blank} for step-by-step instructions.
29
29
30
-
## Step 1: Set Up Your Project
30
+
## Set Up Your Project
31
31
32
32
Let's start by creating a dedicated workspace for your XCM replay and dry-run experiments.
33
33
@@ -68,17 +68,17 @@ Let's start by creating a dedicated workspace for your XCM replay and dry-run ex
68
68
npx tsc --init
69
69
```
70
70
71
-
## Step 2: Capture the XCM to Replay
71
+
## Capture the XCM to Replay
72
72
73
73
To replay a specific XCM, identify:
74
74
75
75
- The source and destination chains involved
76
76
- The block number or height where the XCM was sent
77
77
- Optionally, the call payload (if you plan to simulate it manually via development commands)
78
78
79
-
You can use [Polkadot.Js Apps](/tutorials/polkadot-sdk/testing/fork-live-chains/#use-polkadotjs-apps){target=\_blank}, [papi console](https://dev.papi.how/){target=\_blank}, or indexers such as [Subscan](https://polkadot.subscan.io/xcm_dashboard){target=\_blank} to locate and inspect the original XCM execution.
79
+
You can use [Polkadot.js Apps](/tutorials/polkadot-sdk/testing/fork-live-chains/#use-polkadotjs-apps){target=\_blank}, [papi console](https://dev.papi.how/){target=\_blank}, or indexers such as [Subscan](https://polkadot.subscan.io/xcm_dashboard){target=\_blank} to locate and inspect the original XCM execution.
80
80
81
-
## Step 3: Fork the Relevant Chains
81
+
## Fork the Relevant Chains
82
82
83
83
Use Chopsticks to [fork the required chains](/tutorials/polkadot-sdk/testing/fork-live-chains/#xcm-testing){target=\_blank} at the appropriate block heights.
84
84
@@ -96,13 +96,13 @@ ACALA_BLOCK_NUMBER=8826385
96
96
97
97
Full execution logs only work if the runtime was compiled with logging enabled. Most live chains are built using the `production` profile, which disables logs. To enable logging, you'll need to override the Wasm with a locally built `release` or `debug` version. The `release` profile is faster to load in Chopsticks.
98
98
99
-
1. Clone the `polkadot-fellows/runtimes` repository
99
+
1. Clone the `polkadot-fellows/runtimes` repository:
To replay an XCM, you'll first need to identify the exact extrinsic that triggered it. In this example, we'll use block `#9079592` on the Polkadot Asset Hub.
171
+
To replay an XCM, you'll first need to identify the exact extrinsic that triggered it. In this example, we'll use block 9079592 on the Polkadot Asset Hub.
172
172
173
-
1. Find the block on Subscan, open the block in Subscan to inspect its extrinsics and events. In this case, the block is [`#9079592`](https://assethub-polkadot.subscan.io/block/9079592){target=\_blank}.
173
+
1. Find and open the block on Subscan to inspect its extrinsics and events. In this case, the block is [9079592](https://assethub-polkadot.subscan.io/block/9079592){target=\_blank}.
174
174
175
-
2. Copy the black hash. Look for the block hash at the top of the page. For block `#9079592`, the hash is:
175
+
2. Copy the black hash. Look for the block hash at the top of the page. For block 9079592, the hash is:
3. Explore and view the block in [Polkadot.Js Apps](https://polkadot.js.org/apps){target=\_blank} using this direct link: [Block Hash Explorer](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fpolkadot-asset-hub-rpc.polkadot.io#/explorer/query/0xeb5a5737d47367dc1c02b978232283cdb096eb7e51d2eb22366a106a011347f6){target=\_blank}.
182
182
183
-
4. Locate and Decode the XCM Extrinsic. Once you've found the extrinsic (e.g.`9079592-2`), extract and decode its call data. For example, the call data is:
183
+
4. Locate and decode the XCM extrinsic. Once you've found the extrinsic (e.g., 9079592-2), extract and decode its call data. For example, the call data is:
5. Copy the call data. From the decoded view, copy the **hex-encoded call** (e.g. `0x1f08...0000`). You'll pass this into `api.txFromCallData(...)` to replay the XCM locally.
189
+
5. From the decoded view, copy the **hex-encoded call** (e.g. `0x1f08...0000`). You'll pass this into `api.txFromCallData(...)` to replay the XCM locally.
190
190
191
-
## Step 5: Replay the XCM
191
+
## Replay the XCM
192
192
193
193
Once your project is set up, you're ready to replay the XCM locally.
194
194
@@ -230,7 +230,7 @@ If everything is working, you'll see logs like:
To simulate the XCM without actually sending it, you can use the `dry_run_call` method. This lets you check whether the XCM would succeed without modifying any state.
236
236
@@ -263,7 +263,7 @@ For more information, see:
263
263
- [Dry Run Call](/develop/interoperability/xcm-runtime-apis/#dry-run-call){target=\_blank} to simulate a full extrinsic
264
264
- [Dry Run XCM](/develop/interoperability/xcm-runtime-apis/#dry-run-xcm){target=\_blank} to simulate a raw XCM
265
265
266
-
## Step 7: Review and Debug
266
+
## Review and Debug
267
267
268
268
Replaying XCMs with full logging provides fine-grained control and visibility into cross-chain message behaviour. Chopsticks makes this possible in a safe, local environment – empowering developers to:
0 commit comments