From 72bc64abb8552cf476c4525f19958f07275136f5 Mon Sep 17 00:00:00 2001 From: Adam Reif Date: Tue, 14 Jun 2022 12:30:52 -0500 Subject: [PATCH] Switch nimbus deps to our vendored nimbus repo Signed-off-by: Adam Reif --- Cargo.lock | 767 +++++++++++++------------- Cargo.toml | 2 - nimbus-consensus/Cargo.toml | 39 -- nimbus-consensus/src/import_queue.rs | 275 --------- nimbus-consensus/src/lib.rs | 464 ---------------- nimbus-consensus/src/manual_seal.rs | 125 ----- nimbus-primitives/Cargo.toml | 34 -- nimbus-primitives/src/digests.rs | 80 --- nimbus-primitives/src/inherents.rs | 55 -- nimbus-primitives/src/lib.rs | 156 ------ node/Cargo.toml | 6 +- pallets/aura-style-filter/Cargo.toml | 31 -- pallets/aura-style-filter/src/lib.rs | 78 --- pallets/author-inherent/Cargo.toml | 42 -- pallets/author-inherent/src/exec.rs | 99 ---- pallets/author-inherent/src/lib.rs | 220 -------- pallets/collator-selection/Cargo.toml | 2 +- runtime/dolphin/Cargo.toml | 6 +- 18 files changed, 404 insertions(+), 2077 deletions(-) delete mode 100644 nimbus-consensus/Cargo.toml delete mode 100644 nimbus-consensus/src/import_queue.rs delete mode 100644 nimbus-consensus/src/lib.rs delete mode 100644 nimbus-consensus/src/manual_seal.rs delete mode 100644 nimbus-primitives/Cargo.toml delete mode 100644 nimbus-primitives/src/digests.rs delete mode 100644 nimbus-primitives/src/inherents.rs delete mode 100644 nimbus-primitives/src/lib.rs delete mode 100644 pallets/aura-style-filter/Cargo.toml delete mode 100644 pallets/aura-style-filter/src/lib.rs delete mode 100644 pallets/author-inherent/Cargo.toml delete mode 100644 pallets/author-inherent/src/exec.rs delete mode 100644 pallets/author-inherent/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 5fd686a42..c25a7729c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -99,9 +99,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.57" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" +checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" [[package]] name = "approx" @@ -381,24 +381,25 @@ dependencies = [ [[package]] name = "async-global-executor" -version = "2.1.0" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd8b508d585e01084059b60f06ade4cb7415cd2e4084b71dd1cb44e7d3fb9880" +checksum = "c290043c9a95b05d45e952fb6383c67bcb61471f60cfa21e890dba6654234f43" dependencies = [ "async-channel", "async-executor", "async-io", - "async-lock", + "async-mutex", "blocking", "futures-lite", + "num_cpus", "once_cell", ] [[package]] name = "async-io" -version = "1.7.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5e18f61464ae81cde0a23e713ae8fd299580c54d697a35820cfd0625b8b0e07" +checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" dependencies = [ "concurrent-queue", "futures-lite", @@ -423,10 +424,19 @@ dependencies = [ ] [[package]] -name = "async-process" +name = "async-mutex" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2c06e30a24e8c78a3987d07f0930edf76ef35e027e7bdb063fccafdad1f60c" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-process" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83137067e3a2a6a06d67168e49e68a0957d215410473a740cea95a2425c0b7c6" dependencies = [ "async-io", "blocking", @@ -461,7 +471,7 @@ dependencies = [ "memchr", "num_cpus", "once_cell", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.8", "pin-utils", "slab", "wasm-bindgen-futures", @@ -489,9 +499,9 @@ checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" [[package]] name = "async-trait" -version = "0.1.56" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" dependencies = [ "proc-macro2", "quote", @@ -508,7 +518,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.8", ] [[package]] @@ -521,7 +531,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.8", ] [[package]] @@ -541,9 +551,9 @@ checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" [[package]] name = "attohttpc" -version = "0.19.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "262c3f7f5d61249d8c00e5546e2685cd15ebeeb1bc0f3cc5449350a1cb07319e" +checksum = "e69e13a99a7e6e070bb114f7ff381e58c7ccc188630121fc4c2fe4bcf24cd072" dependencies = [ "flate2", "http", @@ -580,31 +590,31 @@ dependencies = [ "futures-core", "getrandom 0.2.6", "instant", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.8", "rand 0.8.5", "tokio", ] [[package]] name = "backtrace" -version = "0.3.65" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61" +checksum = "5e121dee8023ce33ab248d9ce1493df03c3b38a659b240096fcbd7048ff9c31f" dependencies = [ "addr2line", "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide", - "object 0.28.4", + "miniz_oxide 0.4.4", + "object", "rustc-demangle", ] [[package]] name = "base-x" -version = "0.2.10" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc19a4937b4fbd3fe3379793130e42060d10627a360f2127802b10b87e7baf74" +checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" [[package]] name = "base16ct" @@ -632,9 +642,9 @@ checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" [[package]] name = "beef" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +checksum = "bed554bd50246729a1ec158d08aa3235d1b69d94ad120ebe187e28894787e736" dependencies = [ "serde", ] @@ -650,7 +660,7 @@ dependencies = [ "hex", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "sc-chain-spec", "sc-client-api", "sc-keystore", @@ -683,7 +693,7 @@ dependencies = [ "jsonrpc-pubsub", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "sc-rpc", "sc-utils", "serde", @@ -1098,9 +1108,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.10.0" +version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] name = "byte-slice-cast" @@ -1249,9 +1259,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.0.9" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869119e97797867fd90f5e22af7d0bd274bd4635ebb9eb68c04f3f513ae6c412" +checksum = "6f3132262930b0522068049f5870a856ab8affc80c70d08b6ecb785771a6fc23" dependencies = [ "serde", ] @@ -1273,7 +1283,7 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.10", + "semver 1.0.7", "serde", "serde_json", ] @@ -1392,9 +1402,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.3.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" +checksum = "4cc00842eed744b858222c4c9faf7243aafc6d33f92f96935263ef4d8a41ce21" dependencies = [ "glob", "libc", @@ -1414,16 +1424,16 @@ dependencies = [ [[package]] name = "clap" -version = "3.1.18" +version = "3.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b" +checksum = "71c47df61d9e16dc010b55dba1952a57d8c215dbb533fd13cdd13369aac73b1c" dependencies = [ "atty", "bitflags", "clap_derive", - "clap_lex", "indexmap", "lazy_static", + "os_str_bytes", "strsim", "termcolor", "textwrap 0.15.0", @@ -1431,9 +1441,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.1.18" +version = "3.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c" +checksum = "a3aab4734e083b809aaf5794e14e756d1c798d2c69c7f7de7a09a2f5214993c1" dependencies = [ "heck 0.4.0", "proc-macro-error", @@ -1442,15 +1452,6 @@ dependencies = [ "syn", ] -[[package]] -name = "clap_lex" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213" -dependencies = [ - "os_str_bytes", -] - [[package]] name = "concurrent-queue" version = "1.2.2" @@ -1814,7 +1815,7 @@ name = "cumulus-client-cli" version = "0.1.0" source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.18#b1e91afb7421309b203d7627b736d9bcf58260eb" dependencies = [ - "clap 3.1.18", + "clap 3.1.8", "sc-cli", "sc-service", "url 2.2.2", @@ -1831,7 +1832,7 @@ dependencies = [ "cumulus-relay-chain-interface", "futures 0.3.21", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", @@ -1875,7 +1876,7 @@ dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", "futures 0.3.21", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "sc-client-api", "sc-consensus", "sp-api", @@ -1900,7 +1901,7 @@ dependencies = [ "futures 0.3.21", "futures-timer", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "polkadot-node-primitives", "polkadot-parachain", "polkadot-primitives", @@ -1950,7 +1951,7 @@ dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "polkadot-overseer", "polkadot-primitives", "sc-chain-spec", @@ -2173,7 +2174,7 @@ dependencies = [ "cumulus-relay-chain-interface", "futures 0.3.21", "futures-timer", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "polkadot-client", "polkadot-service", "sc-client-api", @@ -2202,7 +2203,7 @@ dependencies = [ "futures 0.3.21", "jsonrpsee-core 0.9.0", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "polkadot-overseer", "polkadot-service", "sc-client-api", @@ -2228,7 +2229,7 @@ dependencies = [ "futures-timer", "jsonrpsee 0.9.0", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "polkadot-service", "sc-client-api", "sc-rpc-api", @@ -2416,7 +2417,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea" dependencies = [ "byteorder", - "quick-error", + "quick-error 1.2.3", ] [[package]] @@ -2547,9 +2548,9 @@ dependencies = [ [[package]] name = "ed25519" -version = "1.5.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" +checksum = "3d5c4b5e5959dc2c2b89918d8e2cc40fcdd623cef026ed09d2f0ee05199dc8e4" dependencies = [ "signature", ] @@ -2635,9 +2636,9 @@ dependencies = [ [[package]] name = "enumn" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052bc8773a98bd051ff37db74a8a25f00e6bfa2cbd03373390c72e9f7afbf344" +checksum = "4e58b112d5099aa0857c5d05f0eacab86406dd8c0f85fe5d320a13256d29ecf4" dependencies = [ "proc-macro2", "quote", @@ -2780,9 +2781,9 @@ dependencies = [ [[package]] name = "ff" -version = "0.11.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" +checksum = "b2958d04124b9f27f175eaeb9a9f383d026098aa837eadd8ba22c11f13a05b9e" dependencies = [ "rand_core 0.6.3", "subtle", @@ -2834,13 +2835,15 @@ checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" [[package]] name = "flate2" -version = "1.0.24" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af" dependencies = [ + "cfg-if 1.0.0", "crc32fast", + "libc", "libz-sys", - "miniz_oxide", + "miniz_oxide 0.5.1", ] [[package]] @@ -2911,7 +2914,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.1 dependencies = [ "Inflector", "chrono", - "clap 3.1.18", + "clap 3.1.8", "frame-benchmarking", "frame-support", "handlebars", @@ -3224,7 +3227,7 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.8", "waker-fn", ] @@ -3282,7 +3285,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.8", "pin-utils", "slab", ] @@ -3359,9 +3362,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "globset" -version = "0.4.9" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" +checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd" dependencies = [ "aho-corasick", "bstr", @@ -3408,7 +3411,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util 0.7.3", + "tokio-util 0.7.1", "tracing", ] @@ -3420,16 +3423,16 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "handlebars" -version = "4.3.1" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66d0c1b6e3abfd1e72818798925e16e02ed77e1b47f6c25a95a23b377ee4299" +checksum = "99d6a30320f094710245150395bc763ad23128d6a1ebbad7594dc4164b62c56b" dependencies = [ "log", "pest", "pest_derive", + "quick-error 2.0.1", "serde", "serde_json", - "thiserror", ] [[package]] @@ -3458,9 +3461,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" +checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" dependencies = [ "ahash", ] @@ -3551,31 +3554,31 @@ dependencies = [ [[package]] name = "http" -version = "0.2.8" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" dependencies = [ "bytes 1.1.0", "fnv", - "itoa 1.0.2", + "itoa 1.0.1", ] [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes 1.1.0", "http", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.8", ] [[package]] name = "httparse" -version = "1.7.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "6330e8a36bd8c859f3fa6d9382911fbb7147ec39807f63b923933a247240b9ba" [[package]] name = "httpdate" @@ -3591,9 +3594,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.19" +version = "0.14.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42dc3c131584288d375f2d07f822b0cb012d8c6fb899a5b9fdb3cb7eb9b6004f" +checksum = "b26ae0a80afebe130861d90abf98e3814a4f28a4c6ffeb5ab8ebb2be311e0ef2" dependencies = [ "bytes 1.1.0", "futures-channel", @@ -3604,8 +3607,8 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.2", - "pin-project-lite 0.2.9", + "itoa 1.0.1", + "pin-project-lite 0.2.8", "socket2 0.4.4", "tokio", "tower-service", @@ -3639,10 +3642,10 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.20.6", - "rustls-native-certs 0.6.2", + "rustls 0.20.4", + "rustls-native-certs 0.6.1", "tokio", - "tokio-rustls 0.23.4", + "tokio-rustls 0.23.3", "webpki-roots 0.22.3", ] @@ -3749,9 +3752,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.2" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", "hashbrown 0.11.2", @@ -3760,9 +3763,12 @@ dependencies = [ [[package]] name = "indoc" -version = "1.0.6" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05a0bd019339e5d968b37855180087b7b9d512c5046fbd244cf8c95687927d6e" +checksum = "e7906a9fababaeacb774f72410e497a1d18de916322e33797bb2cd29baa23c9e" +dependencies = [ + "unindent", +] [[package]] name = "instant" @@ -3826,9 +3832,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" +checksum = "35e70ee094dc02fd9c13fdad4940090f22dbd6ac7c9e7094a46cf0232a50bc7c" [[package]] name = "itertools" @@ -3847,9 +3853,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "jobserver" @@ -3982,7 +3988,7 @@ dependencies = [ "log", "tokio", "tokio-stream", - "tokio-util 0.6.10", + "tokio-util 0.6.9", "unicase", ] @@ -4047,12 +4053,12 @@ dependencies = [ "jsonrpsee-core 0.8.0", "jsonrpsee-types 0.8.0", "pin-project 1.0.10", - "rustls-native-certs 0.6.2", + "rustls-native-certs 0.6.1", "soketto", "thiserror", "tokio", - "tokio-rustls 0.23.4", - "tokio-util 0.6.10", + "tokio-rustls 0.23.3", + "tokio-util 0.6.9", "tracing", "webpki-roots 0.22.3", ] @@ -4068,12 +4074,12 @@ dependencies = [ "jsonrpsee-core 0.9.0", "jsonrpsee-types 0.9.0", "pin-project 1.0.10", - "rustls-native-certs 0.6.2", + "rustls-native-certs 0.6.1", "soketto", "thiserror", "tokio", - "tokio-rustls 0.23.4", - "tokio-util 0.6.10", + "tokio-rustls 0.23.3", + "tokio-util 0.6.9", "tracing", "webpki-roots 0.22.3", ] @@ -4234,7 +4240,7 @@ dependencies = [ "thiserror", "tokio", "tokio-rustls 0.22.0", - "tokio-util 0.6.10", + "tokio-util 0.6.9", ] [[package]] @@ -4273,9 +4279,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.2" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" +checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" [[package]] name = "kernel32-sys" @@ -4414,7 +4420,7 @@ checksum = "ece7e668abd21387aeb6628130a6f4c802787f014fa46bc83221448322250357" dependencies = [ "kvdb", "parity-util-mem", - "parking_lot 0.12.1", + "parking_lot 0.12.0", ] [[package]] @@ -4429,7 +4435,7 @@ dependencies = [ "num_cpus", "owning_ref", "parity-util-mem", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "regex", "rocksdb", "smallvec", @@ -4449,9 +4455,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "cb691a747a7ab48abc15c5b42066eaafde10dc427e3b6ee2a1cf43db04c763bd" [[package]] name = "libloading" @@ -4845,7 +4851,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "lru 0.7.6", + "lru 0.7.5", "rand 0.7.3", "smallvec", "unsigned-varint 0.7.1", @@ -5017,9 +5023,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.8" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +checksum = "6f35facd4a5673cb5a48822be2be1d4236c1c99cb4113cab7061ac720d5bf859" dependencies = [ "cc", "pkg-config", @@ -5069,9 +5075,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" dependencies = [ "cfg-if 1.0.0", "value-bag", @@ -5088,9 +5094,9 @@ dependencies = [ [[package]] name = "lru" -version = "0.7.6" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8015d95cb7b2ddd3c0d32ca38283ceb1eea09b4713ee380bceb942d85a244228" +checksum = "32613e41de4c47ab04970c348ca7ae7382cf116625755af070b008a15516a889" dependencies = [ "hashbrown 0.11.2", ] @@ -5140,7 +5146,7 @@ dependencies = [ "async-trait", "calamari-runtime", "cfg-if 1.0.0", - "clap 3.1.18", + "clap 3.1.8", "cumulus-client-cli", "cumulus-client-consensus-common", "cumulus-client-consensus-relay-chain", @@ -5207,8 +5213,8 @@ dependencies = [ [[package]] name = "manta-accounting" -version = "0.5.0" -source = "git+https://github.com/manta-network/manta-rs.git#df042ff97cc24c3b4b7e223e56297bcb2b77791f" +version = "0.4.0" +source = "git+https://github.com/manta-network/manta-rs.git#c6567af7e017a37c20b0f099993deb9f3227279c" dependencies = [ "derivative", "derive_more", @@ -5216,7 +5222,8 @@ dependencies = [ "indexmap", "manta-crypto", "manta-util", - "parking_lot 0.12.1", + "parking_lot 0.12.0", + "rand 0.8.5", "statrs", ] @@ -5250,19 +5257,18 @@ dependencies = [ [[package]] name = "manta-crypto" -version = "0.5.0" -source = "git+https://github.com/manta-network/manta-rs.git#df042ff97cc24c3b4b7e223e56297bcb2b77791f" +version = "0.4.0" +source = "git+https://github.com/manta-network/manta-rs.git#c6567af7e017a37c20b0f099993deb9f3227279c" dependencies = [ "derivative", "manta-util", - "rand 0.8.5", "rand_core 0.6.3", ] [[package]] name = "manta-pay" -version = "0.5.0" -source = "git+https://github.com/manta-network/manta-rs.git#df042ff97cc24c3b4b7e223e56297bcb2b77791f" +version = "0.4.0" +source = "git+https://github.com/manta-network/manta-rs.git#c6567af7e017a37c20b0f099993deb9f3227279c" dependencies = [ "aes-gcm", "ark-bls12-381", @@ -5374,7 +5380,7 @@ dependencies = [ [[package]] name = "manta-sdk" version = "0.5.0" -source = "git+https://github.com/manta-network/sdk.git#4695cffb2cbb65f9a2efc24d54c11c801785b006" +source = "git+https://github.com/manta-network/sdk.git#fef5dc1868f6dea4911c8bb03cb6b29399810063" dependencies = [ "anyhow", "attohttpc", @@ -5385,8 +5391,8 @@ dependencies = [ [[package]] name = "manta-util" -version = "0.5.0" -source = "git+https://github.com/manta-network/manta-rs.git#df042ff97cc24c3b4b7e223e56297bcb2b77791f" +version = "0.4.0" +source = "git+https://github.com/manta-network/manta-rs.git#c6567af7e017a37c20b0f099993deb9f3227279c" [[package]] name = "maplit" @@ -5426,9 +5432,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memmap2" @@ -5441,9 +5447,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.5.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5172b50c23043ff43dd53e51392f36519d9b35a8f3a410d30ece5d1aedd58ae" +checksum = "057a3db23999c867821a7a59feb06a578fcb03685e983dff90daf9e7d24ac08f" dependencies = [ "libc", ] @@ -5464,7 +5470,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" dependencies = [ "hash-db", - "hashbrown 0.12.1", + "hashbrown 0.12.0", "parity-util-mem", ] @@ -5532,9 +5538,19 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +dependencies = [ + "adler", + "autocfg", +] + +[[package]] +name = "miniz_oxide" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" dependencies = [ "adler", ] @@ -5552,7 +5568,7 @@ dependencies = [ "kernel32-sys", "libc", "log", - "miow", + "miow 0.2.2", "net2", "slab", "winapi 0.2.8", @@ -5560,14 +5576,16 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" +checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" dependencies = [ "libc", "log", + "miow 0.3.7", + "ntapi", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "winapi 0.3.9", ] [[package]] @@ -5594,6 +5612,15 @@ dependencies = [ "ws2_32-sys", ] +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "more-asserts" version = "0.2.2" @@ -5763,6 +5790,7 @@ dependencies = [ [[package]] name = "nimbus-consensus" version = "0.9.0" +source = "git+https://github.com/manta-network/nimbus.git?branch=manta-v0.9.18#009dfaa9f6f7eba47d232d776cb807dc24276d93" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -5772,7 +5800,7 @@ dependencies = [ "log", "nimbus-primitives", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "polkadot-client", "sc-client-api", "sc-consensus", @@ -5793,6 +5821,7 @@ dependencies = [ [[package]] name = "nimbus-primitives" version = "0.9.0" +source = "git+https://github.com/manta-network/nimbus.git?branch=manta-v0.9.18#009dfaa9f6f7eba47d232d776cb807dc24276d93" dependencies = [ "async-trait", "frame-support", @@ -5828,6 +5857,15 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "ntapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "num-bigint" version = "0.2.6" @@ -5852,9 +5890,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fbc387afefefd5e9e39493299f3069e14a140dd34dc19b4c1c1a8fddb6a790" +checksum = "26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085" dependencies = [ "num-traits", ] @@ -5871,9 +5909,9 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ "autocfg", "num-traits", @@ -5904,9 +5942,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ "autocfg", "libm", @@ -5933,20 +5971,11 @@ dependencies = [ "memchr", ] -[[package]] -name = "object" -version = "0.28.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" -version = "1.12.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "oorandom" @@ -5991,30 +6020,18 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.40" +version = "0.10.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb81a6430ac911acb25fe5ac8f1d2af1b4ea8a4fdfda0f1ee4292af2e2d8eb0e" +checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" dependencies = [ "bitflags", "cfg-if 1.0.0", "foreign-types", "libc", "once_cell", - "openssl-macros", "openssl-sys", ] -[[package]] -name = "openssl-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "openssl-probe" version = "0.1.5" @@ -6023,9 +6040,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.74" +version = "0.9.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835363342df5fba8354c5b453325b110ffd54044e588c539cf2f20a8014e4cb1" +checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" dependencies = [ "autocfg", "cc", @@ -6111,9 +6128,12 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.1.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" +checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +dependencies = [ + "memchr", +] [[package]] name = "owning_ref" @@ -6178,6 +6198,7 @@ dependencies = [ [[package]] name = "pallet-aura-style-filter" version = "0.9.0" +source = "git+https://github.com/manta-network/nimbus.git?branch=manta-v0.9.18#009dfaa9f6f7eba47d232d776cb807dc24276d93" dependencies = [ "frame-support", "frame-system", @@ -6193,6 +6214,7 @@ dependencies = [ [[package]] name = "pallet-author-inherent" version = "0.9.0" +source = "git+https://github.com/manta-network/nimbus.git?branch=manta-v0.9.18#009dfaa9f6f7eba47d232d776cb807dc24276d93" dependencies = [ "frame-support", "frame-system", @@ -6203,9 +6225,7 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-authorship", - "sp-core", "sp-inherents", - "sp-io", "sp-runtime", "sp-std", ] @@ -7139,9 +7159,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.3.13" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55a7901b85874402471e131de3332dde0e51f38432c69a3853627c8e25433048" +checksum = "b3e7f385d61562f5834282b90aa50b41f38a35cf64d5209b8b05487b50553dbe" dependencies = [ "blake2-rfc", "crc32fast", @@ -7158,9 +7178,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.1.5" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9182e4a71cae089267ab03e67c99368db7cd877baf50f931e5d6d4b71e195ac0" +checksum = "e8b44461635bbb1a0300f100a841e571e7d919c81c73075ef5d152ffdb521066" dependencies = [ "arrayvec 0.7.2", "bitvec", @@ -7172,9 +7192,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.1.3" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" +checksum = "c45ed1f39709f5a89338fab50e59816b2e8815f5bb58276e7ddf9afd495f73f8" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -7209,10 +7229,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ "cfg-if 1.0.0", - "hashbrown 0.12.1", + "hashbrown 0.12.0", "impl-trait-for-tuples", "parity-util-mem-derive", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "primitive-types", "smallvec", "winapi 0.3.9", @@ -7281,12 +7301,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" dependencies = [ "lock_api", - "parking_lot_core 0.9.3", + "parking_lot_core 0.9.2", ] [[package]] @@ -7305,9 +7325,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "995f667a6c822200b0433ac218e05582f0e2efa1b922a3fd2fbaadc5f87bab37" dependencies = [ "cfg-if 1.0.0", "libc", @@ -7403,9 +7423,9 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" dependencies = [ "fixedbitset", "indexmap", @@ -7459,9 +7479,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" [[package]] name = "pin-utils" @@ -7555,7 +7575,7 @@ dependencies = [ "derive_more", "fatality", "futures 0.3.21", - "lru 0.7.6", + "lru 0.7.5", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -7577,7 +7597,7 @@ source = "git+https://github.com/paritytech/polkadot.git?branch=release-v0.9.18# dependencies = [ "fatality", "futures 0.3.21", - "lru 0.7.6", + "lru 0.7.5", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -7596,7 +7616,7 @@ name = "polkadot-cli" version = "0.9.18" source = "git+https://github.com/paritytech/polkadot.git?branch=release-v0.9.18#9ed0c98204d25eaad8a6b40248daee8e6a40d111" dependencies = [ - "clap 3.1.18", + "clap 3.1.8", "frame-benchmarking-cli", "futures 0.3.21", "log", @@ -7686,7 +7706,7 @@ dependencies = [ "derive_more", "fatality", "futures 0.3.21", - "lru 0.7.6", + "lru 0.7.5", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -7743,7 +7763,7 @@ dependencies = [ "async-trait", "futures 0.3.21", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7782,7 +7802,7 @@ dependencies = [ "futures 0.3.21", "futures-timer", "kvdb", - "lru 0.7.6", + "lru 0.7.5", "merlin", "parity-scale-codec", "polkadot-node-jaeger", @@ -7911,7 +7931,7 @@ dependencies = [ "fatality", "futures 0.3.21", "kvdb", - "lru 0.7.6", + "lru 0.7.5", "parity-scale-codec", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -8030,7 +8050,7 @@ dependencies = [ "log", "mick-jaeger", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "polkadot-node-primitives", "polkadot-primitives", "sc-network", @@ -8071,7 +8091,7 @@ dependencies = [ "polkadot-primitives", "sc-authority-discovery", "sc-network", - "strum 0.24.1", + "strum 0.24.0", "thiserror", ] @@ -8137,7 +8157,7 @@ dependencies = [ "futures 0.3.21", "itertools", "kvdb", - "lru 0.7.6", + "lru 0.7.5", "metered-channel", "parity-db", "parity-scale-codec", @@ -8166,9 +8186,9 @@ source = "git+https://github.com/paritytech/polkadot.git?branch=release-v0.9.18# dependencies = [ "futures 0.3.21", "futures-timer", - "lru 0.7.6", + "lru 0.7.5", "parity-util-mem", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -8513,7 +8533,7 @@ dependencies = [ "kusama-runtime", "kvdb", "kvdb-rocksdb", - "lru 0.7.6", + "lru 0.7.5", "pallet-babe", "pallet-im-online", "pallet-mmr-primitives", @@ -8731,24 +8751,24 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.39" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" +checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" dependencies = [ - "unicode-ident", + "unicode-xid", ] [[package]] name = "prometheus" -version = "0.13.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cface98dfa6d645ea4c789839f176e4b072265d085bfcc48eaa8d137f58d3c39" +checksum = "b7f64969ffd5dd8f39bd57a68ac53c163a095ed9d0fb707146da1b27025a3504" dependencies = [ "cfg-if 1.0.0", "fnv", "lazy_static", "memchr", - "parking_lot 0.12.1", + "parking_lot 0.11.2", "thiserror", ] @@ -8820,6 +8840,12 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quicksink" version = "0.1.2" @@ -8945,9 +8971,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.5.3" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" dependencies = [ "autocfg", "crossbeam-deque", @@ -8957,13 +8983,14 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.3" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" dependencies = [ "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", + "lazy_static", "num_cpus", ] @@ -9002,18 +9029,18 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.7" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685d58625b6c2b83e4cc88a27c4bf65adb7b6b16dbdc413e515c9405b47432ab" +checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.7" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a043824e29c94169374ac5183ac0ed43f5724dc4556b19568007486bd840fa1f" +checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" dependencies = [ "proc-macro2", "quote", @@ -9033,9 +9060,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.6" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ "aho-corasick", "memchr", @@ -9053,9 +9080,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.26" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "region" @@ -9118,7 +9145,7 @@ dependencies = [ "mime", "native-tls", "percent-encoding 2.1.0", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.8", "serde", "serde_json", "serde_urlencoded", @@ -9138,14 +9165,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" dependencies = [ "hostname", - "quick-error", + "quick-error 1.2.3", ] [[package]] name = "retain_mut" -version = "0.1.9" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" +checksum = "8c31b5c4033f8fdde8700e4657be2c497e7288f01515be52168c631e2e4d4086" [[package]] name = "ring" @@ -9338,7 +9365,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.10", + "semver 1.0.7", ] [[package]] @@ -9370,9 +9397,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.6" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" +checksum = "4fbfeb8d0ddb84706bc597a5574ab8912817c52a397f819e5b614e2265206921" dependencies = [ "log", "ring", @@ -9394,9 +9421,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.6.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "5ca9ebdfa27d3fc180e42879037b5338ab1c040c06affd00d8338598e7800943" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -9406,9 +9433,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" dependencies = [ "base64", ] @@ -9432,9 +9459,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.10" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "salsa20" @@ -9537,7 +9564,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "impl-trait-for-tuples", - "memmap2 0.5.4", + "memmap2 0.5.3", "parity-scale-codec", "sc-chain-spec-derive", "sc-network", @@ -9565,7 +9592,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "chrono", - "clap 3.1.18", + "clap 3.1.8", "fdlimit", "futures 0.3.21", "hex", @@ -9607,7 +9634,7 @@ dependencies = [ "hash-db", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "sc-executor", "sc-transaction-pool-api", "sc-utils", @@ -9638,7 +9665,7 @@ dependencies = [ "log", "parity-db", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "sc-client-api", "sc-state-db", "sp-arithmetic", @@ -9660,7 +9687,7 @@ dependencies = [ "futures-timer", "libp2p", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "sc-client-api", "sc-utils", "serde", @@ -9717,7 +9744,7 @@ dependencies = [ "num-rational 0.2.4", "num-traits", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "rand 0.7.3", "retain_mut", "sc-client-api", @@ -9863,7 +9890,7 @@ dependencies = [ "lazy_static", "lru 0.6.6", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "sc-executor-common", "sc-executor-wasmi", "sc-executor-wasmtime", @@ -9948,7 +9975,7 @@ dependencies = [ "hex", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "rand 0.8.5", "sc-block-builder", "sc-chain-spec", @@ -10021,7 +10048,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.1 dependencies = [ "async-trait", "hex", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "serde_json", "sp-application-crypto", "sp-core", @@ -10050,9 +10077,9 @@ dependencies = [ "linked-hash-map", "linked_hash_set", "log", - "lru 0.7.6", + "lru 0.7.5", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "pin-project 1.0.10", "prost", "prost-build", @@ -10088,7 +10115,7 @@ dependencies = [ "futures-timer", "libp2p", "log", - "lru 0.7.6", + "lru 0.7.5", "sc-network", "sp-runtime", "substrate-prometheus-endpoint", @@ -10110,7 +10137,7 @@ dependencies = [ "num_cpus", "once_cell", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "rand 0.7.3", "sc-client-api", "sc-network", @@ -10156,7 +10183,7 @@ dependencies = [ "jsonrpc-pubsub", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -10188,7 +10215,7 @@ dependencies = [ "jsonrpc-pubsub", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "sc-chain-spec", "sc-transaction-pool-api", "serde", @@ -10234,7 +10261,7 @@ dependencies = [ "log", "parity-scale-codec", "parity-util-mem", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "pin-project 1.0.10", "rand 0.7.3", "sc-block-builder", @@ -10291,7 +10318,7 @@ dependencies = [ "parity-scale-codec", "parity-util-mem", "parity-util-mem-derive", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "sc-client-api", "sp-core", ] @@ -10326,7 +10353,7 @@ dependencies = [ "futures 0.3.21", "libp2p", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "pin-project 1.0.10", "rand 0.7.3", "serde", @@ -10347,7 +10374,7 @@ dependencies = [ "libc", "log", "once_cell", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "regex", "rustc-hash", "sc-client-api", @@ -10388,7 +10415,7 @@ dependencies = [ "log", "parity-scale-codec", "parity-util-mem", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "retain_mut", "sc-client-api", "sc-transaction-pool-api", @@ -10426,15 +10453,15 @@ dependencies = [ "futures-timer", "lazy_static", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "prometheus", ] [[package]] name = "scale-info" -version = "2.1.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c46be926081c9f4dd5dd9b6f1d3e3229f2360bc6502dd8836f84a93b7c75e99a" +checksum = "21fe4ca2b2295d5519b364579162b8e18f4902f6c9e8a975e7d05e7ef63622f5" dependencies = [ "bitvec", "cfg-if 1.0.0", @@ -10446,9 +10473,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.1.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e334bb10a245e28e5fd755cabcafd96cfcd167c99ae63a46924ca8d8703a3c" +checksum = "e767e52f2d5b2e71e86b1c82976bf4c3acdef88d72af7fa3498cef31cd9708cb" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -10458,12 +10485,12 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.20" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ "lazy_static", - "windows-sys", + "winapi 0.3.9", ] [[package]] @@ -10599,9 +10626,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.10" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41d061efea015927ac527063765e73601444cdc344ba855bc7bd44578b25e1c" +checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" dependencies = [ "serde", ] @@ -10653,11 +10680,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.81" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ - "itoa 1.0.2", + "itoa 1.0.1", "ryu", "serde", ] @@ -10678,7 +10705,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.2", + "itoa 1.0.1", "ryu", "serde", ] @@ -10783,9 +10810,9 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "signal-hook" -version = "0.3.14" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" +checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d" dependencies = [ "libc", "signal-hook-registry", @@ -11016,9 +11043,9 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.1 dependencies = [ "futures 0.3.21", "log", - "lru 0.7.6", + "lru 0.7.5", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "sp-api", "sp-consensus", "sp-database", @@ -11136,7 +11163,7 @@ dependencies = [ "num-traits", "parity-scale-codec", "parity-util-mem", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "primitive-types", "rand 0.7.3", "regex", @@ -11190,7 +11217,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "kvdb", - "parking_lot 0.12.1", + "parking_lot 0.12.0", ] [[package]] @@ -11256,7 +11283,7 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "secp256k1", "sp-core", "sp-externalities", @@ -11291,7 +11318,7 @@ dependencies = [ "futures 0.3.21", "merlin", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "schnorrkel", "serde", "sp-core", @@ -11458,7 +11485,7 @@ dependencies = [ "log", "num-traits", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.0", "rand 0.7.3", "smallvec", "sp-core", @@ -11631,9 +11658,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.22.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d804c8d48aeab838be31570866fce1130d275b563d49af08b4927a0bd561e7c" +checksum = "7b84a70894df7a73666e0694f44b41a9571625e9546fb58a0818a565d2c7e084" dependencies = [ "Inflector", "num-format", @@ -11711,11 +11738,11 @@ dependencies = [ [[package]] name = "strum" -version = "0.24.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +checksum = "e96acfc1b70604b8b2f1ffa4c57e59176c7dbb05d556c71ecd2f5498a1dee7f8" dependencies = [ - "strum_macros 0.24.1", + "strum_macros 0.24.0", ] [[package]] @@ -11733,9 +11760,9 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.24.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9550962e7cf70d9980392878dfaf1dcc3ece024f4cf3bf3c46b978d0bad61d6c" +checksum = "6878079b17446e4d3eba6192bb0a2950d5b14f0ed8424b852310e5a94345d0ef" dependencies = [ "heck 0.4.0", "proc-macro2", @@ -11824,13 +11851,13 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.96" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" +checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" dependencies = [ "proc-macro2", "quote", - "unicode-ident", + "unicode-xid", ] [[package]] @@ -11853,9 +11880,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.4" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1" +checksum = "d7fa7e55043acb85fca6b3c01485a2eeb6b69c5d21002e273c79e465f43b7ac1" [[package]] name = "tempfile" @@ -11897,18 +11924,18 @@ checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", @@ -11999,9 +12026,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" dependencies = [ "tinyvec_macros", ] @@ -12014,18 +12041,18 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.19.2" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" +checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" dependencies = [ "bytes 1.1.0", "libc", "memchr", - "mio 0.8.3", + "mio 0.8.2", "num_cpus", "once_cell", - "parking_lot 0.12.1", - "pin-project-lite 0.2.9", + "parking_lot 0.12.0", + "pin-project-lite 0.2.8", "signal-hook-registry", "socket2 0.4.4", "tokio-macros", @@ -12034,9 +12061,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ "proc-macro2", "quote", @@ -12066,60 +12093,60 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.23.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "4151fda0cf2798550ad0b34bcfc9b9dcc2a9d2471c895c68f3a8818e54f2389e" dependencies = [ - "rustls 0.20.6", + "rustls 0.20.4", "tokio", "webpki 0.22.0", ] [[package]] name = "tokio-stream" -version = "0.1.9" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.8", "tokio", ] [[package]] name = "tokio-util" -version = "0.6.10" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ "bytes 1.1.0", "futures-core", "futures-io", "futures-sink", "log", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.8", "tokio", ] [[package]] name = "tokio-util" -version = "0.7.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764" dependencies = [ "bytes 1.1.0", "futures-core", "futures-sink", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.8", "tokio", "tracing", ] [[package]] name = "toml" -version = "0.5.9" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ "serde", ] @@ -12132,21 +12159,21 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.35" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +checksum = "80b9fa4360528139bc96100c160b7ae879f5567f49f1782b0b02035b0358ebf3" dependencies = [ "cfg-if 1.0.0", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.8", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.21" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" +checksum = "2e65ce065b4b5c53e73bb28912318cb8c9e9ad3921f1d669eb0e68b4c8143a2b" dependencies = [ "proc-macro2", "quote", @@ -12155,11 +12182,11 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.27" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7709595b8878a4965ce5e87ebf880a7d39c9afc6837721b21a5a816a8117d921" +checksum = "6dfce9f3241b150f36e8e54bb561a742d5daa1a47b5dd9a5ce369fd4a4db2210" dependencies = [ - "once_cell", + "lazy_static", "valuable", ] @@ -12175,9 +12202,9 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" dependencies = [ "lazy_static", "log", @@ -12224,7 +12251,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d32d034c0d3db64b43c31de38e945f15b40cd4ca6d2dcfc26d4798ce8de4ab83" dependencies = [ "hash-db", - "hashbrown 0.12.1", + "hashbrown 0.12.0", "log", "rustc-hex", "smallvec", @@ -12293,7 +12320,7 @@ name = "try-runtime-cli" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "clap 3.1.18", + "clap 3.1.8", "jsonrpsee 0.4.1", "log", "parity-scale-codec", @@ -12321,11 +12348,11 @@ checksum = "5e66dcbec4290c69dd03c57e76c2469ea5c7ce109c6dd4351c13055cf71ea055" [[package]] name = "twox-hash" -version = "1.6.3" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +checksum = "4ee73e6e4924fe940354b8d4d98cad5231175d615cd855b758adc658c0aac6a0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "digest 0.10.3", "rand 0.8.5", "static_assertions", @@ -12366,15 +12393,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" - -[[package]] -name = "unicode-ident" -version = "1.0.0" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" @@ -12399,9 +12420,15 @@ checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" [[package]] name = "unicode-xid" -version = "0.2.3" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "unindent" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514672a55d7380da379785a4d70ca8386c8883ff7eaae877be4d2081cebe73d8" [[package]] name = "universal-hash" @@ -12480,9 +12507,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.0.0-alpha.9" +version = "1.0.0-alpha.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" +checksum = "79923f7731dc61ebfba3633098bf3ac533bbd35ccd8c57e7088d9a5eebe0263f" dependencies = [ "ctor", "version_check", @@ -12697,7 +12724,7 @@ dependencies = [ "lazy_static", "libc", "log", - "object 0.27.1", + "object", "paste", "psm", "rayon", @@ -12749,7 +12776,7 @@ dependencies = [ "gimli", "log", "more-asserts", - "object 0.27.1", + "object", "target-lexicon", "thiserror", "wasmparser", @@ -12768,7 +12795,7 @@ dependencies = [ "indexmap", "log", "more-asserts", - "object 0.27.1", + "object", "serde", "target-lexicon", "thiserror", @@ -12787,7 +12814,7 @@ dependencies = [ "bincode", "cfg-if 1.0.0", "gimli", - "object 0.27.1", + "object", "region", "rustix", "serde", @@ -13058,9 +13085,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.36.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "5acdd78cb4ba54c0045ac14f62d8f94a03d10047904ae2a40afa1e99d8f70825" dependencies = [ "windows_aarch64_msvc", "windows_i686_gnu", @@ -13071,33 +13098,33 @@ dependencies = [ [[package]] name = "windows_aarch64_msvc" -version = "0.36.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" [[package]] name = "windows_i686_gnu" -version = "0.36.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" [[package]] name = "windows_i686_msvc" -version = "0.36.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" [[package]] name = "windows_x86_64_gnu" -version = "0.36.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" [[package]] name = "winreg" @@ -13242,9 +13269,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.5.5" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94693807d016b2f2d2e14420eb3bfcca689311ff775dcf113d74ea624b7cdf07" +checksum = "7eb5728b8afd3f280a869ce1d4c554ffaed35f45c231fc41bfbd0381bef50317" dependencies = [ "zeroize_derive", ] diff --git a/Cargo.toml b/Cargo.toml index 411923373..68d8da57d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,8 +9,6 @@ members = [ 'runtime/dolphin', 'runtime/common', 'primitives', - 'nimbus-primitives', - 'nimbus-consensus', ] [profile.production] diff --git a/nimbus-consensus/Cargo.toml b/nimbus-consensus/Cargo.toml deleted file mode 100644 index 5b29f6db9..000000000 --- a/nimbus-consensus/Cargo.toml +++ /dev/null @@ -1,39 +0,0 @@ -[package] -name = "nimbus-consensus" -description = "Client-side worker for the Nimbus family of consensus algorithms" -edition = "2021" -version = "0.9.0" -[dependencies] -# Substrate deps -sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" } -sc-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" } -sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" } -sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" } -sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" } -sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" } -sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" } -sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" } -sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" } -sp-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" } -substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" } - -# Polkadot dependencies -polkadot-client = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.18", default-features = false } - -# Cumulus dependencies -cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" } -cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" } - -# Nimbus Dependencies -nimbus-primitives = { path = "../nimbus-primitives" } - -# Other deps -async-trait = "0.1.42" -codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } -futures = { version = "0.3.8", features = [ "compat" ] } -log = "0.4" -parking_lot = "0.12" -tracing = "0.1.22" diff --git a/nimbus-consensus/src/import_queue.rs b/nimbus-consensus/src/import_queue.rs deleted file mode 100644 index b73a40043..000000000 --- a/nimbus-consensus/src/import_queue.rs +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright 2019-2021 PureStake Inc. -// This file is part of Nimbus. - -// Nimbus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Nimbus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Nimbus. If not, see . - -use std::{marker::PhantomData, sync::Arc}; - -use log::debug; -use nimbus_primitives::{digests::CompatibleDigestItem, NimbusId, NimbusPair, NIMBUS_ENGINE_ID}; -use sc_consensus::{ - import_queue::{BasicQueue, Verifier as VerifierT}, - BlockImport, BlockImportParams, -}; -use sp_api::ProvideRuntimeApi; -use sp_application_crypto::{ByteArray, Pair as _}; -use sp_block_builder::BlockBuilder as BlockBuilderApi; -use sp_blockchain::Result as ClientResult; -use sp_consensus::{error::Error as ConsensusError, CacheKeyId}; -use sp_inherents::{CreateInherentDataProviders, InherentDataProvider}; -use sp_runtime::{ - generic::BlockId, - traits::{Block as BlockT, Header as HeaderT}, - DigestItem, -}; - -/// The Nimbus verifier strips the seal digest, and checks that it is a valid signature by -/// the same key that was injected into the runtime and noted in the Seal digest. -/// From Nimbu's perspective any block that faithfully reports its authorship to the runtime -/// is valid. The intention is that the runtime itself may then put further restrictions on -/// the identity of the author. -struct Verifier { - client: Arc, - create_inherent_data_providers: CIDP, - _marker: PhantomData, -} - -#[async_trait::async_trait] -impl VerifierT for Verifier -where - Block: BlockT, - Client: ProvideRuntimeApi + Send + Sync, - >::Api: BlockBuilderApi, - CIDP: CreateInherentDataProviders, -{ - async fn verify( - &mut self, - mut block_params: BlockImportParams, - ) -> Result< - ( - BlockImportParams, - Option)>>, - ), - String, - > { - debug!( - target: crate::LOG_TARGET, - "🪲 Header hash before popping digest {:?}", - block_params.header.hash() - ); - // Grab the seal digest. Assume it is last (since it is a seal after-all). - let seal = block_params - .header - .digest_mut() - .pop() - .expect("Block should have at least one digest on it"); - - let signature = seal - .as_nimbus_seal() - .ok_or_else(|| String::from("HeaderUnsealed"))?; - - debug!( - target: crate::LOG_TARGET, - "🪲 Header hash after popping digest {:?}", - block_params.header.hash() - ); - - debug!( - target: crate::LOG_TARGET, - "🪲 Signature according to verifier is {:?}", signature - ); - - // Grab the author information from either the preruntime digest or the consensus digest - //TODO use the trait - let claimed_author = block_params - .header - .digest() - .logs - .iter() - .find_map(|digest| match *digest { - DigestItem::Consensus(id, ref author_id) if id == NIMBUS_ENGINE_ID => { - Some(author_id.clone()) - } - DigestItem::PreRuntime(id, ref author_id) if id == NIMBUS_ENGINE_ID => { - Some(author_id.clone()) - } - _ => None, - }) - .expect("Expected one consensus or pre-runtime digest that contains author id bytes"); - - debug!( - target: crate::LOG_TARGET, - "🪲 Claimed Author according to verifier is {:?}", claimed_author - ); - - // Verify the signature - let valid_signature = NimbusPair::verify( - &signature, - block_params.header.hash(), - &NimbusId::from_slice(&claimed_author) - .map_err(|_| "Invalid Nimbus ID (wrong length)")?, - ); - - debug!( - target: crate::LOG_TARGET, - "🪲 Valid signature? {:?}", valid_signature - ); - - if !valid_signature { - return Err("Block signature invalid".into()); - } - - // This part copied from RelayChainConsensus. I guess this is the inherent checking. - if let Some(inner_body) = block_params.body.take() { - let inherent_data_providers = self - .create_inherent_data_providers - .create_inherent_data_providers(*block_params.header.parent_hash(), ()) - .await - .map_err(|e| e.to_string())?; - - let inherent_data = inherent_data_providers - .create_inherent_data() - .map_err(|e| format!("{:?}", e))?; - - let block = Block::new(block_params.header.clone(), inner_body); - - let inherent_res = self - .client - .runtime_api() - .check_inherents( - &BlockId::Hash(*block_params.header.parent_hash()), - block.clone(), - inherent_data, - ) - .map_err(|e| format!("{:?}", e))?; - - if !inherent_res.ok() { - for (i, e) in inherent_res.into_errors() { - match inherent_data_providers.try_handle_error(&i, &e).await { - Some(r) => r.map_err(|e| format!("{:?}", e))?, - None => Err(format!( - "Unhandled inherent error from `{}`.", - String::from_utf8_lossy(&i) - ))?, - } - } - } - - let (_, inner_body) = block.deconstruct(); - block_params.body = Some(inner_body); - } - - block_params.post_digests.push(seal); - - // The standard is to use the longest chain rule. This is overridden by the `NimbusBlockImport` in the parachain context. - block_params.fork_choice = Some(sc_consensus::ForkChoiceStrategy::LongestChain); - - debug!( - target: crate::LOG_TARGET, - "🪲 Just finished verifier. posthash from params is {:?}", - &block_params.post_hash() - ); - - Ok((block_params, None)) - } -} - -/// Start an import queue for a Cumulus collator that does not uses any special authoring logic. -pub fn import_queue( - client: Arc, - block_import: I, - create_inherent_data_providers: CIDP, - spawner: &impl sp_core::traits::SpawnEssentialNamed, - registry: Option<&substrate_prometheus_endpoint::Registry>, - parachain: bool, -) -> ClientResult> -where - I: BlockImport + Send + Sync + 'static, - I::Transaction: Send, - Client: ProvideRuntimeApi + Send + Sync + 'static, - >::Api: BlockBuilderApi, - CIDP: CreateInherentDataProviders + 'static, -{ - let verifier = Verifier { - client, - create_inherent_data_providers, - _marker: PhantomData, - }; - - Ok(BasicQueue::new( - verifier, - Box::new(NimbusBlockImport::new(block_import, parachain)), - None, - spawner, - registry, - )) -} - -/// Nimbus specific block import. -/// -/// Nimbus supports both parachain and non-parachain contexts. In the parachain -/// context, new blocks should not be imported as best. Cumulus's ParachainBlockImport -/// handles this correctly, but does not work in non-parachain contexts. -/// This block import has a field indicating whether we should apply parachain rules or not. -/// -/// There may be additional nimbus-specific logic here in the future, but for now it is -/// only the conditional parachain logic -pub struct NimbusBlockImport { - inner: I, - parachain_context: bool, -} - -impl NimbusBlockImport { - /// Create a new instance. - pub fn new(inner: I, parachain_context: bool) -> Self { - Self { - inner, - parachain_context, - } - } -} - -#[async_trait::async_trait] -impl BlockImport for NimbusBlockImport -where - Block: BlockT, - I: BlockImport + Send, -{ - type Error = I::Error; - type Transaction = I::Transaction; - - async fn check_block( - &mut self, - block: sc_consensus::BlockCheckParams, - ) -> Result { - self.inner.check_block(block).await - } - - async fn import_block( - &mut self, - mut block_import_params: sc_consensus::BlockImportParams, - cache: std::collections::HashMap>, - ) -> Result { - // If we are in the parachain context, best block is determined by the relay chain - // except during initial sync - if self.parachain_context { - block_import_params.fork_choice = Some(sc_consensus::ForkChoiceStrategy::Custom( - block_import_params.origin == sp_consensus::BlockOrigin::NetworkInitialSync, - )); - } - - // Now continue on to the rest of the import pipeline. - self.inner.import_block(block_import_params, cache).await - } -} diff --git a/nimbus-consensus/src/lib.rs b/nimbus-consensus/src/lib.rs deleted file mode 100644 index c6b763da7..000000000 --- a/nimbus-consensus/src/lib.rs +++ /dev/null @@ -1,464 +0,0 @@ -// Copyright 2019-2021 PureStake Inc. -// This file is part of Nimbus. - -// Nimbus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Nimbus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Nimbus. If not, see . - -//! The nimbus consensus client-side worker -//! -//! It queries the in-runtime filter to determine whether any keys -//! stored in its keystore are eligible to author at this slot. If it has an eligible -//! key it authors. - -use cumulus_client_consensus_common::{ - ParachainBlockImport, ParachainCandidate, ParachainConsensus, -}; -use cumulus_primitives_core::{relay_chain::v1::Hash as PHash, ParaId, PersistedValidationData}; -pub use import_queue::import_queue; -use log::{debug, info, warn}; -use nimbus_primitives::{ - AuthorFilterAPI, CompatibleDigestItem, NimbusApi, NimbusId, NIMBUS_KEY_ID, -}; -use parking_lot::Mutex; -use sc_consensus::{BlockImport, BlockImportParams}; -use sp_api::{ApiExt, BlockId, ProvideRuntimeApi}; -use sp_application_crypto::{ByteArray, CryptoTypePublicPair}; -use sp_consensus::{ - BlockOrigin, EnableProofRecording, Environment, ProofRecording, Proposal, Proposer, -}; -use sp_inherents::{CreateInherentDataProviders, InherentData, InherentDataProvider}; -use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr}; -use sp_runtime::{ - traits::{Block as BlockT, Header as HeaderT}, - DigestItem, -}; -use std::convert::TryInto; -use std::{marker::PhantomData, sync::Arc, time::Duration}; -use tracing::error; -mod import_queue; -mod manual_seal; -pub use manual_seal::NimbusManualSealConsensusDataProvider; - -const LOG_TARGET: &str = "filtering-consensus"; - -/// The implementation of the relay-chain provided consensus for parachains. -pub struct NimbusConsensus { - para_id: ParaId, - proposer_factory: Arc>, - create_inherent_data_providers: Arc, - block_import: Arc>>, - parachain_client: Arc, - keystore: SyncCryptoStorePtr, - skip_prediction: bool, - _phantom: PhantomData, -} - -impl Clone for NimbusConsensus { - fn clone(&self) -> Self { - Self { - para_id: self.para_id, - proposer_factory: self.proposer_factory.clone(), - create_inherent_data_providers: self.create_inherent_data_providers.clone(), - block_import: self.block_import.clone(), - parachain_client: self.parachain_client.clone(), - keystore: self.keystore.clone(), - skip_prediction: self.skip_prediction, - _phantom: PhantomData, - } - } -} - -impl NimbusConsensus -where - B: BlockT, - PF: 'static, - BI: 'static, - ParaClient: ProvideRuntimeApi + 'static, - CIDP: CreateInherentDataProviders + 'static, -{ - /// Create a new instance of nimbus consensus. - pub fn build( - BuildNimbusConsensusParams { - para_id, - proposer_factory, - create_inherent_data_providers, - block_import, - parachain_client, - keystore, - skip_prediction, - }: BuildNimbusConsensusParams, - ) -> Box> - where - Self: ParachainConsensus, - { - Box::new(Self { - para_id, - proposer_factory: Arc::new(Mutex::new(proposer_factory)), - create_inherent_data_providers: Arc::new(create_inherent_data_providers), - block_import: Arc::new(futures::lock::Mutex::new(ParachainBlockImport::new( - block_import, - ))), - parachain_client, - keystore, - skip_prediction, - _phantom: PhantomData, - }) - } - - //TODO Could this be a provided implementation now that we have this async inherent stuff? - /// Create the data. - async fn inherent_data( - &self, - parent: B::Hash, - validation_data: &PersistedValidationData, - relay_parent: PHash, - author_id: NimbusId, - ) -> Option { - let inherent_data_providers = self - .create_inherent_data_providers - .create_inherent_data_providers( - parent, - (relay_parent, validation_data.clone(), author_id), - ) - .await - .map_err(|e| { - tracing::error!( - target: LOG_TARGET, - error = ?e, - "Failed to create inherent data providers.", - ) - }) - .ok()?; - - inherent_data_providers - .create_inherent_data() - .map_err(|e| { - tracing::error!( - target: LOG_TARGET, - error = ?e, - "Failed to create inherent data.", - ) - }) - .ok() - } -} - -/// Grabs any available nimbus key from the keystore. -/// This may be useful in situations where you expect exactly one key -/// and intend to perform an operation with it regardless of whether it is -/// expected to be eligible. Concretely, this is used in the consensus worker -/// to implement the `skip_prediction` feature. -pub(crate) fn first_available_key(keystore: &dyn SyncCryptoStore) -> Option { - // Get all the available keys - let available_keys = SyncCryptoStore::keys(keystore, NIMBUS_KEY_ID) - .expect("keystore should return the keys it has"); - - // Print a more helpful message than "not eligible" when there are no keys at all. - if available_keys.is_empty() { - warn!( - target: LOG_TARGET, - "🔏 No Nimbus keys available. We will not be able to author." - ); - return None; - } - - Some(available_keys[0].clone()) -} - -/// Grab the first eligible nimbus key from the keystore -/// If multiple keys are eligible this function still only returns one -/// and makes no guarantees which one as that depends on the keystore's iterator behavior. -/// This is the standard way of determining which key to author with. -pub(crate) fn first_eligible_key( - client: Arc, - keystore: &dyn SyncCryptoStore, - parent: &B::Header, - slot_number: u32, -) -> Option -where - C: ProvideRuntimeApi, - C::Api: NimbusApi, - C::Api: AuthorFilterAPI, -{ - // Get all the available keys - let available_keys = SyncCryptoStore::keys(keystore, NIMBUS_KEY_ID) - .expect("keystore should return the keys it has"); - - // Print a more helpful message than "not eligible" when there are no keys at all. - if available_keys.is_empty() { - warn!( - target: LOG_TARGET, - "🔏 No Nimbus keys available. We will not be able to author." - ); - return None; - } - let at = BlockId::Hash(parent.hash()); - - // helper function for calling the various runtime apis and versions - let prediction_helper = |at, nimbus_id: NimbusId, slot: u32, parent| -> bool { - let has_nimbus_api = client - .runtime_api() - .has_api::>(at) - .expect("should be able to dynamically detect the api"); - - if has_nimbus_api { - NimbusApi::can_author(&*client.runtime_api(), at, nimbus_id, slot, parent) - .expect("NimbusAPI should not return error") - } else { - // There are two versions of the author filter, so we do that dynamically also. - let api_version = client - .runtime_api() - .api_version::>(&at) - .expect("Runtime api access to not error.") - .expect("Should be able to detect author filter version"); - - if api_version >= 2 { - AuthorFilterAPI::can_author(&*client.runtime_api(), at, nimbus_id, slot, parent) - .expect("Author API should not return error") - } else { - #[allow(deprecated)] - client - .runtime_api() - .can_author_before_version_2(&at, nimbus_id, slot_number) - .expect("Author API version 2 should not return error") - } - } - }; - - // Iterate keys until we find an eligible one, or run out of candidates. - // If we are skipping prediction, then we author with the first key we find. - // prediction skipping only really makes sense when there is a single key in the keystore. - let maybe_key = available_keys.into_iter().find(|type_public_pair| { - // Have to convert to a typed NimbusId to pass to the runtime API. Maybe this is a clue - // That I should be passing Vec across the wasm boundary? - prediction_helper( - &at, - NimbusId::from_slice(&type_public_pair.1).expect("Provided keys should be valid"), - slot_number, - parent, - ) - }); - - // If there are no eligible keys, print the log, and exit early. - if maybe_key.is_none() { - info!( - target: LOG_TARGET, - "🔮 Skipping candidate production because we are not eligible" - ); - } - - maybe_key -} - -pub(crate) fn seal_header( - header: &B::Header, - keystore: &dyn SyncCryptoStore, - type_public_pair: &CryptoTypePublicPair, -) -> DigestItem -where - B: BlockT, -{ - let pre_hash = header.hash(); - - let raw_sig = SyncCryptoStore::sign_with( - &*keystore, - NIMBUS_KEY_ID, - type_public_pair, - pre_hash.as_ref(), - ) - .expect("Keystore should be able to sign") - .expect("We already checked that the key was present"); - - debug!(target: LOG_TARGET, "The signature is \n{:?}", raw_sig); - - let signature = raw_sig - .clone() - .try_into() - .expect("signature bytes produced by keystore should be right length"); - - ::nimbus_seal(signature) -} - -#[async_trait::async_trait] -impl ParachainConsensus - for NimbusConsensus -where - B: BlockT, - BI: BlockImport + Send + Sync + 'static, - PF: Environment + Send + Sync + 'static, - PF::Proposer: Proposer< - B, - Transaction = BI::Transaction, - ProofRecording = EnableProofRecording, - Proof = ::Proof, - >, - ParaClient: ProvideRuntimeApi + Send + Sync + 'static, - // We require the client to provide both runtime apis, but only one will be called - ParaClient::Api: AuthorFilterAPI, - ParaClient::Api: NimbusApi, - CIDP: CreateInherentDataProviders + 'static, -{ - async fn produce_candidate( - &mut self, - parent: &B::Header, - relay_parent: PHash, - validation_data: &PersistedValidationData, - ) -> Option> { - // Determine if runtime change - let runtime_upgraded = if *parent.number() > sp_runtime::traits::Zero::zero() { - let at = BlockId::Hash(parent.hash()); - let parent_at = BlockId::::Hash(*parent.parent_hash()); - use sp_api::Core as _; - let previous_runtime_version: sp_api::RuntimeVersion = self - .parachain_client - .runtime_api() - .version(&parent_at) - .expect("Runtime api access to not error."); - let runtime_version: sp_api::RuntimeVersion = self - .parachain_client - .runtime_api() - .version(&at) - .expect("Runtime api access to not error."); - - previous_runtime_version != runtime_version - } else { - false - }; - - let maybe_key = if self.skip_prediction || runtime_upgraded { - first_available_key(&*self.keystore) - } else { - first_eligible_key::( - self.parachain_client.clone(), - &*self.keystore, - parent, - validation_data.relay_parent_number, - ) - }; - - // If there are no eligible keys, print the log, and exit early. - let type_public_pair = match maybe_key { - Some(p) => p, - None => { - return None; - } - }; - - let proposer_future = self.proposer_factory.lock().init(&parent); - - let proposer = proposer_future - .await - .map_err(|e| error!(target: LOG_TARGET, error = ?e, "Could not create proposer.")) - .ok()?; - - let nimbus_id = NimbusId::from_slice(&type_public_pair.1) - .map_err( - |e| error!(target: LOG_TARGET, error = ?e, "Invalid Nimbus ID (wrong length)."), - ) - .ok()?; - - let inherent_data = self - .inherent_data( - parent.hash(), - &validation_data, - relay_parent, - nimbus_id.clone(), - ) - .await?; - - let inherent_digests = sp_runtime::generic::Digest { - logs: vec![CompatibleDigestItem::nimbus_pre_digest(nimbus_id)], - }; - - let Proposal { - block, - storage_changes, - proof, - } = proposer - .propose( - inherent_data, - inherent_digests, - //TODO: Fix this. - Duration::from_millis(500), - // Set the block limit to 50% of the maximum PoV size. - // - // TODO: If we got benchmarking that includes that encapsulates the proof size, - // we should be able to use the maximum pov size. - Some((validation_data.max_pov_size / 2) as usize), - ) - .await - .map_err(|e| error!(target: LOG_TARGET, error = ?e, "Proposing failed.")) - .ok()?; - - let (header, extrinsics) = block.clone().deconstruct(); - - let sig_digest = seal_header::(&header, &*self.keystore, &type_public_pair); - - let mut block_import_params = BlockImportParams::new(BlockOrigin::Own, header.clone()); - block_import_params.post_digests.push(sig_digest.clone()); - block_import_params.body = Some(extrinsics.clone()); - block_import_params.state_action = sc_consensus::StateAction::ApplyChanges( - sc_consensus::StorageChanges::Changes(storage_changes), - ); - - // Print the same log line as slots (aura and babe) - info!( - "🔖 Sealed block for proposal at {}. Hash now {:?}, previously {:?}.", - *header.number(), - block_import_params.post_hash(), - header.hash(), - ); - - if let Err(err) = self - .block_import - .lock() - .await - .import_block(block_import_params, Default::default()) - .await - { - error!( - target: LOG_TARGET, - at = ?parent.hash(), - error = ?err, - "Error importing built block.", - ); - - return None; - } - - // Compute info about the block after the digest is added - let mut post_header = header.clone(); - post_header.digest_mut().logs.push(sig_digest.clone()); - let post_block = B::new(post_header, extrinsics); - - // Returning the block WITH the seal for distribution around the network. - Some(ParachainCandidate { - block: post_block, - proof, - }) - } -} - -/// Paramaters of [`build_relay_chain_consensus`]. -/// -/// I briefly tried the async keystore approach, but decided to go sync so I can copy -/// code from Aura. Maybe after it is working, Jeremy can help me go async. -pub struct BuildNimbusConsensusParams { - pub para_id: ParaId, - pub proposer_factory: PF, - pub create_inherent_data_providers: CIDP, - pub block_import: BI, - pub parachain_client: Arc, - pub keystore: SyncCryptoStorePtr, - pub skip_prediction: bool, -} diff --git a/nimbus-consensus/src/manual_seal.rs b/nimbus-consensus/src/manual_seal.rs deleted file mode 100644 index 2342f7073..000000000 --- a/nimbus-consensus/src/manual_seal.rs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright 2019-2021 PureStake Inc. -// This file is part of Nimbus. - -// Nimbus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Nimbus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Nimbus. If not, see . - -use cumulus_primitives_parachain_inherent::{ - ParachainInherentData, INHERENT_IDENTIFIER as PARACHAIN_INHERENT_IDENTIFIER, -}; -use nimbus_primitives::{ - AuthorFilterAPI, CompatibleDigestItem, NimbusApi, NimbusId, NIMBUS_ENGINE_ID, -}; -use sc_consensus::BlockImportParams; -use sc_consensus_manual_seal::{ConsensusDataProvider, Error}; -use sp_api::{HeaderT, ProvideRuntimeApi, TransactionFor}; -use sp_application_crypto::ByteArray; -use sp_inherents::InherentData; -use sp_keystore::SyncCryptoStorePtr; -use sp_runtime::{ - generic::{Digest, DigestItem}, - traits::Block as BlockT, -}; -use std::sync::Arc; - -/// Provides nimbus-compatible pre-runtime digests for use with manual seal consensus -pub struct NimbusManualSealConsensusDataProvider { - /// Shared reference to keystore - pub keystore: SyncCryptoStorePtr, - - /// Shared reference to the client - pub client: Arc, - // Could have a skip_prediction field here if it becomes desireable -} - -impl ConsensusDataProvider for NimbusManualSealConsensusDataProvider -where - B: BlockT, - C: ProvideRuntimeApi + Send + Sync, - C::Api: NimbusApi, - C::Api: AuthorFilterAPI, -{ - type Transaction = TransactionFor; - - fn create_digest(&self, parent: &B::Header, inherents: &InherentData) -> Result { - // Retrieve the relay chain block number to use as the slot number from the parachain inherent - let slot_number = inherents - .get_data::(&PARACHAIN_INHERENT_IDENTIFIER) - .expect("Parachain inherent should decode correctly") - .expect("Parachain inherent should be present because we are mocking it") - .validation_data - .relay_parent_number; - - // Fetch first eligible key from keystore - let maybe_key = crate::first_eligible_key::( - self.client.clone(), - &*self.keystore, - parent, - // For now we author all blocks in slot zero, which is consistent with how we are - // mocking the relay chain height which the runtime uses for slot beacon. - // This should improve. See https://github.com/PureStake/nimbus/issues/3 - slot_number, - ); - - // If we aren't eligible, return an appropriate error - match maybe_key { - Some(key) => { - let nimbus_id = NimbusId::from_slice(&key.1).map_err(|_| { - Error::StringError(String::from("invalid nimbus id (wrong length)")) - })?; - - Ok(Digest { - logs: vec![DigestItem::nimbus_pre_digest(nimbus_id)], - }) - } - None => Err(Error::StringError(String::from( - "no nimbus keys available to manual seal", - ))), - } - } - - // This is where we actually sign with the nimbus key and attach the seal - fn append_block_import( - &self, - _parent: &B::Header, - params: &mut BlockImportParams, - _inherents: &InherentData, - ) -> Result<(), Error> { - // We have to reconstruct the type-public pair which is only communicated through the pre-runtime digest - let claimed_author = params - .header - .digest() - .logs - .iter() - .find_map(|digest| { - match *digest { - // We do not support the older author inherent in manual seal - DigestItem::PreRuntime(id, ref author_id) if id == NIMBUS_ENGINE_ID => { - Some(author_id.clone()) - } - _ => None, - } - }) - .expect("Expected one pre-runtime digest that contains author id bytes"); - - let nimbus_public = NimbusId::from_slice(&claimed_author) - .map_err(|_| Error::StringError(String::from("invalid nimbus id (wrong length)")))?; - - let sig_digest = - crate::seal_header::(¶ms.header, &*self.keystore, &nimbus_public.into()); - - params.post_digests.push(sig_digest); - - Ok(()) - } -} diff --git a/nimbus-primitives/Cargo.toml b/nimbus-primitives/Cargo.toml deleted file mode 100644 index f9c6bc557..000000000 --- a/nimbus-primitives/Cargo.toml +++ /dev/null @@ -1,34 +0,0 @@ -[package] -name = "nimbus-primitives" -authors = [ "PureStake" ] -description = "Primitive types and traits used in the Nimbus consensus framework" -edition = "2021" -version = "0.9.0" - -[dependencies] -async-trait = { version = "0.1", optional = true } -parity-scale-codec = { version = "3.0.0", default-features = false, features = [ "derive" ] } - -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18", default-features = false } -scale-info = { version = "2.0.0", default-features = false, features = [ "derive" ] } -sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18", default-features = false } -sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18", default-features = false } -sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18", default-features = false } - -[features] -default = [ "std" ] -std = [ - "async-trait", - "frame-support/std", - "frame-system/std", - "parity-scale-codec/std", - "scale-info/std", - "sp-api/std", - "sp-application-crypto/std", - "sp-inherents/std", - "sp-runtime/std", - "sp-std/std", -] diff --git a/nimbus-primitives/src/digests.rs b/nimbus-primitives/src/digests.rs deleted file mode 100644 index e1ec9020a..000000000 --- a/nimbus-primitives/src/digests.rs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2019-2021 PureStake Inc. -// This file is part of Nimbus. - -// Nimbus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Nimbus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Nimbus. If not, see . - -//! A convenient interface over the digests used in nimbus. -//! -//! Currently Nimbus has two digests; -//! 1. A consensus digest that contains the block author identity -//! This information is copied from the author inehrent. -//! This may be replaced with a pre-runtime digest in the future. -//! 2. A seal digest that contains a signature over the rest of the -//! block including the first digest. - -use crate::{NimbusId, NimbusSignature, NIMBUS_ENGINE_ID}; -use parity_scale_codec::Encode; -use sp_runtime::generic::DigestItem; - -/// A digest item which is usable with aura consensus. -pub trait CompatibleDigestItem: Sized { - /// Construct a pre-runtime digest from the given AuthorId - fn nimbus_pre_digest(author: NimbusId) -> Self; - - /// If this item is a nimbus pre-runtime digest, return the author - fn as_nimbus_pre_digest(&self) -> Option; - - /// Construct a seal digest item from the given signature - fn nimbus_seal(signature: NimbusSignature) -> Self; - - /// If this item is a nimbus seal, return the signature. - fn as_nimbus_seal(&self) -> Option; - - /// This will be deprecated in the future - /// Construct a consensus digest from the given AuthorId - fn nimbus_consensus_digest(author: NimbusId) -> Self; - - /// This will be deprecated in the future - /// If this item is a nimbus consensus digest, return the author - fn as_nimbus_consensus_digest(&self) -> Option; -} - -impl CompatibleDigestItem for DigestItem { - fn nimbus_pre_digest(author: NimbusId) -> Self { - DigestItem::PreRuntime(NIMBUS_ENGINE_ID, author.encode()) - } - - fn as_nimbus_pre_digest(&self) -> Option { - self.pre_runtime_try_to(&NIMBUS_ENGINE_ID) - } - - fn nimbus_seal(signature: NimbusSignature) -> Self { - DigestItem::Seal(NIMBUS_ENGINE_ID, signature.encode()) - } - - fn as_nimbus_seal(&self) -> Option { - self.seal_try_to(&NIMBUS_ENGINE_ID) - } - - // Remove this once deprecated - fn nimbus_consensus_digest(author: NimbusId) -> Self { - DigestItem::Consensus(NIMBUS_ENGINE_ID, author.encode()) - } - - // Remove this once deprecated. I don't think it is used anyway. - // Notice that it calls the pre_runtime helper function. - fn as_nimbus_consensus_digest(&self) -> Option { - self.pre_runtime_try_to(&NIMBUS_ENGINE_ID) - } -} diff --git a/nimbus-primitives/src/inherents.rs b/nimbus-primitives/src/inherents.rs deleted file mode 100644 index 84f2f4bad..000000000 --- a/nimbus-primitives/src/inherents.rs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2019-2021 PureStake Inc. -// This file is part of Nimbus. - -// Nimbus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Nimbus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Nimbus. If not, see . - -use parity_scale_codec::Encode; -use sp_inherents::{InherentData, InherentIdentifier}; - -/// The InherentIdentifier for nimbus's author inherent -pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"author__"; - -/// A thing that an outer node could use to inject the inherent data. -/// This should be used in simple uses of the author inherent (eg permissionless authoring) -/// When using the full nimbus system, we are manually inserting the inherent. -pub struct InherentDataProvider(pub AuthorId); - -#[cfg(feature = "std")] -#[async_trait::async_trait] -impl sp_inherents::InherentDataProvider - for InherentDataProvider -{ - fn provide_inherent_data( - &self, - inherent_data: &mut InherentData, - ) -> Result<(), sp_inherents::Error> { - inherent_data.put_data(INHERENT_IDENTIFIER, &self.0) - } - - async fn try_handle_error( - &self, - identifier: &InherentIdentifier, - _error: &[u8], - ) -> Option> { - // Dont' process modules from other inherents - if *identifier != INHERENT_IDENTIFIER { - return None; - } - - // All errors with the author inehrent are fatal - Some(Err(sp_inherents::Error::Application(Box::from( - String::from("Error processing author inherent"), - )))) - } -} diff --git a/nimbus-primitives/src/lib.rs b/nimbus-primitives/src/lib.rs deleted file mode 100644 index e80f0f0e1..000000000 --- a/nimbus-primitives/src/lib.rs +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2019-2021 PureStake Inc. -// This file is part of Nimbus. - -// Nimbus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Nimbus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Nimbus. If not, see . - -//! Nimbus Consensus Primitives -//! -//! Primitive types and traits for working with the Nimbus consensus framework. -//! This code can be built to no_std for use in the runtime - -#![cfg_attr(not(feature = "std"), no_std)] - -use sp_application_crypto::KeyTypeId; -use sp_runtime::traits::BlockNumberProvider; -use sp_runtime::ConsensusEngineId; -use sp_std::vec::Vec; - -pub mod digests; -mod inherents; - -pub use digests::CompatibleDigestItem; - -pub use inherents::{InherentDataProvider, INHERENT_IDENTIFIER}; - -/// The given account ID is the author of the current block. -pub trait EventHandler { - //TODO should we be tking ownership here? - fn note_author(author: Author); -} - -impl EventHandler for () { - fn note_author(_author: T) {} -} - -/// A mechanism for determining the current slot. -/// For now we use u32 as the slot type everywhere. Let's see how long we can get away with that. -pub trait SlotBeacon { - fn slot() -> u32; -} - -/// Anything that can provide a block height can be used as a slot beacon. This could be -/// used in at least two realistic ways. -/// 1. Use your own chain's height as the slot number -/// 2. If you're a parachain, use the relay chain's height as the slot number. -impl> SlotBeacon for T { - fn slot() -> u32 { - Self::current_block_number() - } -} - -/// PLANNED: A SlotBeacon that starts a new slot based on the timestamp. Behaviorally, this is -/// similar to what aura, babe and company do. Implementation-wise it is different because it -/// depends on the timestamp pallet for its notion of time. -pub struct IntervalBeacon; - -impl SlotBeacon for IntervalBeacon { - fn slot() -> u32 { - todo!() - } -} - -/// Trait to determine whether this author is eligible to author in this slot. -/// This is the primary trait your nimbus filter needs to implement. -/// -/// This is the proposition-logic variant. -/// That is to say the caller specifies an author an author and the implementation -/// replies whether that author is eligible. This is useful in many cases and is -/// particularly useful when the active set is unbounded. -/// There may be another variant where the caller only supplies a slot and the -/// implementation replies with a complete set of eligible authors. -pub trait CanAuthor { - fn can_author(author: &AuthorId, slot: &u32) -> bool; -} -/// Default implementation where anyone can author. -/// -/// This is identical to Cumulus's RelayChainConsensus -impl CanAuthor for () { - fn can_author(_: &T, _: &u32) -> bool { - true - } -} - -/// A Trait to lookup runtime AccountIds from AuthorIds (probably NimbusIds) -/// The trait is generic over the AccountId, becuase different runtimes use -/// different notions of AccoutId. It is also generic over the AuthorId to -/// support the usecase where the author inherent is used for beneficiary info -/// and contains an AccountId directly. -pub trait AccountLookup { - fn lookup_account(author: &NimbusId) -> Option; -} - -// A dummy impl used in simple tests -impl AccountLookup for () { - fn lookup_account(_: &NimbusId) -> Option { - None - } -} - -/// The ConsensusEngineId for nimbus consensus -/// this same identifier will be used regardless of the filters installed -pub const NIMBUS_ENGINE_ID: ConsensusEngineId = *b"nmbs"; - -/// The KeyTypeId used in the Nimbus consensus framework regardles of wat filters are in place. -/// If this gets well adopted, we could move this definition to sp_core to avoid conflicts. -pub const NIMBUS_KEY_ID: KeyTypeId = KeyTypeId(*b"nmbs"); - -// The strongly-typed crypto wrappers to be used by Nimbus in the keystore -mod nimbus_crypto { - use sp_application_crypto::{app_crypto, sr25519}; - app_crypto!(sr25519, crate::NIMBUS_KEY_ID); -} - -/// A nimbus author identifier (A public key). -pub type NimbusId = nimbus_crypto::Public; - -/// A nimbus signature. -pub type NimbusSignature = nimbus_crypto::Signature; - -sp_application_crypto::with_pair! { - /// A nimbus keypair - pub type NimbusPair = nimbus_crypto::Pair; -} - -sp_api::decl_runtime_apis! { - /// The runtime api used to predict whether a Nimbus author will be eligible in the given slot - pub trait NimbusApi { - fn can_author(author: NimbusId, relay_parent: u32, parent_header: &Block::Header) -> bool; - } - - - // #[deprecated] - // The macro ended up always making the warning print - // so I decided to bail on that. - - /// Deprecated Runtime API from earlier versions of Nimbus. - /// It is retained for now so that live chains can temporarily support both - /// for a smooth migration. It will be removed soon. - #[api_version(2)] - pub trait AuthorFilterAPI { - #[changed_in(2)] - fn can_author(author: AuthorId, relay_parent: u32) -> bool; - - fn can_author(author: AuthorId, relay_parent: u32, parent_header: &Block::Header) -> bool; - } -} diff --git a/node/Cargo.toml b/node/Cargo.toml index 667de61e9..18e182f6f 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -79,9 +79,9 @@ cumulus-relay-chain-interface = { git = 'https://github.com/paritytech/cumulus.g cumulus-relay-chain-rpc-interface = { git = 'https://github.com/paritytech/cumulus.git', branch = "polkadot-v0.9.18" } # Nimbus dependencies -nimbus-primitives = { path = "../nimbus-primitives" } -nimbus-consensus = { path = "../nimbus-consensus" } -pallet-author-inherent = { path = "../pallets/author-inherent" } +nimbus-primitives = { git = "https://github.com/manta-network/nimbus.git", branch="manta-v0.9.18", default-features = false } +nimbus-consensus = { git = "https://github.com/manta-network/nimbus.git", branch="manta-v0.9.18", default-features = false } +pallet-author-inherent = { git = "https://github.com/manta-network/nimbus.git", branch="manta-v0.9.18", default-features = false } # Polkadot dependencies polkadot-cli = { git = 'https://github.com/paritytech/polkadot.git', branch = "release-v0.9.18" } diff --git a/pallets/aura-style-filter/Cargo.toml b/pallets/aura-style-filter/Cargo.toml deleted file mode 100644 index dd9a69771..000000000 --- a/pallets/aura-style-filter/Cargo.toml +++ /dev/null @@ -1,31 +0,0 @@ -[package] -name = "pallet-aura-style-filter" -authors = [ "PureStake" ] -description = "The Aura (authority round) consensus engine implemented in the Nimbus framework" -edition = "2021" -version = "0.9.0" - -[dependencies] -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -nimbus-primitives = { path = "../../nimbus-primitives", default-features = false } -parity-scale-codec = { version = "3.0.0", default-features = false, features = [ "derive" ] } -scale-info = { version = "2.0.0", default-features = false, features = [ "derive" ] } -serde = { version = "1.0.101", optional = true, features = [ "derive" ] } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } - -[features] -default = [ "std" ] -std = [ - "frame-support/std", - "frame-system/std", - "nimbus-primitives/std", - "parity-scale-codec/std", - "scale-info/std", - "serde", - "sp-core/std", - "sp-runtime/std", - "sp-std/std", -] diff --git a/pallets/aura-style-filter/src/lib.rs b/pallets/aura-style-filter/src/lib.rs deleted file mode 100644 index f3fb10716..000000000 --- a/pallets/aura-style-filter/src/lib.rs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2019-2021 PureStake Inc. -// This file is part of Nimbus. - -// Nimbus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Nimbus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Nimbus. If not, see . - -//! A Nimbus filter for the AuRa consensus algorithm. This filter does not use any entropy, it -//! simply rotates authors in order. A single author is eligible at each slot. -//! -//! In the Substrate ecosystem, this algorithm is typically known as AuRa (authority round). -//! There is a well known implementation in the main Substrate repository and published at -//! https://crates.io/crates/sc-consensus-aura. There are two primary differences between -//! the approaches: -//! -//! 1. This filter leverages all the heavy lifting of the Nimbus framework and consequently is -//! capable of expressing Aura in < 100 lines of code. -//! -//! Whereas sc-consensus-aura includes the entire consensus stack including block signing, digest -//! formats, and slot prediction. This is a lot of overhead for a sipmle round robin -//! consensus that basically boils down to this function -//! https://github.com/paritytech/substrate/blob/0f849efc/client/consensus/aura/src/lib.rs#L91-L106 -//! -//! 2. The Nimbus framework places the author checking logic in the runtime which makes it relatively -//! easy for relay chain validators to confirm the author is valid. -//! -//! Whereas sc-consensus-aura places the author checking offchain. The offchain approach is fine -//! for standalone layer 1 blockchains, but net well suited for verification on the relay chain -//! where validators only run a wasm blob. - -#![cfg_attr(not(feature = "std"), no_std)] - -use frame_support::pallet; -pub use pallet::*; - -#[pallet] -pub mod pallet { - - use frame_support::pallet_prelude::*; - use sp_std::vec::Vec; - - //TODO Now that the CanAuthor trait takes a slot number, I don't think this even needs to be a pallet. - // I think it could eb jsut a simple type. - /// The Author Filter pallet - #[pallet::pallet] - pub struct Pallet(PhantomData); - - /// Configuration trait of this pallet. - #[pallet::config] - pub trait Config: frame_system::Config { - /// A source for the complete set of potential authors. - /// The starting point of the filtering. - type PotentialAuthors: Get>; - } - - // This code will be called by the author-inherent pallet to check whether the reported author - // of this block is eligible at this slot. We calculate that result on demand and do not - // record it instorage. - impl nimbus_primitives::CanAuthor for Pallet { - fn can_author(account: &T::AccountId, slot: &u32) -> bool { - let active: Vec = T::PotentialAuthors::get(); - - // This is the core Aura logic right here. - let active_author = &active[*slot as usize % active.len()]; - - account == active_author - } - } -} diff --git a/pallets/author-inherent/Cargo.toml b/pallets/author-inherent/Cargo.toml deleted file mode 100644 index 6a4be1271..000000000 --- a/pallets/author-inherent/Cargo.toml +++ /dev/null @@ -1,42 +0,0 @@ -[package] -name = "pallet-author-inherent" -authors = [ "PureStake" ] -description = "This pallet is the core of the in-runtime portion of Nimbus." -edition = "2021" -license = "GPL-3.0-only" -version = "0.9.0" - -[dependencies] -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -log = { version = "0.4", default-features = false } -nimbus-primitives = { path = "../../nimbus-primitives", default-features = false } -parity-scale-codec = { version = "3.0.0", default-features = false, features = [ "derive" ] } -scale-info = { version = "2.0.0", default-features = false, features = [ "derive" ] } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -sp-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } - -[dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } - -[features] -default = [ "std" ] -std = [ - "frame-support/std", - "frame-system/std", - "log/std", - "nimbus-primitives/std", - "parity-scale-codec/std", - "scale-info/std", - "sp-api/std", - "sp-application-crypto/std", - "sp-authorship/std", - "sp-inherents/std", - "sp-runtime/std", - "sp-std/std", -] diff --git a/pallets/author-inherent/src/exec.rs b/pallets/author-inherent/src/exec.rs deleted file mode 100644 index f4247b571..000000000 --- a/pallets/author-inherent/src/exec.rs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2019-2021 PureStake Inc. -// This file is part of Nimbus. - -// Nimbus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Nimbus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Nimbus. If not, see . - -//! Block executive to be used by relay chain validators when validating parachain blocks built -//! with the nimubs consensus family. - -use frame_support::traits::ExecuteBlock; -use sp_api::{BlockT, HeaderT}; -// For some reason I can't get these logs to actually print -use log::debug; -use nimbus_primitives::{digests::CompatibleDigestItem, NimbusId, NIMBUS_ENGINE_ID}; -use sp_application_crypto::ByteArray; -use sp_runtime::{generic::DigestItem, RuntimeAppPublic}; - -/// Block executive to be used by relay chain validators when validating parachain blocks built -/// with the nimubs consensus family. -/// -/// This will strip the seal digest, and confirm that it contains a valid signature -/// By the block author reported in the author inherent. -/// -/// Essentially this contains the logic of the verifier plus the inner executive. -/// TODO Degisn improvement: -/// Can we share code with the verifier? -/// Can this struct take a verifier as an associated type? -/// Or maybe this will just get simpler in general when https://github.com/paritytech/polkadot/issues/2888 lands -pub struct BlockExecutor(sp_std::marker::PhantomData<(T, I)>); - -impl ExecuteBlock for BlockExecutor -where - Block: BlockT, - I: ExecuteBlock, -{ - fn execute_block(block: Block) { - let (mut header, extrinsics) = block.deconstruct(); - - debug!(target: "executive", "In hacked Executive. Initial digests are {:?}", header.digest()); - - // Set the seal aside for checking. - let seal = header - .digest_mut() - .pop() - .expect("Seal digest is present and is last item"); - - debug!(target: "executive", "In hacked Executive. digests after stripping {:?}", header.digest()); - debug!(target: "executive", "The seal we got {:?}", seal); - - let signature = seal - .as_nimbus_seal() - .unwrap_or_else(|| panic!("HeaderUnsealed")); - - debug!(target: "executive", "🪲 Header hash after popping digest {:?}", header.hash()); - - debug!(target: "executive", "🪲 Signature according to executive is {:?}", signature); - - // Grab the author information from the preruntime digest - //TODO use the trait - let claimed_author = header - .digest() - .logs - .iter() - .find_map(|digest| match *digest { - DigestItem::PreRuntime(id, ref author_id) if id == NIMBUS_ENGINE_ID => { - Some(author_id.clone()) - } - _ => None, - }) - .expect("Expected pre-runtime digest that contains author id bytes"); - - debug!(target: "executive", "🪲 Claimed Author according to executive is {:?}", claimed_author); - - // Verify the signature - let valid_signature = NimbusId::from_slice(&claimed_author) - .expect("Expected claimed author to be a valid NimbusId.") - .verify(&header.hash(), &signature); - - debug!(target: "executive", "🪲 Valid signature? {:?}", valid_signature); - - if !valid_signature { - panic!("Block signature invalid"); - } - - // Now that we've verified the signature, hand execution off to the inner executor - // which is probably the normal frame executive. - I::execute_block(Block::new(header, extrinsics)); - } -} diff --git a/pallets/author-inherent/src/lib.rs b/pallets/author-inherent/src/lib.rs deleted file mode 100644 index 27c70ccdd..000000000 --- a/pallets/author-inherent/src/lib.rs +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright 2019-2021 PureStake Inc. -// This file is part of Nimbus. - -// Nimbus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Nimbus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Nimbus. If not, see . - -//! Pallet that allows block authors to include their identity in a block via an inherent. -//! Currently the author does not _prove_ their identity, just states it. So it should not be used, -//! for things like equivocation slashing that require authenticated authorship information. - -#![cfg_attr(not(feature = "std"), no_std)] - -use frame_support::traits::FindAuthor; -use nimbus_primitives::{ - AccountLookup, CanAuthor, EventHandler, NimbusId, SlotBeacon, INHERENT_IDENTIFIER, - NIMBUS_ENGINE_ID, -}; -use parity_scale_codec::{Decode, Encode}; -use sp_inherents::{InherentIdentifier, IsFatalError}; -use sp_runtime::{ConsensusEngineId, RuntimeString}; - -mod exec; -pub use exec::BlockExecutor; - -pub use pallet::*; - -#[frame_support::pallet] -pub mod pallet { - use super::*; - use frame_support::pallet_prelude::*; - use frame_system::pallet_prelude::*; - - /// The Author Inherent pallet. The core of the nimbus consensus framework's runtime presence. - #[pallet::pallet] - pub struct Pallet(PhantomData); - - #[pallet::config] - pub trait Config: frame_system::Config { - /// A type to convert between AuthorId and AccountId. This is useful when you want to associate - /// Block authoring behavior with an AccoutId for rewards or slashing. If you do not need to - /// hold an AccountID responsible for authoring use `()` which acts as an identity mapping. - type AccountLookup: AccountLookup; - - /// Other pallets that want to be informed about block authorship - type EventHandler: EventHandler; - - /// The final word on whether the reported author can author at this height. - /// This will be used when executing the inherent. This check is often stricter than the - /// Preliminary check, because it can use more data. - /// If the pallet that implements this trait depends on an inherent, that inherent **must** - /// be included before this one. - type CanAuthor: CanAuthor; - - /// Some way of determining the current slot for purposes of verifying the author's eligibility - type SlotBeacon: SlotBeacon; - } - - impl sp_runtime::BoundToRuntimeAppPublic for Pallet { - type Public = NimbusId; - } - - #[pallet::error] - pub enum Error { - /// Author already set in block. - AuthorAlreadySet, - /// No AccountId was found to be associated with this author - NoAccountId, - /// The author in the inherent is not an eligible author. - CannotBeAuthor, - } - - /// Author of current block. - #[pallet::storage] - pub type Author = StorageValue<_, T::AccountId, OptionQuery>; - - #[pallet::hooks] - impl Hooks> for Pallet { - fn on_initialize(_: T::BlockNumber) -> Weight { - // Start by clearing out the previous block's author - >::kill(); - - // Now extract the author from the digest - let digest = >::digest(); - - let pre_runtime_digests = digest.logs.iter().filter_map(|d| d.as_pre_runtime()); - Self::find_author(pre_runtime_digests).map(|author_account| { - // Store the author so we can confirm eligibility after the inherents have executed - >::put(&author_account); // RAD: This is added with no verification, so collators can impersonate others - - //TODO, should we reuse the same trait that Pallet Authorship uses? - // Notify any other pallets that are listening (eg rewards) about the author - T::EventHandler::note_author(author_account); - }); - - T::DbWeight::get().write * 2 - } - } - - #[pallet::call] - impl Pallet { - /// This inherent is a workaround to run code after the "real" inherents have executed, - /// but before transactions are executed. - // This should go into on_post_inherents when it is ready https://github.com/paritytech/substrate/pull/10128 - // TODO better weight. For now we just set a somewhat conservative fudge factor - #[pallet::weight((10 * T::DbWeight::get().write, DispatchClass::Mandatory))] - pub fn kick_off_authorship_validation(origin: OriginFor) -> DispatchResultWithPostInfo { - ensure_none(origin)?; - - let author = >::get() - .expect("Block invalid, no authorship information supplied in preruntime digest."); - - assert!( - T::CanAuthor::can_author(&author, &T::SlotBeacon::slot()), - "Block invalid, supplied author is not eligible." - ); - - Ok(Pays::No.into()) - } - } - - #[pallet::inherent] - impl ProvideInherent for Pallet { - type Call = Call; - type Error = InherentError; - const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER; - - fn is_inherent_required(_: &InherentData) -> Result, Self::Error> { - // Return Ok(Some(_)) unconditionally because this inherent is required in every block - // If it is not found, throw an AuthorInherentRequired error. - Ok(Some(InherentError::Other( - sp_runtime::RuntimeString::Borrowed( - "Inherent required to manually initiate author validation", - ), - ))) - } - - // Regardless of whether the client is still supplying the author id, - // we will create the new empty-payload inherent extrinsic. - fn create_inherent(_data: &InherentData) -> Option { - Some(Call::kick_off_authorship_validation {}) - } - - fn is_inherent(call: &Self::Call) -> bool { - matches!(call, Call::kick_off_authorship_validation { .. }) - } - } - - impl FindAuthor for Pallet { - fn find_author<'a, I>(digests: I) -> Option - where - I: 'a + IntoIterator, - { - for (id, mut data) in digests.into_iter() { - if id == NIMBUS_ENGINE_ID { - let author_id = NimbusId::decode(&mut data) - .expect("NimbusId encoded in preruntime digest must be valid"); - - let author_account = T::AccountLookup::lookup_account(&author_id) - .expect("No Account Mapped to this NimbusId"); - - return Some(author_account); - } - } - - None - } - } - - /// To learn whether a given NimbusId can author, as opposed to an account id, you - /// can ask this pallet directly. It will do the mapping for you. - impl CanAuthor for Pallet { - fn can_author(author: &NimbusId, slot: &u32) -> bool { - let account = match T::AccountLookup::lookup_account(&author) { - Some(account) => account, - // Authors whose account lookups fail will not be eligible - None => { - return false; - } - }; - - T::CanAuthor::can_author(&account, slot) - } - } -} - -#[derive(Encode)] -#[cfg_attr(feature = "std", derive(Debug, Decode))] -pub enum InherentError { - Other(RuntimeString), -} - -impl IsFatalError for InherentError { - fn is_fatal_error(&self) -> bool { - match *self { - InherentError::Other(_) => true, - } - } -} - -impl InherentError { - /// Try to create an instance ouf of the given identifier and data. - #[cfg(feature = "std")] - pub fn try_from(id: &InherentIdentifier, data: &[u8]) -> Option { - if id == &INHERENT_IDENTIFIER { - ::decode(&mut &data[..]).ok() - } else { - None - } - } -} diff --git a/pallets/collator-selection/Cargo.toml b/pallets/collator-selection/Cargo.toml index 3b2228fe6..8891c041d 100644 --- a/pallets/collator-selection/Cargo.toml +++ b/pallets/collator-selection/Cargo.toml @@ -28,7 +28,7 @@ frame-system = { git = 'https://github.com/paritytech/substrate.git', defa pallet-authorship = { git = 'https://github.com/paritytech/substrate.git', default-features = false, branch = "polkadot-v0.9.18" } pallet-session = { git = 'https://github.com/paritytech/substrate.git', default-features = false, branch = "polkadot-v0.9.18" } frame-benchmarking = { git = 'https://github.com/paritytech/substrate.git', default-features = false, branch = "polkadot-v0.9.18", optional = true } -nimbus-primitives = { path = "../../nimbus-primitives", default-features = false } +nimbus-primitives = { git = "https://github.com/manta-network/nimbus.git", branch="manta-v0.9.18", default-features = false } [dev-dependencies] sp-core = { git = 'https://github.com/paritytech/substrate.git', branch = "polkadot-v0.9.18" } diff --git a/runtime/dolphin/Cargo.toml b/runtime/dolphin/Cargo.toml index e2cc018fd..7b95c7ffd 100644 --- a/runtime/dolphin/Cargo.toml +++ b/runtime/dolphin/Cargo.toml @@ -68,9 +68,9 @@ cumulus-pallet-xcm = { git = 'https://github.com/paritytech/cumulus.git', defaul parachain-info = { git = 'https://github.com/paritytech/cumulus.git', default-features = false, branch = "polkadot-v0.9.18" } # Nimbus Dependencies -nimbus-primitives = { path = "../../nimbus-primitives", default-features = false } -pallet-author-inherent = { path = "../../pallets/author-inherent", default-features = false } -pallet-aura-style-filter = { path = "../../pallets/aura-style-filter", default-features = false } +nimbus-primitives = { git = "https://github.com/manta-network/nimbus.git", branch="manta-v0.9.18", default-features = false } +pallet-author-inherent = { git = "https://github.com/manta-network/nimbus.git", branch="manta-v0.9.18", default-features = false } +pallet-aura-style-filter = { git = "https://github.com/manta-network/nimbus.git", branch="manta-v0.9.18", default-features = false } # Polkadot dependencies polkadot-primitives = { git = 'https://github.com/paritytech/polkadot.git', default-features = false, branch = "release-v0.9.18" }