Skip to content

Add Guide: Replay & Dry Run XCMs with Full Logging Using Chopsticks #734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 57 commits into
base: master
Choose a base branch
from

Conversation

raymondkfcheung
Copy link

@raymondkfcheung raymondkfcheung commented Jun 18, 2025

This PR adds a new guide under the Polkadot SDK documentation that explains how to replay and dry-run XCMs using Chopsticks with full logging enabled.

The tutorial covers:

  • Capturing and locating the XCM to replay
  • Forking relevant chains at the correct block height
  • Replaying the XCM using TypeScript
  • Dry-running the XCM using TypeScript
  • Debugging with full trace and error output

This addresses Issue #488 by providing a step-by-step developer workflow for XCM observability and debugging in a local environment.

@raymondkfcheung raymondkfcheung requested a review from a team as a code owner June 18, 2025 13:56
@raymondkfcheung raymondkfcheung changed the title Ray add chopsticks Add Guide: Replay XCMs with Full Logging Using Chopsticks Jun 18, 2025
@eshaben eshaben requested a review from nhussein11 June 19, 2025 03:37
Copy link
Collaborator

@nhussein11 nhussein11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @raymondkfcheung! Thanks so much for incorporating the suggestions – I really appreciate it! I'm currently going through each step of the tutorial to ensure everything works smoothly. Could you please also run through the tutorial step-by-step to confirm that all the instructions are clear and doable from a third-party perspective? I've got a few thoughts and suggestions based on my testing:

  1. Specify a Port in Chopsticks Config: It might be helpful to specify a port (like 3000) in the chopsticks config. I ran into an issue where the port wasn't explicitly defined, which might be a common hurdle for users
  2. Improve "Enable Logging and Wasm Override" Clarity: For the "Enable Logging and Wasm Override" section, I found the steps a bit tricky to follow. To make it smoother for users, perhaps we could clarify where each command should be run and the purpose behind it. For instance, it's not immediately clear if the "Clone the polkadot-fellows/runtimes Repository" step should occur within the current repository or a new one. My personal preference would be to keep everything within the same repository for consistency.
  3. Enhance "Replay the XCM" Section: The "Replay the XCM" section could benefit from a brief introduction. Could you please explain if users need to create a new file for this and what its overall purpose is? This tutorial might serve as a good reference for the level of detail: https://docs.polkadot.com/tutorials/interoperability/xcm-transfers/from-relaychain-to-parachain/
  4. Clarify @polkadot/api polkadot-api Installation: I also noticed that @polkadot/api polkadot-api is installed again in the "How to Run" section. Is there a specific reason for this second installation?
  5. Expand "Dry Run the XCM" Explanations: Similarly, the "Dry Run the XCM" section could be more descriptive from a user experience perspective. Adding explanations about file creation (where and why) would be really helpful.
  6. Consider Moving Page Location: Finally, regarding the path: /develop/toolkit/parachains/fork-chains/chopsticks/replay-and-dry-run-xcms, I'm wondering if /tutorials/interoperability/ might be a more fitting location. Since this page feels more like a step-by-step tutorial rather than a high-level guide, it might be more discoverable there.

There are still some minor formatting adjustments to be made, but let's not fret over those just yet. Once the PR is approved, I'll pull it into my own branch and handle those tweaks.

Thanks again for all your hard work on this!

@raymondkfcheung
Copy link
Author

  1. Specify a Port in Chopsticks Config

Since the tutorial assumes some familiarity with Chopsticks (as noted in several sections), and isn't meant to explain Chopsticks itself, I think it's clearer to just add a reminder to check the terminal logs for the actual port. That avoids over-explaining or hardcoding a specific setup.

@raymondkfcheung
Copy link
Author

  1. Clarify @polkadot/api polkadot-api Installation

Removed the duplicated part.

@raymondkfcheung
Copy link
Author

@nhussein11 Thanks a lot for the detailed feedback. I've updated accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants