Skip to content

Refactor XCM tests#3685

Open
manuelmauro wants to merge 99 commits into
masterfrom
manuel/refactor-xcm-tests
Open

Refactor XCM tests#3685
manuelmauro wants to merge 99 commits into
masterfrom
manuel/refactor-xcm-tests

Conversation

@manuelmauro

@manuelmauro manuelmauro commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Refactor: Replace XCM simulator tests with xcm-config unit tests and xcm-emulator integration tests

Summary

Replaces the legacy XCM test suite (xcm_tests.rs + xcm_mock/) across all three runtimes with a two-layer testing architecture that is more modular, more thorough, and tests
against real runtime configurations instead of hand-rolled mocks.

Motivation

The previous XCM tests relied on xcm-simulator with manually maintained mock runtimes (parachain.rs, relay_chain.rs, statemint_like.rs) that duplicated large amounts of
configuration and drifted from the actual runtime over time. Several tests contained subtle bugs — no-op assertions, hardcoded values instead of config-derived ones, and tests that
didn't actually exercise what their names claimed. The monolithic ~5,500-line xcm_tests.rs files were difficult to navigate and extend.

What changed

Deleted (−23,529 lines):

  • runtime/{moonbeam,moonbase,moonriver}/tests/xcm_tests.rs — monolithic test files
  • runtime/{moonbeam,moonbase,moonriver}/tests/xcm_mock/ — hand-rolled mock runtimes (parachain, relay chain, statemint-like)

Added (+16,360 lines across 42 new files):

Layer Directory Purpose
Level 1 — xcm_config tests/xcm_config/ Unit tests for XCM config components in isolation using the real runtime types
Level 2A — xcm_emulator tests/xcm_emulator/ Integration tests using xcm-emulator with real Westend relay + Asset Hub Westend + Moonbeam parachain

xcm_config/ tests cover (per runtime):

  • barriers.rs — which XCM messages are allowed/denied execution
  • reserves.rs — reserve asset filtering and self-reserve recognition
  • traders.rs — XCM fee charging logic
  • transactors.rs — asset deposit/withdrawal mechanics
  • location.rs — location-to-account conversions (relay, sibling, ethereum-style)
  • origin.rs — XCM origin conversion
  • weigher.rs — XCM message weight calculation

xcm_emulator/ tests cover (per runtime):

  • transfers.rs — relay↔para, para↔para, and Asset Hub transfers (DMP/UMP/XCMP)
  • transact.rs — signed transact, EthereumXcm transact, sovereign transact, HRMP channel management
  • asset_hub.rs — multi-hop and remote-reserve transfers through Asset Hub
  • relay.rs — relay chain interactions
  • versioning.rs — XCM version negotiation and safe-subscription

Test coverage

Runtime Old tests New tests
moonbeam 39 97
moonbase 41 97
moonriver 41 97
Total 121 291

Dependency changes

  • Replaced xcm-simulatorxcm-emulator (dev dependency for all three runtimes)
  • Added westend-runtime, asset-hub-westend-runtime as dev dependencies (real relay/parachain runtimes for the emulator network)
  • Added pallet-delegated-staking, parachains-common as dev dependencies for moonbeam runtime

License Allowlist Update

This PR adds LGPL-3.0-or-later to the allowed licenses in scripts/verify-licenses.sh.

The new XCM emulator test setup pulls in asset-hub-westend-runtime, which transitively depends on revm-precompile. That crate brings in:

  • rug 1.29.0 — LGPL-3.0+ (high-level Rust bindings to GMP/MPFR/MPC)
  • gmp-mpfr-sys 1.7.0 — LGPL-3.0+ (low-level FFI bindings used by rug)

Both are used as unmodified library dependencies (dynamic/linked use), which is permitted under LGPL-3.0 without affecting the licensing of Moonbeam's own code.

@manuelmauro manuelmauro self-assigned this Feb 27, 2026
@manuelmauro manuelmauro added B0-silent Changes should not be mentioned in any release notes D2-notlive PR doesn't change runtime code (so can't be audited) not-breaking Does not need to be mentioned in breaking changes labels Feb 27, 2026
@coderabbitai

coderabbitai Bot commented Feb 27, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

I can’t reliably construct the required detailed hidden review-stack artifact that assigns every provided range id exactly once within the time/format constraints. The input contains several hundred distinct range IDs and file summaries, and building a correct, parser-perfect artifact (every id used exactly once) requires deterministic automated handling or more time.

If you want, I can:

  • Produce a correct review stack if you provide a smaller set of ranges (ideally ≤ ~25 ranges), or
  • Generate the visible Walkthrough and Changes sections only (no hidden artifact), or
  • Generate an initial high-level review stack (cohorts/layers) and you can supply a mapping of range IDs to those layers for me to embed.

Which option do you prefer?

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch manuel/refactor-xcm-tests

- Remove incorrect doc comment on register_dot_asset
- Use 'should' phrasing in expect() per Rust guidelines
- Switch remark to remark_with_event and verify Remarked event on relay
- Encode calls via RuntimeCall instead of manual pallet-index assembly
- Assert OpenChannelRequested/Accepted events and channel storage in HRMP test
- Clean up unused PalletInfoT import
Keep the pre-existing xcm_tests.rs and xcm_mock/ from master as a
separate test binary so the old suite runs in parallel with the new
xcm_config_tests, xcm_emulator_tests, and xcm_integration_tests.
This allows splitting the refactoring across multiple PRs.
Same as the moonbeam restore — keep the pre-existing xcm_tests.rs and
xcm_mock/ from master for moonbase (47 tests) and moonriver (47 tests)
so they run alongside the new test suites.
New transact tests (emulator_transact_tests.rs):
- transact_through_sovereign: fee_payer=None, custom_fee_weight, refund
- transact_through_derivative: basic, custom_fee_weight, refund
- transact_through_signed: basic, custom_fee_weight, refund
- hrmp_close_via_xcm_transactor: close a previously opened channel

New transfer tests (emulator_transfer_tests.rs):
- evm_account_receives_foreign_asset: EVM account with GLMR receives DOT
- foreign_assets_survive_native_balance_drain: DOT survives GLMR drain

Also:
- Extract relay_remark_call(), assert_relay_remark_executed(), relay_derived_account()
  and setup_derivative() helpers to reduce duplication
- Add ConvertLocation import for relay account derivation
- Use real Westend LocationConverter for signed origin account derivation
  (Account32Hash != HashedDescription<DescribeFamily>)
Two new tests covering HRMP-based transact from Moonbeam to sibling:
- transact_through_signed_para_to_para: basic remark execution
- transact_through_signed_para_to_para_refund: with fee refund

Introduces setup_para_to_para_signed() helper that:
- Opens bidirectional HRMP channels
- Registers DOT on the sibling chain
- Derives the signed-origin account on sibling (HashedDescription)
- Funds the derived account with DOT via relay DMP
Three new tests covering EthereumXcm operations via signed XCM transact:
- transact_through_signed_para_to_para_ethereum: EVM value transfer via
  EthereumXcm::transact (MoonbeamCall dispatcher re-routes Signed origin
  to XcmEthereumTransaction origin)
- transact_through_signed_para_to_para_ethereum_no_proxy_fails: proxy
  transact without proxy setup — verifies no balance change
- transact_through_signed_para_to_para_ethereum_proxy_succeeds: proxy
  transact with ALITH delegating to derived account

Introduces setup_para_to_para_ethereum() and ethereum_xcm_transfer_call()
helpers.
Three new tests covering Moonbeam's native token (GLMR) transfers to sibling:
- transfer_glmr_from_moonbeam_to_sibling: reserve-backed GLMR transfer
- transfer_glmr_roundtrip_moonbeam_sibling: GLMR → sibling → back, verifies
  only fees are lost in the roundtrip
- transfer_glmr_to_sibling_with_trader_fees: verifies sibling's XCM weight
  trader deducts GLMR fees and treasury collects them

Introduces register_glmr_on_sibling() and setup_glmr_para_to_para() helpers.
Documents test inventory, emulator network topology, technical
discoveries, deferred work, and known issues for future reference
when splitting changes across PRs.
- Fix barrier_passes_unpaid_with_weight_credit by supplying weight credit
  via new execute_xcm_with_credit() helper
- Add 5 barrier tests: AccountKey20 paid execution, unpaid rejection,
  known/unknown query response
- Add 2 reserve tests: DOT from relay, teleport always rejected
- Add 2 transactor tests: foreign asset withdraw, ERC20 bridge asset
- Remove unused ONE_DOT constant from traders_test (dead code warning)
- Add xcm_config_tests/COVERAGE.md documenting all 48 tests
- Apply all fixes to moonbeam, moonbase, and moonriver runtimes
Add 7 new emulator tests covering previously-deferred scenarios:

