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

Added Polkadot <> Kusama bridge configuration #108

Merged
merged 76 commits into from
Jan 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
014dbe9
add bridging stuff to Kusama Bridge Hub
svyatonik Nov 2, 2023
7a5d3ce
add bridging stuff to Polkadot Bridge Hub
svyatonik Nov 2, 2023
d54a80e
add bridging stuff to Kusama Asset Hub
svyatonik Nov 2, 2023
82cf606
add bridging stuff to Polkadot Asset Hub
svyatonik Nov 2, 2023
601c8b9
Allow `initialize` bridge
bkontur Nov 7, 2023
7fd0081
Add `BridgeHub` to the trusted teleporters for relaychain.
bkontur Nov 8, 2023
51d2501
Moved in `bp-bridge-hub-kusama` and `bp-bridge-hub-cumulus`
bkontur Nov 9, 2023
9f435e7
Bring in `bp-bridge-hub-polkadot`
bkontur Nov 9, 2023
2516bb8
Bring in `bp-asset-hub-kusama` and `bp-asset-hub-polkadot`
bkontur Nov 9, 2023
f48d8de
use bp-bridge-hub-cumulus instead of local bridge-hub-common
svyatonik Nov 9, 2023
64a61ce
post-rebase fixes
svyatonik Nov 10, 2023
335449f
tune balance - otherwise msg is rejected by source BH. Should be fixe…
svyatonik Nov 10, 2023
82235f8
change weight of reserve_asset_deposited from 500_000_000_000 to 20_0…
svyatonik Nov 10, 2023
6bfb2b5
moved (un)CongestedMessage to local primitives crates
svyatonik Nov 10, 2023
9735c10
fmt
svyatonik Nov 10, 2023
fee80e4
compilation
svyatonik Nov 10, 2023
adf283f
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
50c1807
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
53079ea
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
b0cbbc1
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
9b7ee3f
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
088b476
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
eec040b
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
016a5f0
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
12a03d3
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
e92ad1a
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
af9cc41
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
6294cb7
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
4ca9230
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
0e1c7e6
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
0684d04
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
0ca25eb
../polkadot-sdk/target/release/polkadot-parachain-benchmarks benchmar…
svyatonik Nov 13, 2023
33ae2eb
fix compilation + added missing benchmark configuration params + rege…
svyatonik Nov 13, 2023
1392e48
fix benchmarks + scripts
svyatonik Nov 13, 2023
bd85ce1
tests fixes
svyatonik Nov 13, 2023
8968afc
updated weights
svyatonik Nov 13, 2023
7dbc1eb
fixed invalid reference + wrong BridgeHubPolkadotBaseXcmFeeInDots con…
svyatonik Nov 13, 2023
7f0f216
use real (without some components though) delivery fee on AH
svyatonik Nov 13, 2023
30072f5
typo
svyatonik Nov 13, 2023
01304bf
all AH tests are working
svyatonik Nov 13, 2023
5879dd8
post-cherry fixes
svyatonik Nov 30, 2023
cafa490
added benchmarks for brdige router pallet
svyatonik Nov 30, 2023
89cb190
added weights for xcm bridge houter pallet
svyatonik Nov 30, 2023
3cd7b26
use fresh weights in pallet configuration
svyatonik Nov 30, 2023
70048d7
fix update-weights.sh
svyatonik Nov 30, 2023
8798ddd
cleanup
svyatonik Nov 30, 2023
1cbc165
benchmark results from ref hardware
svyatonik Nov 30, 2023
8767702
final bridge fees
svyatonik Nov 30, 2023
6748c96
removed tessts body + left comments
svyatonik Nov 30, 2023
7081b8b
removed TODO
svyatonik Nov 30, 2023
45f6e1e
fixed last TODO
svyatonik Nov 30, 2023
b5d9717
fix compilation
svyatonik Dec 1, 2023
a017db2
removed test files
svyatonik Dec 1, 2023
474fbdc
fixed rate conversion based on EDs
svyatonik Dec 1, 2023
f02d3ed
clippy
svyatonik Dec 1, 2023
258ecfb
move base bridge fee computations to primitives
svyatonik Dec 1, 2023
60e0412
regenerate weights using production profile
svyatonik Dec 5, 2023
44009e5
updated fee-related constants
svyatonik Dec 5, 2023
21bd0df
updated comments
svyatonik Dec 5, 2023
0f0b446
updated comments
svyatonik Dec 8, 2023
05d1d3c
.all(...) || .all(...) ---> .all(... || ...)
svyatonik Dec 8, 2023
12b672f
added comments to fix references+tests after another dependencies bump
svyatonik Dec 12, 2023
80da14f
indices of router pallet: change from 43 to 34
svyatonik Dec 12, 2023
e90daad
Merge remote-tracking branch 'origin/main' into sv-pk-bridge
svyatonik Dec 13, 2023
fe18826
added bridge mention to changelog
svyatonik Dec 13, 2023
3ea9722
fmt
svyatonik Dec 13, 2023
a312317
-unused import
svyatonik Dec 13, 2023
7594f02
allow relay chain governance to halt and resume bridge pallets
svyatonik Dec 14, 2023
9542090
update bridge fees using last changes in tests + estimations
svyatonik Dec 15, 2023
2d2c25b
Merge remote-tracking branch 'polkadot-fellows/main' into sv-pk-bridge
bkontur Jan 8, 2024
7281a23
Update system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs
bkontur Jan 8, 2024
987c181
Update system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs
bkontur Jan 8, 2024
6eb9d42
Update system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs
bkontur Jan 8, 2024
70f0a20
Update system-parachains/bridge-hubs/bridge-hub-kusama/primitives/src…
bkontur Jan 8, 2024
ba94fff
fmt
bkontur Jan 8, 2024
b26a5be
fix
bkontur Jan 8, 2024
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
Prev Previous commit
Next Next commit
add bridging stuff to Polkadot Asset Hub
svyatonik committed Nov 30, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 82cf60617564367dd1089b307039132a3e03154f
5 changes: 5 additions & 0 deletions Cargo.lock

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

