Add Zombienet XCM test infrastructure for cross-chain validation#487
Add Zombienet XCM test infrastructure for cross-chain validation#487Copilot wants to merge 8 commits intorelease/4.1from
Conversation
…documentation Co-authored-by: akru <786394+akru@users.noreply.github.com>
…nore Co-authored-by: akru <786394+akru@users.noreply.github.com>
Co-authored-by: akru <786394+akru@users.noreply.github.com>
Co-authored-by: akru <786394+akru@users.noreply.github.com>
| @@ -0,0 +1,67 @@ | |||
| # Zombienet configuration for AssetHub-specific XCM tests | |||
There was a problem hiding this comment.
Removed assethub-xcm.toml in d0cf343. The xcm-tests.toml configuration now covers all XCM test scenarios including AssetHub integration.
….toml Co-authored-by: akru <786394+akru@users.noreply.github.com>
| @@ -0,0 +1,57 @@ | |||
| # Zombienet configuration for Robonomics XCM tests | |||
There was a problem hiding this comment.
Reuse robonomics-local.toml, just add trace for xcm into it
There was a problem hiding this comment.
Done in 5edccb2. Removed xcm-tests.toml and added -lxcm=trace to robonomics-local.toml for all nodes.
scripts/zombienet/README.md
Outdated
|
|
||
| ## Prerequisites | ||
|
|
||
| ### Required Software |
There was a problem hiding this comment.
Binaries comes from local-testnet nix devshell, let's describe it here instead of install dependencies manually.
There was a problem hiding this comment.
Updated in 5edccb2. README now documents the local-testnet nix devshell which provides all required binaries (zombienet, polkadot, polkadot-parachain, robonomics).
…ment nix devshell Co-authored-by: akru <786394+akru@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR implements comprehensive Zombienet-based XCM testing infrastructure for the Robonomics parachain, enabling validation of cross-chain messaging functionality including UMP (upward), DMP (downward), relay token transfers, and AssetHub integration.
Changes:
- Comprehensive XCM test suite covering all four required categories (UMP, DMP, relay token transfers, AssetHub)
- Consolidated network configuration with XCM tracing enabled
- Helper utilities for chain interactions and XCM message construction
- Enhanced test runner with filtering, verbose mode, and improved error handling
- 1200+ lines of documentation including setup guides, troubleshooting, and extension guidelines
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/zombienet/tsconfig.json |
TypeScript configuration with strict mode for future TypeScript test development |
scripts/zombienet/tests/xcm-tests.js |
Refactored to use shared helper utilities from chain-utils and xcm-utils |
scripts/zombienet/tests/relay-token-transfer.test.js |
New test module for relay token transfers and reserve transfer filter validation |
scripts/zombienet/tests/package.json |
Added TypeScript dependencies and additional npm scripts for building |
scripts/zombienet/tests/integration-tests.js |
Integrated new relay token transfer tests into main test runner |
scripts/zombienet/tests/helpers/xcm-utils.js |
New utility module with XCM message construction and token conversion helpers |
scripts/zombienet/tests/helpers/chain-utils.js |
New utility module with blockchain interaction helpers and logging utilities |
scripts/zombienet/spawn-network.sh |
Enhanced to accept custom configuration file as argument |
scripts/zombienet/run-tests.sh |
Added verbose mode, test filtering, and improved help documentation |
scripts/zombienet/configs/robonomics-local.toml |
Added XCM tracing flags to all nodes for comprehensive debugging |
scripts/zombienet/configs/README.md |
New configuration documentation with detailed explanations |
scripts/zombienet/README.md |
New comprehensive documentation with setup, usage, and troubleshooting |
scripts/zombienet/IMPLEMENTATION_SUMMARY.md |
New implementation summary documenting all delivered features |
scripts/zombienet/.gitignore |
New gitignore file for Node.js and Zombienet artifacts |
Comments suppressed due to low confidence (2)
scripts/zombienet/run-tests.sh:1
- This line number (86) appears to reference JavaScript code in a shell script file. This is likely a line numbering error in the diff or the code content doesn't match the file type.
#!/usr/bin/env bash
scripts/zombienet/tests/helpers/chain-utils.js:1
- The method is named
log.warnbut the actual logger object defineswarndifferently than this usage suggests. Based on the logger definition, this should log with a warning symbol, which is correct, but consider documenting the logger interface or using TypeScript types to ensure consistency.
/**
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| */ | ||
| function toPlanck(amount, decimals = 12) { | ||
| // Use BigInt to avoid precision loss | ||
| const bigAmount = BigInt(Math.floor(amount * Math.pow(10, decimals))); |
There was a problem hiding this comment.
Using Math.pow(10, decimals) in toPlanck() creates a floating-point number before converting to BigInt, which can cause precision loss for large decimal values. Consider using BigInt arithmetic directly: const factor = BigInt(10) ** BigInt(decimals); const bigAmount = BigInt(amount) * factor;
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Zombienet XCM Tests Implementation - COMPLETE ✅
All requirements from the problem statement have been successfully implemented.
Implementation Summary
Test Coverage:
Infrastructure:
robonomics-local.tomlconfiguration with XCM tracing enabledlocal-testnet) integration for easy binary setupQuality Assurance:
Files Created/Modified: 14 files, ~2,200 lines
Directory Structure
Runtime Configuration Validated
Tests validate
runtime/robonomics/src/xcm_config.rs:How to Use
Setup with Nix (Recommended):
The
local-testnetnix devshell provides all required binaries: zombienet, polkadot, polkadot-parachain, and robonomics.Documentation
Security
See
IMPLEMENTATION_SUMMARY.mdfor complete details.Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.