Skip to content

Commit 323dc1e

Browse files
nhussein11eshaben
andauthored
Apply suggestions from code review
Co-authored-by: Erin Shaben <[email protected]>
1 parent a689c15 commit 323dc1e

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

tutorials/interoperability/replay-and-dry-run-xcms.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
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.
44
---
55

66
# Replay and Dry Run XCMs Using Chopsticks
@@ -27,7 +27,7 @@ Before you begin, make sure you have:
2727

2828
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.
2929

30-
## Step 1: Set Up Your Project
30+
## Set Up Your Project
3131

3232
Let's start by creating a dedicated workspace for your XCM replay and dry-run experiments.
3333

@@ -68,17 +68,17 @@ Let's start by creating a dedicated workspace for your XCM replay and dry-run ex
6868
npx tsc --init
6969
```
7070

71-
## Step 2: Capture the XCM to Replay
71+
## Capture the XCM to Replay
7272

7373
To replay a specific XCM, identify:
7474

7575
- The source and destination chains involved
7676
- The block number or height where the XCM was sent
7777
- Optionally, the call payload (if you plan to simulate it manually via development commands)
7878

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.
8080

81-
## Step 3: Fork the Relevant Chains
81+
## Fork the Relevant Chains
8282

8383
Use Chopsticks to [fork the required chains](/tutorials/polkadot-sdk/testing/fork-live-chains/#xcm-testing){target=\_blank} at the appropriate block heights.
8484

@@ -96,13 +96,13 @@ ACALA_BLOCK_NUMBER=8826385
9696

9797
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.
9898
99-
1. Clone the `polkadot-fellows/runtimes` repository
99+
1. Clone the `polkadot-fellows/runtimes` repository:
100100
101101
```bash
102102
git clone [email protected]:polkadot-fellows/runtimes.git
103103
```
104104
105-
2. Build the Polkadot Asset Hub runtime
105+
2. Build the Polkadot Asset Hub runtime:
106106
107107
```bash
108108
cd runtimes
@@ -113,7 +113,7 @@ Full execution logs only work if the runtime was compiled with logging enabled.
113113
cargo build --release -p asset-hub-polkadot-runtime
114114
```
115115
116-
3. Copy the compiled Wasm to your working directory
116+
3. Copy the compiled Wasm to your working directory:
117117
118118
```bash
119119
# Assuming you're still in the `runtimes` directory
@@ -128,7 +128,7 @@ Full execution logs only work if the runtime was compiled with logging enabled.
128128
cp target/release/wbuild/asset-hub-polkadot-runtime/asset_hub_polkadot_runtime.compact.compressed.wasm ../wasms
129129
```
130130
131-
4. Download and modify a config file
131+
4. Download and modify a config file:
132132
133133
```bash
134134
# Still in the `runtimes` directory
@@ -166,29 +166,29 @@ Full execution logs only work if the runtime was compiled with logging enabled.
166166
167167
--8<-- 'code/tutorials/interoperability/replay-and-dry-run-xcms/launch-chopsticks.html'
168168
169-
## Step 4: Identify and Extract the XCM
169+
## Identify and Extract the XCM
170170
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.
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.
172172
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}.
174174
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:
176176
177177
```bash title="Block Hash"
178178
0xeb5a5737d47367dc1c02b978232283cdb096eb7e51d2eb22366a106a011347f6
179179
```
180180
181181
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}.
182182
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:
184184
185185
```bash title="Call Data"
186186
0xad028400fc39fcf04a8071b7409823b7c82427ce67910c6ed80aa0e5093aff234624c820016a30461702adc48213e5c9ee4d15c5a481c578cb5cbc935f0bd11fe8aee489082a745ffbbe94282f91b67daa6cb44920d77c30849c1d25f5f6c3e59015a3e383440055040000011f0803010100411f0300010100fc39fcf04a8071b7409823b7c82427ce67910c6ed80aa0e5093aff234624c8200304000002043205011f0092e81d790000000000
187187
```
188188
189-
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.
190190
191-
## Step 5: Replay the XCM
191+
## Replay the XCM
192192
193193
Once your project is set up, you're ready to replay the XCM locally.
194194
@@ -230,7 +230,7 @@ If everything is working, you'll see logs like:
230230
231231
--8<-- 'code/tutorials/interoperability/replay-and-dry-run-xcms/replay-xcm-result.html'
232232
233-
## Step 6: Dry Run the XCM
233+
## Dry Run the XCM
234234
235235
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.
236236
@@ -263,7 +263,7 @@ For more information, see:
263263
- [Dry Run Call](/develop/interoperability/xcm-runtime-apis/#dry-run-call){target=\_blank} to simulate a full extrinsic
264264
- [Dry Run XCM](/develop/interoperability/xcm-runtime-apis/#dry-run-xcm){target=\_blank} to simulate a raw XCM
265265
266-
## Step 7: Review and Debug
266+
## Review and Debug
267267
268268
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:
269269

0 commit comments

Comments
 (0)