Transfer tests (emulator_transfer_tests.rs, 11→16):
- transfer_glmr_across_three_chains: GLMR traverses A→B→A→C via 3rd
  parachain (ParaCPara, para 2006)
- transfer_dot_to_sibling_via_remote_reserve: DOT via RemoteReserve
  through relay
- transfer_dot_roundtrip_via_remote_reserve: DOT outbound + return
- transfer_glmr_self_reserve_to_sibling: GLMR self-reserve transfer
- receive_sibling_native_asset: sibling sends its native to Moonbeam

Versioning tests (new emulator_versioning_tests.rs, 2 tests):
- xcm_version_discovery_with_relay: SafeXcmVersion + relay awareness
- xcm_version_discovery_with_sibling: SafeXcmVersion + sibling awareness

Infrastructure:
- Add ParaCPara (para 2006) to emulator network
- Register para 2006 in relay genesis (head, lifecycle, sovereign)
- Add para_c_execute_with() helper
- Update COVERAGE.md (28 → 35 tests)
With PR #3692 removing `runtime-benchmarks` from the CI test command,
the `force-xcm-processor` workaround is no longer needed. Tests run
without benchmarks, so both Westend and Moonbeam use the real
`MessageProcessor` by default.

Removed:
- `[patch]` section from root Cargo.toml (~200 local path overrides)
- `force-xcm-processor` feature from runtime/moonbeam/Cargo.toml
- `force-xcm-processor` cfg guards from runtime/moonbeam/src/xcm_config.rs

All polkadot-sdk crates now resolve from the upstream
moonbeam-polkadot-stable2506 branch.
Add the real asset-hub-westend-runtime as a parachain (para 1000) in the
xcm-emulator network, alongside the existing Moonbeam instances.

New tests (emulator_asset_hub_tests.rs, 3 tests):
- transfer_dot_from_relay_to_asset_hub: relay teleports DOT to real AH
- relay_funds_both_asset_hub_and_moonbeam: DOT on both chains from relay
- transfer_trust_backed_asset_from_asset_hub_to_moonbeam: USDT (id=1984)
  from Asset Hub to Moonbeam as an EVM foreign asset

Infrastructure:
- Add asset-hub-westend-runtime to workspace and moonbeam-runtime deps
- Add AssetHubPara declaration with genesis (para 1000)
- Register Asset Hub on relay (head, lifecycle, sovereign, endowment)
- Add asset_hub_execute_with() helper
- Update COVERAGE.md (35 → 38 tests)

Note: Direct DOT transfers between Asset Hub and Moonbeam are not
supported — DOT uses teleport (relay↔AH) vs reserve (relay↔Moonbeam),
a hybrid that pallet_xcm cannot route in a single call. Trust-backed
assets (USDT, etc.) work because Asset Hub is their reserve.
ParaCPara (para 2006) was an identical Moonbeam clone used only for the
transfer_glmr_across_three_chains test, whose individual legs were
already covered by transfer_glmr_from_moonbeam_to_sibling and
transfer_glmr_roundtrip_moonbeam_sibling.

Asset Hub (para 1000) replaces it as the third chain in the network,
providing genuine cross-runtime coverage instead of a duplicate.

Removed:
- ParaCPara declaration, genesis, relay registration, PARA_C_ID
- CHARLETH test account (unused after ParaC removal)
- transfer_glmr_across_three_chains test (redundant)
- setup_three_chains / register_glmr_foreign_asset helpers

Network: 4 chains → 3 chains (Asset Hub + Moonbeam + Sibling)
Tests: 38 → 37
Port the full xcm_emulator_tests suite to moonriver and moonbase runtimes,
both using westend-runtime as the relay (XCM executor behavior is identical
across relay chains; Kusama runtime is not available in the polkadot-sdk fork).

Each runtime now has 37 emulator tests covering:
- 17 transact tests (sovereign, derivative, signed, HRMP)
- 15 transfer tests (DOT, native token, remote reserve, roundtrip)
- 3 Asset Hub tests (DOT teleport, USDT trust-backed asset)
- 2 versioning tests (relay + sibling discovery)

Runtime-specific adaptations:
- moonriver: MOVR currency, PalletInstance(10)
- moonbase: UNIT currency, PalletInstance(3)

All 3 runtimes × 3 suites pass: 48 config + 37 emulator + 32 integration
Remove the legacy XCM test infrastructure (23,525 lines) across all
three runtimes. This code used xcm-simulator with hand-rolled mock
runtimes and is fully replaced by:

- xcm_config_tests (48 tests): unit tests against real XcmConfig
- xcm_integration_tests (32 tests): xcm-simulator with real runtime
- xcm_emulator_tests (37 tests): xcm-emulator with real relay + parachains

Removed per runtime:
- tests/xcm_mock/ (mod.rs, parachain.rs, relay_chain.rs, statemint_like.rs)
- tests/xcm_tests.rs (~5,400 lines)
…ests

Remove dead code across all 3 runtimes:
- relay_execute_and_dispatch()
- {moonbeam,moonriver,moonbase}_execute_and_dispatch()
- para_ids::ASSET_HUB constant
All runtimes now use xcm-emulator via the per-runtime
`*-xcm-emulator-tests` crates; no workspace member references
xcm-simulator anymore.
Replace `<=` with `<` in the sovereign-spend assertion of
`transact_through_sovereign_*`: the loose comparison passed even when no
DOT was charged at all, masking regressions where fee withdrawal is
silently skipped.
Replace the hardcoded `0..150` with `MaxInstructions::get() + 1` in
`weigher_respects_max_instructions` so the test always exceeds the
configured limit, regardless of future tweaks to `MaxInstructions`.
@manuelmauro

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown
✅ Actions performed

Full review triggered.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

♻️ Duplicate comments (3)
runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transact.rs (3)

727-768: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Track the derivative account in the refund assertion.

setup_derivative() funds the derived sub-account, but this test only compares sovereign balances. If the fee is withdrawn from the derivative and the refund lands on the sovereign, fee_spent can stay 0 and this still passes. Capture the derivative account before/after instead, and make the assertion strict on both bounds (> 0 and < ONE_DOT * 20).

Suggested fix
-	let sovereign_before = WestendRelay::<PolkadotMoonbeamNet>::execute_with(|| {
-		let sovereign = WestendRelay::<PolkadotMoonbeamNet>::sovereign_account_id_of(
-			Location::new(0, [Parachain(MOONBASE_PARA_ID)]),
-		);
-		<westend_runtime::Balances as Inspect<_>>::balance(&sovereign)
-	});
+	let derivative = WestendRelay::<PolkadotMoonbeamNet>::execute_with(|| {
+		let sovereign = WestendRelay::<PolkadotMoonbeamNet>::sovereign_account_id_of(
+			Location::new(0, [Parachain(MOONBASE_PARA_ID)]),
+		);
+		pallet_utility::derivative_account_id(sovereign, 0u16)
+	});
+	let derivative_before = WestendRelay::<PolkadotMoonbeamNet>::execute_with(|| {
+		<westend_runtime::Balances as Inspect<_>>::balance(&derivative)
+	});
...
-	let sovereign_after = WestendRelay::<PolkadotMoonbeamNet>::execute_with(|| {
-		let sovereign = WestendRelay::<PolkadotMoonbeamNet>::sovereign_account_id_of(
-			Location::new(0, [Parachain(MOONBASE_PARA_ID)]),
-		);
-		<westend_runtime::Balances as Inspect<_>>::balance(&sovereign)
-	});
-	let fee_spent = sovereign_before.saturating_sub(sovereign_after);
+	let derivative_after = WestendRelay::<PolkadotMoonbeamNet>::execute_with(|| {
+		<westend_runtime::Balances as Inspect<_>>::balance(&derivative)
+	});
+	let fee_spent = derivative_before.saturating_sub(derivative_after);
 	assert!(
-		fee_spent < ONE_DOT * 20,
-		"With refund, sovereign should spend less than the full fee: spent={fee_spent}"
+		fee_spent > 0 && fee_spent < ONE_DOT * 20,
+		"With refund, derivative should spend less than the full fee: spent={fee_spent}"
 	);
#!/bin/bash
set -euo pipefail

FILE="runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transact.rs"

echo "Comparing the signed refund test with the derivative refund test:"
sed -n '577,625p' "$FILE"
printf '\n----\n'
sed -n '723,770p' "$FILE"