16 changes: 15 additions & 1 deletion system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -70,14 +70,21 @@ cumulus-pallet-dmp-queue = { default-features = false , version = "0.4.0" }
cumulus-pallet-parachain-system = { default-features = false, features = ["parameterized-consensus-hook",] , version = "0.4.0" }
cumulus-pallet-session-benchmarking = { default-features = false, version = "6.0.0" }
cumulus-pallet-xcm = { default-features = false , version = "0.4.0" }
cumulus-pallet-xcmp-queue = { default-features = false , version = "0.4.0" }
cumulus-pallet-xcmp-queue = { default-features = false , features = ["bridging"] , version = "0.4.0" }
cumulus-primitives-core = { default-features = false , version = "0.4.0" }
cumulus-primitives-utility = { default-features = false , version = "0.4.0" }
pallet-collator-selection = { default-features = false , version = "6.0.0" }
parachain-info = { package = "staging-parachain-info", default-features = false , version = "0.4.0" }
parachains-common = { default-features = false , version = "4.0.0" }
assets-common = { default-features = false , version = "0.4.0" }

# Bridges
bp-asset-hub-kusama = { default-features = false , version = "0.2.0" }
bp-asset-hub-polkadot = { default-features = false , version = "0.2.0" }
bp-bridge-hub-kusama = { default-features = false , version = "0.3.0" }
bp-bridge-hub-polkadot = { default-features = false , version = "0.3.0" }
pallet-xcm-bridge-hub-router = { default-features = false , version = "0.2.0" }

