Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit addf44c

Browse files
bkonturEgorPopelyaev
authored andcommitted
Added new empty shell runtime for BridgeHubPolkadot (without bridging stuff) for onboarding parachain on Polkadot (#2137)
* Added new empty shell runtime for `BridgeHubPolkadot` (without bridging stuff) for onboarding parachain on Polkadot * Fix benchmarks/try-runtime * ".git/.scripts/commands/bench/bench.sh" pallet bridge-hub-polkadot bridge-hubs frame_system * ".git/.scripts/commands/bench/bench.sh" pallet bridge-hub-polkadot bridge-hubs pallet_balances * ".git/.scripts/commands/bench/bench.sh" pallet bridge-hub-polkadot bridge-hubs pallet_multisig * ".git/.scripts/commands/bench/bench.sh" pallet bridge-hub-polkadot bridge-hubs pallet_xcm * Fixes * ".git/.scripts/commands/bench/bench.sh" pallet bridge-hub-polkadot bridge-hubs pallet_session * ".git/.scripts/commands/bench/bench.sh" pallet bridge-hub-polkadot bridge-hubs pallet_utility * ".git/.scripts/commands/bench/bench.sh" pallet bridge-hub-polkadot bridge-hubs pallet_timestamp * ".git/.scripts/commands/bench/bench.sh" pallet bridge-hub-polkadot bridge-hubs pallet_collator_selection * ".git/.scripts/commands/bench/bench.sh" pallet bridge-hub-polkadot bridge-hubs cumulus_pallet_xcmp_queue * PR fixes * Rebase fix * Fix new runtime api * ".git/.scripts/commands/bench/bench.sh" xcm bridge-hub-polkadot bridge-hubs pallet_xcm_benchmarks::fungible * ".git/.scripts/commands/bench/bench.sh" xcm bridge-hub-polkadot bridge-hubs pallet_xcm_benchmarks::generic * Updated aura/bootNodes in `create_bridge_hub_polkadot_spec.sh` --------- Co-authored-by: command-bot <>
1 parent b97eb8d commit addf44c

39 files changed

+3586
-11
lines changed

.github/workflows/release-30_create-draft.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
runtime: statemint
5151
- category: assets
5252
runtime: westmint
53+
- category: bridge-hubs
54+
runtime: bridge-hub-polkadot
5355
- category: bridge-hubs
5456
runtime: bridge-hub-kusama
5557
- category: bridge-hubs
@@ -156,6 +158,7 @@ jobs:
156158
STATEMINT_DIGEST: ${{ github.workspace}}/statemint-srtool-json/statemint-srtool-digest.json
157159
BRIDGE_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/bridge-hub-rococo-srtool-json/bridge-hub-rococo-srtool-digest.json
158160
BRIDGE_HUB_KUSAMA_DIGEST: ${{ github.workspace}}/bridge-hub-kusama-srtool-json/bridge-hub-kusama-srtool-digest.json
161+
BRIDGE_HUB_POLKADOT_DIGEST: ${{ github.workspace}}/bridge-hub-polkadot-srtool-json/bridge-hub-polkadot-srtool-digest.json
159162
COLLECTIVES_POLKADOT_DIGEST: ${{ github.workspace}}/collectives-polkadot-srtool-json/collectives-polkadot-srtool-digest.json
160163
ROCOCO_PARA_DIGEST: ${{ github.workspace}}/rococo-parachain-srtool-json/rococo-parachain-srtool-digest.json
161164
CANVAS_KUSAMA_DIGEST: ${{ github.workspace}}/contracts-rococo-srtool-json/contracts-rococo-srtool-digest.json
@@ -173,6 +176,7 @@ jobs:
173176
ls -al $STATEMINT_DIGEST || true
174177
ls -al $BRIDGE_HUB_ROCOCO_DIGEST || true
175178
ls -al $BRIDGE_HUB_KUSAMA_DIGEST || true
179+
ls -al $BRIDGE_HUB_POLKADOT_DIGEST || true
176180
ls -al $COLLECTIVES_POLKADOT_DIGEST || true
177181
ls -al $ROCOCO_PARA_DIGEST || true
178182
ls -al $CANVAS_KUSAMA_DIGEST || true
@@ -224,6 +228,8 @@ jobs:
224228
runtime: statemint
225229
- category: assets
226230
runtime: westmint
231+
- category: bridge-hubs
232+
runtime: bridge-hub-polkadot
227233
- category: bridge-hubs
228234
runtime: bridge-hub-kusama
229235
- category: bridge-hubs

.github/workflows/srtool.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
runtime: statemint
3838
- category: assets
3939
runtime: westmint
40+
- category: bridge-hubs
41+
runtime: bridge-hub-polkadot
4042
- category: bridge-hubs
4143
runtime: bridge-hub-kusama
4244
- category: bridge-hubs

Cargo.lock

Lines changed: 64 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ members = [
4040
"parachains/runtimes/assets/westmint",
4141
"parachains/runtimes/bridge-hubs/bridge-hub-rococo",
4242
"parachains/runtimes/bridge-hubs/bridge-hub-kusama",
43+
"parachains/runtimes/bridge-hubs/bridge-hub-polkadot",
4344
"parachains/runtimes/collectives/collectives-polkadot",
4445
"parachains/runtimes/contracts/contracts-rococo",
4546
"parachains/runtimes/testing/penpal",

parachains/chain-specs/bridge-hub-polkadot.json

Lines changed: 67 additions & 0 deletions
Large diffs are not rendered by default.

parachains/runtimes/assets/statemint/src/constants.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub mod currency {
1717
use polkadot_core_primitives::Balance;
1818
use polkadot_runtime_constants as constants;
1919

20-
/// The existential deposit. Set to 1/10 of its parent Relay Chain (v9010).
20+
/// The existential deposit. Set to 1/10 of its parent Relay Chain.
2121
pub const EXISTENTIAL_DEPOSIT: Balance = constants::currency::EXISTENTIAL_DEPOSIT / 10;
2222

2323
pub const UNITS: Balance = constants::currency::UNITS;
@@ -26,7 +26,7 @@ pub mod currency {
2626
pub const MILLICENTS: Balance = constants::currency::MILLICENTS;
2727

2828
pub const fn deposit(items: u32, bytes: u32) -> Balance {
29-
// 1/100 of Polkadot v9010
29+
// 1/100 of Polkadot
3030
constants::currency::deposit(items, bytes) / 100
3131
}
3232
}

parachains/runtimes/bridge-hubs/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ cd <base-cumulus-repo-directory>
2020
cargo build --release -p [email protected]
2121
2222
# script expect to have pre-built polkadot binary on the path: ../polkadot/target/release/polkadot
23-
# if using kusama-local, build polkadot with `--features fast-runtime`
23+
# if using `kusama-local` / `polkadot-local`, build polkadot with `--features fast-runtime`
2424
2525
# BridgeHubRococo
2626
zombienet-linux --provider native spawn ./zombienet/examples/bridge_hub_rococo_local_network.toml
@@ -29,4 +29,9 @@ zombienet-linux --provider native spawn ./zombienet/examples/bridge_hub_rococo_l
2929
3030
# BridgeHubKusama
3131
zombienet-linux --provider native spawn ./zombienet/examples/bridge_hub_kusama_local_network.toml
32+
33+
or
34+
35+
# BridgeHubPolkadot
36+
zombienet-linux --provider native spawn ./zombienet/examples/bridge_hub_polkadot_local_network.toml
3237
```
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
[package]
2+
name = "bridge-hub-polkadot-runtime"
3+
version = "0.1.0"
4+
authors = ["Parity Technologies <[email protected]>"]
5+
edition = "2021"
6+
description = "Polkadot's BridgeHub parachain runtime"
7+
8+
[build-dependencies]
9+
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
10+
11+
[dependencies]
12+
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
13+
hex-literal = { version = "0.3.4" }
14+
log = { version = "0.4.17", default-features = false }
15+
scale-info = { version = "2.3.1", default-features = false, features = ["derive"] }
16+
serde = { version = "1.0.152", optional = true, features = ["derive"] }
17+
smallvec = "1.8.1"
18+
19+
# Substrate
20+
frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "master" }
21+
frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
22+
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
23+
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
24+
frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "master" }
25+
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
26+
frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "master" }
27+
pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
28+
pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
29+
pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
30+
pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
31+
pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
32+
pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
33+
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
34+
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
35+
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
36+
pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
37+
sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
38+
sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
39+
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
40+
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
41+
sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
42+
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
43+
sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
44+
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
45+
sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
46+
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
47+
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
48+
sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
49+
50+
# Polkadot
51+
polkadot-runtime-constants = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
52+
pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
53+
pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, optional = true }
54+
polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
55+
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
56+
polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
57+
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
58+
xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
59+
xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
60+
61+
# Cumulus
62+
cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false }
63+
cumulus-pallet-dmp-queue = { path = "../../../../pallets/dmp-queue", default-features = false }
64+
cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system", default-features = false }
65+
cumulus-pallet-session-benchmarking = {path = "../../../../pallets/session-benchmarking", default-features = false, version = "3.0.0"}
66+
cumulus-pallet-xcm = { path = "../../../../pallets/xcm", default-features = false }
67+
cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false }
68+
cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false }
69+
cumulus-primitives-timestamp = { path = "../../../../primitives/timestamp", default-features = false }
70+
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
71+
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
72+
parachain-info = { path = "../../../../parachains/pallets/parachain-info", default-features = false }
73+
parachains-common = { path = "../../../../parachains/common", default-features = false }
74+
75+
[features]
76+
default = [
77+
"std",
78+
]
79+
std = [
80+
"codec/std",
81+
"log/std",
82+
"scale-info/std",
83+
"serde",
84+
"cumulus-pallet-aura-ext/std",
85+
"cumulus-pallet-dmp-queue/std",
86+
"cumulus-pallet-parachain-system/std",
87+
"cumulus-pallet-xcm/std",
88+
"cumulus-pallet-xcmp-queue/std",
89+
"cumulus-primitives-core/std",
90+
"cumulus-primitives-timestamp/std",
91+
"cumulus-primitives-utility/std",
92+
"frame-executive/std",
93+
"frame-support/std",
94+
"frame-system-rpc-runtime-api/std",
95+
"frame-system/std",
96+
"polkadot-runtime-constants/std",
97+
"pallet-aura/std",
98+
"pallet-authorship/std",
99+
"pallet-balances/std",
100+
"pallet-collator-selection/std",
101+
"pallet-multisig/std",
102+
"pallet-session/std",
103+
"pallet-sudo/std",
104+
"pallet-timestamp/std",
105+
"pallet-transaction-payment-rpc-runtime-api/std",
106+
"pallet-transaction-payment/std",
107+
"pallet-utility/std",
108+
"pallet-xcm/std",
109+
"parachain-info/std",
110+
"parachains-common/std",
111+
"polkadot-core-primitives/std",
112+
"polkadot-parachain/std",
113+
"polkadot-runtime-common/std",
114+
"sp-api/std",
115+
"sp-block-builder/std",
116+
"sp-consensus-aura/std",
117+
"sp-core/std",
118+
"sp-inherents/std",
119+
"sp-io/std",
120+
"sp-offchain/std",
121+
"sp-runtime/std",
122+
"sp-session/std",
123+
"sp-std/std",
124+
"sp-transaction-pool/std",
125+
"sp-version/std",
126+
"xcm-builder/std",
127+
"xcm-executor/std",
128+
"xcm/std",
129+
]
130+
131+
runtime-benchmarks = [
132+
"frame-benchmarking/runtime-benchmarks",
133+
"frame-support/runtime-benchmarks",
134+
"frame-system-benchmarking/runtime-benchmarks",
135+
"frame-system/runtime-benchmarks",
136+
"pallet-balances/runtime-benchmarks",
137+
"pallet-multisig/runtime-benchmarks",
138+
"pallet-timestamp/runtime-benchmarks",
139+
"pallet-utility/runtime-benchmarks",
140+
"pallet-xcm/runtime-benchmarks",
141+
"sp-runtime/runtime-benchmarks",
142+
"xcm-builder/runtime-benchmarks",
143+
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
144+
"pallet-collator-selection/runtime-benchmarks",
145+
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
146+
"pallet-xcm-benchmarks/runtime-benchmarks",
147+
]
148+
149+
try-runtime = [
150+
"cumulus-pallet-aura-ext/try-runtime",
151+
"cumulus-pallet-dmp-queue/try-runtime",
152+
"cumulus-pallet-parachain-system/try-runtime",
153+
"cumulus-pallet-xcm/try-runtime",
154+
"cumulus-pallet-xcmp-queue/try-runtime",
155+
"frame-executive/try-runtime",
156+
"frame-system/try-runtime",
157+
"frame-try-runtime/try-runtime",
158+
"pallet-aura/try-runtime",
159+
"pallet-authorship/try-runtime",
160+
"pallet-balances/try-runtime",
161+
"pallet-collator-selection/try-runtime",
162+
"pallet-multisig/try-runtime",
163+
"pallet-session/try-runtime",
164+
"pallet-timestamp/try-runtime",
165+
"pallet-transaction-payment/try-runtime",
166+
"pallet-utility/try-runtime",
167+
"pallet-xcm/try-runtime",
168+
"parachain-info/try-runtime",
169+
]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use substrate_wasm_builder::WasmBuilder;
2+
3+
fn main() {
4+
WasmBuilder::new()
5+
.with_current_project()
6+
.export_heap_base()
7+
.import_memory()
8+
.build()
9+
}

0 commit comments

Comments
 (0)