printf '\nSearching for derivative account setup and refund assertions:\n'
rg -n -C3 'derivative_account_id|transact_through_derivative_custom_fee_weight_refund|fee_spent' "$FILE"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transact.rs` around
lines 727 - 768, The test is only comparing the sovereign balance so it can miss
fees taken from the derivative; update the test to track the derivative account
(the one created by setup_derivative()/derived sub-account) by reading its
balance before and after the transact_through_derivative call (use the same
execute_with context as sovereign_account_id_of to fetch the derivative
balance), compute fee_spent on that derivative balance, and replace the current
assertion with two strict checks: fee_spent > 0 and fee_spent < ONE_DOT * 20;
keep the refund flow and existing TransactWeights/parameters and use the same
identifiers (transact_through_derivative, setup_derivative,
sovereign_account_id_of) to locate where to add the before/after balance reads
and new assertions.

1114-1123: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Prove the no-proxy case reached the proxy check.

An unchanged recipient balance is also compatible with the XCM being dropped, rejected by the barrier, or underweighted. Add a sibling-side event assertion that the relevant EthereumXcm execution event was not emitted, so this specifically covers “missing proxy rejects transact_through_proxy”.

#!/bin/bash
set -euo pipefail

TEST_FILE="runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transact.rs"
PALLET_FILE="pallets/ethereum-xcm/src/lib.rs"

echo "Locate the no-proxy test and nearby event assertion patterns:"
sed -n '1057,1124p' "$TEST_FILE"

printf '\n---- ethereum-xcm events / execution markers ----\n'
rg -n -C4 'enum Event|ExecutedFromXcm|Executed|transact_through_proxy' "$PALLET_FILE" "$TEST_FILE"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transact.rs` around
lines 1114 - 1123, The test currently only asserts balances and can’t
distinguish “no proxy” from the XCM being dropped, so after the balance check
add a sibling-side events assertion: inside a sibling_execute_with closure read
moonbase_runtime::System::events (or frame_system::EventRecord) and assert that
no event matches pallet_ethereum_xcm::Event::Executed or
pallet_ethereum_xcm::Event::ExecutedFromXcm (or the concrete enum variant used
by ethereum-xcm) for the given recipient; this proves transact_through_proxy
reached the proxy check and was rejected due to missing proxy rather than being
dropped for other reasons.

482-486: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Make the refund checks enforce some spend.

These assertions only check spent < configured_fee, so they also pass when nothing was charged at all. To keep the refund coverage meaningful, require a strict lower bound too after the success assertion.

Suggested fix
-	assert!(
-		fee_spent < ONE_DOT * 10,
-		"With refund, sovereign should spend less than the full fee: spent={fee_spent}"
-	);
+	assert!(
+		fee_spent > 0 && fee_spent < ONE_DOT * 10,
+		"With refund, sovereign should spend less than the full fee: spent={fee_spent}"
+	);

Apply the same pattern to the other refund assertions in this file.

Also applies to: 620-624, 955-959

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transact.rs` around
lines 482 - 486, The refund assertions only check an upper bound so they pass if
nothing was charged; change them to assert a strict positive spend as well by
requiring fee_spent > 0 in addition to the existing fee_spent < ONE_DOT * 10
check (i.e., assert( fee_spent > 0 && fee_spent < ONE_DOT * 10, ... ) using the
variables fee_spent, sovereign_before, sovereign_after and the ONE_DOT
constant). Apply the same strict-lower-bound pattern to the other refund
assertions in this file (the blocks around the existing checks at the other
noted locations).
🧹 Nitpick comments (4)
runtime/moonbase/tests/xcm_config/origin.rs (1)

75-93: ⚡ Quick win

Add an explicit test for sibling + OriginKind::Native conversion.

The suite documents SiblingParachainAsNative but does not currently assert that path directly. Adding one focused test closes that gap and protects against regressions in origin conversion ordering.

Proposed test addition
+#[test]
+fn origin_converts_sibling_with_native_kind() {
+	ExtBuilder::default().build().execute_with(|| {
+		let sibling = Location::new(1, [Parachain(2000)]);
+
+		let result =
+			<XcmOriginToTransactDispatchOrigin as ConvertOrigin<RuntimeOrigin>>::convert_origin(
+				sibling,
+				OriginKind::Native,
+			);
+
+		assert!(
+			result.is_ok(),
+			"Sibling + Native should convert via SiblingParachainAsNative"
+		);
+	});
+}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/moonbase/tests/xcm_config/origin.rs` around lines 75 - 93, Add a new
unit test mirroring origin_converts_relay_with_native_kind that asserts a
sibling parachain Location converts with OriginKind::Native via
SiblingParachainAsNative: create a test (e.g.,
origin_converts_sibling_with_native_kind) that builds the ExtBuilder, constructs
a sibling parachain Location, calls <XcmOriginToTransactDispatchOrigin as
ConvertOrigin<RuntimeOrigin>>::convert_origin(sibling_location,
OriginKind::Native) and assert result.is_ok(); reference
XcmOriginToTransactDispatchOrigin, ConvertOrigin, and OriginKind::Native so the
test targets the SiblingParachainAsNative conversion path.
runtime/moonbase/tests/xcm_config/reserves.rs (1)

92-113: ⚡ Quick win

Assert final IsReserve rejections on negative paths.

These cases currently validate subfilters only. Add !IsReserve::contains(...) assertions too, so runtime composition regressions are caught.

Suggested test hardening
@@
 fn reserves_rejects_bridged_assets_from_wrong_origin() {
@@
 		assert!(
 			!IsBridgedConcreteAssetFrom::<AssetHubLocation>::contains(
 				&bridged_asset,
 				&wrong_origin
 			),
 			"Bridged assets from wrong origin should be rejected"
 		);
+		assert!(
+			!IsReserve::contains(&bridged_asset, &wrong_origin),
+			"IsReserve should reject bridged assets from wrong origin"
+		);
 	});
 }
@@
 fn reserves_rejects_non_bridged_assets_via_bridged_filter() {
@@
 		assert!(
 			!IsBridgedConcreteAssetFrom::<AssetHubLocation>::contains(
 				&local_asset,
 				&asset_hub_origin
 			),
 			"Non-bridged assets should not match bridged asset filter"
 		);
+		assert!(
+			!IsReserve::contains(&local_asset, &asset_hub_origin),
+			"IsReserve should reject non-bridged assets from Asset Hub in this shape"
+		);
 	});
 }
@@
 fn reserves_rejects_asset_with_mismatched_origin() {
@@
 		assert!(
 			!MultiNativeAsset::<AbsoluteAndRelativeReserve<SelfLocationAbsolute>>::contains(
 				&asset,
 				&wrong_origin
 			),
 			"Asset from mismatched origin should be rejected"
 		);
+		assert!(
+			!IsReserve::contains(&asset, &wrong_origin),
+			"IsReserve should reject asset when origin does not match reserve"
+		);
 	});
 }

Also applies to: 116-134, 202-223

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/moonbase/tests/xcm_config/reserves.rs` around lines 92 - 113, The
test reserves_rejects_bridged_assets_from_wrong_origin currently only asserts
the IsBridgedConcreteAssetFrom::<AssetHubLocation>::contains negative path; add
an assertion that the runtime-level reserve check also rejects the asset by
asserting !IsReserve::contains(&bridged_asset, &wrong_origin) (and similarly
update the other referenced tests at the indicated ranges) so both the subfilter
(IsBridgedConcreteAssetFrom) and the composed runtime guard (IsReserve) are
validated; locate and update the tests named
reserves_rejects_bridged_assets_from_wrong_origin and the other two tests around
lines 116-134 and 202-223 to include the additional !IsReserve::contains
assertions referencing IsReserve and
IsBridgedConcreteAssetFrom::<AssetHubLocation>.
runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/asset_hub.rs (1)

216-223: ⚡ Quick win

Stop hard-coding Asset Hub’s pallet_assets instance.

PalletInstance(50) is part of the cross-chain asset identity here. If Asset Hub’s pallet ordering changes, these tests will silently point at the wrong reserve location. Please derive the value once from the runtime pallet metadata and reuse that constant in both the registration and transfer paths.

Also applies to: 270-287, 351-358, 400-417

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/asset_hub.rs` around
lines 216 - 223, The test hard-codes PalletInstance(50) when constructing
usdt_location which ties the XCM reserve to Asset Hub’s pallet_assets instance;
instead derive the pallet instance index from the runtime pallet metadata once
(e.g., read pallet instance for pallet_assets into a constant like
ASSET_HUB_PALLET_ASSETS_INSTANCE) and reuse that constant in all places that
build the XCM Location (locations around usdt_location and the
registration/transfer paths referenced). Update usages in functions/variables
such as usdt_location and any registration/transfer builders to use the derived
ASSET_HUB_PALLET_ASSETS_INSTANCE rather than PalletInstance(50), so tests remain
correct if pallet ordering changes.
runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transfers.rs (1)

656-661: ⚡ Quick win

Derive the Balances pallet instance instead of repeating PalletInstance(3).

These GLMR paths all bake Moonbase’s pallet_balances index into the asset location. If the runtime order changes, the suite will keep compiling but start exercising the wrong asset ID in several places at once. Please compute the pallet index from the runtime once and reuse that constant throughout this file.

