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

BridgeHubKusama - initial setup - (chain_spec + basic runtime without any bridging pallets) #1764

Merged
merged 46 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
56beecc
[BridgeHub] Setup Rococo backbone parachain
bkontur Jul 28, 2022
7ed6d06
[BridgeHub] Setup Wococo parachain backbone (reused from Rococo)
bkontur Aug 5, 2022
4420a0b
[BridgeHub] Added chain_spec for live Rococo/Wococo
bkontur Oct 3, 2022
84ce2fa
[BridgeHub] Clean bridge-hub-rococo runtime
bkontur Oct 5, 2022
384e65e
[BridgeHub] Add bridge-hub-rococo to CI pipelines
bkontur Sep 20, 2022
3d29c5a
[BridgeHub] Added bridge-hub-kusama - empty runtime/chain_spec setup
bkontur Oct 5, 2022
2b4d48d
Merge remote-tracking branch 'origin/master' into bko-bridges-setup
bkontur Nov 15, 2022
7ca535b
Fixes
bkontur Nov 15, 2022
eb1d7c2
Fixes for BH
bkontur Nov 15, 2022
4cc4216
Fixes for other runtimes - align all
bkontur Nov 15, 2022
1821bc9
Fixes - const
bkontur Nov 15, 2022
5475227
Fixes const
bkontur Nov 15, 2022
4210b39
Fixes
bkontur Nov 15, 2022
afc6caf
Fix kusama-local
bkontur Nov 15, 2022
601abfe
Sample zombienet runs
bkontur Nov 16, 2022
efb79b2
Merge remote-tracking branch 'origin/master' into bko-bridges-setup
bkontur Nov 16, 2022
53dc6a0
Fixes
bkontur Nov 16, 2022
c5bf12e
Fixes for benchmarking
bkontur Nov 16, 2022
fe88ad0
Fixes CI
bkontur Nov 16, 2022
6ccdbf8
Fixes
bkontur Nov 16, 2022
4bb3eff
".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs fra…
Nov 16, 2022
93ca6e2
".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pal…
Nov 16, 2022
9c608dc
".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pal…
Nov 16, 2022
f22b102
".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pal…
Nov 16, 2022
eb7659d
Fixes name
bkontur Nov 16, 2022
08017fb
Fixes readme
bkontur Nov 16, 2022
d66e46f
".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pal…
Nov 16, 2022
e090afb
".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs cum…
Nov 16, 2022
e52641c
".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pal…
Nov 16, 2022
a700450
Merge remote-tracking branch 'origin/master' into bko-bridges-setup
bkontur Nov 22, 2022
30f6691
Merge remote-tracking branch 'origin/master' into bko-bridges-setup
bkontur Nov 28, 2022
b7b45a9
Fixes
bkontur Nov 28, 2022
eb54ade
Fixes
bkontur Nov 28, 2022
d1e2e6d
rustfmt
bkontur Nov 28, 2022
95093ab
Fixes
bkontur Nov 28, 2022
8a59829
Added pallet_utility/pallet_multisig
bkontur Nov 28, 2022
495a06d
Blind try for regex pr-custom-review.yml (added bridge-hub-kusama + c…
bkontur Nov 28, 2022
670b3e3
Fixes
bkontur Nov 28, 2022
64e53a3
Fixes
bkontur Nov 28, 2022
922b3cd
".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pal…
Nov 28, 2022
2e11cbd
Merge branch 'master' of https://github.com/paritytech/cumulus into HEAD
Nov 28, 2022
a1bd1dc
".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pal…
Nov 28, 2022
fc86117
Trying to fix sed expression?
bkontur Nov 24, 2022
8ddb5e6
Merge remote-tracking branch 'origin/master' into bko-bridges-setup
bkontur Dec 1, 2022
32a951a
Added license headers + correct "DAG:" desc
bkontur Dec 1, 2022
081bf26
Merge remote-tracking branch 'origin/master' into bko-bridges-setup
bkontur Dec 1, 2022
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
4 changes: 2 additions & 2 deletions .github/pr-custom-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ action-review-team: ci
rules:
- name: Runtime files
check_type: changed_files
condition: ^parachains/runtimes/assets/(statemine|statemint)/src/[^/]+\.rs$
condition: ^parachains/runtimes/assets/(statemine|statemint)/src/[^/]+\.rs$|^parachains/runtimes/bridge-hubs/(bridge-hub-kusama|bridge-hub-polkadot)/src/[^/]+\.rs$|^parachains/runtimes/collectives/collectives-polkadot/src/[^/]+\.rs$|^parachains/common/src/[^/]+\.rs$
all_distinct:
- min_approvals: 1
teams:
Expand All @@ -20,7 +20,7 @@ rules:
condition:
include: .*
# excluding files from 'Runtime files' and 'CI files' rules
exclude: ^parachains/runtimes/assets/(statemine|statemint)/src/[^/]+\.rs$|^\.gitlab-ci\.yml|^scripts/ci/.*|^\.github/.*
exclude: ^parachains/runtimes/assets/(statemine|statemint)/src/[^/]+\.rs$|^parachains/runtimes/bridge-hubs/(bridge-hub-kusama|bridge-hub-polkadot)/src/[^/]+\.rs$|^parachains/runtimes/collectives/collectives-polkadot/src/[^/]+\.rs$|^parachains/common/src/[^/]+\.rs$|^\.gitlab-ci\.yml|^scripts/ci/.*|^\.github/.*
min_approvals: 2
teams:
- core-devs
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/release-30_create-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ jobs:
runtime: statemint
- category: assets
runtime: westmint
- category: bridge-hubs
runtime: bridge-hub-kusama
- category: bridge-hubs
runtime: bridge-hub-rococo
- category: collectives
runtime: collectives-polkadot
- category: contracts
Expand Down Expand Up @@ -150,6 +154,8 @@ jobs:
WESTMINT_DIGEST: ${{ github.workspace}}/westmint-srtool-json/westmint-srtool-digest.json
STATEMINE_DIGEST: ${{ github.workspace}}/statemine-srtool-json/statemine-srtool-digest.json
STATEMINT_DIGEST: ${{ github.workspace}}/statemint-srtool-json/statemint-srtool-digest.json
BRIDGE_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/bridge-hub-rococo-srtool-json/bridge-hub-rococo-srtool-digest.json
BRIDGE_HUB_KUSAMA_DIGEST: ${{ github.workspace}}/bridge-hub-kusama-srtool-json/bridge-hub-kusama-srtool-digest.json
COLLECTIVES_POLKADOT_DIGEST: ${{ github.workspace}}/collectives-polkadot-srtool-json/collectives-polkadot-srtool-digest.json
ROCOCO_PARA_DIGEST: ${{ github.workspace}}/rococo-parachain-srtool-json/rococo-parachain-srtool-digest.json
CANVAS_KUSAMA_DIGEST: ${{ github.workspace}}/contracts-rococo-srtool-json/contracts-rococo-srtool-digest.json
Expand All @@ -165,6 +171,8 @@ jobs:
ls -al $WESTMINT_DIGEST || true
ls -al $STATEMINE_DIGEST || true
ls -al $STATEMINT_DIGEST || true
ls -al $BRIDGE_HUB_ROCOCO_DIGEST || true
ls -al $BRIDGE_HUB_KUSAMA_DIGEST || true
ls -al $COLLECTIVES_POLKADOT_DIGEST || true
ls -al $ROCOCO_PARA_DIGEST || true
ls -al $CANVAS_KUSAMA_DIGEST || true
Expand Down Expand Up @@ -216,6 +224,10 @@ jobs:
runtime: statemint
- category: assets
runtime: westmint
- category: bridge-hubs
runtime: bridge-hub-kusama
- category: bridge-hubs
runtime: bridge-hub-rococo
- category: collectives
runtime: collectives-polkadot
- category: contracts
Expand Down Expand Up @@ -255,7 +267,7 @@ jobs:
id: fix-runtime-path
run: |
cd "${{ matrix.runtime }}-runtime/"
mv "$(sed -E 's/-(.*)/_\1/' <<< ${{ matrix.runtime }})_runtime.compact.compressed.wasm" "${{ matrix.runtime }}_runtime.compact.compressed.wasm" || true
mv "$(sed -E 's/- */_/g' <<< ${{ matrix.runtime }})_runtime.compact.compressed.wasm" "${{ matrix.runtime }}_runtime.compact.compressed.wasm" || true

- name: Upload compressed ${{ matrix.runtime }} wasm
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/srtool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
runtime: statemint
- category: assets
runtime: westmint
- category: bridge-hubs
runtime: bridge-hub-kusama
- category: bridge-hubs
runtime: bridge-hub-rococo
- category: collectives
runtime: collectives-polkadot
- category: contracts
Expand Down
128 changes: 128 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ members = [
"parachains/runtimes/assets/statemint",
"parachains/runtimes/assets/statemine",
"parachains/runtimes/assets/westmint",
"parachains/runtimes/bridge-hubs/bridge-hub-rococo",
"parachains/runtimes/bridge-hubs/bridge-hub-kusama",
"parachains/runtimes/collectives/collectives-polkadot",
"parachains/runtimes/contracts/contracts-rococo",
"parachains/runtimes/testing/penpal",
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ Refer to the [setup instructions](#local-setup) to run a local network for devel

See [the `contracts-rococo` readme](parachains/runtimes/contracts/contracts-rococo/README.md) for details.

## Bridge-hub 📝

See [the `bridge-hubs` readme](parachains/runtimes/bridge-hubs/README.md) for details.

## Rococo 👑

[Rococo](https://polkadot.js.org/apps/?rpc=wss://rococo-rpc.polkadot.io) is becoming a [Community Parachain Testbed](https://polkadot.network/blog/rococo-revamp-becoming-a-community-parachain-testbed/) for parachain teams in the Polkadot ecosystem. It supports multiple parachains with the differentiation of long-term connections and recurring short-term connections, to see which parachains are currently connected and how long they will be connected for [see here](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-rpc.polkadot.io#/parachains).
Expand Down
11 changes: 3 additions & 8 deletions pallets/collator-selection/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use super::*;
use crate as collator_selection;
use frame_support::{
ord_parameter_types, parameter_types,
traits::{FindAuthor, GenesisBuild, ValidatorRegistration},
traits::{ConstU32, ConstU64, FindAuthor, GenesisBuild, ValidatorRegistration},
PalletId,
};
use frame_system as system;
Expand Down Expand Up @@ -115,20 +115,16 @@ impl pallet_authorship::Config for Test {
type EventHandler = CollatorSelection;
}

parameter_types! {
pub const MinimumPeriod: u64 = 1;
}

impl pallet_timestamp::Config for Test {
type Moment = u64;
type OnTimestampSet = Aura;
type MinimumPeriod = MinimumPeriod;
type MinimumPeriod = ConstU64<1>;
type WeightInfo = ();
}

impl pallet_aura::Config for Test {
type AuthorityId = sp_consensus_aura::sr25519::AuthorityId;
type MaxAuthorities = MaxAuthorities;
type MaxAuthorities = ConstU32<100_000>;
type DisabledValidators = ();
}

Expand Down Expand Up @@ -192,7 +188,6 @@ parameter_types! {
pub const MaxCandidates: u32 = 20;
pub const MaxInvulnerables: u32 = 20;
pub const MinCandidates: u32 = 1;
pub const MaxAuthorities: u32 = 100_000;
}

pub struct IsRegistered;
Expand Down
28 changes: 8 additions & 20 deletions parachain-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use frame_support::{
construct_runtime,
dispatch::DispatchClass,
parameter_types,
traits::Everything,
traits::{ConstU32, ConstU64, ConstU8, Everything},
weights::{
constants::WEIGHT_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient,
WeightToFeeCoefficients, WeightToFeePolynomial,
Expand Down Expand Up @@ -309,37 +309,27 @@ impl frame_system::Config for Runtime {
type MaxConsumers = frame_support::traits::ConstU32<16>;
}

parameter_types! {
pub const MinimumPeriod: u64 = SLOT_DURATION / 2;
}

impl pallet_timestamp::Config for Runtime {
/// A timestamp: milliseconds since the unix epoch.
type Moment = u64;
type OnTimestampSet = Aura;
type MinimumPeriod = MinimumPeriod;
type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>;
type WeightInfo = ();
}

parameter_types! {
pub const UncleGenerations: u32 = 0;
}

impl pallet_authorship::Config for Runtime {
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Aura>;
type UncleGenerations = UncleGenerations;
type UncleGenerations = ConstU32<0>;
type FilterUncle = ();
type EventHandler = (CollatorSelection,);
}

parameter_types! {
pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT;
pub const MaxLocks: u32 = 50;
pub const MaxReserves: u32 = 50;
}

impl pallet_balances::Config for Runtime {
type MaxLocks = MaxLocks;
type MaxLocks = ConstU32<50>;
/// The type for recording an account's balance.
type Balance = Balance;
/// The ubiquitous event type.
Expand All @@ -348,14 +338,13 @@ impl pallet_balances::Config for Runtime {
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>;
type MaxReserves = MaxReserves;
type MaxReserves = ConstU32<50>;
type ReserveIdentifier = [u8; 8];
}

parameter_types! {
/// Relay Chain `TransactionByteFee` / 10
pub const TransactionByteFee: Balance = 10 * MICROUNIT;
pub const OperationalFeeMultiplier: u8 = 5;
}

impl pallet_transaction_payment::Config for Runtime {
Expand All @@ -364,7 +353,7 @@ impl pallet_transaction_payment::Config for Runtime {
type WeightToFee = WeightToFee;
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type OperationalFeeMultiplier = ConstU8<5>;
}

parameter_types! {
Expand Down Expand Up @@ -408,7 +397,6 @@ impl cumulus_pallet_dmp_queue::Config for Runtime {
parameter_types! {
pub const Period: u32 = 6 * HOURS;
pub const Offset: u32 = 0;
pub const MaxAuthorities: u32 = 100_000;
}

impl pallet_session::Config for Runtime {
Expand All @@ -419,7 +407,7 @@ impl pallet_session::Config for Runtime {
type ShouldEndSession = pallet_session::PeriodicSessions<Period, Offset>;
type NextSessionRotation = pallet_session::PeriodicSessions<Period, Offset>;
type SessionManager = CollatorSelection;
// Essentially just Aura, but lets be pedantic.
// Essentially just Aura, but let's be pedantic.
type SessionHandler = <SessionKeys as sp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type WeightInfo = ();
Expand All @@ -428,7 +416,7 @@ impl pallet_session::Config for Runtime {
impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = MaxAuthorities;
type MaxAuthorities = ConstU32<100_000>;
}

parameter_types! {
Expand Down
1 change: 1 addition & 0 deletions parachains/chain-specs/bridge-hub-kusama.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO: setup
Loading