Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add AH-next runtime - the post-migration Asset Hub runtime (WIP) #6996

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ members = [
"cumulus/pallets/xcm",
"cumulus/pallets/xcmp-queue",
"cumulus/parachains/common",
"cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-next-westend",
"cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-rococo",
"cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-westend",
"cumulus/parachains/integration-tests/emulated/chains/parachains/bridges/bridge-hub-rococo",
Expand All @@ -102,6 +103,7 @@ members = [
"cumulus/parachains/integration-tests/emulated/networks/rococo-system",
"cumulus/parachains/integration-tests/emulated/networks/rococo-westend-system",
"cumulus/parachains/integration-tests/emulated/networks/westend-system",
"cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-next-westend",
"cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo",
"cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend",
"cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo",
Expand All @@ -114,6 +116,7 @@ members = [
"cumulus/parachains/pallets/collective-content",
"cumulus/parachains/pallets/parachain-info",
"cumulus/parachains/pallets/ping",
"cumulus/parachains/runtimes/assets/asset-hub-next-westend",
"cumulus/parachains/runtimes/assets/asset-hub-rococo",
"cumulus/parachains/runtimes/assets/asset-hub-westend",
"cumulus/parachains/runtimes/assets/common",
Expand Down Expand Up @@ -609,6 +612,8 @@ arrayvec = { version = "0.7.4" }
assert_cmd = { version = "2.0.14" }
assert_matches = { version = "1.5.0" }
asset-hub-rococo-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-rococo" }
asset-hub-next-westend-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-next-westend" }
asset-hub-next-westend-runtime = { path = "cumulus/parachains/runtimes/assets/asset-hub-next-westend" }
asset-hub-rococo-runtime = { path = "cumulus/parachains/runtimes/assets/asset-hub-rococo", default-features = false }
asset-hub-westend-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-westend" }
asset-hub-westend-runtime = { path = "cumulus/parachains/runtimes/assets/asset-hub-westend" }
Expand All @@ -632,6 +637,7 @@ bounded-collections = { version = "0.2.0", default-features = false }
bounded-vec = { version = "0.7" }
bp-asset-hub-rococo = { path = "bridges/chains/chain-asset-hub-rococo", default-features = false }
bp-asset-hub-westend = { path = "bridges/chains/chain-asset-hub-westend", default-features = false }
bp-asset-hub-next-westend = { path = "bridges/chains/chain-asset-hub-next-westend", default-features = false }
bp-beefy = { path = "bridges/primitives/beefy", default-features = false }
bp-bridge-hub-cumulus = { path = "bridges/chains/chain-bridge-hub-cumulus", default-features = false }
bp-bridge-hub-kusama = { default-features = false, path = "bridges/chains/chain-bridge-hub-kusama" }
Expand Down
33 changes: 33 additions & 0 deletions bridges/chains/chain-asset-hub-next-westend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "bp-asset-hub-next-westend"
description = "Primitives of AssetHubNextWestend parachain runtime."
version = "0.3.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
repository.workspace = true

[package.metadata.polkadot-sdk]
exclude-from-umbrella = true

[lints]
workspace = true

[dependencies]
codec = { workspace = true }
scale-info = { features = ["derive"], workspace = true }

# Substrate Dependencies
frame-support = { workspace = true }

# Bridge Dependencies
bp-xcm-bridge-hub-router = { workspace = true }

[features]
default = ["std"]
std = [
"bp-xcm-bridge-hub-router/std",
"codec/std",
"frame-support/std",
"scale-info/std",
]
48 changes: 48 additions & 0 deletions bridges/chains/chain-asset-hub-next-westend/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Parity Bridges Common.

// Parity Bridges Common is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Parity Bridges Common is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.

//! Module with configuration which reflects AssetHubNextWestend runtime setup.

#![cfg_attr(not(feature = "std"), no_std)]

use codec::{Decode, Encode};
use scale_info::TypeInfo;

pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall;

/// `AssetHubNextWestend` Runtime `Call` enum.
///
/// The enum represents a subset of possible `Call`s we can send to `AssetHubNextWestend` chain.
/// Ideally this code would be auto-generated from metadata, because we want to
/// avoid depending directly on the ENTIRE runtime just to get the encoding of `Dispatchable`s.
///
/// All entries here (like pretty much in the entire file) must be kept in sync with
/// `AssetHubNextWestend` `construct_runtime`, so that we maintain SCALE-compatibility.
#[allow(clippy::large_enum_variant)]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub enum Call {
/// `ToRococoXcmRouter` bridge pallet.
#[codec(index = 34)]
ToRococoXcmRouter(XcmBridgeHubRouterCall),
}

frame_support::parameter_types! {
/// Some sane weight to execute `xcm::Transact(pallet-xcm-bridge-hub-router::Call::report_bridge_status)`.
pub const XcmBridgeHubRouterTransactCallMaxWeight: frame_support::weights::Weight = frame_support::weights::Weight::from_parts(200_000_000, 6144);
}

/// Identifier of AssetHubNextWestend in the Westend relay chain.
pub const ASSET_HUB_NEXT_WESTEND_PARACHAIN_ID: u32 = 1100;
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "asset-hub-next-westend-emulated-chain"
version = "0.0.0"
authors.workspace = true
edition.workspace = true
license = "Apache-2.0"
description = "Asset Hub Next Westend emulated chain"
publish = false

[lints]
workspace = true

[dependencies]

# Substrate
sp-core = { workspace = true }
sp-keyring = { workspace = true }
frame-support = { workspace = true }

# Cumulus
parachains-common = { workspace = true, default-features = true }
cumulus-primitives-core = { workspace = true }
emulated-integration-tests-common = { workspace = true }
asset-hub-next-westend-runtime = { workspace = true }
westend-emulated-chain = { workspace = true, default-features = true }
testnet-parachains-constants = { features = ["westend"], workspace = true, default-features = true }

# Polkadot
xcm = { workspace = true }

# Bridges
bp-bridge-hub-westend = { workspace = true }
Loading