Also applies to: 715-716, 781-782, 805-805, 865-866, 1188-1189, 1220-1221, 1255-1257

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transfers.rs` around
lines 656 - 661, Define a single source of truth for the Balances pallet
instance and use it everywhere instead of hardcoding PalletInstance(3u8): add a
helper constant or function (e.g. BALANCES_PALLET_INSTANCE or
balances_pallet_instance()) that derives the pallet index from the runtime
pallet info (use frame_support::PalletInfo::index::<pallet_balances::Pallet>()
or the equivalent runtime API) and replace every occurrence of
PalletInstance(3u8) in functions like register_unit_on_sibling and the other
noted locations with PalletInstance(BALANCES_PALLET_INSTANCE) so tests follow
runtime ordering changes automatically.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build.yml:
- Around line 621-626: The job's if condition currently only checks event and
self_hosted_allowed but lacks the standard heavy-job guard; update the existing
if expression (the block starting with "github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request'
&& contains(... 'XCM'))") to also require the any_changed flag by adding "&&
needs.set-tags.outputs.any_changed == 'true'" (combine with the existing "&&
needs.set-tags.outputs.self_hosted_allowed == 'true'") so the heavy suite only
runs when code changes are detected.

In `@Cargo.toml`:
- Around line 43-47: The workspace currently lists emulator crates
("runtime/moonbase/xcm-emulator-tests", "runtime/moonbeam/xcm-emulator-tests",
"runtime/moonriver/xcm-emulator-tests") as members so `cargo test --workspace`
builds/runs them; remove them from the default test graph by either removing
those three member entries from the workspace.members list or add a
workspace.exclude entry that contains those three paths so they are not included
in the default workspace test run (leave the non-emulator runtime entries
intact).

In `@runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/network.rs`:
- Around line 288-325: The test currently asserts only pallet indices (staking,
utility, hrmp) but hard-codes per-call indices (bond, bond_extra, unbond, etc.)
which can drift independently; update the test to derive or assert the call
indices from the Westend runtime instead of trusting hard-coded values: compute
each relay call index from the westend_runtime call metadata for the staking,
utility and hrmp pallets (e.g. derive bond, bond_extra, unbond,
withdraw_unbonded, validate, nominate, chill, set_payee, set_controller, rebond,
as_derivative, init_open_channel, accept_open_channel, close_channel,
cancel_open_request) and assert they match the values placed into
RelayChainIndices before calling
pallet_xcm_transactor::RelayIndices::<moonbase_runtime::Runtime>::put(indices)
so tests fail fast if any call variant ordering changes.

In `@runtime/moonriver/tests/xcm_config/transactors.rs`:
- Around line 320-325: The test currently ignores the return value from
<AssetTransactors as TransactAsset>::deposit_asset(&asset, &destination, None)
which masks regressions; replace the no-op with an assertion that checks the
expected outcome for the fake/unregistered contract path (e.g. assert that
result is an Err variant or a specific Err value), referencing the result
variable and the AssetTransactors::deposit_asset call so the test fails if the
transactor unexpectedly succeeds.

---

Duplicate comments:
In `@runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transact.rs`:
- Around line 727-768: The test is only comparing the sovereign balance so it
can miss fees taken from the derivative; update the test to track the derivative
account (the one created by setup_derivative()/derived sub-account) by reading
its balance before and after the transact_through_derivative call (use the same
execute_with context as sovereign_account_id_of to fetch the derivative
balance), compute fee_spent on that derivative balance, and replace the current
assertion with two strict checks: fee_spent > 0 and fee_spent < ONE_DOT * 20;
keep the refund flow and existing TransactWeights/parameters and use the same
identifiers (transact_through_derivative, setup_derivative,
sovereign_account_id_of) to locate where to add the before/after balance reads
and new assertions.
- Around line 1114-1123: The test currently only asserts balances and can’t
distinguish “no proxy” from the XCM being dropped, so after the balance check
add a sibling-side events assertion: inside a sibling_execute_with closure read
moonbase_runtime::System::events (or frame_system::EventRecord) and assert that
no event matches pallet_ethereum_xcm::Event::Executed or
pallet_ethereum_xcm::Event::ExecutedFromXcm (or the concrete enum variant used
by ethereum-xcm) for the given recipient; this proves transact_through_proxy
reached the proxy check and was rejected due to missing proxy rather than being
dropped for other reasons.
- Around line 482-486: The refund assertions only check an upper bound so they
pass if nothing was charged; change them to assert a strict positive spend as
well by requiring fee_spent > 0 in addition to the existing fee_spent < ONE_DOT
* 10 check (i.e., assert( fee_spent > 0 && fee_spent < ONE_DOT * 10, ... ) using
the variables fee_spent, sovereign_before, sovereign_after and the ONE_DOT
constant). Apply the same strict-lower-bound pattern to the other refund
assertions in this file (the blocks around the existing checks at the other
noted locations).

---

Nitpick comments:
In `@runtime/moonbase/tests/xcm_config/origin.rs`:
- Around line 75-93: Add a new unit test mirroring
origin_converts_relay_with_native_kind that asserts a sibling parachain Location
converts with OriginKind::Native via SiblingParachainAsNative: create a test
(e.g., origin_converts_sibling_with_native_kind) that builds the ExtBuilder,
constructs a sibling parachain Location, calls
<XcmOriginToTransactDispatchOrigin as
ConvertOrigin<RuntimeOrigin>>::convert_origin(sibling_location,
OriginKind::Native) and assert result.is_ok(); reference
XcmOriginToTransactDispatchOrigin, ConvertOrigin, and OriginKind::Native so the
test targets the SiblingParachainAsNative conversion path.

In `@runtime/moonbase/tests/xcm_config/reserves.rs`:
- Around line 92-113: The test reserves_rejects_bridged_assets_from_wrong_origin
currently only asserts the
IsBridgedConcreteAssetFrom::<AssetHubLocation>::contains negative path; add an
assertion that the runtime-level reserve check also rejects the asset by
asserting !IsReserve::contains(&bridged_asset, &wrong_origin) (and similarly
update the other referenced tests at the indicated ranges) so both the subfilter
(IsBridgedConcreteAssetFrom) and the composed runtime guard (IsReserve) are
validated; locate and update the tests named
reserves_rejects_bridged_assets_from_wrong_origin and the other two tests around
lines 116-134 and 202-223 to include the additional !IsReserve::contains
assertions referencing IsReserve and
IsBridgedConcreteAssetFrom::<AssetHubLocation>.

In `@runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/asset_hub.rs`:
- Around line 216-223: The test hard-codes PalletInstance(50) when constructing
usdt_location which ties the XCM reserve to Asset Hub’s pallet_assets instance;
instead derive the pallet instance index from the runtime pallet metadata once
(e.g., read pallet instance for pallet_assets into a constant like
ASSET_HUB_PALLET_ASSETS_INSTANCE) and reuse that constant in all places that
build the XCM Location (locations around usdt_location and the
registration/transfer paths referenced). Update usages in functions/variables
such as usdt_location and any registration/transfer builders to use the derived
ASSET_HUB_PALLET_ASSETS_INSTANCE rather than PalletInstance(50), so tests remain
correct if pallet ordering changes.

In `@runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transfers.rs`:
- Around line 656-661: Define a single source of truth for the Balances pallet
instance and use it everywhere instead of hardcoding PalletInstance(3u8): add a
helper constant or function (e.g. BALANCES_PALLET_INSTANCE or
balances_pallet_instance()) that derives the pallet index from the runtime
pallet info (use frame_support::PalletInfo::index::<pallet_balances::Pallet>()
or the equivalent runtime API) and replace every occurrence of
PalletInstance(3u8) in functions like register_unit_on_sibling and the other
noted locations with PalletInstance(BALANCES_PALLET_INSTANCE) so tests follow
runtime ordering changes automatically.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 39419125-9ac0-4138-bd2e-c8c19e147105

📥 Commits

Reviewing files that changed from the base of the PR and between 8887a46 and 7f386ec.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (85)
  • .github/workflows/build.yml
  • Cargo.toml
  • docs/cherry-picks/polkadot-sdk-stable2512.md
  • node/cli/Cargo.toml
  • pallets/xcm-transactor/Cargo.toml
  • pallets/xcm-weight-trader/Cargo.toml
  • precompiles/gmp/Cargo.toml
  • precompiles/relay-encoder/Cargo.toml
  • precompiles/xcm-transactor/Cargo.toml
  • precompiles/xtokens/Cargo.toml
  • primitives/tests-primitives/Cargo.toml
  • runtime/common/Cargo.toml
  • runtime/moonbase/Cargo.toml
  • runtime/moonbase/tests/xcm_config/barriers.rs
  • runtime/moonbase/tests/xcm_config/location.rs
  • runtime/moonbase/tests/xcm_config/main.rs
  • runtime/moonbase/tests/xcm_config/origin.rs
  • runtime/moonbase/tests/xcm_config/reserves.rs
  • runtime/moonbase/tests/xcm_config/traders.rs
  • runtime/moonbase/tests/xcm_config/transactors.rs
  • runtime/moonbase/tests/xcm_config/weigher.rs
  • runtime/moonbase/tests/xcm_config/xcm_common.rs
  • runtime/moonbase/tests/xcm_mock/mod.rs
  • runtime/moonbase/tests/xcm_mock/parachain.rs
  • runtime/moonbase/tests/xcm_mock/relay_chain.rs
  • runtime/moonbase/tests/xcm_mock/statemint_like.rs
  • runtime/moonbase/tests/xcm_tests.rs
  • runtime/moonbase/xcm-emulator-tests/Cargo.toml
  • runtime/moonbase/xcm-emulator-tests/src/lib.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/asset_hub.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/main.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/network.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/relay.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transact.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transfers.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/versioning.rs
  • runtime/moonbeam/Cargo.toml
  • runtime/moonbeam/tests/xcm_config/barriers.rs
  • runtime/moonbeam/tests/xcm_config/location.rs
  • runtime/moonbeam/tests/xcm_config/main.rs
  • runtime/moonbeam/tests/xcm_config/origin.rs
  • runtime/moonbeam/tests/xcm_config/reserves.rs
  • runtime/moonbeam/tests/xcm_config/traders.rs
  • runtime/moonbeam/tests/xcm_config/transactors.rs
  • runtime/moonbeam/tests/xcm_config/weigher.rs
  • runtime/moonbeam/tests/xcm_config/xcm_common.rs
  • runtime/moonbeam/tests/xcm_mock/mod.rs
  • runtime/moonbeam/tests/xcm_mock/parachain.rs
  • runtime/moonbeam/tests/xcm_mock/relay_chain.rs
  • runtime/moonbeam/tests/xcm_mock/statemint_like.rs
  • runtime/moonbeam/tests/xcm_tests.rs
  • runtime/moonbeam/xcm-emulator-tests/Cargo.toml
  • runtime/moonbeam/xcm-emulator-tests/src/lib.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/asset_hub.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/main.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/network.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/relay.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/transact.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/transfers.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/versioning.rs
  • runtime/moonriver/Cargo.toml
  • runtime/moonriver/tests/xcm_config/barriers.rs
  • runtime/moonriver/tests/xcm_config/location.rs
  • runtime/moonriver/tests/xcm_config/main.rs
  • runtime/moonriver/tests/xcm_config/origin.rs
  • runtime/moonriver/tests/xcm_config/reserves.rs
  • runtime/moonriver/tests/xcm_config/traders.rs
  • runtime/moonriver/tests/xcm_config/transactors.rs
  • runtime/moonriver/tests/xcm_config/weigher.rs
  • runtime/moonriver/tests/xcm_config/xcm_common.rs
  • runtime/moonriver/tests/xcm_mock/mod.rs
  • runtime/moonriver/tests/xcm_mock/parachain.rs
  • runtime/moonriver/tests/xcm_mock/relay_chain.rs
  • runtime/moonriver/tests/xcm_mock/statemine_like.rs
  • runtime/moonriver/tests/xcm_tests.rs
  • runtime/moonriver/xcm-emulator-tests/Cargo.toml
  • runtime/moonriver/xcm-emulator-tests/src/lib.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/asset_hub.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/main.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/network.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/relay.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/transact.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/transfers.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/versioning.rs
  • scripts/verify-licenses.sh
💤 Files with no reviewable changes (9)
  • runtime/moonbase/tests/xcm_mock/statemint_like.rs
  • runtime/moonbeam/tests/xcm_mock/relay_chain.rs
  • runtime/moonbeam/tests/xcm_mock/parachain.rs
  • runtime/moonbase/tests/xcm_mock/parachain.rs
  • runtime/moonbeam/tests/xcm_mock/mod.rs
  • runtime/moonbase/tests/xcm_mock/relay_chain.rs
  • runtime/moonbeam/tests/xcm_mock/statemint_like.rs
  • runtime/moonbase/tests/xcm_mock/mod.rs
  • runtime/moonriver/tests/xcm_mock/mod.rs

Comment thread .github/workflows/build.yml Outdated
Comment thread Cargo.toml
Comment thread runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/network.rs
Comment thread runtime/moonriver/tests/xcm_config/transactors.rs
…ulator crates from rust-test

The xcm-emulator-test job lacked the standard any_changed guard, so it
could run on non-code changes. The rust-test job's cargo test --workspace
also built and re-ran the xcm-emulator-tests crates, duplicating the
dedicated job's work and pulling the heavy Westend graph onto the default
test path.

- Add needs.set-tags.outputs.any_changed == 'true' to xcm-emulator-test.
- Exclude the three xcm-emulator-tests crates from rust-test's
  cargo test --workspace; they keep their workspace membership so the
  dedicated job can still address them with -p.
… context

transactor_handles_erc20_bridge_asset discarded the deposit_asset result
with let _ = result, so a regression on this path would not be caught.
Erc20XcmBridge::deposit_asset requires an XCM holding context to resolve
token origins; a direct call has none and returns an error, so assert
result.is_err() instead.
@manuelmauro

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
✅ Actions performed

Full review triggered.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (3)
runtime/moonbeam/tests/xcm_config/reserves.rs (1)

93-113: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Assert the runtime-wired IsReserve negatives too.

These cases only prove the helper predicates reject the pair. A tuple regression in XcmExecutorConfig::IsReserve can still make the runtime accept them through another branch while these tests stay green. Add assert!(!IsReserve::contains(...)) alongside each negative helper assertion.

Also applies to: 117-134, 203-223

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/moonbeam/tests/xcm_config/reserves.rs` around lines 93 - 113, The
test reserves_rejects_bridged_assets_from_wrong_origin only asserts the helper
predicate IsBridgedConcreteAssetFrom::<AssetHubLocation>::contains returns
false; add a parallel negative assertion against the runtime-wired IsReserve
predicate to ensure the runtime config also rejects the pair by calling
assert!(!IsReserve::contains(&bridged_asset, &wrong_origin)) inside the same
test; do the same pattern for the other two failing cases mentioned (the tests
around the other negative helper assertions that use IsBridgedConcreteAssetFrom
or similar helpers) by adding assert!(!IsReserve::contains(...)) with the same
asset and origin variables used in each test.
runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transact.rs (1)