[dev-dependencies]
hex-literal = "0.4.1"
asset-test-utils = { version = "4.0.0" }
@@ -109,6 +116,7 @@ runtime-benchmarks = [
"pallet-uniques/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
"pallet-xcm-bridge-hub-router/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
"polkadot-runtime-common/runtime-benchmarks",
@@ -140,13 +148,18 @@ try-runtime = [
"pallet-transaction-payment/try-runtime",
"pallet-uniques/try-runtime",
"pallet-utility/try-runtime",
"pallet-xcm-bridge-hub-router/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
"polkadot-runtime-common/try-runtime",
"sp-runtime/try-runtime",
]
std = [
"assets-common/std",
"bp-asset-hub-kusama/std",
"bp-asset-hub-polkadot/std",
"bp-bridge-hub-kusama/std",
"bp-bridge-hub-polkadot/std",
"codec/std",
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-dmp-queue/std",
@@ -181,6 +194,7 @@ std = [
"pallet-uniques/std",
"pallet-utility/std",
"pallet-xcm-benchmarks?/std",
"pallet-xcm-bridge-hub-router/std",
"pallet-xcm/std",
"parachain-info/std",
"parachains-common/std",
36 changes: 35 additions & 1 deletion system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ use frame_support::{
genesis_builder_helper::{build_config, create_default_config},
parameter_types,
traits::{
AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse,
AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Equals,
InstanceFilter,
},
weights::{ConstantMultiplier, Weight},
@@ -749,6 +749,37 @@ impl pallet_nfts::Config for Runtime {
type Helper = ();
}

/// XCM router instance to BridgeHub with bridging capabilities for `Kusama` global
/// consensus with dynamic fees and back-pressure.
pub type ToKusamaXcmRouterInstance = pallet_xcm_bridge_hub_router::Instance1;
impl pallet_xcm_bridge_hub_router::Config<ToKusamaXcmRouterInstance> for Runtime {
type WeightInfo = (); // TODO

type UniversalLocation = xcm_config::UniversalLocation;
type BridgedNetworkId = xcm_config::bridging::to_kusama::KusamaNetwork;
type Bridges = xcm_config::bridging::NetworkExportTable;

#[cfg(not(feature = "runtime-benchmarks"))]
type BridgeHubOrigin = EnsureXcm<Equals<xcm_config::bridging::SiblingBridgeHub>>;
#[cfg(feature = "runtime-benchmarks")]
type BridgeHubOrigin = frame_support::traits::EitherOfDiverse<
// for running benchmarks
EnsureRoot<AccountId>,
// for running tests with `--feature runtime-benchmarks`
EnsureXcm<Equals<xcm_config::bridging::SiblingBridgeHub>>,
>;

type ToBridgeHubSender = XcmpQueue;
type WithBridgeHubChannel =
cumulus_pallet_xcmp_queue::bridging::InAndOutXcmpChannelStatusProvider<
xcm_config::bridging::SiblingBridgeHubParaId,
Runtime,
>;

type ByteFee = xcm_config::bridging::XcmBridgeHubRouterByteFee;
type FeeAsset = xcm_config::bridging::XcmBridgeHubRouterFeeAssetId;
}

// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime
@@ -785,6 +816,9 @@ construct_runtime!(
Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 41,
Proxy: pallet_proxy::{Pallet, Call, Storage, Event<T>} = 42,

// Bridge utilities.
ToKusamaXcmRouter: pallet_xcm_bridge_hub_router::<Instance1>::{Pallet, Storage, Call} = 43,
svyatonik marked this conversation as resolved.
Show resolved Hide resolved

// The main stage.
Assets: pallet_assets::<Instance1>::{Pallet, Call, Storage, Event<T>} = 50,
Uniques: pallet_uniques::{Pallet, Call, Storage, Event<T>} = 51,
Original file line number Diff line number Diff line change
@@ -209,7 +209,7 @@ impl<Call> XcmWeightInfo<Call> for AssetHubPolkadotXcmWeight<Call> {
XcmGeneric::<Runtime>::clear_transact_status()
}
fn universal_origin(_: &Junction) -> Weight {
Weight::MAX
XcmGeneric::<Runtime>::universal_origin()
}
fn export_message(_: &NetworkId, _: &Junctions, _: &Xcm<()>) -> Weight {
Weight::MAX
Original file line number Diff line number Diff line change
@@ -312,6 +312,16 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Minimum execution time: 2_845_000 picoseconds.
Weight::from_parts(2_970_000, 0)
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
pub fn universal_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `1489`
// Minimum execution time: 5_088_000 picoseconds.
Weight::from_parts(5_253_000, 1489)
.saturating_add(T::DbWeight::get().reads(1))
}
pub fn set_fees_mode() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
Loading