Conversation
* [CI] fix toolchain and enable cache for nightly * [CI] fix toolchain * Initial plan * Add try-runtime feature and migration module with Location updates Co-authored-by: akru <786394+akru@users.noreply.github.com> * Apply cargo fmt to fix code formatting Co-authored-by: akru <786394+akru@users.noreply.github.com> * Address code review feedback: remove unnecessary cloning and unused variable Co-authored-by: akru <786394+akru@users.noreply.github.com> * Update frame/xcm-info/src/lib.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Alexander Krupenkin <mail@akru.me> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: akru <786394+akru@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot looks like zombienet workfow unable to download polkadot binary, would you check it? |
* New runtime struct definition * Added migrations (including XCM) * LazyBlock runtime API
There was a problem hiding this comment.
Pull request overview
This PR introduces XCM v4 support and comprehensive zombienet-based integration testing infrastructure for the Robonomics parachain. The changes enable cross-chain messaging capabilities and provide automated testing to verify multi-chain functionality.
Key changes:
- Migration of XCM configuration from v3 to v4 with updated types (Location, Asset, Junction)
- Addition of zombienet test suite including basic connectivity tests and XCM message passing tests
- Updated runtime dependencies to polkadot-sdk stable2509-2 versions
- Implementation of storage migrations for XCM-related pallets
Reviewed changes
Copilot reviewed 21 out of 23 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| runtime/robonomics/src/xcm_config.rs | Migrates XCM types from v3 to v4, removes Ethereum bridge transactor, updates pallet configurations |
| runtime/robonomics/src/lib.rs | Enables XCM pallets, adds storage migrations, updates runtime macro to new format |
| frame/xcm-info/src/lib.rs | Updates to XCM v4 Location types, adds comprehensive tests and documentation |
| frame/xcm-info/src/migration.rs | New storage migration for v3→v4 XCM type conversions |
| scripts/zombienet/*.sh | Test infrastructure for automated zombienet-based integration testing |
| scripts/zombienet/tests/*.js | Integration test suite covering network initialization, block production, and XCM messaging |
| scripts/zombienet/*.md | Documentation for test suite usage, configuration, and development |
| .github/workflows/zombienet.yml | CI workflow for automated testing on PRs and pushes |
Comments suppressed due to low confidence (1)
scripts/zombienet/tests/xcm-tests.js:1
- Two issues: (1) X1 should not wrap the junction in an array - it should be a single junction object. (2) The Parachain value should be numeric (1000) not a string ('1000').
/**
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ## XCM Testing Examples | ||
|
|
||
| The test suite includes XCM (Cross-Consensus Messaging) v5 tests demonstrating cross-chain communication patterns. |
There was a problem hiding this comment.
Similar to Comment 8: The documentation states XCM v5, but the code uses XCM v4. Update to 'XCM v4' for consistency with the implementation.
|
@copilot open a new pull request to apply changes based on the comments in this thread |
* Added polkadot.nix overlay and import polkadot-sdk as dependencies * Added robonomics binary and crates as flake packages * Added Github action to cache nix builds using Cachix
…ities, refactor crypto module (#481) * Initial plan * Update plan: Use subxt macro with metadata file from WASM Co-authored-by: akru <786394+akru@users.noreply.github.com> * WIP: Implement metadata extraction approach Co-authored-by: akru <786394+akru@users.noreply.github.com> * WIP: Implement metadata extraction - need to extract metadata from WASM Co-authored-by: akru <786394+akru@users.noreply.github.com> * Complete metadata extraction implementation using subwasm Co-authored-by: akru <786394+akru@users.noreply.github.com> * New approach: Use runtime_path to directly reference runtime WASM Co-authored-by: akru <786394+akru@users.noreply.github.com> * Final implementation: Extract metadata from runtime dependency Co-authored-by: akru <786394+akru@users.noreply.github.com> * Use WASM_BINARY from runtime dependency - simplest working solution Co-authored-by: akru <786394+akru@users.noreply.github.com> * Add runtime metadata extractor into libcps build script * Replace sp-core with subxt utilities - Remove sp-core dependency from Cargo.toml - Replace sp_core::crypto::AccountId32 with subxt::utils::AccountId32 - Replace sp_core::Pair with subxt_signer::{sr25519, ed25519}::Keypair - Replace from_ss58check() with from_string() for AccountId32 - Remove to_ss58check() calls (AccountId32 implements Display) - Update all imports across crypto, commands, main, display, and mqtt modules Co-authored-by: akru <786394+akru@users.noreply.github.com> * Fix: Replace from_string with from_str for AccountId32 AccountId32 doesn't have a from_string method - use from_str from FromStr trait instead. Changes: - Add std::str::FromStr import to main.rs and mqtt/bridge.rs - Replace AccountId32::from_string() with from_str() in both files - Update documentation to reference from_str instead of from_string Co-authored-by: akru <786394+akru@users.noreply.github.com> * Remove path/type aliases * Refactor crypto module structure Per requirements: - types.rs: Contains CryptoScheme, EncryptionAlgorithm, and EncryptedMessage (message/scheme/algorithm types) - cipher.rs: Contains only Cipher struct and its implementation - mod.rs: Root module with comprehensive documentation and re-exports only Changes: - Moved CryptoScheme from cipher.rs to types.rs - Moved EncryptionAlgorithm and EncryptedMessage to types.rs - Moved Cipher implementation to cipher.rs - Cleaned up mod.rs to contain only documentation and re-exports - Removed duplicate code between mod.rs and types.rs Co-authored-by: akru <786394+akru@users.noreply.github.com> * Modernize libcps: automate metadata extraction, remove sp-core, refactor crypto module Co-authored-by: akru <786394+akru@users.noreply.github.com> * Optimized payload decryption in mqtt; code formatting * Move robonomics api to blockchain module, fix imports * Revert crypto module to use sp-core for ED25519 support Per feedback, subxt-signer doesn't support ED25519 properly. Reverted crypto module to use sp-core::Pair for both SR25519 and ED25519 keypair handling. Changes: - Re-added sp-core dependency to Cargo.toml - Reverted cipher.rs to use sp_core::Pair instead of subxt_signer - Restored original keypair parsing using sp_core::sr25519::Pair::from_string and sp_core::ed25519::Pair::from_string Note: Other modules (commands, main, display, mqtt) still use subxt::utils::AccountId32 for address handling, which works correctly. Co-authored-by: akru <786394+akru@users.noreply.github.com> * Fix tests & imports * Remove unused runtime deps * Fix documentation: update imports, type names, and metadata generation Updated all documentation to reflect current module structure: - Fixed type aliases: BlockchainConfig → blockchain::Config, BlockchainClient → blockchain::Client - Updated import paths: types::NodeData → node::NodeData - Removed outdated metadata generation instructions - Updated README.md with automatic metadata extraction process - Updated DEVELOPMENT.md to reflect build-time generation - Fixed all doc-test examples to use correct module paths - Removed references to manual subxt codegen process All examples now use proper module structure: - use libcps::blockchain::{Client, Config}; - use libcps::node::{Node, NodeData}; - use libcps::crypto::{Cipher, CryptoScheme, EncryptionAlgorithm}; Co-authored-by: akru <786394+akru@users.noreply.github.com> * [CI] Add autocommit into auto-format workflow * Apply auto-formatting changes * Fix README Project Structure section Updated Project Structure section to reflect current codebase: - Fixed path: tools/cps/ → tools/libcps/ - Added build.rs (metadata extraction script) - Added DEVELOPMENT.md - Replaced types.rs with node.rs (CPS type definitions now in node module) - Updated crypto/ structure: scheme.rs → types.rs and cipher.rs - Added descriptive comments for each component - Marked MQTT as optional feature Co-authored-by: akru <786394+akru@users.noreply.github.com> * Update tools/libcps/src/mqtt/bridge.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix spelling: Unvalid → Invalid in error messages Corrected two typos in mqtt/bridge.rs error messages. Co-authored-by: akru <786394+akru@users.noreply.github.com> * Fix doc-test imports across all modules Fixed all 11 failing doc-tests by correcting import paths: mqtt/mod.rs and mqtt/bridge.rs: - Changed: use libcps::{mqtt, Config as BlockchainConfig} - To: use libcps::{mqtt, blockchain::Config} - Updated BlockchainConfig → Config throughout node.rs (8 fixes): - Changed: use libcps::{Client, Config, node::Node} - To: use libcps::blockchain::{Client, Config}; use libcps::node::Node - Changed: use libcps::{Client, Config, node::Node, types::NodeData} - To: use libcps::blockchain::{Client, Config}; use libcps::node::{Node, NodeData} - Replaced BlockchainClient → Client, BlockchainConfig → Config All doc-tests now use correct module paths matching the refactored structure. Co-authored-by: akru <786394+akru@users.noreply.github.com> * Inline derive_encryption_key_with_algorithm to Cipher encrypt/decrypt methods * Update Cargo.toml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add test coverage for CryptoScheme enum Added comprehensive tests for CryptoScheme: - test_crypto_scheme_name: Tests name() method returns uppercase names - test_crypto_scheme_info_suffix: Tests info_suffix() method returns HKDF suffixes - test_crypto_scheme_display: Tests Display trait implementation - test_crypto_scheme_from_str: Tests FromStr trait with valid and invalid inputs All CryptoScheme methods now have test coverage matching EncryptionAlgorithm tests. Co-authored-by: akru <786394+akru@users.noreply.github.com> * Apply auto-formatting changes * Remove unused method and test from CryptoScheme --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: akru <786394+akru@users.noreply.github.com> Co-authored-by: Alexander Krupenkin <mail@akru.me> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…als and design decisions
…with WeightInfo integration, Nix flakes, CI validation, and rename pallet-wrapped-native to pallet-wrapped-asset (#483) * Initial plan * Fix XCMP queue weight integrity test by using unit weights The cumulus_pallet_xcmp_queue integrity test was failing because the estimated weights from SubstrateWeight didn't match the actual runtime weights (141756000 vs 181000000, a ~27% difference). Using unit weights () skips this check while maintaining functionality. Proper runtime-specific benchmarks should be generated in the future. Fixes test failure in workflow run 21472182920 Co-authored-by: akru <786394+akru@users.noreply.github.com> * Add comprehensive runtime benchmarks for all pallets Added benchmark configurations for: - System pallets: balances, timestamp, utility, multisig, vesting, assets - Consensus pallets: collator_selection, session - Robonomics pallets: cps (newly added), all existing pallets - XCM pallets: xcm_info (newly added), xcm, xcmp_queue This enables proper weight generation for all runtime pallets through benchmarking, which will allow replacing unit weights with accurate runtime-specific weights in the future. Note: pallet_aura and pallet_authorship don't support runtime-benchmarks feature and were excluded from benchmarks configuration. Co-authored-by: akru <786394+akru@users.noreply.github.com> * Integrate runtime benchmarks into Nix flakes Added comprehensive benchmarking workflow: 1. Created new 'benchmarking' devshell in nix/modules/flake/devshell.nix - Provides frame-omni-bencher, srtool-cli, and all required tools - Optimized for runtime benchmarking workflow 2. Added scripts/benchmark-all.sh - new comprehensive benchmark script - Benchmarks all configured pallets (Robonomics + system pallets) - Colored output with progress indicators - Works both in Nix shell and standalone - Generates weights for all 8 Robonomics pallets + XCM pallets 3. Updated README.md with complete benchmarking guide - Added "Runtime Benchmarking" section with quick start guide - One-line command using Nix: nix develop .#benchmarking -c ./scripts/benchmark-all.sh - Documented all 17 pallets available for benchmarking - Included manual benchmarking instructions (without Nix) - Explained benchmark results and their purpose 4. Deprecated old benchmark-weights.sh script - Shows deprecation message pointing to new workflow - Offers to run new script interactively This provides a single, simple command to run all benchmarks as requested. Co-authored-by: akru <786394+akru@users.noreply.github.com> * Address code review feedback for benchmarking integration Fixed issues identified in code review: - Added missing semicolon in nix devshell.nix - Improved error handling in benchmark-all.sh with output capture - Added WASM file verification after cargo build - Fixed shebang in benchmark-weights.sh - Changed exit code to 0 for normal user termination - Clarified DoS prevention description in README - Fixed pallet_utility description (batch calls, not multi-sig) - Improved weight function example with trait implementation pseudocode Co-authored-by: akru <786394+akru@users.noreply.github.com> * Add GitHub Actions workflow for runtime benchmark validation Created .github/workflows/runtime-benchmarks.yml workflow that: - Automatically runs on feat/* and release/* branches (and PRs to these branches) - Builds runtime with runtime-benchmarks feature - Installs frame-omni-bencher tool - Runs benchmarks on 4 representative Robonomics pallets: - pallet_robonomics_datalog - pallet_robonomics_rws - pallet_robonomics_cps - pallet_wrapped_native - Uses minimal steps/repeats (2/1) for faster CI execution - Verifies benchmarks complete successfully and generate weight files - Validates runtime WASM exists before running benchmarks This ensures runtime benchmarks continue to work correctly as the codebase evolves. Co-authored-by: akru <786394+akru@users.noreply.github.com> * Address review feedback: rename script, remove deprecated file, use Nix in CI Changes made: 1. Renamed scripts/benchmark-all.sh to scripts/benchmark-pallets.sh 2. Removed deprecated scripts/benchmark-weights.sh 3. Updated README.md with new script name 4. Rewrote .github/workflows/runtime-benchmarks.yml to use Nix: - Added aggressive cleanup step for disk space - Install Nix with cachix - Use 'nix develop .#benchmarking' to run benchmarks - Tests benchmarking devshell accessibility - All benchmark commands now run within Nix shell - This makes the one-line command work in CI as intended This aligns the CI workflow with the local development workflow using Nix. Co-authored-by: akru <786394+akru@users.noreply.github.com> * Add system pallets benchmarking and save weights to runtime directory Changes made: 1. Created runtime/robonomics/src/weights/ directory for system pallet weights 2. Updated scripts/benchmark-pallets.sh to include system pallets: - Added 8 system pallets (balances, timestamp, utility, multisig, vesting, assets, collator_selection, session) - Added 2 XCM pallets (cumulus_pallet_xcmp_queue, pallet_xcm) - System/XCM pallet weights save to runtime/robonomics/src/weights/ - Robonomics custom pallet weights save to frame/*/src/weights.rs - Total: 18 pallets benchmarked 3. Updated README.md to clarify weight file locations: - System pallets → runtime/robonomics/src/weights/ - Custom pallets → frame/*/src/weights.rs 4. Updated .github/workflows/runtime-benchmarks.yml: - Now tests representative pallets from different categories - Tests pallet_robonomics_datalog (custom), pallet_balances (system), pallet_xcm (XCM) - Verifies multiple weight files are generated This addresses the request to benchmark system pallets and organize weights properly. Co-authored-by: akru <786394+akru@users.noreply.github.com> * Update CI workflow to use benchmark-pallets.sh script directly Changes made: 1. Made benchmark-pallets.sh configurable via environment variables: - BENCHMARK_STEPS (default: 50) - BENCHMARK_REPEAT (default: 20) - Script displays settings at start 2. Simplified .github/workflows/runtime-benchmarks.yml: - Now calls ./scripts/benchmark-pallets.sh directly - Sets BENCHMARK_STEPS=2 and BENCHMARK_REPEAT=1 for fast CI - Removed all inline benchmark commands - CI now tests exactly as the script does 3. Updated README.md: - Added section on customizing benchmark parameters - Documented environment variables - Provided examples for different use cases This ensures CI validates the same workflow that developers use locally, while maintaining fast execution through environment variable configuration. Co-authored-by: akru <786394+akru@users.noreply.github.com> * Fix syntax error in devshell.nix (extra semicolon) Fixed Nix syntax error that was causing CI failure: - Removed extra semicolon on line 35 of nix/modules/flake/devshell.nix - Changed "};" to "};" (removed duplicate semicolon) Error was: "syntax error, unexpected ';'" This was introduced in a previous commit when adding the benchmarking devshell. Fixes workflow run: https://github.com/airalab/robonomics/actions/runs/21504166786 Co-authored-by: akru <786394+akru@users.noreply.github.com> * Fix compilation error in pallet-xcm-info benchmarking Removed unused import of xcm::opaque::v3::MultiLocation in benchmarking.rs. This import was causing compilation failures because v3 has been replaced with v4 in the XCM update. The import was unused and not needed for the benchmarking code. Error was: "error: could not compile `pallet-xcm-info` (lib)" Fixes workflow run: https://github.com/airalab/robonomics/actions/runs/21504557735 Co-authored-by: akru <786394+akru@users.noreply.github.com> * Fix Location import in pallet-xcm-info benchmarking Added proper import `use xcm::latest::prelude::*;` to benchmarking module. When I removed the unused v3 MultiLocation import, I inadvertently removed the import that provided the Location type used in the set_asset_link benchmark. The benchmarking module needs its own import of xcm::latest::prelude::* to access Location and NetworkId types. Error was: "error[E0433]: failed to resolve: use of undeclared type `Location`" Fixes workflow run: https://github.com/airalab/robonomics/actions/runs/21507229776 Co-authored-by: akru <786394+akru@users.noreply.github.com> * Added more pallets for benchmark, fix build * Apply auto-formatting changes * Add complete benchmarking support and rename pallet-wrapped-native to pallet-wrapped-asset Added comprehensive benchmarking support to both pallets: 1. **pallet-xcm-info**: - Created weights.rs with WeightInfo trait and implementations - Added WeightInfo type parameter to Config trait - Updated extrinsics to use T::WeightInfo for weight calculations - Removed dev_mode to enforce proper weight usage - Updated test mock to include WeightInfo = () 2. **pallet-wrapped-asset** (renamed from pallet-wrapped-native): - Created benchmarking.rs with wrap_and_send benchmark - Created weights.rs with WeightInfo trait and implementations - Added WeightInfo type parameter to Config trait - Updated wrap_and_send extrinsic to use T::WeightInfo - Updated test mock to include WeightInfo = () - Renamed all references from wrapped-native to wrapped-asset across: * Directory: frame/wrapped-native → frame/wrapped-asset * Cargo package name: pallet-wrapped-native → pallet-wrapped-asset * All module names and imports updated * Runtime configuration updated * Benchmark script updated * Documentation updated Both pallets now have complete benchmarking support with WeightInfo trait integration, allowing proper weight generation via frame-omni-bencher. Co-authored-by: akru <786394+akru@users.noreply.github.com> * Apply auto-formatting changes * [CI] optimize benchmark workflow * Update frame/wrapped-asset/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update frame/wrapped-asset/src/weights.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: akru <786394+akru@users.noreply.github.com> Co-authored-by: Alexander Krupenkin <mail@akru.me> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nsitive information Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
@copilot Update repository structure in readme, libcps added, new scripts introduced. |
* Initial plan * Update README repository structure: add libcps tools and expand scripts documentation Co-authored-by: akru <786394+akru@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: akru <786394+akru@users.noreply.github.com>
* Added message_queue pallet for XCMP * Temporary disable XCM benchmarks
* Added pallet-robonomics-claim * Fix license headers and add comprehensive documentation for claim pallet (#491) * Initial plan * Fix license headers and improve documentation for claim pallet Co-authored-by: akru <786394+akru@users.noreply.github.com> * Fix README documentation issues Co-authored-by: akru <786394+akru@users.noreply.github.com> * Add prefix to signing examples in README Co-authored-by: akru <786394+akru@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: akru <786394+akru@users.noreply.github.com> * Apply auto-formatting changes * Rename misleading test function in claim pallet (#492) * Initial plan * Rename test to better reflect its purpose Co-authored-by: akru <786394+akru@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: akru <786394+akru@users.noreply.github.com> * Update lib.rs * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix xcm-info tests --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add dev-runtime feature into runtime (enable some pallets for --dev runtime only) * Use development runtime in libcps * Use cps pallet for development runtime only
Description
Basic XCM support and zombienet test suits.