727-769: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Also track the derivative account in the refund case.

This reintroduces the earlier false-positive pattern: setup_derivative() funds the relay-side derivative account, but this test only snapshots the sovereign. If the derivative pays the fee and refunding is broken or misrouted, the current assertion still passes. Capture the derivative balance before/after as well and assert it actually changes on execution; keep the sovereign check only if SelfLocation is intentionally the refund target.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transact.rs` around
lines 727 - 769, The test currently only snapshots the sovereign balance (using
WestendRelay::sovereign_account_id_of and
WestendRelay::<PolkadotMoonbeamNet>::execute_with) but setup_derivative() funds
a relay-side derivative account and XcmTransactor::transact_through_derivative
may withdraw from that derivative; capture the derivative account balance (the
derivative account created by setup_derivative()/the code path that computes the
derivative AccountId) before and after the moonbase_execute_with invocation and
assert that the derivative balance decreases (or is refunded appropriately) in
addition to your existing sovereign assertions; if the intended refund target is
SelfLocation make that explicit in the assertion logic (i.e., keep the
sovereign_before/after check only when refund target == SelfLocation), otherwise
assert the sovereign did not change and the derivative did.
runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/transact.rs (1)

727-769: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Also track the derivative account in the refund case.

This reintroduces the earlier false-positive pattern: setup_derivative() funds the relay-side derivative account, but this test only snapshots the sovereign. If the derivative pays the fee and refunding is broken or misrouted, the current assertion still passes. Capture the derivative balance before/after as well and assert it actually changes on execution; keep the sovereign check only if SelfLocation is intentionally the refund target.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/transact.rs` around
lines 727 - 769, The test only snapshots the sovereign but not the relay-side
derivative funded by setup_derivative(), so capture the derivative account
balance before and after the Transact through
moonbeam_runtime::XcmTransactor::transact_through_derivative and assert it
changes; specifically, after calling setup_derivative() obtain the derivative
account id (the value returned by or stored by setup_derivative()), snapshot its
balance using WestendRelay::<PolkadotMoonbeamNet>::execute_with and
<westend_runtime::Balances as Inspect<_>>::balance(&derivative_account) before
the transact, execute
moonbeam_runtime::XcmTransactor::transact_through_derivative as currently done,
then snapshot the derivative balance again and assert the derivative balance
decreased (or changed) appropriately; keep the existing
sovereign_before/sovereign_after checks only if SelfLocation is intended as the
refund target.
🧹 Nitpick comments (2)
runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/versioning.rs (1)

