git.delta.rocks / unique-network / refs/commits / 9667dc5f64e7

difftreelog

feat(CollatorSelection) inclusion + migration + genesis

Fahrrader2022-03-30parent: #997ec5a.patch.diff
in: master

10 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -108,9 +108,9 @@
 
 [[package]]
 name = "anyhow"
-version = "1.0.61"
+version = "1.0.62"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "508b352bb5c066aac251f6daf6b36eccd03e8a88e8081cd44959ea277a3af9a8"
+checksum = "1485d4d2cc45e7b201ee3767015c96faa5904387c9d87c6efdd0fb511f12d305"
 
 [[package]]
 name = "approx"
@@ -213,10 +213,11 @@
 
 [[package]]
 name = "async-io"
-version = "1.7.0"
+version = "1.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5e18f61464ae81cde0a23e713ae8fd299580c54d697a35820cfd0625b8b0e07"
+checksum = "0ab006897723d9352f63e2b13047177c3982d8d79709d713ce7747a8f19fd1b0"
 dependencies = [
+ "autocfg",
  "concurrent-queue",
  "futures-lite",
  "libc",
@@ -241,11 +242,12 @@
 
 [[package]]
 name = "async-process"
-version = "1.4.0"
+version = "1.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf2c06e30a24e8c78a3987d07f0930edf76ef35e027e7bdb063fccafdad1f60c"
+checksum = "02111fd8655a613c25069ea89fc8d9bb89331fa77486eb3bc059ee757cfa481c"
 dependencies = [
  "async-io",
+ "autocfg",
  "blocking",
  "cfg-if 1.0.0",
  "event-listener",
@@ -717,9 +719,9 @@
 
 [[package]]
 name = "bumpalo"
-version = "3.10.0"
+version = "3.11.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3"
+checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d"
 
 [[package]]
 name = "byte-slice-cast"
@@ -1045,9 +1047,9 @@
 
 [[package]]
 name = "cpufeatures"
-version = "0.2.2"
+version = "0.2.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b"
+checksum = "dc948ebb96241bb40ab73effeb80d9f93afaad49359d159a5e61be51619fe813"
 dependencies = [
  "libc",
 ]
@@ -2021,9 +2023,9 @@
 
 [[package]]
 name = "either"
-version = "1.7.0"
+version = "1.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be"
+checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797"
 
 [[package]]
 name = "elliptic-curve"
@@ -2345,7 +2347,7 @@
 [[package]]
 name = "fc-consensus"
 version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "async-trait",
  "fc-db",
@@ -2364,7 +2366,7 @@
 [[package]]
 name = "fc-db"
 version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "fp-storage",
  "kvdb-rocksdb",
@@ -2380,7 +2382,7 @@
 [[package]]
 name = "fc-mapping-sync"
 version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "fc-db",
  "fp-consensus",
@@ -2397,7 +2399,7 @@
 [[package]]
 name = "fc-rpc"
 version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "ethereum",
  "ethereum-types",
@@ -2437,7 +2439,7 @@
 [[package]]
 name = "fc-rpc-core"
 version = "1.1.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "ethereum",
  "ethereum-types",
@@ -2578,7 +2580,7 @@
 [[package]]
 name = "fp-consensus"
 version = "2.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "ethereum",
  "parity-scale-codec 3.1.5",
@@ -2590,7 +2592,7 @@
 [[package]]
 name = "fp-evm"
 version = "3.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "evm",
  "frame-support",
@@ -2604,7 +2606,7 @@
 [[package]]
 name = "fp-evm-mapping"
 version = "0.1.0"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "frame-support",
  "sp-core",
@@ -2613,7 +2615,7 @@
 [[package]]
 name = "fp-rpc"
 version = "3.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "ethereum",
  "ethereum-types",
@@ -2630,7 +2632,7 @@
 [[package]]
 name = "fp-self-contained"
 version = "1.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "ethereum",
  "frame-support",
@@ -2646,7 +2648,7 @@
 [[package]]
 name = "fp-storage"
 version = "2.0.0"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "parity-scale-codec 3.1.5",
 ]
@@ -2897,9 +2899,9 @@
 
 [[package]]
 name = "fs-err"
-version = "2.7.0"
+version = "2.8.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5bd79fa345a495d3ae89fb7165fec01c0e72f41821d642dda363a1e97975652e"
+checksum = "64db3e262960f0662f43a6366788d5f10f7f244b8f7d7d987f560baf5ded5c50"
 
 [[package]]
 name = "fs-swap"
@@ -3197,9 +3199,9 @@
 
 [[package]]
 name = "h2"
-version = "0.3.13"
+version = "0.3.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57"
+checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be"
 dependencies = [
  "bytes",
  "fnv",
@@ -3417,9 +3419,9 @@
 
 [[package]]
 name = "iana-time-zone"
-version = "0.1.45"
+version = "0.1.46"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef5528d9c2817db4e10cc78f8d4c8228906e5854f389ff6b076cee3572a09d35"
+checksum = "ad2bfd338099682614d3ee3fe0cd72e0b6a41ca6a87f6a74a3bd593c91650501"
 dependencies = [
  "android_system_properties",
  "core-foundation-sys",
@@ -3554,9 +3556,9 @@
 
 [[package]]
 name = "io-lifetimes"
-version = "0.7.2"
+version = "0.7.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24c3f4eff5495aee4c0399d7b6a0dc2b6e81be84242ffbfcf253ebacccc1d0cb"
+checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06"
 
 [[package]]
 name = "ip_network"
@@ -3936,9 +3938,9 @@
 
 [[package]]
 name = "libc"
-version = "0.2.131"
+version = "0.2.132"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04c3b4822ccebfa39c02fc03d1534441b22ead323fa0f48bb7ddd8e6ba076a40"
+checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5"
 
 [[package]]
 name = "libloading"
@@ -5160,9 +5162,9 @@
 
 [[package]]
 name = "once_cell"
-version = "1.13.0"
+version = "1.13.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
+checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e"
 
 [[package]]
 name = "opal-runtime"
@@ -5192,8 +5194,10 @@
  "log",
  "orml-vesting",
  "pallet-aura",
+ "pallet-authorship",
  "pallet-balances",
  "pallet-base-fee",
+ "pallet-collator-selection",
  "pallet-common",
  "pallet-configuration",
  "pallet-ethereum",
@@ -5209,6 +5213,7 @@
  "pallet-refungible",
  "pallet-rmrk-core",
  "pallet-rmrk-equip",
+ "pallet-session",
  "pallet-structure",
  "pallet-sudo",
  "pallet-template-transaction-payment",
@@ -5445,7 +5450,7 @@
 [[package]]
 name = "pallet-base-fee"
 version = "1.0.0"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "fp-evm",
  "frame-support",
@@ -5534,6 +5539,26 @@
 ]
 
 [[package]]
+name = "pallet-collator-selection"
+version = "3.0.0"
+source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "log",
+ "pallet-authorship",
+ "pallet-session",
+ "parity-scale-codec 3.1.5",
+ "rand 0.8.5",
+ "scale-info",
+ "serde",
+ "sp-runtime",
+ "sp-staking",
+ "sp-std",
+]
+
+[[package]]
 name = "pallet-collective"
 version = "4.0.0-dev"
 source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05"
@@ -5660,7 +5685,7 @@
 [[package]]
 name = "pallet-ethereum"
 version = "4.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "ethereum",
  "ethereum-types",
@@ -5689,7 +5714,7 @@
 [[package]]
 name = "pallet-evm"
 version = "6.0.0-dev"
-source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21"
+source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c"
 dependencies = [
  "evm",
  "fp-evm",
@@ -6806,9 +6831,9 @@
 
 [[package]]
 name = "pest"
-version = "2.2.1"
+version = "2.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69486e2b8c2d2aeb9762db7b4e00b0331156393555cff467f4163ff06821eef8"
+checksum = "4b0560d531d1febc25a3c9398a62a71256c0178f2e3443baedd9ad4bb8c9deb4"
 dependencies = [
  "thiserror",
  "ucd-trie",
@@ -6816,9 +6841,9 @@
 
 [[package]]
 name = "pest_derive"
-version = "2.2.1"
+version = "2.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b13570633aff33c6d22ce47dd566b10a3b9122c2fe9d8e7501895905be532b91"
+checksum = "905708f7f674518498c1f8d644481440f476d39ca6ecae83319bba7c6c12da91"
 dependencies = [
  "pest",
  "pest_generator",
@@ -6826,9 +6851,9 @@
 
 [[package]]
 name = "pest_generator"
-version = "2.2.1"
+version = "2.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3c567e5702efdc79fb18859ea74c3eb36e14c43da7b8c1f098a4ed6514ec7a0"
+checksum = "5803d8284a629cc999094ecd630f55e91b561a1d1ba75e233b00ae13b91a69ad"
 dependencies = [
  "pest",
  "pest_meta",
@@ -6839,9 +6864,9 @@
 
 [[package]]
 name = "pest_meta"
-version = "2.2.1"
+version = "2.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5eb32be5ee3bbdafa8c7a18b0a8a8d962b66cfa2ceee4037f49267a50ee821fe"
+checksum = "1538eb784f07615c6d9a8ab061089c6c54a344c5b4301db51990ca1c241e8c04"
 dependencies = [
  "once_cell",
  "pest",
@@ -8142,10 +8167,11 @@
 
 [[package]]
 name = "polling"
-version = "2.2.0"
+version = "2.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259"
+checksum = "899b00b9c8ab553c743b3e11e87c5c7d423b2a2de229ba95b24a756344748011"
 dependencies = [
+ "autocfg",
  "cfg-if 1.0.0",
  "libc",
  "log",
@@ -8397,8 +8423,10 @@
  "log",
  "orml-vesting",
  "pallet-aura",
+ "pallet-authorship",
  "pallet-balances",
  "pallet-base-fee",
+ "pallet-collator-selection",
  "pallet-common",
  "pallet-configuration",
  "pallet-ethereum",
@@ -8414,6 +8442,7 @@
  "pallet-refungible",
  "pallet-rmrk-core",
  "pallet-rmrk-equip",
+ "pallet-session",
  "pallet-structure",
  "pallet-sudo",
  "pallet-template-transaction-payment",
@@ -9004,13 +9033,13 @@
 
 [[package]]
 name = "rustix"
-version = "0.35.7"
+version = "0.35.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d51cc38aa10f6bbb377ed28197aa052aa4e2b762c22be9d3153d01822587e787"
+checksum = "72c825b8aa8010eb9ee99b75f05e10180b9278d161583034d7574c9d617aeada"
 dependencies = [
  "bitflags",
  "errno",
- "io-lifetimes 0.7.2",
+ "io-lifetimes 0.7.3",
  "libc",
  "linux-raw-sys 0.0.46",
  "windows-sys",
@@ -9567,7 +9596,7 @@
  "once_cell",
  "parity-scale-codec 3.1.5",
  "parity-wasm 0.42.2",
- "rustix 0.35.7",
+ "rustix 0.35.9",
  "sc-allocator",
  "sc-executor-common",
  "sp-runtime-interface",
@@ -10260,9 +10289,9 @@
 
 [[package]]
 name = "security-framework"
-version = "2.6.1"
+version = "2.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc"
+checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c"
 dependencies = [
  "bitflags",
  "core-foundation",
@@ -10316,18 +10345,18 @@
 
 [[package]]
 name = "serde"
-version = "1.0.143"
+version = "1.0.144"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53e8e5d5b70924f74ff5c6d64d9a5acd91422117c60f48c4e07855238a254553"
+checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860"
 dependencies = [
  "serde_derive",
 ]
 
 [[package]]
 name = "serde_derive"
-version = "1.0.143"
+version = "1.0.144"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3d8e8de557aee63c26b85b947f5e59b690d0454c753f3adeb5cd7835ab88391"
+checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -10336,9 +10365,9 @@
 
 [[package]]
 name = "serde_json"
-version = "1.0.83"
+version = "1.0.85"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7"
+checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44"
 dependencies = [
  "itoa 1.0.3",
  "ryu",
@@ -11306,9 +11335,9 @@
 
 [[package]]
 name = "ss58-registry"
-version = "1.25.0"
+version = "1.28.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a039906277e0d8db996cd9d1ef19278c10209d994ecfc1025ced16342873a17c"
+checksum = "1c8a1e645fa0bd3e81a90e592a677f7ada3182ac338c4a71cd9ec0ba911f6abb"
 dependencies = [
  "Inflector",
  "num-format",
@@ -12386,8 +12415,10 @@
  "log",
  "orml-vesting",
  "pallet-aura",
+ "pallet-authorship",
  "pallet-balances",
  "pallet-base-fee",
+ "pallet-collator-selection",
  "pallet-common",
  "pallet-configuration",
  "pallet-ethereum",
@@ -12403,6 +12434,7 @@
  "pallet-refungible",
  "pallet-rmrk-core",
  "pallet-rmrk-equip",
+ "pallet-session",
  "pallet-structure",
  "pallet-sudo",
  "pallet-template-transaction-payment",
@@ -12473,7 +12505,7 @@
 
 [[package]]
 name = "up-common"
-version = "0.9.25"
+version = "0.9.27"
 dependencies = [
  "fp-rpc",
  "frame-support",
modifiednode/cli/src/chain_spec.rsdiffbeforeafterboth
--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -24,6 +24,7 @@
 use serde_json::map::Map;
 
 use up_common::types::opaque::*;
+use up_common::constants::EXISTENTIAL_DEPOSIT;
 
 #[cfg(feature = "unique-runtime")]
 pub use unique_runtime as default_runtime;
@@ -146,7 +147,7 @@
 	(
 		$runtime:path,
 		$root_key:expr,
-		$initial_authorities:expr,
+		$initial_invulnerables:expr,
 		$endowed_accounts:expr,
 		$id:expr
 	) => {{
@@ -175,9 +176,31 @@
 				parachain_id: $id.into(),
 			},
 			parachain_system: Default::default(),
-			aura: AuraConfig {
-				authorities: $initial_authorities,
+			collator_selection: CollatorSelectionConfig {
+				invulnerables: $initial_invulnerables
+					.iter()
+					.cloned()
+					.map(|(acc, _)| acc)
+					.collect(),
+				candidacy_bond: EXISTENTIAL_DEPOSIT * 16,
+				..Default::default()
+			},
+			session: SessionConfig {
+				keys: $initial_invulnerables
+					.into_iter()
+					.map(|(acc, aura)| {
+						(
+							acc.clone(),          // account id
+							acc,                  // validator id
+							SessionKeys { aura }, // session keys
+						)
+					})
+					.collect(),
 			},
+			aura: Default::default(),
+			/*aura: AuraConfig {
+				authorities: $initial_authorities,
+			},*/
 			aura_ext: Default::default(),
 			evm: EVMConfig {
 				accounts: BTreeMap::new(),
@@ -217,8 +240,14 @@
 				// Sudo account
 				get_account_id_from_seed::<sr25519::Public>("Alice"),
 				vec![
-					get_from_seed::<AuraId>("Alice"),
-					get_from_seed::<AuraId>("Bob"),
+					(
+						get_account_id_from_seed::<sr25519::Public>("Alice"),
+						get_from_seed::<AuraId>("Alice"),
+					),
+					(
+						get_account_id_from_seed::<sr25519::Public>("Bob"),
+						get_from_seed::<AuraId>("Bob"),
+					),
 				],
 				// Pre-funded accounts
 				vec![
@@ -285,8 +314,14 @@
 				// Sudo account
 				get_account_id_from_seed::<sr25519::Public>("Alice"),
 				vec![
-					get_from_seed::<AuraId>("Alice"),
-					get_from_seed::<AuraId>("Bob"),
+					(
+						get_account_id_from_seed::<sr25519::Public>("Alice"),
+						get_from_seed::<AuraId>("Alice"),
+					),
+					(
+						get_account_id_from_seed::<sr25519::Public>("Bob"),
+						get_from_seed::<AuraId>("Bob"),
+					),
 				],
 				// Pre-funded accounts
 				vec![
modifiedprimitives/common/src/constants.rsdiffbeforeafterboth
--- a/primitives/common/src/constants.rs
+++ b/primitives/common/src/constants.rs
@@ -35,6 +35,8 @@
 pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE;
 pub const UNIQUE: Balance = 100 * CENTIUNIQUE;
 
+pub const EXISTENTIAL_DEPOSIT: u128 = 0;
+
 // Targeting 0.1 UNQ per transfer
 pub const WEIGHT_TO_FEE_COEFF: u32 = /*<weight2fee>*/207_163_598/*</weight2fee>*/;
 
modifiedruntime/common/config/substrate.rsdiffbeforeafterboth
before · runtime/common/config/substrate.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use frame_support::{18	traits::{Everything, ConstU32, NeverEnsureOrigin},19	weights::{20		constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight},21		DispatchClass, ConstantMultiplier,22	},23	parameter_types, PalletId,24};25use sp_runtime::{26	generic,27	traits::{BlakeTwo256, AccountIdLookup},28	Perbill, Permill, Percent,29};30use frame_system::{31	limits::{BlockLength, BlockWeights},32	EnsureRoot,33};34use crate::{35	runtime_common::DealWithFees, Runtime, Event, Call, Origin, PalletInfo, System, Balances,36	Treasury, SS58Prefix, Version,37};38use up_common::{types::*, constants::*};3940parameter_types! {41	pub const BlockHashCount: BlockNumber = 2400;42	pub RuntimeBlockLength: BlockLength =43		BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);44	pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);45	pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;46	pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()47		.base_block(BlockExecutionWeight::get())48		.for_class(DispatchClass::all(), |weights| {49			weights.base_extrinsic = ExtrinsicBaseWeight::get();50		})51		.for_class(DispatchClass::Normal, |weights| {52			weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);53		})54		.for_class(DispatchClass::Operational, |weights| {55			weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);56			// Operational transactions have some extra reserved space, so that they57			// are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.58			weights.reserved = Some(59				MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT60			);61		})62		.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)63		.build_or_panic();64}6566impl frame_system::Config for Runtime {67	/// The data to be stored in an account.68	type AccountData = pallet_balances::AccountData<Balance>;69	/// The identifier used to distinguish between accounts.70	type AccountId = AccountId;71	/// The basic call filter to use in dispatchable.72	type BaseCallFilter = Everything;73	/// Maximum number of block number to block hash mappings to keep (oldest pruned first).74	type BlockHashCount = BlockHashCount;75	/// The maximum length of a block (in bytes).76	type BlockLength = RuntimeBlockLength;77	/// The index type for blocks.78	type BlockNumber = BlockNumber;79	/// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block.80	type BlockWeights = RuntimeBlockWeights;81	/// The aggregated dispatch type that is available for extrinsics.82	type Call = Call;83	/// The weight of database operations that the runtime can invoke.84	type DbWeight = RocksDbWeight;85	/// The ubiquitous event type.86	type Event = Event;87	/// The type for hashing blocks and tries.88	type Hash = Hash;89	/// The hashing algorithm used.90	type Hashing = BlakeTwo256;91	/// The header type.92	type Header = generic::Header<BlockNumber, BlakeTwo256>;93	/// The index type for storing how many extrinsics an account has signed.94	type Index = Index;95	/// The lookup mechanism to get account ID from whatever is passed in dispatchers.96	type Lookup = AccountIdLookup<AccountId, ()>;97	/// What to do if an account is fully reaped from the system.98	type OnKilledAccount = ();99	/// What to do if a new account is created.100	type OnNewAccount = ();101	type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;102	/// The ubiquitous origin type.103	type Origin = Origin;104	/// This type is being generated by `construct_runtime!`.105	type PalletInfo = PalletInfo;106	/// This is used as an identifier of the chain. 42 is the generic substrate prefix.107	type SS58Prefix = SS58Prefix;108	/// Weight information for the extrinsics of this pallet.109	type SystemWeightInfo = frame_system::weights::SubstrateWeight<Self>;110	/// Version of the runtime.111	type Version = Version;112	type MaxConsumers = ConstU32<16>;113}114115impl pallet_randomness_collective_flip::Config for Runtime {}116117parameter_types! {118	pub const MinimumPeriod: u64 = SLOT_DURATION / 2;119}120121impl pallet_timestamp::Config for Runtime {122	/// A timestamp: milliseconds since the unix epoch.123	type Moment = u64;124	type OnTimestampSet = ();125	type MinimumPeriod = MinimumPeriod;126	type WeightInfo = ();127}128129parameter_types! {130	// pub const ExistentialDeposit: u128 = 500;131	pub const ExistentialDeposit: u128 = 0;132	pub const MaxLocks: u32 = 50;133	pub const MaxReserves: u32 = 50;134}135136impl pallet_balances::Config for Runtime {137	type MaxLocks = MaxLocks;138	type MaxReserves = MaxReserves;139	type ReserveIdentifier = [u8; 16];140	/// The type for recording an account's balance.141	type Balance = Balance;142	/// The ubiquitous event type.143	type Event = Event;144	type DustRemoval = Treasury;145	type ExistentialDeposit = ExistentialDeposit;146	type AccountStore = System;147	type WeightInfo = pallet_balances::weights::SubstrateWeight<Self>;148}149150parameter_types! {151	/// This value increases the priority of `Operational` transactions by adding152	/// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`.153	pub const OperationalFeeMultiplier: u8 = 5;154}155156impl pallet_transaction_payment::Config for Runtime {157	type Event = Event;158	type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees>;159	type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;160	type OperationalFeeMultiplier = OperationalFeeMultiplier;161	type WeightToFee = pallet_configuration::WeightToFee<Self, Balance>;162	type FeeMultiplierUpdate = ();163}164165parameter_types! {166	pub const ProposalBond: Permill = Permill::from_percent(5);167	pub const ProposalBondMinimum: Balance = 1 * UNIQUE;168	pub const ProposalBondMaximum: Balance = 1000 * UNIQUE;169	pub const SpendPeriod: BlockNumber = 5 * MINUTES;170	pub const Burn: Permill = Permill::from_percent(0);171	pub const TipCountdown: BlockNumber = 1 * DAYS;172	pub const TipFindersFee: Percent = Percent::from_percent(20);173	pub const TipReportDepositBase: Balance = 1 * UNIQUE;174	pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE;175	pub const BountyDepositBase: Balance = 1 * UNIQUE;176	pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;177	pub const TreasuryModuleId: PalletId = PalletId(*b"py/trsry");178	pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;179	pub const MaximumReasonLength: u32 = 16384;180	pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);181	pub const BountyValueMinimum: Balance = 5 * UNIQUE;182	pub const MaxApprovals: u32 = 100;183}184185impl pallet_treasury::Config for Runtime {186	type PalletId = TreasuryModuleId;187	type Currency = Balances;188	type ApproveOrigin = EnsureRoot<AccountId>;189	type RejectOrigin = EnsureRoot<AccountId>;190	type SpendOrigin = NeverEnsureOrigin<u128>;191	type Event = Event;192	type OnSlash = ();193	type ProposalBond = ProposalBond;194	type ProposalBondMinimum = ProposalBondMinimum;195	type ProposalBondMaximum = ProposalBondMaximum;196	type SpendPeriod = SpendPeriod;197	type Burn = Burn;198	type BurnDestination = ();199	type SpendFunds = ();200	type WeightInfo = pallet_treasury::weights::SubstrateWeight<Self>;201	type MaxApprovals = MaxApprovals;202}203204impl pallet_sudo::Config for Runtime {205	type Event = Event;206	type Call = Call;207}208209parameter_types! {210	pub const MaxAuthorities: u32 = 100_000;211}212213impl pallet_aura::Config for Runtime {214	type AuthorityId = AuraId;215	type DisabledValidators = ();216	type MaxAuthorities = MaxAuthorities;217}
after · runtime/common/config/substrate.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use frame_support::{18	traits::{Everything, ConstU32, NeverEnsureOrigin},19	weights::{20		constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight},21		DispatchClass, ConstantMultiplier,22	},23	parameter_types, PalletId,24};25use sp_runtime::{26	generic,27	traits::{BlakeTwo256, AccountIdLookup},28	Perbill, Permill, Percent,29};30use frame_system::{31	limits::{BlockLength, BlockWeights},32	EnsureRoot,33};34use crate::{35	runtime_common::DealWithFees, Runtime, Event, Call, Origin, PalletInfo, System, Balances,36	Treasury, SS58Prefix, Aura, Session, SessionKeys, CollatorSelection, Version,37};38use xcm::v1::BodyId;39use up_common::{types::*, constants::*};4041parameter_types! {42	pub const BlockHashCount: BlockNumber = 2400;43	pub RuntimeBlockLength: BlockLength =44		BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);45	pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);46	pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;47	pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()48		.base_block(BlockExecutionWeight::get())49		.for_class(DispatchClass::all(), |weights| {50			weights.base_extrinsic = ExtrinsicBaseWeight::get();51		})52		.for_class(DispatchClass::Normal, |weights| {53			weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);54		})55		.for_class(DispatchClass::Operational, |weights| {56			weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);57			// Operational transactions have some extra reserved space, so that they58			// are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.59			weights.reserved = Some(60				MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT61			);62		})63		.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)64		.build_or_panic();65}6667impl frame_system::Config for Runtime {68	/// The data to be stored in an account.69	type AccountData = pallet_balances::AccountData<Balance>;70	/// The identifier used to distinguish between accounts.71	type AccountId = AccountId;72	/// The basic call filter to use in dispatchable.73	type BaseCallFilter = Everything;74	/// Maximum number of block number to block hash mappings to keep (oldest pruned first).75	type BlockHashCount = BlockHashCount;76	/// The maximum length of a block (in bytes).77	type BlockLength = RuntimeBlockLength;78	/// The index type for blocks.79	type BlockNumber = BlockNumber;80	/// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block.81	type BlockWeights = RuntimeBlockWeights;82	/// The aggregated dispatch type that is available for extrinsics.83	type Call = Call;84	/// The weight of database operations that the runtime can invoke.85	type DbWeight = RocksDbWeight;86	/// The ubiquitous event type.87	type Event = Event;88	/// The type for hashing blocks and tries.89	type Hash = Hash;90	/// The hashing algorithm used.91	type Hashing = BlakeTwo256;92	/// The header type.93	type Header = generic::Header<BlockNumber, BlakeTwo256>;94	/// The index type for storing how many extrinsics an account has signed.95	type Index = Index;96	/// The lookup mechanism to get account ID from whatever is passed in dispatchers.97	type Lookup = AccountIdLookup<AccountId, ()>;98	/// What to do if an account is fully reaped from the system.99	type OnKilledAccount = ();100	/// What to do if a new account is created.101	type OnNewAccount = ();102	type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;103	/// The ubiquitous origin type.104	type Origin = Origin;105	/// This type is being generated by `construct_runtime!`.106	type PalletInfo = PalletInfo;107	/// This is used as an identifier of the chain. 42 is the generic substrate prefix.108	type SS58Prefix = SS58Prefix;109	/// Weight information for the extrinsics of this pallet.110	type SystemWeightInfo = frame_system::weights::SubstrateWeight<Self>;111	/// Version of the runtime.112	type Version = Version;113	type MaxConsumers = ConstU32<16>;114}115116impl pallet_randomness_collective_flip::Config for Runtime {}117118parameter_types! {119	pub const MinimumPeriod: u64 = SLOT_DURATION / 2;120}121122impl pallet_timestamp::Config for Runtime {123	/// A timestamp: milliseconds since the unix epoch.124	type Moment = u64;125	type OnTimestampSet = ();126	type MinimumPeriod = MinimumPeriod;127	type WeightInfo = ();128}129130parameter_types! {131	// pub const ExistentialDeposit: u128 = 500;132	pub const ExistentialDeposit: u128 = EXISTENTIAL_DEPOSIT;133	pub const MaxLocks: u32 = 50;134	pub const MaxReserves: u32 = 50;135}136137impl pallet_balances::Config for Runtime {138	type MaxLocks = MaxLocks;139	type MaxReserves = MaxReserves;140	type ReserveIdentifier = [u8; 16];141	/// The type for recording an account's balance.142	type Balance = Balance;143	/// The ubiquitous event type.144	type Event = Event;145	type DustRemoval = Treasury;146	type ExistentialDeposit = ExistentialDeposit;147	type AccountStore = System;148	type WeightInfo = pallet_balances::weights::SubstrateWeight<Self>;149}150151parameter_types! {152	/// This value increases the priority of `Operational` transactions by adding153	/// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`.154	pub const OperationalFeeMultiplier: u8 = 5;155}156157impl pallet_transaction_payment::Config for Runtime {158	type Event = Event;159	type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees>;160	type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;161	type OperationalFeeMultiplier = OperationalFeeMultiplier;162	type WeightToFee = pallet_configuration::WeightToFee<Self, Balance>;163	type FeeMultiplierUpdate = ();164}165166parameter_types! {167	pub const ProposalBond: Permill = Permill::from_percent(5);168	pub const ProposalBondMinimum: Balance = 1 * UNIQUE;169	pub const ProposalBondMaximum: Balance = 1000 * UNIQUE;170	pub const SpendPeriod: BlockNumber = 5 * MINUTES;171	pub const Burn: Permill = Permill::from_percent(0);172	pub const TipCountdown: BlockNumber = 1 * DAYS;173	pub const TipFindersFee: Percent = Percent::from_percent(20);174	pub const TipReportDepositBase: Balance = 1 * UNIQUE;175	pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE;176	pub const BountyDepositBase: Balance = 1 * UNIQUE;177	pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;178	pub const TreasuryModuleId: PalletId = PalletId(*b"py/trsry");179	pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;180	pub const MaximumReasonLength: u32 = 16384;181	pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);182	pub const BountyValueMinimum: Balance = 5 * UNIQUE;183	pub const MaxApprovals: u32 = 100;184}185186impl pallet_treasury::Config for Runtime {187	type PalletId = TreasuryModuleId;188	type Currency = Balances;189	type ApproveOrigin = EnsureRoot<AccountId>;190	type RejectOrigin = EnsureRoot<AccountId>;191	type SpendOrigin = NeverEnsureOrigin<u128>;192	type Event = Event;193	type OnSlash = ();194	type ProposalBond = ProposalBond;195	type ProposalBondMinimum = ProposalBondMinimum;196	type ProposalBondMaximum = ProposalBondMaximum;197	type SpendPeriod = SpendPeriod;198	type Burn = Burn;199	type BurnDestination = ();200	type SpendFunds = ();201	type WeightInfo = pallet_treasury::weights::SubstrateWeight<Self>;202	type MaxApprovals = MaxApprovals;203}204205impl pallet_sudo::Config for Runtime {206	type Event = Event;207	type Call = Call;208}209210parameter_types! {211	pub const MaxAuthorities: u32 = 100_000;212}213214impl pallet_aura::Config for Runtime {215	type AuthorityId = AuraId;216	type DisabledValidators = ();217	type MaxAuthorities = MaxAuthorities;218}219220parameter_types! {221	pub const Period: u32 = 6 * HOURS;222	pub const Offset: u32 = 0;223	//pub const MaxAuthorities: u32 = 100_000;224}225226impl pallet_session::Config for Runtime {227	type Event = Event;228	type ValidatorId = <Self as frame_system::Config>::AccountId;229	// we don't have stash and controller, thus we don't need the convert as well.230	type ValidatorIdOf = pallet_collator_selection::IdentityCollator;231	type ShouldEndSession = pallet_session::PeriodicSessions<Period, Offset>;232	type NextSessionRotation = pallet_session::PeriodicSessions<Period, Offset>;233	type SessionManager = CollatorSelection;234	// Essentially just Aura, but lets be pedantic.235	type SessionHandler = <SessionKeys as sp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;236	type Keys = SessionKeys;237	type WeightInfo = ();238}239240parameter_types! {241	pub const UncleGenerations: u32 = 0;242}243244impl pallet_authorship::Config for Runtime {245	type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Aura>;246	type UncleGenerations = UncleGenerations;247	type FilterUncle = ();248	type EventHandler = (CollatorSelection,);249}250251parameter_types! {252	pub const PotId: PalletId = PalletId(*b"PotStake");253	pub const MaxCandidates: u32 = 1000;254	pub const MinCandidates: u32 = 5;255	pub const SessionLength: BlockNumber = 6 * HOURS;256	pub const MaxInvulnerables: u32 = 100;257	pub const ExecutiveBody: BodyId = BodyId::Executive;258}259260// We allow root only to execute privileged collator selection operations.261pub type CollatorSelectionUpdateOrigin = EnsureRoot<AccountId>;262263impl pallet_collator_selection::Config for Runtime {264	type Event = Event;265	type Currency = Balances;266	type UpdateOrigin = CollatorSelectionUpdateOrigin;267	type PotId = PotId;268	type MaxCandidates = MaxCandidates;269	type MinCandidates = MinCandidates;270	type MaxInvulnerables = MaxInvulnerables;271	// should be a multiple of session or things will get inconsistent272	type KickThreshold = Period;273	type ValidatorId = <Self as frame_system::Config>::AccountId;274	type ValidatorIdOf = pallet_collator_selection::IdentityCollator;275	type ValidatorRegistration = Session;276	type WeightInfo = ();277}
modifiedruntime/common/construct_runtime/mod.rsdiffbeforeafterboth
--- a/runtime/common/construct_runtime/mod.rs
+++ b/runtime/common/construct_runtime/mod.rs
@@ -32,8 +32,11 @@
                 ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
                 ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
 
-                Aura: pallet_aura::{Pallet, Config<T>} = 22,
-                AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,
+                Authorship: pallet_authorship::{Pallet, Call, Storage} = 22,
+                CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event<T>, Config<T>} = 23,
+                Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>} = 24,
+                Aura: pallet_aura::{Pallet, Config<T>} = 25,
+                AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 26,
 
                 Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,
                 RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,
modifiedruntime/common/mod.rsdiffbeforeafterboth
--- a/runtime/common/mod.rs
+++ b/runtime/common/mod.rs
@@ -25,7 +25,10 @@
 pub mod weights;
 
 use sp_core::H160;
-use frame_support::traits::{Currency, OnUnbalanced, Imbalance};
+use frame_support::{
+	traits::{Currency, OnUnbalanced, Imbalance},
+	weights::Weight,
+};
 use sp_runtime::{
 	generic,
 	traits::{BlakeTwo256, BlockNumberProvider},
@@ -103,6 +106,7 @@
 	frame_system::ChainContext<Runtime>,
 	Runtime,
 	AllPalletsReversedWithSystemFirst,
+	AuraToCollatorSelection,
 >;
 
 type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;
@@ -165,3 +169,158 @@
 	/// Transfer tokens to the given account from the Parachain account.
 	TransferToken(XAccountId, XBalance),
 }
+
+pub struct AuraToCollatorSelection;
+impl frame_support::traits::OnRuntimeUpgrade for AuraToCollatorSelection {
+	fn on_runtime_upgrade() -> Weight {
+		use frame_support::{BoundedVec, storage::migration};
+		use sp_runtime::{
+			traits::{OpaqueKeys, Saturating},
+			RuntimeAppPublic,
+		};
+		use pallet_session::SessionManager;
+		use up_common::constants::EXISTENTIAL_DEPOSIT;
+		use crate::config::substrate::MaxInvulnerables;
+
+		let mut weight = <Runtime as frame_system::Config>::DbWeight::get().reads(1);
+
+		let version =
+			migration::get_storage_value::<()>(b"AuraToCollatorSelection", b"StorageVersion", &[]);
+
+		let should_upgrade = match version {
+			None => true,
+			Some(_) => false,
+		};
+
+		if should_upgrade {
+			log::info!(
+				target: "runtime::aura_to_collator_selection",
+				"Running migration of Aura authorities to Collator Selection invulnerables"
+			);
+
+			let invulnerables = pallet_aura::Pallet::<Runtime>::authorities()
+				.iter()
+				.cloned()
+				.filter_map(|authority_id| {
+					weight.saturating_accrue(<Runtime as frame_system::Config>::DbWeight::get().reads_writes(1, 1));
+					let vec = authority_id.clone().to_raw_vec();
+					let slice = vec.as_slice();
+					let array: Option<[u8; 32]> = match slice.try_into() {
+						Ok(a) => Some(a),
+						Err(_) => {
+							log::error!("Failed to convert an Aura authority to a Collator Selection invulnerable: {:?}", authority_id);
+							None
+						},
+					};
+					array.map(|a| (AccountId::from(a), authority_id))
+				})
+				.collect::<Vec<_>>();
+
+			let bounded_invulnerables = BoundedVec::<_, MaxInvulnerables>::try_from(
+				invulnerables
+					.iter()
+					.cloned()
+					.map(|(acc, _)| acc)
+					.collect::<Vec<_>>(),
+			)
+			.expect("Existing collators/invulnerables are more than MaxInvulnerables");
+			
+			<pallet_collator_selection::Invulnerables<Runtime>>::put(bounded_invulnerables);
+			<pallet_collator_selection::DesiredCandidates<Runtime>>::put(0);
+			<pallet_collator_selection::CandidacyBond<Runtime>>::put(EXISTENTIAL_DEPOSIT * 16);
+
+			let keys = invulnerables
+				.into_iter()
+				.map(|(acc, aura)| {
+					(
+						acc.clone(),                        // account id
+						acc,                                // validator id
+						SessionKeys { aura: aura.clone() }, // session keys
+					)
+				})
+				.collect::<Vec<_>>();
+
+			for (account, val, keys) in keys.iter().cloned() {
+				for id in <Runtime as pallet_session::Config>::Keys::key_ids() {
+					<pallet_session::KeyOwner<Runtime>>::insert((*id, keys.get_raw(*id)), &val)
+				}
+				<pallet_session::NextKeys<Runtime>>::insert(&val, &keys);
+				// todo exercise caution, the following is taken from genesis
+				if frame_system::Pallet::<Runtime>::inc_consumers_without_limit(&account).is_err() {
+					log::warn!(
+						"We have entered an error with incrementing consumers without limit"
+					);
+					// This will leak a provider reference, however it only happens once (at
+					// genesis) so it's really not a big deal and we assume that the user wants to
+					// do this since it's the only way a non-endowed account can contain a session
+					// key.
+					frame_system::Pallet::<Runtime>::inc_providers(&account);
+				}
+			}
+
+			let initial_validators_0 =
+				<Runtime as pallet_session::Config>::SessionManager::new_session(0).unwrap_or_else(
+					|| {
+						frame_support::print(
+							"No initial validator provided by `SessionManager`, use \
+						session config keys to generate initial validator set.",
+						);
+						keys.iter().map(|x| x.1.clone()).collect()
+					},
+				);
+			/*assert!(
+				!initial_validators_0.is_empty(),
+				"Empty validator set for session 0 in (pseudo) genesis block!"
+			);*/
+
+			let initial_validators_1 =
+				<Runtime as pallet_session::Config>::SessionManager::new_session(1)
+					.unwrap_or_else(|| initial_validators_0.clone());
+			/*assert!(
+				!initial_validators_1.is_empty(),
+				"Empty validator set for session 1 in (pseudo) genesis block!"
+			);*/
+
+			let queued_keys: Vec<_> = initial_validators_1
+				.iter()
+				.cloned()
+				.map(|v| {
+					(
+						v.clone(),
+						<pallet_session::NextKeys<Runtime>>::get(&v)
+							.expect("Validator in session 1 missing keys!"),
+					)
+				})
+				.collect();
+
+			// Tell everyone about the genesis session keys -- Aura must've already initialized it
+			//<Runtime as pallet_session::Config>::SessionHandler::on_genesis_session::<<Runtime as pallet_session::Config>::Keys>(&queued_keys);
+
+			<pallet_session::Validators<Runtime>>::put(initial_validators_0);
+			<pallet_session::QueuedKeys<Runtime>>::put(queued_keys);
+
+			<Runtime as pallet_session::Config>::SessionManager::start_session(0);
+
+			log::info!(
+				target: "runtime::aura_to_collator_selection",
+				"Migration of Aura authorities to Collator Selection invulnerables is complete."
+			);
+
+			migration::put_storage_value::<()>(
+				b"AuraToCollatorSelection",
+				b"StorageVersion",
+				&[],
+				(),
+			);
+
+			weight += <Runtime as frame_system::Config>::DbWeight::get().writes(1)
+		} else {
+			log::info!(
+				target: "runtime::aura_to_collator_selection",
+				"The storage migration has already been flagged as complete. No migration needs to be done.",
+			);
+		}
+
+		weight
+	}
+}
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -27,6 +27,7 @@
     'pallet-evm-migration/runtime-benchmarks',
     'pallet-evm-coder-substrate/runtime-benchmarks',
     'pallet-balances/runtime-benchmarks',
+	"pallet-collator-selection/runtime-benchmarks",
     'pallet-timestamp/runtime-benchmarks',
     'pallet-common/runtime-benchmarks',
     'pallet-structure/runtime-benchmarks',
@@ -66,6 +67,9 @@
     # 'pallet-contracts-primitives/std',
     # 'pallet-contracts-rpc-runtime-api/std',
     # 'pallet-contract-helpers/std',
+	"pallet-authorship/std",
+	'pallet-collator-selection/std',
+	"pallet-session/std",
     'pallet-randomness-collective-flip/std',
     'pallet-sudo/std',
     'pallet-timestamp/std',
@@ -190,6 +194,21 @@
 git = "https://github.com/paritytech/substrate"
 branch = "polkadot-v0.9.27"
 
+[dependencies.pallet-collator-selection]
+default-features = false
+git = 'https://github.com/paritytech/cumulus'
+branch = 'polkadot-v0.9.27'
+
+[dependencies.pallet-authorship]
+default-features = false
+git = 'https://github.com/paritytech/substrate'
+branch = 'polkadot-v0.9.27'
+
+[dependencies.pallet-session]
+default-features = false
+git = 'https://github.com/paritytech/substrate'
+branch = 'polkadot-v0.9.27'
+
 [dependencies.pallet-balances]
 default-features = false
 git = "https://github.com/paritytech/substrate"
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -27,6 +27,7 @@
     'pallet-evm-migration/runtime-benchmarks',
     'pallet-evm-coder-substrate/runtime-benchmarks',
     'pallet-balances/runtime-benchmarks',
+	"pallet-collator-selection/runtime-benchmarks",
     'pallet-timestamp/runtime-benchmarks',
     'pallet-common/runtime-benchmarks',
     'pallet-structure/runtime-benchmarks',
@@ -66,6 +67,9 @@
     # 'pallet-contracts-primitives/std',
     # 'pallet-contracts-rpc-runtime-api/std',
     # 'pallet-contract-helpers/std',
+	"pallet-authorship/std",
+	'pallet-collator-selection/std',
+	"pallet-session/std",
     'pallet-randomness-collective-flip/std',
     'pallet-sudo/std',
     'pallet-timestamp/std',
@@ -187,6 +191,21 @@
 git = "https://github.com/paritytech/substrate"
 branch = "polkadot-v0.9.27"
 
+[dependencies.pallet-collator-selection]
+default-features = false
+git = 'https://github.com/paritytech/cumulus'
+branch = 'polkadot-v0.9.27'
+
+[dependencies.pallet-authorship]
+default-features = false
+git = 'https://github.com/paritytech/substrate'
+branch = 'polkadot-v0.9.27'
+
+[dependencies.pallet-session]
+default-features = false
+git = 'https://github.com/paritytech/substrate'
+branch = 'polkadot-v0.9.27'
+
 [dependencies.pallet-balances]
 default-features = false
 git = "https://github.com/paritytech/substrate"
modifiedruntime/tests/src/lib.rsdiffbeforeafterboth
--- a/runtime/tests/src/lib.rs
+++ b/runtime/tests/src/lib.rs
@@ -189,6 +189,9 @@
 	fn conv_eq(&self, other: &Self) -> bool {
 		self.as_sub() == other.as_sub()
 	}
+	fn is_canonical_substrate(&self) -> bool {
+		todo!()
+	}
 }
 
 impl Default for TestCrossAccountId {
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -27,6 +27,7 @@
     'pallet-evm-migration/runtime-benchmarks',
     'pallet-evm-coder-substrate/runtime-benchmarks',
     'pallet-balances/runtime-benchmarks',
+	"pallet-collator-selection/runtime-benchmarks",
     'pallet-timestamp/runtime-benchmarks',
     'pallet-common/runtime-benchmarks',
     'pallet-structure/runtime-benchmarks',
@@ -67,6 +68,9 @@
     # 'pallet-contracts-primitives/std',
     # 'pallet-contracts-rpc-runtime-api/std',
     # 'pallet-contract-helpers/std',
+	"pallet-authorship/std",
+	'pallet-collator-selection/std',
+	"pallet-session/std",
     'pallet-randomness-collective-flip/std',
     'pallet-sudo/std',
     'pallet-timestamp/std',
@@ -188,6 +192,21 @@
 git = "https://github.com/paritytech/substrate"
 branch = "polkadot-v0.9.27"
 
+[dependencies.pallet-collator-selection]
+default-features = false
+git = 'https://github.com/paritytech/cumulus'
+branch = 'polkadot-v0.9.27'
+
+[dependencies.pallet-authorship]
+default-features = false
+git = 'https://github.com/paritytech/substrate'
+branch = 'polkadot-v0.9.27'
+
+[dependencies.pallet-session]
+default-features = false
+git = 'https://github.com/paritytech/substrate'
+branch = 'polkadot-v0.9.27'
+
 [dependencies.pallet-balances]
 default-features = false
 git = "https://github.com/paritytech/substrate"