Skip to content

fix: expose try-runtime feature in bridge-hub-test-utils#11211

Open
Kanasjnr wants to merge 23 commits into
paritytech:masterfrom
Kanasjnr:Kanas/fix-bridge-hub-test-utils-try-runtime
Open

fix: expose try-runtime feature in bridge-hub-test-utils#11211
Kanasjnr wants to merge 23 commits into
paritytech:masterfrom
Kanasjnr:Kanas/fix-bridge-hub-test-utils-try-runtime

Conversation

@Kanasjnr

@Kanasjnr Kanasjnr commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes and should probably close #10962

When running cargo test --features try-runtime (or --all-features) on BridgeHub runtimes, compilation failed with:

error[E0046]: not all trait items implemented, missing: `try_successful_origin`
  --> .../assets-common-0.27.1/src/foreign_creators.rs:29:1

This happened because bridge-hub-test-utils did not declare a try-runtime feature, so the flag never propagated to asset-test-utilsassets-common.
As a result, assets-common was compiled without try-runtime, while frame-support had it enabled → the try_successful_origin method (guarded by #[cfg(feature = "try-runtime")]) was missing, causing the trait implementation error.

Changes:

  • Added a try-runtime feature to bridge-hub-test-utils/Cargo.toml that forwards the flag only to the 16 dependencies that actually declare/support it.
  • Activated the new feature in the two test runtimes that depend on it:
    • cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml
    • cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/Cargo.toml

After these changes, cargo check --features try-runtime and cargo test --release --locked --all-features (with SKIP_PALLET_REVIVE_FIXTURES=1) pass cleanly on both rococo and westend runtimes.

The real BridgeHub Kusama & Polkadot runtimes (in polkadot-fellows/runtimes) will need the same one-line activation in their try-runtime feature lists as seen in this error (planned as a follow-up PR).

Integration

Downstream projects / other runtimes that depend on bridge-hub-test-utils as a dev-dependency and want to use try-runtime tests should add:

try-runtime = [
    # ... existing entries ...
    "bridge-hub-test-utils/try-runtime",
    # ...
]

in their runtime Cargo.toml.
This is the same pattern already used by asset-test-utils, parachains-common, etc.

No crate publish is required this is only a feature addition in a test-utils crate.

Review Notes

  • The list of crates that receive try-runtime forwarding matches exactly the crates in polkadot-sdk that declare the feature (verified against your earlier table: 16 crates with, 9 without).
  • No new dependencies or breaking changes introduced.
  • Tests were verified locally with:
    SKIP_PALLET_REVIVE_FIXTURES=1 cargo test -p bridge-hub-rococo-runtime --release --locked -q --all-features
    SKIP_PALLET_REVIVE_FIXTURES=1 cargo test -p bridge-hub-westend-runtime --release --locked -q --all-features
    → all suites pass (some expected ERROR logs from bridge/XCM simulation tests are normal in emulated environment).

No leftover TODOs.

Checklist

  • My PR includes a detailed description as outlined above.
  • My PR follows the labeling requirements (suggest: T6-XCM, D2-trivial, I5-enhancement or similar)
  • I have made corresponding changes to the documentation (none needed — this is test-utils internal)
  • I have added / verified tests that prove my fix is effective (local test runs pass)

Bot Commands

You can use the following bot commands in comments to help manage your PR:

Labeling (Self-service for contributors):

  • /cmd label T1-FRAME - Add a single label
  • /cmd label T1-FRAME R0-no-crate-publish-required - Add multiple labels
  • /cmd label T6-XCM D2-substantial I5-enhancement - Add multiple labels at once
  • See label documentation for all available labels

Other useful commands:

  • /cmd fmt - Format code (cargo +nightly fmt and taplo)
  • /cmd prdoc - Generate PR documentation
  • /cmd bench - Run benchmarks
  • /cmd update-ui - Update UI tests
  • /cmd --help - Show help for all available commands

@Kanasjnr

Copy link
Copy Markdown
Contributor Author

/cmd prdoc --audience node_dev --bump patch

@Kanasjnr

Copy link
Copy Markdown
Contributor Author

/cmd label T6-XCM I5-enhancement R0-no-crate-publish-required

@paritytech-cmd-bot-polkadot-sdk paritytech-cmd-bot-polkadot-sdk Bot added I5-enhancement An additional feature request. R0-no-crate-publish-required The change does not require any crates to be re-published. T6-XCM This PR/Issue is related to XCM. labels Feb 27, 2026
@Kanasjnr

Copy link
Copy Markdown
Contributor Author

@pandres95 Kindly review

Comment thread prdoc/pr_11211.prdoc Outdated
@Kanasjnr Kanasjnr requested a review from rockbmb February 28, 2026 00:23
@bkontur

bkontur commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

@Kanasjnr please, apply this patch below to this branch, when somebody is using westend-emulated-chain = { workspace = true }, this should prevent unnecessary including:

westend-runtime = { workspace = true }

"westend-runtime/runtime-benchmarks",
"westend-runtime/try-runtime",
git apply a.patch

a.patch

diff --git a/cumulus/parachains/integration-tests/emulated/chains/relays/rococo/Cargo.toml b/cumulus/parachains/integration-tests/emulated/chains/relays/rococo/Cargo.toml
index 4d1d8c5841..f6263e583b 100644
--- a/cumulus/parachains/integration-tests/emulated/chains/relays/rococo/Cargo.toml
+++ b/cumulus/parachains/integration-tests/emulated/chains/relays/rococo/Cargo.toml
@@ -27,3 +27,11 @@ rococo-runtime-constants = { workspace = true }
 # Cumulus
 emulated-integration-tests-common = { workspace = true }
 parachains-common = { workspace = true, default-features = true }
+
+[features]
+runtime-benchmarks = [
+  "parachains-common/runtime-benchmarks",
+  "polkadot-primitives/runtime-benchmarks",
+  "rococo-runtime/runtime-benchmarks",
+]
+try-runtime = ["rococo-runtime/try-runtime", "parachains-common/try-runtime"]
diff --git a/cumulus/parachains/integration-tests/emulated/chains/relays/westend/Cargo.toml b/cumulus/parachains/integration-tests/emulated/chains/relays/westend/Cargo.toml
index a6e6396a38..1a421cc9da 100644
--- a/cumulus/parachains/integration-tests/emulated/chains/relays/westend/Cargo.toml
+++ b/cumulus/parachains/integration-tests/emulated/chains/relays/westend/Cargo.toml
@@ -28,3 +28,19 @@ westend-runtime-constants = { workspace = true }
 # Cumulus
 emulated-integration-tests-common = { workspace = true }
 parachains-common = { workspace = true, default-features = true }
+
+[features]
+runtime-benchmarks = [
+  "pallet-staking/runtime-benchmarks",
+  "parachains-common/runtime-benchmarks",
+  "polkadot-primitives/runtime-benchmarks",
+  "sp-runtime/runtime-benchmarks",
+  "westend-runtime-constants/runtime-benchmarks",
+  "westend-runtime/runtime-benchmarks",
+]
+try-runtime = [
+  "pallet-staking/try-runtime",
+  "westend-runtime/try-runtime",
+  "parachains-common/try-runtime",
+  "sp-runtime/try-runtime",
+]

@github-actions github-actions Bot requested a review from pandres95 March 3, 2026 22:14
@github-actions

github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Review required! Latest push from author must always be reviewed

@Kanasjnr

Kanasjnr commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

@Kanasjnr please, apply this patch below to this branch, when somebody is using westend-emulated-chain = { workspace = true }, this should prevent unnecessary including:

westend-runtime = { workspace = true }

"westend-runtime/runtime-benchmarks",
"westend-runtime/try-runtime",
git apply a.patch

a.patch

diff --git a/cumulus/parachains/integration-tests/emulated/chains/relays/rococo/Cargo.toml b/cumulus/parachains/integration-tests/emulated/chains/relays/rococo/Cargo.toml
index 4d1d8c5841..f6263e583b 100644
--- a/cumulus/parachains/integration-tests/emulated/chains/relays/rococo/Cargo.toml
+++ b/cumulus/parachains/integration-tests/emulated/chains/relays/rococo/Cargo.toml
@@ -27,3 +27,11 @@ rococo-runtime-constants = { workspace = true }
 # Cumulus
 emulated-integration-tests-common = { workspace = true }
 parachains-common = { workspace = true, default-features = true }
+
+[features]
+runtime-benchmarks = [
+  "parachains-common/runtime-benchmarks",
+  "polkadot-primitives/runtime-benchmarks",
+  "rococo-runtime/runtime-benchmarks",
+]
+try-runtime = ["rococo-runtime/try-runtime", "parachains-common/try-runtime"]
diff --git a/cumulus/parachains/integration-tests/emulated/chains/relays/westend/Cargo.toml b/cumulus/parachains/integration-tests/emulated/chains/relays/westend/Cargo.toml
index a6e6396a38..1a421cc9da 100644
--- a/cumulus/parachains/integration-tests/emulated/chains/relays/westend/Cargo.toml
+++ b/cumulus/parachains/integration-tests/emulated/chains/relays/westend/Cargo.toml
@@ -28,3 +28,19 @@ westend-runtime-constants = { workspace = true }
 # Cumulus
 emulated-integration-tests-common = { workspace = true }
 parachains-common = { workspace = true, default-features = true }
+
+[features]
+runtime-benchmarks = [
+  "pallet-staking/runtime-benchmarks",
+  "parachains-common/runtime-benchmarks",
+  "polkadot-primitives/runtime-benchmarks",
+  "sp-runtime/runtime-benchmarks",
+  "westend-runtime-constants/runtime-benchmarks",
+  "westend-runtime/runtime-benchmarks",
+]
+try-runtime = [
+  "pallet-staking/try-runtime",
+  "westend-runtime/try-runtime",
+  "parachains-common/try-runtime",
+  "sp-runtime/try-runtime",
+]

updated

@Kanasjnr

Kanasjnr commented Mar 5, 2026

Copy link
Copy Markdown
Contributor Author

@bkontur @pandres95 @rockbmb Pinging you on this kindly help review

sigurpol and others added 10 commits March 8, 2026 21:19
…ly set keys (paritytech#11197)

Tracks whether session keys were set externally (via `SessionInterface`,
e.g. from AH) or locally.
Transitions between the two paths correctly manage the key deposit and
consumer ref in both directions.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…1223)

Fix failing semver check due to old compiled-in cargo in parity-publish
by:
1. Upgrading `parity-publish` to the latest version.
2. Fixing its build dependencies installation with `apt-get`.

```
Error: failed to load manifest for workspace member `/__w/polkadot-sdk/polkadot-sdk/bridges/bin/runtime-common`
referenced by workspace at `/__w/polkadot-sdk/polkadot-sdk/Cargo.toml`

Caused by:
    0: failed to load manifest for dependency `bp-header-chain`
    ...
   23: failed to load manifest for dependency `pallet-revive`
   24: failed to parse manifest at `/__w/polkadot-sdk/polkadot-sdk/substrate/frame/revive/Cargo.toml`
   25: feature `edition2024` is required
       
       The package requires the Cargo feature called `edition2024`, but that feature is not stabilized in this version of Cargo (1.83.0).
       Consider adding `cargo-features = ["edition2024"]` to the top of Cargo.toml (above the [package] table) to tell Cargo you are opting in to use this unstable feature.
```
This PR brings litep2p
[v0.13.1](https://github.com/paritytech/litep2p/releases/tag/v0.13.1) to
polkadot-sdk. The improvements include:

1. When dialing remote peers, all addresses from the DHT are tried,
starting from the public addresses. Before litep2p v0.13.1, only up to 8
addresses were tried, leading to dial failures when due to
misconfiguration there was a lot of private addresses in the DHT.
2. Protocols are now notified about connected peers before the library
user, fixing failures in opening substreams when the user command
arrived before the connection event.
3. Ping protocol implementation now conforms to the spec. This improves
the connection stability between polkadot-sdk and
[smoldot](https://github.com/smol-dot/smoldot) dramatically. Before this
PR, smoldot always disconnected polkadot-sdk peers every 15 seconds for
5 seconds due to failed pings.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Closes: paritytech#11205

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lukasz Rubaszewski <117115317+lrubasze@users.noreply.github.com>
@Kanasjnr Kanasjnr force-pushed the Kanas/fix-bridge-hub-test-utils-try-runtime branch from c224a5f to 748488e Compare March 8, 2026 22:04
@Kanasjnr Kanasjnr requested review from a team as code owners March 8, 2026 22:04
@paritytech-review-bot paritytech-review-bot Bot requested a review from a team March 8, 2026 22:04
@Kanasjnr

Copy link
Copy Markdown
Contributor Author

@bkontur @rockbmb @pandres95 Pinging you on this again the pr is ready for review

@Kanasjnr

Copy link
Copy Markdown
Contributor Author

@bkontur @rockbmb a gentle reminder this pr needs review thanks

Comment thread prdoc/pr_11211.prdoc Outdated
@Kanasjnr Kanasjnr force-pushed the Kanas/fix-bridge-hub-test-utils-try-runtime branch from 08bc7ea to 3c045a6 Compare April 10, 2026 21:38
@Kanasjnr Kanasjnr force-pushed the Kanas/fix-bridge-hub-test-utils-try-runtime branch from 3c045a6 to c48cb69 Compare April 10, 2026 21:52
@Kanasjnr Kanasjnr force-pushed the Kanas/fix-bridge-hub-test-utils-try-runtime branch from a06a974 to 1cd8796 Compare April 10, 2026 22:07
Comment thread prdoc/pr_11224.prdoc Outdated
Comment thread prdoc/pr_11211.prdoc
@Kanasjnr Kanasjnr requested a review from rockbmb April 21, 2026 07:23
Comment thread prdoc/pr_11204.prdoc Outdated
Drop prdoc entries for other PRs (paritytech#11197, paritytech#11204, paritytech#11224) that were
accidentally included on this branch.
@Kanasjnr Kanasjnr requested a review from ggwpez May 20, 2026 21:00
Kanasjnr added 2 commits May 20, 2026 22:08
Required by check-zepter and check-umbrella after master added
pallet-accumulate-and-forward and pallet-dap to emulated tests common.

@franciscoaguirre franciscoaguirre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@bkontur bkontur enabled auto-merge May 25, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I5-enhancement An additional feature request. R0-no-crate-publish-required The change does not require any crates to be re-published. T6-XCM This PR/Issue is related to XCM.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bridge-hub-test-utils is not exposing try-runtime