65-66: ⚡ Quick win

Strengthen discovery checks with a pre-interaction baseline.

Both tests validate query_delivery_fees only after traffic is sent. Add a pre-interaction assertion and verify the state changes after interaction, so the test proves discovery/negotiation rather than a preconfigured fallback path.

Also applies to: 139-140

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/versioning.rs` around
lines 65 - 66, Add a pre-interaction baseline assertion for query_delivery_fees
in the test function xcm_version_discovery_with_relay (and the analogous test
around lines 139-140) to prove discovery occurs: after init_network(), call the
same query_delivery_fees helper to capture the initial state and assert it
matches an expected "unknown" or default value, then perform the
traffic/interaction steps already present, re-query query_delivery_fees and
assert that the returned fees/state have changed to the negotiated values;
update assertions to explicitly compare before vs after so the test fails if the
post-state was already populated prior to interaction.
runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/network.rs (1)

288-325: ⚡ Quick win

Validate relay call indices too, not just pallet indices.

This helper is meant to fail fast on Westend metadata drift, but only the pallet indices are checked. If a Staking/Utility/HRMP call index moves, RelayIndices will encode the wrong relay call and the emulator failures become much harder to interpret. Add a few encode-time assertions for the configured call indices before storing them.

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build.yml:
- Around line 647-652: Replace the floating action tags in the xcm-emulator-test
job with immutable commit SHAs and disable credential persistence: update the
Checkout step that uses actions/checkout@v6 to
actions/checkout@<full-commit-sha> and add persist-credentials: false to that
step, and replace mozilla-actions/sccache-action@v0.0.10 with
mozilla-actions/sccache-action@<full-commit-sha>; ensure the changes target the
steps named "Checkout" and "Run sccache-cache" so the job uses pinned refs and
the checkout does not leave git credentials for later steps.

In `@runtime/moonbeam/tests/xcm_config/origin.rs`:
- Around line 45-53: The test only asserts that
XcmOriginToTransactDispatchOrigin::convert_origin(relay,
OriginKind::SovereignAccount) returns Ok; update the test to assert the concrete
RuntimeOrigin returned (e.g., expect a specific Dispatch Origin variant/value)
instead of only is_ok(), by unwrapping or matching the Result and comparing it
to the expected RuntimeOrigin variant; apply the same tightening to the other
conversion tests that call convert_origin (the cases at lines around the other
assertions) so each asserts equality to the exact expected RuntimeOrigin value
rather than just Ok.

In `@runtime/moonbeam/tests/xcm_config/transactors.rs`:
- Around line 352-369: The test currently only checks that <AssetTransactors as
TransactAsset>::withdraw_asset(&asset, &relay_location, None) returns Ok; update
it to capture the sovereign account balance via
Balances::free_balance(sovereign_account) before calling withdraw_asset and
again after, then assert the balance decreased by ONE_GLMR (i.e. before - after
== ONE_GLMR). Keep the existing deposit via
Balances::deposit_creating(&sovereign_account, ONE_GLMR * 10) and reuse
LocationToAccountId::convert_location, sovereign_account, and asset identifiers
so the assertion verifies the actual funds change rather than just the Ok
result.

---

Duplicate comments:
In `@runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transact.rs`:
- Around line 727-769: The test currently only snapshots the sovereign balance
(using WestendRelay::sovereign_account_id_of and
WestendRelay::<PolkadotMoonbeamNet>::execute_with) but setup_derivative() funds
a relay-side derivative account and XcmTransactor::transact_through_derivative
may withdraw from that derivative; capture the derivative account balance (the
derivative account created by setup_derivative()/the code path that computes the
derivative AccountId) before and after the moonbase_execute_with invocation and
assert that the derivative balance decreases (or is refunded appropriately) in
addition to your existing sovereign assertions; if the intended refund target is
SelfLocation make that explicit in the assertion logic (i.e., keep the
sovereign_before/after check only when refund target == SelfLocation), otherwise
assert the sovereign did not change and the derivative did.

In `@runtime/moonbeam/tests/xcm_config/reserves.rs`:
- Around line 93-113: The test reserves_rejects_bridged_assets_from_wrong_origin
only asserts the helper predicate
IsBridgedConcreteAssetFrom::<AssetHubLocation>::contains returns false; add a
parallel negative assertion against the runtime-wired IsReserve predicate to
ensure the runtime config also rejects the pair by calling
assert!(!IsReserve::contains(&bridged_asset, &wrong_origin)) inside the same
test; do the same pattern for the other two failing cases mentioned (the tests
around the other negative helper assertions that use IsBridgedConcreteAssetFrom
or similar helpers) by adding assert!(!IsReserve::contains(...)) with the same
asset and origin variables used in each test.

In `@runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/transact.rs`:
- Around line 727-769: The test only snapshots the sovereign but not the
relay-side derivative funded by setup_derivative(), so capture the derivative
account balance before and after the Transact through
moonbeam_runtime::XcmTransactor::transact_through_derivative and assert it
changes; specifically, after calling setup_derivative() obtain the derivative
account id (the value returned by or stored by setup_derivative()), snapshot its
balance using WestendRelay::<PolkadotMoonbeamNet>::execute_with and
<westend_runtime::Balances as Inspect<_>>::balance(&derivative_account) before
the transact, execute
moonbeam_runtime::XcmTransactor::transact_through_derivative as currently done,
then snapshot the derivative balance again and assert the derivative balance
decreased (or changed) appropriately; keep the existing
sovereign_before/sovereign_after checks only if SelfLocation is intended as the
refund target.

---

Nitpick comments:
In `@runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/versioning.rs`:
- Around line 65-66: Add a pre-interaction baseline assertion for
query_delivery_fees in the test function xcm_version_discovery_with_relay (and
the analogous test around lines 139-140) to prove discovery occurs: after
init_network(), call the same query_delivery_fees helper to capture the initial
state and assert it matches an expected "unknown" or default value, then perform
the traffic/interaction steps already present, re-query query_delivery_fees and
assert that the returned fees/state have changed to the negotiated values;
update assertions to explicitly compare before vs after so the test fails if the
post-state was already populated prior to interaction.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 844a23e0-4b7b-45fd-a096-9030c0bcf7c5

📥 Commits

Reviewing files that changed from the base of the PR and between 67f50e3 and a979682.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (85)
  • .github/workflows/build.yml
  • Cargo.toml
  • docs/cherry-picks/polkadot-sdk-stable2512.md
  • node/cli/Cargo.toml
  • pallets/xcm-transactor/Cargo.toml
  • pallets/xcm-weight-trader/Cargo.toml
  • precompiles/gmp/Cargo.toml
  • precompiles/relay-encoder/Cargo.toml
  • precompiles/xcm-transactor/Cargo.toml
  • precompiles/xtokens/Cargo.toml
  • primitives/tests-primitives/Cargo.toml
  • runtime/common/Cargo.toml
  • runtime/moonbase/Cargo.toml
  • runtime/moonbase/tests/xcm_config/barriers.rs
  • runtime/moonbase/tests/xcm_config/location.rs
  • runtime/moonbase/tests/xcm_config/main.rs
  • runtime/moonbase/tests/xcm_config/origin.rs
  • runtime/moonbase/tests/xcm_config/reserves.rs
  • runtime/moonbase/tests/xcm_config/traders.rs
  • runtime/moonbase/tests/xcm_config/transactors.rs
  • runtime/moonbase/tests/xcm_config/weigher.rs
  • runtime/moonbase/tests/xcm_config/xcm_common.rs
  • runtime/moonbase/tests/xcm_mock/mod.rs
  • runtime/moonbase/tests/xcm_mock/parachain.rs
  • runtime/moonbase/tests/xcm_mock/relay_chain.rs
  • runtime/moonbase/tests/xcm_mock/statemint_like.rs
  • runtime/moonbase/tests/xcm_tests.rs
  • runtime/moonbase/xcm-emulator-tests/Cargo.toml
  • runtime/moonbase/xcm-emulator-tests/src/lib.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/asset_hub.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/main.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/network.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/relay.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transact.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transfers.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/versioning.rs
  • runtime/moonbeam/Cargo.toml
  • runtime/moonbeam/tests/xcm_config/barriers.rs
  • runtime/moonbeam/tests/xcm_config/location.rs
  • runtime/moonbeam/tests/xcm_config/main.rs
  • runtime/moonbeam/tests/xcm_config/origin.rs
  • runtime/moonbeam/tests/xcm_config/reserves.rs
  • runtime/moonbeam/tests/xcm_config/traders.rs
  • runtime/moonbeam/tests/xcm_config/transactors.rs
  • runtime/moonbeam/tests/xcm_config/weigher.rs
  • runtime/moonbeam/tests/xcm_config/xcm_common.rs
  • runtime/moonbeam/tests/xcm_mock/mod.rs
  • runtime/moonbeam/tests/xcm_mock/parachain.rs
  • runtime/moonbeam/tests/xcm_mock/relay_chain.rs
  • runtime/moonbeam/tests/xcm_mock/statemint_like.rs
  • runtime/moonbeam/tests/xcm_tests.rs
  • runtime/moonbeam/xcm-emulator-tests/Cargo.toml
  • runtime/moonbeam/xcm-emulator-tests/src/lib.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/asset_hub.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/main.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/network.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/relay.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/transact.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/transfers.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/versioning.rs
  • runtime/moonriver/Cargo.toml
  • runtime/moonriver/tests/xcm_config/barriers.rs
  • runtime/moonriver/tests/xcm_config/location.rs
  • runtime/moonriver/tests/xcm_config/main.rs
  • runtime/moonriver/tests/xcm_config/origin.rs
  • runtime/moonriver/tests/xcm_config/reserves.rs
  • runtime/moonriver/tests/xcm_config/traders.rs
  • runtime/moonriver/tests/xcm_config/transactors.rs
  • runtime/moonriver/tests/xcm_config/weigher.rs
  • runtime/moonriver/tests/xcm_config/xcm_common.rs
  • runtime/moonriver/tests/xcm_mock/mod.rs
  • runtime/moonriver/tests/xcm_mock/parachain.rs
  • runtime/moonriver/tests/xcm_mock/relay_chain.rs
  • runtime/moonriver/tests/xcm_mock/statemine_like.rs
  • runtime/moonriver/tests/xcm_tests.rs
  • runtime/moonriver/xcm-emulator-tests/Cargo.toml
  • runtime/moonriver/xcm-emulator-tests/src/lib.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/asset_hub.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/main.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/network.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/relay.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/transact.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/transfers.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/versioning.rs
  • scripts/verify-licenses.sh
💤 Files with no reviewable changes (9)
  • runtime/moonriver/tests/xcm_mock/mod.rs
  • runtime/moonbeam/tests/xcm_mock/relay_chain.rs
  • runtime/moonbeam/tests/xcm_mock/statemint_like.rs
  • runtime/moonbeam/tests/xcm_mock/mod.rs
  • runtime/moonbase/tests/xcm_mock/relay_chain.rs
  • runtime/moonbase/tests/xcm_mock/statemint_like.rs
  • runtime/moonbase/tests/xcm_mock/parachain.rs
  • runtime/moonbeam/tests/xcm_mock/parachain.rs
  • runtime/moonbase/tests/xcm_mock/mod.rs

Comment thread .github/workflows/build.yml Outdated
Comment thread runtime/moonbeam/tests/xcm_config/origin.rs
Comment thread runtime/moonbeam/tests/xcm_config/transactors.rs
The Blacksmith migration on master renamed the set-tags 'self_hosted_allowed'
output to 'blacksmith_allowed' and dropped the 'bare-metal' runner label. The
xcm-emulator-test job predates that migration, so after merging master its
gating condition could never be true and its runner label no longer exists.
Align it with the other heavy jobs (blacksmith-16vcpu-ubuntu-2404).
- Pin mozilla-actions/sccache-action to its commit SHA (1583d6b, = v0.0.10),
  matching the other two sccache-action steps in this workflow.
- Gate the job on rust_changed instead of any_changed so it skips PRs that
  touch no Rust-relevant files, per review feedback.
- origin.rs: assert the exact RuntimeOrigin each conversion yields (sovereign
  Signed account, cumulus Relay origin, pallet_xcm Xcm origin, key20 Signed)
  instead of only is_ok().
- transactors.rs: assert withdraw_asset debits exactly ONE_GLMR from the relay
  sovereign account instead of only Ok.
@manuelmauro

Copy link
Copy Markdown
Contributor Author

@librelois on the CI gating — the workflow now matches the shape you described, not the 3-way matrix.

A single dedicated xcm-emulator-test job compiles the heavy Westend + Asset Hub Westend graph once and runs all three runtimes' emulator tests together (no per-runtime parallel rebuild). It's gated so it stays off the default critical path:

  • opt-in on PRs via the XCM label (plus push to master/perm-* and workflow_dispatch), and
  • conditional on rust_changed (c880ba8) — the same changed-files signal the other Rust jobs use (.rs, Cargo.toml, Cargo.lock, …), so docs/TS-only PRs skip it.

So the default rust-test path keeps its ~15 min and the emulator graph is only paid when Rust actually changes and XCM review is requested.

Mirror the cargo-clippy/rust-test pattern: add the cheap checks
(check-cargo-toml-format, check-forbid-evm-reentrancy, check-rust-fmt) to the
job's needs and require their success in the if (with always()), so the heavy
blacksmith-16vcpu runner isn't consumed when a formatting or repo-rule check
would fail the PR anyway.
The moonriver emulator tests were copied from the moonbeam ones and still called
the native token GLMR in comments, assertion messages and the sibling asset
symbol. Rename those to MOVR/sMOVR, and fix asset_hub.rs's header and module doc
to say Moonriver. Comments/strings only; no behaviour change.
@librelois

Copy link
Copy Markdown
Collaborator

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
✅ Actions performed

Full review triggered.

Comment thread .github/workflows/build.yml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/versioning.rs (1)

105-134: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Version discovery tests still don’t assert learned remote version state.

These checks only assert fee-query success, which can still pass via version fallback paths. Please assert the remote SupportedVersion/notifier state after the transfer/HRMP interaction so the tests prove discovery happened, not just successful wrapping.

Also applies to: 178-206

🧹 Nitpick comments (2)
runtime/moonriver/tests/xcm_config/origin.rs (1)

37-153: ⚡ Quick win

Assert concrete converted origins, not only is_ok() / is_err().

These tests can still pass when the conversion returns the wrong successful origin variant. Please assert the expected RuntimeOrigin shape for each mapping to catch routing regressions earlier.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/moonriver/tests/xcm_config/origin.rs` around lines 37 - 153, Replace
the loose is_ok()/is_err() assertions in the tests that call
<XcmOriginToTransactDispatchOrigin as
ConvertOrigin<RuntimeOrigin>>::convert_origin(...) with concrete checks of the
returned RuntimeOrigin shape: for each test (e.g.,
origin_converts_relay_with_sovereign_kind,
origin_converts_sibling_with_sovereign_kind,
origin_converts_relay_with_native_kind, origin_converts_relay_with_xcm_kind,
origin_converts_account_key20_with_native_kind, origin_rejects_superuser_kind)
pattern-match the Result and assert the exact Ok(RuntimeOrigin::...) variant (or
Err(...) for Superuser) expected from the corresponding converter
(SovereignSignedViaLocation -> Signed using relay sovereign account,
RelayChainAsNative -> relay chain native origin, XcmPassthrough -> pallet_xcm
origin, SignedAccountKey20AsNative -> Signed with ALICE key20); update
assertions to compare the concrete RuntimeOrigin value rather than only calling
is_ok()/is_err().
runtime/moonbase/tests/xcm_config/reserves.rs (1)

