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

cumulus: add asset-hub-rococo runtime based on asset-hub-kusama and add asset-bridging support to it #1215

Merged
merged 93 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
d6044a0
add `asset-hub-rococo-runtime` as a copy of `asset-hub-kusama-runtime`
acatangiu Sep 8, 2023
ec28f46
update new `asset-hub-rococo-runtime` with rococo-specific components
acatangiu Sep 8, 2023
b320b1f
asset-hub-rococo-runtime: add asset transfer over bridge capabilities
acatangiu Sep 8, 2023
b3c1810
asset-hub-rococo-runtime: add asset transfer over bridge tests
acatangiu Sep 8, 2023
3bc4634
fix toml formatting
acatangiu Sep 8, 2023
4eccdf4
add more tests to Bridge Hubs
acatangiu Sep 8, 2023
e3d77f8
bridge-hubs: add script for testing Rococo <> Wococo bridge
acatangiu Sep 11, 2023
52c7cd5
Do not consume `msg` on `NotApplicable` for remote exporters
bkontur Sep 12, 2023
ff2891c
Added bridging configuration + tests for AssetHubRococo vs AssetHubWo…
bkontur Sep 13, 2023
4f0776d
Merge remote-tracking branch 'origin/master' into bko-asset-hub-rococ…
bkontur Sep 13, 2023
f18f146
".git/.scripts/commands/fmt/fmt.sh"
Sep 13, 2023
a717e91
Merge branch 'master' into asset-hub-rococo-runtime
bkontur Sep 13, 2023
754ed42
Added `asset-hub-(r/w)ococo` to `polkadot-parachain`
bkontur Sep 13, 2023
ddc09d3
Merge remote-tracking branch 'origin/master' into asset-hub-rococo-ru…
bkontur Sep 13, 2023
03b1bb4
Merge branch 'master' into asset-hub-rococo-runtime
bkontur Sep 14, 2023
00cfa54
Finished local run asset transfer for AssetHubRococo/AssetHubWococo
bkontur Sep 14, 2023
116010f
Zombienet tweaks
bkontur Sep 14, 2023
ab648a5
Just paid `ExportMessage` on BridgeHubRococo/BridgeHubWococo
bkontur Sep 15, 2023
b78343b
Added congestion to BridgeHubs + nits
bkontur Sep 15, 2023
3f3081b
fix typos
acatangiu Sep 15, 2023
5d318c5
Typo
bkontur Sep 15, 2023
85b7f84
Fixed benchmarks for asset-hub-rococo
bkontur Sep 15, 2023
642e29e
Tweaks to BridgeHubRococo
bkontur Sep 15, 2023
09e8c15
From PR review
bkontur Sep 15, 2023
bc44872
xcm-emulator nits
bkontur Sep 15, 2023
8df113a
Merge branch 'master' into asset-hub-rococo-runtime
bkontur Sep 15, 2023
d64d1fc
Fix features
bkontur Sep 15, 2023
b20c353
Fixed
bkontur Sep 15, 2023
d04bf3a
Merge remote-tracking branch 'origin/master' into asset-hub-rococo-ru…
bkontur Sep 19, 2023
9f0d255
Fix for benchmarks
bkontur Sep 19, 2023
1faec85
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Sep 19, 2023
76e513d
Merge remote-tracking branch 'origin/master' into asset-hub-rococo-ru…
bkontur Sep 19, 2023
99e001c
Added xcm-emulator integration test for AssetHubRococo (as copy of As…
bkontur Sep 20, 2023
3a0b3c1
Addressing pr comments for xcmp-queue
bkontur Sep 21, 2023
791b88a
Added test for `AllowUnpaidTransactsFrom`
bkontur Sep 21, 2023
a4f3f4e
Nit
bkontur Sep 21, 2023
a4ef4f5
Simplify Location and AssetFilter
bkontur Sep 21, 2023
713d7ad
Merge remote-tracking branch 'origin/master' into asset-hub-rococo-ru…
bkontur Sep 21, 2023
33b672c
fmt
bkontur Sep 21, 2023
474b8a4
ensure_configuration -> prepare_configuration
bkontur Sep 22, 2023
b500fbc
Constants nit
bkontur Sep 22, 2023
d4dc7c8
Merge remote-tracking branch 'origin/master' into asset-hub-rococo-ru…
bkontur Sep 25, 2023
559b954
Add claiming relayer rewards to Ro/Wo demo
bkontur Sep 27, 2023
89fc271
Merge remote-tracking branch 'origin/master' into asset-hub-rococo-ru…
bkontur Sep 27, 2023
6e7e53d
Deduplicate with `build_congestion_message`
bkontur Sep 27, 2023
7cbfbb2
Merge remote-tracking branch 'origin/master' into asset-hub-rococo-ru…
bkontur Sep 27, 2023
42d6fe4
Merge remote-tracking branch 'origin/master' into asset-hub-rococo-ru…
bkontur Oct 3, 2023
132c5a0
Merge remote-tracking branch 'origin/master' into asset-hub-rococo-ru…
bkontur Oct 4, 2023
94619d7
Compile
bkontur Oct 5, 2023
5f785b6
Merge remote-tracking branch 'origin/master' into asset-hub-rococo-ru…
bkontur Oct 5, 2023
58c4089
Fix to compile
bkontur Oct 5, 2023
14c2855
Merge remote-tracking branch 'origin/master' into asset-hub-rococo-ru…
bkontur Oct 5, 2023
653b9fb
Add filtering capabilities for remote location to `NetworkExportTable`
bkontur Oct 11, 2023
62bbee0
Expose `BridgeMessage` field as `pub` because it cannot be access out…
bkontur Oct 11, 2023
19381bd
Move `StartsWith` and `Equals` to `xcm-builder`
bkontur Oct 11, 2023
255595e
Refactored and simplified xcm stuff
bkontur Oct 11, 2023
ecf0688
Merge branch 'bko-xcm-builder-enhancements' into asset-hub-rococo-run…
bkontur Oct 11, 2023
1269bd7
Fix import
bkontur Oct 11, 2023
8dcca0f
Merge remote-tracking branch 'origin/bko-xcm-builder-enhancements' in…
bkontur Oct 11, 2023
c7b1625
Added generic `EqualsTo` implementation for `frame_support::traits::C…
bkontur Oct 11, 2023
296dc1c
Merge remote-tracking branch 'origin/master' into bko-xcm-builder-enh…
bkontur Oct 11, 2023
889e9e2
Removed import
bkontur Oct 11, 2023
e95ec38
Merge remote-tracking branch 'origin/bko-xcm-builder-enhancements' in…
bkontur Oct 11, 2023
04cabcd
More fixes
bkontur Oct 12, 2023
5fdd787
PR comments + added `LocationWithAssetFilters` useful for `XcmTelepor…
bkontur Oct 13, 2023
ea0997b
PR comments
bkontur Oct 14, 2023
668756d
Merge branch 'bko-xcm-builder-enhancements' into asset-hub-rococo-run…
bkontur Oct 15, 2023
fa87f2a
Removed unnecessary import
bkontur Oct 15, 2023
65761b5
Merge remote-tracking branch 'origin/bko-xcm-builder-enhancements' in…
bkontur Oct 15, 2023
6c087c2
Update cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
bkontur Oct 15, 2023
4d07d71
Removed unnecessary import
bkontur Oct 15, 2023
39a227f
Fmt
bkontur Oct 15, 2023
0cfd718
Merge remote-tracking branch 'origin/bko-xcm-builder-enhancements' in…
bkontur Oct 15, 2023
34a438d
Update cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
bkontur Oct 16, 2023
2555615
PR comments - removed `FellowsBodyId`
bkontur Oct 16, 2023
3ade1cf
Doc
bkontur Oct 16, 2023
3089154
Serban's nit + test
bkontur Oct 16, 2023
2c04796
Merge branch 'bko-xcm-builder-enhancements' into asset-hub-rococo-run…
bkontur Oct 16, 2023
79f6794
Removed comment
bkontur Oct 16, 2023
98efacd
Changed `RuntimeVersion` to be compatible with live Rococo' AssetHub …
bkontur Oct 16, 2023
c26fde1
Typo
bkontur Oct 16, 2023
be2210a
PR comments - Added `UnpaidExecution` + refactor of `AllowTransactsFrom`
bkontur Oct 16, 2023
49d45ba
Removed unnecessary barrier `AllowTransactsFrom`
bkontur Oct 16, 2023
2c32b43
Update polkadot/xcm/xcm-builder/src/universal_exports.rs
bkontur Oct 17, 2023
ee1d681
PR comment - case with payment to the test
bkontur Oct 17, 2023
cfa2616
Merge remote-tracking branch 'origin/master' into bko-xcm-builder-enh…
bkontur Oct 17, 2023
4941b44
Merge remote-tracking branch 'origin/bko-xcm-builder-enhancements' in…
bkontur Oct 17, 2023
e82b712
Update cumulus/parachains/runtimes/assets/test-utils/src/test_cases_o…
bkontur Oct 17, 2023
0887912
Update cumulus/parachains/runtimes/assets/test-utils/src/test_cases_o…
bkontur Oct 17, 2023
2ddf42e
Update cumulus/parachains/runtimes/assets/test-utils/src/test_cases_o…
bkontur Oct 17, 2023
f98ee90
Merge branch 'master' of github.com:paritytech/polkadot-sdk into asse…
acatangiu Oct 17, 2023
1fb29e8
AssetHub Rococo: make all SPs trusted teleporters
acatangiu Oct 17, 2023
5392057
Merge branch 'master' into asset-hub-rococo-runtime
acatangiu Oct 18, 2023
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
5 changes: 5 additions & 0 deletions .gitlab/pipeline/short-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ short-benchmark-asset-hub-kusama:
variables:
RUNTIME_CHAIN: asset-hub-kusama-dev

short-benchmark-asset-hub-rococo:
<<: *short-bench-cumulus
variables:
RUNTIME_CHAIN: asset-hub-rococo-dev

short-benchmark-asset-hub-westend:
<<: *short-bench-cumulus
variables:
Expand Down
130 changes: 129 additions & 1 deletion Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ members = [
"bridges/modules/xcm-bridge-hub-router",
"bridges/primitives/chain-asset-hub-kusama",
"bridges/primitives/chain-asset-hub-polkadot",
"bridges/primitives/chain-asset-hub-rococo",
"bridges/primitives/chain-asset-hub-wococo",
"bridges/primitives/chain-bridge-hub-cumulus",
"bridges/primitives/chain-bridge-hub-kusama",
"bridges/primitives/chain-bridge-hub-polkadot",
Expand Down Expand Up @@ -60,13 +62,15 @@ members = [
"cumulus/parachain-template/pallets/template",
"cumulus/parachain-template/runtime",
"cumulus/parachains/common",
"cumulus/parachains/integration-tests/emulated/assets/asset-hub-rococo",
"cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend",
"cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo",
"cumulus/parachains/integration-tests/emulated/common",
"cumulus/parachains/pallets/parachain-info",
"cumulus/parachains/pallets/ping",
"cumulus/parachains/runtimes/assets/asset-hub-kusama",
"cumulus/parachains/runtimes/assets/asset-hub-polkadot",
"cumulus/parachains/runtimes/assets/asset-hub-rococo",
"cumulus/parachains/runtimes/assets/asset-hub-westend",
"cumulus/parachains/runtimes/assets/common",
"cumulus/parachains/runtimes/assets/test-utils",
Expand Down
8 changes: 5 additions & 3 deletions bridges/modules/xcm-bridge-hub-router/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ benchmarks_instance_pallet! {
is_congested: false,
delivery_fee_factor: MINIMAL_DELIVERY_FEE_FACTOR + MINIMAL_DELIVERY_FEE_FACTOR,
});

let _ = T::ensure_bridged_target_destination();
T::make_congested();
}: {
crate::Pallet::<T, I>::on_initialize(Zero::zero())
Expand All @@ -79,11 +81,11 @@ benchmarks_instance_pallet! {
}

send_message {
// make local queue congested, because it means additional db write
T::make_congested();

let dest = T::ensure_bridged_target_destination();
let xcm = sp_std::vec![].into();

// make local queue congested, because it means additional db write
T::make_congested();
}: {
send_xcm::<crate::Pallet<T, I>>(dest, xcm).expect("message is sent")
}
Expand Down
13 changes: 10 additions & 3 deletions bridges/modules/xcm-bridge-hub-router/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use sp_runtime::{
BuildStorage,
};
use xcm::prelude::*;
use xcm_builder::NetworkExportTable;
use xcm_builder::{NetworkExportTable, NetworkExportTableItem};

pub type AccountId = u64;
type Block = frame_system::mocking::MockBlock<TestRuntime>;
Expand All @@ -53,8 +53,15 @@ parameter_types! {
pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(ThisNetworkId::get()), Parachain(1000));
pub SiblingBridgeHubLocation: MultiLocation = ParentThen(X1(Parachain(1002))).into();
pub BridgeFeeAsset: AssetId = MultiLocation::parent().into();
pub BridgeTable: Vec<(NetworkId, MultiLocation, Option<MultiAsset>)>
= vec![(BridgedNetworkId::get(), SiblingBridgeHubLocation::get(), Some((BridgeFeeAsset::get(), BASE_FEE).into()))];
pub BridgeTable: Vec<NetworkExportTableItem>
= vec![
NetworkExportTableItem::new(
BridgedNetworkId::get(),
None,
SiblingBridgeHubLocation::get(),
Some((BridgeFeeAsset::get(), BASE_FEE).into())
)
];
}

impl frame_system::Config for TestRuntime {
Expand Down
26 changes: 26 additions & 0 deletions bridges/primitives/chain-asset-hub-rococo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "bp-asset-hub-rococo"
description = "Primitives of AssetHubRococo parachain runtime."
version = "0.1.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
scale-info = { version = "2.9.0", default-features = false, features = ["derive"] }

# Substrate Dependencies
frame-support = { path = "../../../substrate/frame/support", default-features = false }

# Bridge Dependencies
bp-xcm-bridge-hub-router = { path = "../xcm-bridge-hub-router", default-features = false }

[features]
default = [ "std" ]
std = [
"bp-xcm-bridge-hub-router/std",
"codec/std",
"frame-support/std",
"scale-info/std",
]
52 changes: 52 additions & 0 deletions bridges/primitives/chain-asset-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// 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 AssetHubRococo 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;

/// `AssetHubRococo` Runtime `Call` enum.
///
/// The enum represents a subset of possible `Call`s we can send to `AssetHubRococo` 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
/// `AssetHubRococo` `construct_runtime`, so that we maintain SCALE-compatibility.
#[allow(clippy::large_enum_variant)]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub enum Call {
/// `ToWococoXcmRouter` bridge pallet.
#[codec(index = 43)]
ToWococoXcmRouter(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);

/// Base delivery fee to `BridgeHubRococo`.
/// (initially was calculated by test `BridgeHubRococo::can_calculate_weight_for_paid_export_message_with_reserve_transfer`)
pub const BridgeHubRococoBaseFeeInRocs: u128 = 1214739988;
}

/// Identifier of AssetHubRococo in the Rococo relay chain.
pub const ASSET_HUB_ROCOCO_PARACHAIN_ID: u32 = 1000;
26 changes: 26 additions & 0 deletions bridges/primitives/chain-asset-hub-wococo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "bp-asset-hub-wococo"
description = "Primitives of AssetHubWococo parachain runtime."
version = "0.1.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
scale-info = { version = "2.9.0", default-features = false, features = ["derive"] }

# Substrate Dependencies
frame-support = { path = "../../../substrate/frame/support", default-features = false }

# Bridge Dependencies
bp-xcm-bridge-hub-router = { path = "../xcm-bridge-hub-router", default-features = false }

[features]
default = [ "std" ]
std = [
"bp-xcm-bridge-hub-router/std",
"codec/std",
"frame-support/std",
"scale-info/std",
]
Loading
Loading