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

Commit

Permalink
BridgeHubKusama - initial setup - (chain_spec + basic runtime without…
Browse files Browse the repository at this point in the history
… any bridging pallets) (#1764)

* [BridgeHub] Setup Rococo backbone parachain

* [BridgeHub] Setup Wococo parachain backbone (reused from Rococo)
[Bridge-Backport] Rebase-fix
BridgeHub] Added zombienet startup tomls for Rococo/Wococo
Fix typo

* [BridgeHub] Added chain_spec for live Rococo/Wococo

* [BridgeHub] Clean bridge-hub-rococo runtime

* [BridgeHub] Add bridge-hub-rococo to CI pipelines

* [BridgeHub] Added bridge-hub-kusama - empty runtime/chain_spec setup

* Fixes

* Fixes for BH

* Fixes for other runtimes - align all

* Fixes - const

* Fixes const

* Fixes

* Fix kusama-local

* Sample zombienet runs

* Fixes

* Fixes for benchmarking

* Fixes CI

* Fixes

* ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs frame_system

* ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_collator_selection

* ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_balances

* ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_session

* Fixes name

* Fixes readme

* ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_timestamp

* ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs cumulus_pallet_xcmp_queue

* ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_collator_selection

* Fixes

* Fixes

* rustfmt

* Fixes

* Added pallet_utility/pallet_multisig

* Blind try for regex pr-custom-review.yml (added bridge-hub-kusama + collectives-polkadot)

* Fixes

* Fixes

* ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_utility

* ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_multisig

* Trying to fix sed expression?

* Added license headers + correct "DAG:" desc

Co-authored-by: command-bot <>
  • Loading branch information
bkontur authored Dec 2, 2022
1 parent 93ee44c commit 8b6984c
Show file tree
Hide file tree
Showing 68 changed files with 5,319 additions and 212 deletions.
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

0 comments on commit 8b6984c

Please sign in to comment.