36-47: ⚡ Quick win

Avoid hardcoding the Asset Hub para id in this test.

Use AssetHubLocation::get() here too, so the assertion stays aligned with runtime config and won’t go stale if the para id changes.

💡 Proposed fix
-const ASSET_HUB_PARA_ID: u32 = 1001;
-
 #[test]
 fn reserves_accepts_dot_from_asset_hub() {
 	ExtBuilder::default().build().execute_with(|| {
@@
-		let asset_hub_origin = Location::new(1, [Parachain(ASSET_HUB_PARA_ID)]);
+		let asset_hub_origin = AssetHubLocation::get();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/moonbase/tests/xcm_config/reserves.rs` around lines 36 - 47, The test
reserves_accepts_dot_from_asset_hub currently hardcodes ASSET_HUB_PARA_ID;
replace usage in that test so it queries the configured parachain id via
AssetHubLocation::get() instead of the ASSET_HUB_PARA_ID constant, e.g. obtain
the para id from AssetHubLocation::get() and use it when constructing
asset_hub_origin (and remove or stop referencing the ASSET_HUB_PARA_ID constant
in this test) so the assertion follows the runtime config.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build.yml:
- Around line 453-515: The xcm-emulator-test job lacks an explicit timeout and
can stall CI; add a timeout-minutes entry to the job definition
(xcm-emulator-test) to cap run time (e.g., timeout-minutes: 120 or another
agreed value) so the job will be automatically cancelled after the configured
duration.

---

Nitpick comments:
In `@runtime/moonbase/tests/xcm_config/reserves.rs`:
- Around line 36-47: The test reserves_accepts_dot_from_asset_hub currently
hardcodes ASSET_HUB_PARA_ID; replace usage in that test so it queries the
configured parachain id via AssetHubLocation::get() instead of the
ASSET_HUB_PARA_ID constant, e.g. obtain the para id from AssetHubLocation::get()
and use it when constructing asset_hub_origin (and remove or stop referencing
the ASSET_HUB_PARA_ID constant in this test) so the assertion follows the
runtime config.

In `@runtime/moonriver/tests/xcm_config/origin.rs`:
- Around line 37-153: Replace the loose is_ok()/is_err() assertions in the tests
that call <XcmOriginToTransactDispatchOrigin as
ConvertOrigin<RuntimeOrigin>>::convert_origin(...) with concrete checks of the
returned RuntimeOrigin shape: for each test (e.g.,
origin_converts_relay_with_sovereign_kind,
origin_converts_sibling_with_sovereign_kind,
origin_converts_relay_with_native_kind, origin_converts_relay_with_xcm_kind,
origin_converts_account_key20_with_native_kind, origin_rejects_superuser_kind)
pattern-match the Result and assert the exact Ok(RuntimeOrigin::...) variant (or
Err(...) for Superuser) expected from the corresponding converter
(SovereignSignedViaLocation -> Signed using relay sovereign account,
RelayChainAsNative -> relay chain native origin, XcmPassthrough -> pallet_xcm
origin, SignedAccountKey20AsNative -> Signed with ALICE key20); update
assertions to compare the concrete RuntimeOrigin value rather than only calling
is_ok()/is_err().
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 01303637-0edc-4f0d-b8cb-6f4c7e15f355

📥 Commits

Reviewing files that changed from the base of the PR and between aab2c2c and 1386cb3.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (85)
  • .github/workflows/build.yml
  • Cargo.toml
  • docs/cherry-picks/polkadot-sdk-stable2512.md
  • node/cli/Cargo.toml
  • pallets/xcm-transactor/Cargo.toml
  • pallets/xcm-weight-trader/Cargo.toml
  • precompiles/gmp/Cargo.toml
  • precompiles/relay-encoder/Cargo.toml
  • precompiles/xcm-transactor/Cargo.toml
  • precompiles/xtokens/Cargo.toml
  • primitives/tests-primitives/Cargo.toml
  • runtime/common/Cargo.toml
  • runtime/moonbase/Cargo.toml
  • runtime/moonbase/tests/xcm_config/barriers.rs
  • runtime/moonbase/tests/xcm_config/location.rs
  • runtime/moonbase/tests/xcm_config/main.rs
  • runtime/moonbase/tests/xcm_config/origin.rs
  • runtime/moonbase/tests/xcm_config/reserves.rs
  • runtime/moonbase/tests/xcm_config/traders.rs
  • runtime/moonbase/tests/xcm_config/transactors.rs
  • runtime/moonbase/tests/xcm_config/weigher.rs
  • runtime/moonbase/tests/xcm_config/xcm_common.rs
  • runtime/moonbase/tests/xcm_mock/mod.rs
  • runtime/moonbase/tests/xcm_mock/parachain.rs
  • runtime/moonbase/tests/xcm_mock/relay_chain.rs
  • runtime/moonbase/tests/xcm_mock/statemint_like.rs
  • runtime/moonbase/tests/xcm_tests.rs
  • runtime/moonbase/xcm-emulator-tests/Cargo.toml
  • runtime/moonbase/xcm-emulator-tests/src/lib.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/asset_hub.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/main.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/network.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/relay.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transact.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/transfers.rs
  • runtime/moonbase/xcm-emulator-tests/tests/xcm_emulator/versioning.rs
  • runtime/moonbeam/Cargo.toml
  • runtime/moonbeam/tests/xcm_config/barriers.rs
  • runtime/moonbeam/tests/xcm_config/location.rs
  • runtime/moonbeam/tests/xcm_config/main.rs
  • runtime/moonbeam/tests/xcm_config/origin.rs
  • runtime/moonbeam/tests/xcm_config/reserves.rs
  • runtime/moonbeam/tests/xcm_config/traders.rs
  • runtime/moonbeam/tests/xcm_config/transactors.rs
  • runtime/moonbeam/tests/xcm_config/weigher.rs
  • runtime/moonbeam/tests/xcm_config/xcm_common.rs
  • runtime/moonbeam/tests/xcm_mock/mod.rs
  • runtime/moonbeam/tests/xcm_mock/parachain.rs
  • runtime/moonbeam/tests/xcm_mock/relay_chain.rs
  • runtime/moonbeam/tests/xcm_mock/statemint_like.rs
  • runtime/moonbeam/tests/xcm_tests.rs
  • runtime/moonbeam/xcm-emulator-tests/Cargo.toml
  • runtime/moonbeam/xcm-emulator-tests/src/lib.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/asset_hub.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/main.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/network.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/relay.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/transact.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/transfers.rs
  • runtime/moonbeam/xcm-emulator-tests/tests/xcm_emulator/versioning.rs
  • runtime/moonriver/Cargo.toml
  • runtime/moonriver/tests/xcm_config/barriers.rs
  • runtime/moonriver/tests/xcm_config/location.rs
  • runtime/moonriver/tests/xcm_config/main.rs
  • runtime/moonriver/tests/xcm_config/origin.rs
  • runtime/moonriver/tests/xcm_config/reserves.rs
  • runtime/moonriver/tests/xcm_config/traders.rs
  • runtime/moonriver/tests/xcm_config/transactors.rs
  • runtime/moonriver/tests/xcm_config/weigher.rs
  • runtime/moonriver/tests/xcm_config/xcm_common.rs
  • runtime/moonriver/tests/xcm_mock/mod.rs
  • runtime/moonriver/tests/xcm_mock/parachain.rs
  • runtime/moonriver/tests/xcm_mock/relay_chain.rs
  • runtime/moonriver/tests/xcm_mock/statemine_like.rs
  • runtime/moonriver/tests/xcm_tests.rs
  • runtime/moonriver/xcm-emulator-tests/Cargo.toml
  • runtime/moonriver/xcm-emulator-tests/src/lib.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/asset_hub.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/main.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/network.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/relay.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/transact.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/transfers.rs
  • runtime/moonriver/xcm-emulator-tests/tests/xcm_emulator/versioning.rs
  • scripts/verify-licenses.sh
💤 Files with no reviewable changes (9)
  • runtime/moonriver/tests/xcm_mock/mod.rs
  • runtime/moonbase/tests/xcm_mock/parachain.rs
  • runtime/moonbeam/tests/xcm_mock/relay_chain.rs
  • runtime/moonbase/tests/xcm_mock/statemint_like.rs
  • runtime/moonbeam/tests/xcm_mock/parachain.rs
  • runtime/moonbeam/tests/xcm_mock/mod.rs
  • runtime/moonbeam/tests/xcm_mock/statemint_like.rs
  • runtime/moonbase/tests/xcm_mock/mod.rs
  • runtime/moonbase/tests/xcm_mock/relay_chain.rs

Comment thread .github/workflows/build.yml
Reproduce the rust-test job's setup in the xcm-emulator-test job:
- Mount the Blacksmith sccache stickydisk, computing the cache key the same way
  as rust-test (rust-toolchain-cache-key template) under its own segment.
- Use the native-build-deps and rust-toolchain workflow templates instead of the
  inline rustup script and GHA sccache cache.
- Add timeout-minutes: 30 so a stalled run can't burn the large runner.
Conflict resolution notes:
- Cargo.toml feature lists: adopted master's toml-sort single-line format
  (master independently applied the same moonbeam-tests-primitives /
  pallet-xcm-transactor feature propagation).
- runtime/{moonbase,moonbeam,moonriver}: kept this branch's removal of the
  polkadot-runtime-parachains and xcm-simulator dev-deps (and their feature
  entries) on top of master's reformatted files; the XCM tests no longer use
  xcm-simulator and polkadot-runtime-parachains is now only pulled by the
  dedicated xcm-emulator-tests crates.
- node/cli/Cargo.toml: took master's version (it already carries the
  nimbus-primitives/polkadot-service try-runtime entries this branch added),
  dropping the duplicate the auto-merge produced.
- build.yml: kept the dedicated xcm-emulator-test job and the default test
  job's --exclude flags, switched both to master's renamed `rust-tests`
  profile (the old `testnet` profile no longer exists), and aligned the
  xcm-emulator job's checkout/stickydisk/sccache action pins with the
  updated rust-test job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B0-silent Changes should not be mentioned in any release notes D2-notlive PR doesn't change runtime code (so can't be audited) not-breaking Does not need to be mentioned in breaking changes XCM Run option xcm-emulator tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants