From 519587ec569cef5bed62a1621b36ef969c17bfb0 Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Mon, 3 Aug 2020 12:39:10 +0300 Subject: [PATCH 1/6] node: Upgrade to the Substrate 2.0.0-rc4 --- Cargo.lock | 4955 +++++++++++++++++++++++++++++++----- Cargo.toml | 2 +- node/Cargo.toml | 370 ++- node/bin/main.rs | 25 +- node/src/chain_spec.rs | 118 +- node/src/cli.rs | 170 +- node/src/command.rs | 104 + node/src/lib.rs | 4 + node/src/members_config.rs | 14 +- node/src/node_executor.rs | 10 + node/src/node_rpc.rs | 193 ++ node/src/service.rs | 828 ++++-- runtime/Cargo.toml | 10 +- runtime/src/lib.rs | 260 +- runtime/src/primitives.rs | 92 + 15 files changed, 5760 insertions(+), 1395 deletions(-) create mode 100644 node/src/command.rs create mode 100644 node/src/node_executor.rs create mode 100644 node/src/node_rpc.rs create mode 100644 runtime/src/primitives.rs diff --git a/Cargo.lock b/Cargo.lock index 375db18f04..dc44112197 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,6 +10,72 @@ dependencies = [ "regex", ] +[[package]] +name = "adler" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" + +[[package]] +name = "adler32" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b077b825e468cc974f0020d4082ee6e03132512f207ef1a02fd5d00d1f32d" + +[[package]] +name = "aead" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" +dependencies = [ + "generic-array 0.14.3", +] + +[[package]] +name = "aes" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7001367fde4c768a19d1029f0a8be5abd9308e1119846d5bd9ad26297b8faf5" +dependencies = [ + "aes-soft", + "aesni", + "block-cipher", +] + +[[package]] +name = "aes-gcm" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f5007801316299f922a6198d1d09a0bae95786815d066d5880d13f7c45ead1" +dependencies = [ + "aead", + "aes", + "block-cipher", + "ghash", + "subtle 2.2.2", +] + +[[package]] +name = "aes-soft" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4925647ee64e5056cf231608957ce7c81e12d6d6e316b9ce1404778cc1d35fa7" +dependencies = [ + "block-cipher", + "byteorder", + "opaque-debug 0.2.3", +] + +[[package]] +name = "aesni" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050d39b0b7688b3a3254394c3e30a9d66c41dcf9b05b0e2dbdc623f6505d264" +dependencies = [ + "block-cipher", + "opaque-debug 0.2.3", +] + [[package]] name = "ahash" version = "0.2.18" @@ -36,7 +102,25 @@ checksum = "4f823d037a7ec6ea2197046bafd4ae150e6bc36f9ca347404f46a46823fa84f2" dependencies = [ "approx", "num-complex", - "num-traits", + "num-traits 0.2.11", +] + +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +dependencies = [ + "winapi 0.3.8", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi 0.3.8", ] [[package]] @@ -51,9 +135,15 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" dependencies = [ - "num-traits", + "num-traits 0.2.11", ] +[[package]] +name = "arc-swap" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" + [[package]] name = "arrayref" version = "0.3.6" @@ -90,10 +180,16 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d0864d84b8e07b145449be9a8537db86bf9de5ce03b913214694643b4743502" dependencies = [ - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] +[[package]] +name = "assert_matches" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7deb0a829ca7bcfaf5da70b073a8d128619259a7be8216a355e23f00763059e5" + [[package]] name = "async-std" version = "1.5.0" @@ -130,6 +226,29 @@ dependencies = [ "winapi 0.3.8", ] +[[package]] +name = "async-tls" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95fd83426b89b034bf4e9ceb9c533c2f2386b813fd3dcae0a425ec6f1837d78a" +dependencies = [ + "futures 0.3.4", + "rustls", + "webpki", + "webpki-roots 0.19.0", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi 0.3.8", +] + [[package]] name = "autocfg" version = "0.1.7" @@ -170,6 +289,36 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" + +[[package]] +name = "bindgen" +version = "0.53.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c72a978d268b1d70b0e963217e60fdabd9523a941457a6c42a7315d15c7e89e5" +dependencies = [ + "bitflags", + "cexpr", + "cfg-if", + "clang-sys", + "clap", + "env_logger", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "proc-macro2", + "quote 1.0.7", + "regex", + "rustc-hash", + "shlex", + "which", +] + [[package]] name = "bitflags" version = "1.2.1" @@ -192,6 +341,31 @@ dependencies = [ "radium", ] +[[package]] +name = "blake2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" +dependencies = [ + "byte-tools", + "crypto-mac 0.7.0", + "digest 0.8.1", + "opaque-debug 0.2.3", +] + +[[package]] +name = "blake2" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84ce5b6108f8e154604bd4eb76a2f726066c3464d5a552a4229262a18c9bb471" +dependencies = [ + "byte-tools", + "byteorder", + "crypto-mac 0.8.0", + "digest 0.9.0", + "opaque-debug 0.2.3", +] + [[package]] name = "blake2-rfc" version = "0.2.18" @@ -233,7 +407,25 @@ dependencies = [ "block-padding", "byte-tools", "byteorder", - "generic-array", + "generic-array 0.12.3", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.3", +] + +[[package]] +name = "block-cipher" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa136449e765dc7faa244561ccae839c394048667929af599b5d931ebe7b7f10" +dependencies = [ + "generic-array 0.14.3", ] [[package]] @@ -255,7 +447,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "parking_lot 0.10.0", + "parking_lot 0.10.2", "slab", ] @@ -265,6 +457,15 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb" +[[package]] +name = "bstr" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" +dependencies = [ + "memchr", +] + [[package]] name = "bumpalo" version = "3.2.1" @@ -289,17 +490,46 @@ version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +dependencies = [ + "byteorder", + "either", + "iovec", +] + [[package]] name = "bytes" version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" +[[package]] +name = "c_linked_list" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" + [[package]] name = "cc" -version = "1.0.50" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" +checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cexpr" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -307,6 +537,68 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +[[package]] +name = "chacha20" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "086c0f07ac275808b7bf9a39f2fd013aae1498be83632814c8c4e0bd53f2dc58" +dependencies = [ + "stream-cipher", + "zeroize", +] + +[[package]] +name = "chacha20poly1305" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18b0c90556d8e3fec7cf18d84a2f53d27b21288f2fe481b830fadcf809e48205" +dependencies = [ + "aead", + "chacha20", + "poly1305", + "stream-cipher", + "zeroize", +] + +[[package]] +name = "chrono" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" +dependencies = [ + "js-sys", + "num-integer", + "num-traits 0.2.11", + "time", + "wasm-bindgen", +] + +[[package]] +name = "clang-sys" +version = "0.29.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "2.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" +dependencies = [ + "ansi_term 0.11.0", + "atty", + "bitflags", + "strsim", + "textwrap", + "unicode-width", + "vec_map", +] + [[package]] name = "clear_on_drop" version = "0.2.3" @@ -325,6 +617,26 @@ dependencies = [ "bitflags", ] +[[package]] +name = "console_error_panic_hook" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7871d2947441b0fdd8e2bd1ce2a2f75304f896582c0d572162d48290683c48" +dependencies = [ + "log", + "web-sys", +] + [[package]] name = "const-random" version = "0.1.8" @@ -351,6 +663,37 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" + +[[package]] +name = "cpuid-bool" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" + +[[package]] +name = "crc32fast" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +dependencies = [ + "cfg-if", +] + [[package]] name = "crossbeam-channel" version = "0.4.3" @@ -387,6 +730,17 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "crossbeam-queue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "maybe-uninit", +] + [[package]] name = "crossbeam-utils" version = "0.7.2" @@ -410,10 +764,29 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" dependencies = [ - "generic-array", + "generic-array 0.12.3", "subtle 1.0.0", ] +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.3", + "subtle 2.2.2", +] + +[[package]] +name = "ct-logs" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d3686f5fa27dbc1d76c751300376e167c5a43387f44bb451fd1c24776e49113" +dependencies = [ + "sct", +] + [[package]] name = "curve25519-dalek" version = "2.0.0" @@ -421,7 +794,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26778518a7f6cffa1d25a44b602b62b979bd88adb9e99ffec546998cf3404839" dependencies = [ "byteorder", - "digest", + "digest 0.8.1", "rand_core 0.5.1", "subtle 2.2.2", "zeroize", @@ -440,8 +813,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "298998b1cf6b5b2c8a7b023dfd45821825ce3ba8a8af55c921a0e734e4653f76" dependencies = [ "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] @@ -456,39 +829,127 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "generic-array", + "generic-array 0.12.3", ] [[package]] -name = "downcast" -version = "0.10.0" +name = "digest" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb454f0228b18c7f4c3b0ebbee346ed9c52e7443b0999cd543ff3571205701d" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.3", +] [[package]] -name = "ed25519-dalek" -version = "1.0.0-pre.3" +name = "directories" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978710b352437433c97b2bff193f2fb1dfd58a093f863dd95e225a19baa599a2" +checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" dependencies = [ - "clear_on_drop", - "curve25519-dalek", - "rand 0.7.3", - "sha2", + "cfg-if", + "dirs-sys", ] [[package]] -name = "either" -version = "1.5.3" +name = "dirs-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.8", +] + +[[package]] +name = "dns-parser" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea" +dependencies = [ + "byteorder", + "quick-error", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "downcast" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bb454f0228b18c7f4c3b0ebbee346ed9c52e7443b0999cd543ff3571205701d" + +[[package]] +name = "ed25519-dalek" +version = "1.0.0-pre.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978710b352437433c97b2bff193f2fb1dfd58a093f863dd95e225a19baa599a2" +dependencies = [ + "clear_on_drop", + "curve25519-dalek", + "rand 0.7.3", + "sha2 0.8.1", +] + +[[package]] +name = "either" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +[[package]] +name = "enum-primitive-derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b90e520ec62c1864c8c78d637acbfe8baf5f63240f2fb8165b8325c07812dd" +dependencies = [ + "num-traits 0.1.43", + "quote 0.3.15", + "syn 0.11.11", +] + +[[package]] +name = "env_logger" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + [[package]] name = "environmental" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "516aa8d7a71cb00a1c4146f0798549b93d083d4f189b3ced8f3de6b8f11ee6c4" +[[package]] +name = "erased-serde" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ca8b296792113e1500fd935ae487be6e00ce318952a6880555554824d6ebf38" +dependencies = [ + "serde", +] + +[[package]] +name = "exit-future" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" +dependencies = [ + "futures 0.3.4", +] + [[package]] name = "failure" version = "0.1.7" @@ -506,8 +967,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "030a733c8287d6213886dd487564ff5c8f6aae10278b3588ed177f9d18f8d231" dependencies = [ "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", "synstructure", ] @@ -517,6 +978,15 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +[[package]] +name = "fdlimit" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0da54a593b34c71b889ee45f5b5bb900c74148c5f7f8c6a9479ee7899f69603c" +dependencies = [ + "libc", +] + [[package]] name = "finality-grandpa" version = "0.12.3" @@ -524,10 +994,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8feb87a63249689640ac9c011742c33139204e3c134293d3054022276869133b" dependencies = [ "either", - "futures", + "futures 0.3.4", "futures-timer 2.0.2", "log", - "num-traits", + "num-traits 0.2.11", "parity-scale-codec", "parking_lot 0.9.0", ] @@ -550,13 +1020,26 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" +[[package]] +name = "flate2" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68c90b0fc46cf89d227cc78b40e494ff81287a92dd07631e5af0d06fe3cf885e" +dependencies = [ + "cfg-if", + "crc32fast", + "libc", + "libz-sys", + "miniz_oxide", +] + [[package]] name = "float-cmp" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da62c4f1b81918835a8c6a484a397775fff5953fe83529afd51b05f5c6a6617d" dependencies = [ - "num-traits", + "num-traits 0.2.11", ] [[package]] @@ -565,6 +1048,14 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "fork-tree" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", +] + [[package]] name = "fragile" version = "1.0.0" @@ -588,6 +1079,24 @@ dependencies = [ "sp-std", ] +[[package]] +name = "frame-benchmarking-cli" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "frame-benchmarking", + "parity-scale-codec", + "sc-cli", + "sc-client-db", + "sc-executor", + "sc-service", + "sp-core", + "sp-externalities", + "sp-runtime", + "sp-state-machine", + "structopt", +] + [[package]] name = "frame-executive" version = "2.0.0-rc4" @@ -646,8 +1155,8 @@ source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478 dependencies = [ "frame-support-procedural-tools", "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] @@ -658,8 +1167,8 @@ dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] @@ -668,8 +1177,8 @@ version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] @@ -697,6 +1206,18 @@ dependencies = [ "sp-api", ] +[[package]] +name = "fs-swap" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "921d332c89b3b61a826de38c61ee5b6e02c56806cade1b0e5d81bd71f57a71bb" +dependencies = [ + "lazy_static", + "libc", + "libloading", + "winapi 0.3.8", +] + [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -719,6 +1240,12 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +[[package]] +name = "futures" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" + [[package]] name = "futures" version = "0.3.4" @@ -744,12 +1271,53 @@ dependencies = [ "futures-sink", ] +[[package]] +name = "futures-channel-preview" +version = "0.3.0-alpha.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5e5f4df964fa9c1c2f8bddeb5c3611631cacd93baf810fc8bb2fb4b495c263a" +dependencies = [ + "futures-core-preview", +] + [[package]] name = "futures-core" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" +[[package]] +name = "futures-core-preview" +version = "0.3.0-alpha.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b35b6263fb1ef523c3056565fa67b1d16f0a8604ff12b11b08c25f28a734c60a" + +[[package]] +name = "futures-cpupool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" +dependencies = [ + "futures 0.1.29", + "num_cpus", +] + +[[package]] +name = "futures-diagnose" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdcef58a173af8148b182684c9f2d5250875adbcaff7b5794073894f9d8634a9" +dependencies = [ + "futures 0.1.29", + "futures 0.3.4", + "lazy_static", + "log", + "parking_lot 0.9.0", + "pin-project", + "serde", + "serde_json", +] + [[package]] name = "futures-executor" version = "0.3.4" @@ -776,8 +1344,8 @@ checksum = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" dependencies = [ "proc-macro-hack", "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] @@ -803,6 +1371,10 @@ name = "futures-timer" version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +dependencies = [ + "gloo-timers", + "send_wrapper 0.4.0", +] [[package]] name = "futures-util" @@ -810,6 +1382,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" dependencies = [ + "futures 0.1.29", "futures-channel", "futures-core", "futures-io", @@ -823,6 +1396,48 @@ dependencies = [ "slab", ] +[[package]] +name = "futures-util-preview" +version = "0.3.0-alpha.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce968633c17e5f97936bd2797b6e38fb56cf16a7422319f7ec2e30d3c470e8d" +dependencies = [ + "futures-channel-preview", + "futures-core-preview", + "pin-utils", + "slab", +] + +[[package]] +name = "futures_codec" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0a73299e4718f5452e45980fc1d6957a070abe308d3700b63b8673f47e1c2b3" +dependencies = [ + "bytes 0.5.6", + "futures 0.3.4", + "memchr", + "pin-project", +] + +[[package]] +name = "futures_codec" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe8859feb7140742ed1a2a85a07941100ad2b5f98a421b353931d718a34144d1" +dependencies = [ + "bytes 0.5.6", + "futures 0.3.4", + "memchr", + "pin-project", +] + +[[package]] +name = "gcc" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" + [[package]] name = "generic-array" version = "0.12.3" @@ -832,6 +1447,38 @@ dependencies = [ "typenum", ] +[[package]] +name = "generic-array" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60fb4bb6bba52f78a471264d9a3b7d026cc0af47b22cd2cffbc0b787ca003e63" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "get_if_addrs" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abddb55a898d32925f3148bd281174a68eeb68bbfd9a5938a57b18f506ee4ef7" +dependencies = [ + "c_linked_list", + "get_if_addrs-sys", + "libc", + "winapi 0.2.8", +] + +[[package]] +name = "get_if_addrs-sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d04f9fb746cf36b191c00f3ede8bde9c8e64f9f4b05ae2694a9ccf5e3f5ab48" +dependencies = [ + "gcc", + "libc", +] + [[package]] name = "getrandom" version = "0.1.14" @@ -841,6 +1488,66 @@ dependencies = [ "cfg-if", "libc", "wasi", + "wasm-bindgen", +] + +[[package]] +name = "ghash" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6e27f0689a6e15944bdce7e45425efb87eaa8ab0c6e87f11d0987a9133e2531" +dependencies = [ + "polyval", +] + +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "globset" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ad1da430bd7281dde2576f44c84cc3f0f7b475e7202cd503042dff01a8c8120" +dependencies = [ + "aho-corasick", + "bstr", + "fnv", + "log", + "regex", +] + +[[package]] +name = "gloo-timers" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891f" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "h2" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" +dependencies = [ + "byteorder", + "bytes 0.4.12", + "fnv", + "futures 0.1.29", + "http 0.1.21", + "indexmap", + "log", + "slab", + "string", + "tokio-io", ] [[package]] @@ -849,15 +1556,15 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" dependencies = [ - "bytes", + "bytes 0.5.6", "fnv", "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.1", "indexmap", "slab", - "tokio", + "tokio 0.2.22", "tokio-util", "tracing", ] @@ -920,14 +1627,33 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" +[[package]] +name = "hex-literal" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "961de220ec9a91af2e1e5bd80d02109155695e516771762381ef8581317066e0" +dependencies = [ + "hex-literal-impl", + "proc-macro-hack", +] + +[[package]] +name = "hex-literal-impl" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "853f769599eb31de176303197b7ba4973299c38c7a7604a6bc88c3eef05b9b46" +dependencies = [ + "proc-macro-hack", +] + [[package]] name = "hmac" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" dependencies = [ - "crypto-mac", - "digest", + "crypto-mac 0.7.0", + "digest 0.8.1", ] [[package]] @@ -936,59 +1662,151 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b" dependencies = [ - "digest", - "generic-array", + "digest 0.8.1", + "generic-array 0.12.3", "hmac", ] +[[package]] +name = "http" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" +dependencies = [ + "bytes 0.4.12", + "fnv", + "itoa", +] + [[package]] name = "http" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" dependencies = [ - "bytes", + "bytes 0.5.6", "fnv", "itoa", ] [[package]] name = "http-body" -version = "0.3.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" dependencies = [ - "bytes", - "http", + "bytes 0.4.12", + "futures 0.1.29", + "http 0.1.21", + "tokio-buf", ] [[package]] -name = "httparse" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" +name = "http-body" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +dependencies = [ + "bytes 0.5.6", + "http 0.2.1", +] + +[[package]] +name = "httparse" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +[[package]] +name = "humantime" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +dependencies = [ + "quick-error", +] + +[[package]] +name = "hyper" +version = "0.12.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.29", + "futures-cpupool", + "h2 0.1.26", + "http 0.1.21", + "http-body 0.1.0", + "httparse", + "iovec", + "itoa", + "log", + "net2", + "rustc_version", + "time", + "tokio 0.1.22", + "tokio-buf", + "tokio-executor 0.1.10", + "tokio-io", + "tokio-reactor", + "tokio-tcp", + "tokio-threadpool", + "tokio-timer", + "want 0.2.0", +] + [[package]] name = "hyper" version = "0.13.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e68a8dd9716185d9e64ea473ea6ef63529252e3e27623295a0378a19665d5eb" dependencies = [ - "bytes", + "bytes 0.5.6", "futures-channel", "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.2.6", + "http 0.2.1", + "http-body 0.3.1", "httparse", "itoa", "pin-project", + "socket2", "time", - "tokio", + "tokio 0.2.22", "tower-service", "tracing", - "want", + "want 0.3.0", +] + +[[package]] +name = "hyper-rustls" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac965ea399ec3a25ac7d13b8affd4b8f39325cca00858ddf5eb29b79e6b14b08" +dependencies = [ + "bytes 0.5.6", + "ct-logs", + "futures-util", + "hyper 0.13.7", + "log", + "rustls", + "rustls-native-certs", + "tokio 0.2.22", + "tokio-rustls", + "webpki", +] + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -1036,8 +1854,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef5550a42e3740a0e71f909d4c861056a284060af885ae7aa6242820f920d9d" dependencies = [ "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] @@ -1056,6 +1874,16 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f65877bf7d44897a473350b1046277941cee20b263397e90869c50b6e766088b" +[[package]] +name = "intervalier" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275" +dependencies = [ + "futures 0.3.4", + "futures-timer 2.0.2", +] + [[package]] name = "iovec" version = "0.1.4" @@ -1065,6 +1893,18 @@ dependencies = [ "libc", ] +[[package]] +name = "ip_network" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee15951c035f79eddbef745611ec962f63f4558f1dadf98ab723cc603487c6f" + +[[package]] +name = "ipnet" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" + [[package]] name = "itertools" version = "0.8.2" @@ -1089,6 +1929,92 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +[[package]] +name = "jobserver" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" +dependencies = [ + "libc", +] + +[[package]] +name = "joystream-node" +version = "3.0.0" +dependencies = [ + "frame-benchmarking", + "frame-benchmarking-cli", + "frame-support", + "frame-system", + "futures 0.3.4", + "hex-literal", + "joystream-node-runtime", + "jsonrpc-core", + "log", + "node-inspect", + "pallet-authority-discovery", + "pallet-balances", + "pallet-contracts", + "pallet-contracts-rpc", + "pallet-grandpa", + "pallet-im-online", + "pallet-indices", + "pallet-staking", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc", + "parity-scale-codec", + "parking_lot 0.10.2", + "rand 0.7.3", + "sc-authority-discovery", + "sc-basic-authorship", + "sc-chain-spec", + "sc-cli", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-consensus-babe", + "sc-consensus-babe-rpc", + "sc-consensus-epochs", + "sc-executor", + "sc-finality-grandpa", + "sc-finality-grandpa-rpc", + "sc-keystore", + "sc-network", + "sc-offchain", + "sc-rpc", + "sc-rpc-api", + "sc-service", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "serde", + "serde_json", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-finality-grandpa", + "sp-finality-tracker", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-runtime", + "sp-timestamp", + "sp-transaction-pool", + "structopt", + "substrate-browser-utils", + "substrate-frame-rpc-system", + "tokio 0.1.22", + "tracing", + "vergen", + "wasm-bindgen", + "wasm-bindgen-futures", +] + [[package]] name = "joystream-node-runtime" version = "7.0.0" @@ -1097,7 +2023,6 @@ dependencies = [ "frame-support", "frame-system", "frame-system-rpc-runtime-api", - "node-primitives", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", @@ -1105,6 +2030,9 @@ dependencies = [ "pallet-collective", "pallet-common", "pallet-content-working-group", + "pallet-contracts", + "pallet-contracts-primitives", + "pallet-contracts-rpc-runtime-api", "pallet-finality-tracker", "pallet-forum", "pallet-governance", @@ -1137,6 +2065,7 @@ dependencies = [ "parity-scale-codec", "serde", "sp-api", + "sp-application-crypto", "sp-arithmetic", "sp-authority-discovery", "sp-block-builder", @@ -1162,6 +2091,128 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonrpc-client-transports" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecbdaacc17243168d9d1fa6b2bd7556a27e1e60a621d8a2a6e590ae2b145d158" +dependencies = [ + "failure", + "futures 0.1.29", + "jsonrpc-core", + "jsonrpc-pubsub", + "log", + "serde", + "serde_json", + "url 1.7.2", +] + +[[package]] +name = "jsonrpc-core" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0747307121ffb9703afd93afbd0fb4f854c38fb873f2c8b90e0e902f27c7b62" +dependencies = [ + "futures 0.1.29", + "log", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "jsonrpc-core-client" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34221123bc79b66279a3fde2d3363553835b43092d629b34f2e760c44dc94713" +dependencies = [ + "jsonrpc-client-transports", +] + +[[package]] +name = "jsonrpc-derive" +version = "14.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fadf6945e227246825a583514534d864554e9f23d80b3c77d034b10983db5ef" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", +] + +[[package]] +name = "jsonrpc-http-server" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0da906d682799df05754480dac1b9e70ec92e12c19ebafd2662a5ea1c9fd6522" +dependencies = [ + "hyper 0.12.35", + "jsonrpc-core", + "jsonrpc-server-utils", + "log", + "net2", + "parking_lot 0.10.2", + "unicase", +] + +[[package]] +name = "jsonrpc-ipc-server" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dedccd693325d833963b549e959137f30a7a0ea650cde92feda81dc0c1393cb5" +dependencies = [ + "jsonrpc-core", + "jsonrpc-server-utils", + "log", + "parity-tokio-ipc", + "parking_lot 0.10.2", + "tokio-service", +] + +[[package]] +name = "jsonrpc-pubsub" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d44f5602a11d657946aac09357956d2841299ed422035edf140c552cb057986" +dependencies = [ + "jsonrpc-core", + "log", + "parking_lot 0.10.2", + "rand 0.7.3", + "serde", +] + +[[package]] +name = "jsonrpc-server-utils" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56cbfb462e7f902e21121d9f0d1c2b77b2c5b642e1a4e8f4ebfa2e15b94402bb" +dependencies = [ + "bytes 0.4.12", + "globset", + "jsonrpc-core", + "lazy_static", + "log", + "tokio 0.1.22", + "tokio-codec", + "unicase", +] + +[[package]] +name = "jsonrpc-ws-server" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "903d3109fe7c4acb932b567e1e607e0f524ed04741b09fb0e61841bc40a022fc" +dependencies = [ + "jsonrpc-core", + "jsonrpc-server-utils", + "log", + "parking_lot 0.10.2", + "slab", + "ws", +] + [[package]] name = "keccak" version = "0.1.0" @@ -1187,17 +2238,107 @@ dependencies = [ "log", ] +[[package]] +name = "kvdb" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e763b2a9b500ba47948061d1e8bc3b5f03a8a1f067dbcf822a4d2c84d2b54a3a" +dependencies = [ + "parity-util-mem", + "smallvec 1.4.1", +] + +[[package]] +name = "kvdb-memorydb" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73027d5e228de6f503b5b7335d530404fc26230a6ae3e09b33ec6e45408509a4" +dependencies = [ + "kvdb", + "parity-util-mem", + "parking_lot 0.10.2", +] + +[[package]] +name = "kvdb-rocksdb" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84384eca250c7ff67877eda5336f28a86586aaee24acb945643590671f6bfce1" +dependencies = [ + "fs-swap", + "kvdb", + "log", + "num_cpus", + "owning_ref", + "parity-util-mem", + "parking_lot 0.10.2", + "regex", + "rocksdb", + "smallvec 1.4.1", +] + +[[package]] +name = "kvdb-web" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c7f36acb1841d4c701d30ae1f2cfd242e805991443f75f6935479ed3de64903" +dependencies = [ + "futures 0.3.4", + "js-sys", + "kvdb", + "kvdb-memorydb", + "log", + "parity-util-mem", + "send_wrapper 0.3.0", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lazycell" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" + [[package]] name = "libc" -version = "0.2.68" +version = "0.2.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" + +[[package]] +name = "libflate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9bac9023e1db29c084f9f8cd9d3852e5e8fddf98fb47c4964a0ea4663d95949" +dependencies = [ + "adler32", + "crc32fast", + "libflate_lz77", + "rle-decode-fast", +] + +[[package]] +name = "libflate_lz77" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3286f09f7d4926fc486334f28d8d2e6ebe4f7f9994494b6dab27ddfad2c9b11b" + +[[package]] +name = "libloading" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0" +checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +dependencies = [ + "cc", + "winapi 0.3.8", +] [[package]] name = "libm" @@ -1211,15 +2352,26 @@ version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "057eba5432d3e740e313c6e13c9153d0cb76b4f71bfc2e5242ae5bdb7d41af67" dependencies = [ - "bytes", - "futures", + "bytes 0.5.6", + "futures 0.3.4", "lazy_static", "libp2p-core", "libp2p-core-derive", + "libp2p-dns", + "libp2p-identify", + "libp2p-kad", + "libp2p-mdns", + "libp2p-mplex", + "libp2p-noise", + "libp2p-ping", "libp2p-swarm", + "libp2p-tcp", + "libp2p-wasm-ext", + "libp2p-websocket", + "libp2p-yamux", "multihash", - "parity-multiaddr", - "parking_lot 0.10.0", + "parity-multiaddr 0.9.1", + "parking_lot 0.10.2", "pin-project", "smallvec 1.4.1", "wasm-timer", @@ -1236,22 +2388,22 @@ dependencies = [ "ed25519-dalek", "either", "fnv", - "futures", + "futures 0.3.4", "futures-timer 3.0.2", "lazy_static", "libsecp256k1", "log", "multihash", "multistream-select", - "parity-multiaddr", - "parking_lot 0.10.0", + "parity-multiaddr 0.9.1", + "parking_lot 0.10.2", "pin-project", "prost", "prost-build", "rand 0.7.3", "ring", "rw-stream-sink", - "sha2", + "sha2 0.8.1", "smallvec 1.4.1", "thiserror", "unsigned-varint 0.4.0", @@ -1265,57 +2417,288 @@ version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f09548626b737ed64080fde595e06ce1117795b8b9fc4d2629fa36561c583171" dependencies = [ - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] -name = "libp2p-swarm" -version = "0.19.1" +name = "libp2p-dns" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce53ff4d127cf8b39adf84dbd381ca32d49bd85788cee08e6669da2495993930" +checksum = "3cc186d9a941fd0207cf8f08ef225a735e2d7296258f570155e525f6ee732f87" dependencies = [ - "futures", + "futures 0.3.4", "libp2p-core", "log", - "rand 0.7.3", - "smallvec 1.4.1", - "void", - "wasm-timer", ] [[package]] -name = "libsecp256k1" -version = "0.3.5" +name = "libp2p-identify" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc1e2c808481a63dc6da2074752fdd4336a3c8fcc68b83db6f1fd5224ae7962" +checksum = "62f76075b170d908bae616f550ade410d9d27c013fa69042551dbfc757c7c094" dependencies = [ - "arrayref", - "crunchy", - "digest", - "hmac-drbg", - "rand 0.7.3", - "sha2", - "subtle 2.2.2", - "typenum", + "futures 0.3.4", + "libp2p-core", + "libp2p-swarm", + "log", + "prost", + "prost-build", + "smallvec 1.4.1", + "wasm-timer", ] [[package]] -name = "linregress" -version = "0.1.7" +name = "libp2p-kad" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9290cf6f928576eeb9c096c6fad9d8d452a0a1a70a2bbffa6e36064eedc0aac9" +checksum = "41d6c1d5100973527ae70d82687465b17049c1b717a7964de38b8e65000878ff" dependencies = [ - "failure", - "nalgebra", + "arrayvec 0.5.1", + "bytes 0.5.6", + "either", + "fnv", + "futures 0.3.4", + "futures_codec 0.3.4", + "libp2p-core", + "libp2p-swarm", + "log", + "multihash", + "prost", + "prost-build", + "rand 0.7.3", + "sha2 0.8.1", + "smallvec 1.4.1", + "uint", + "unsigned-varint 0.3.3", + "void", + "wasm-timer", +] + +[[package]] +name = "libp2p-mdns" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f55b2d4b80986e5bf158270ab23268ec0e7f644ece5436fbaabc5155472f357" +dependencies = [ + "async-std", + "data-encoding", + "dns-parser", + "either", + "futures 0.3.4", + "lazy_static", + "libp2p-core", + "libp2p-swarm", + "log", + "net2", + "rand 0.7.3", + "smallvec 1.4.1", + "void", + "wasm-timer", +] + +[[package]] +name = "libp2p-mplex" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be7d913a4cd57de2013257ec73f07d77bfce390b370023e2d59083e5ca079864" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures 0.3.4", + "futures_codec 0.4.0", + "libp2p-core", + "log", + "parking_lot 0.10.2", + "unsigned-varint 0.4.0", +] + +[[package]] +name = "libp2p-noise" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a03db664653369f46ee03fcec483a378c20195089bb43a26cb9fb0058009ac88" +dependencies = [ + "curve25519-dalek", + "futures 0.3.4", + "lazy_static", + "libp2p-core", + "log", + "prost", + "prost-build", + "rand 0.7.3", + "sha2 0.8.1", + "snow", + "static_assertions", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "libp2p-ping" +version = "0.19.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dedd34e35a9728d52d59ef36a218e411359a353f9011b2574b86ee790978f6" +dependencies = [ + "futures 0.3.4", + "libp2p-core", + "libp2p-swarm", + "log", + "rand 0.7.3", + "void", + "wasm-timer", +] + +[[package]] +name = "libp2p-swarm" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce53ff4d127cf8b39adf84dbd381ca32d49bd85788cee08e6669da2495993930" +dependencies = [ + "futures 0.3.4", + "libp2p-core", + "log", + "rand 0.7.3", + "smallvec 1.4.1", + "void", + "wasm-timer", +] + +[[package]] +name = "libp2p-tcp" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481500c5774c62e8c413e9535b3f33a0e3dbacf2da63b8d3056c686a9df4146" +dependencies = [ + "async-std", + "futures 0.3.4", + "futures-timer 3.0.2", + "get_if_addrs", + "ipnet", + "libp2p-core", + "log", + "socket2", +] + +[[package]] +name = "libp2p-wasm-ext" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f59fdbb5706f2723ca108c088b1c7a37f735a8c328021f0508007162627e9885" +dependencies = [ + "futures 0.3.4", + "js-sys", + "libp2p-core", + "parity-send-wrapper", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "libp2p-websocket" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "085fbe4c05c4116c2164ab4d5a521eb6e00516c444f61b3ee9f68c7b1e53580b" +dependencies = [ + "async-tls", + "bytes 0.5.6", + "either", + "futures 0.3.4", + "libp2p-core", + "log", + "quicksink", + "rustls", + "rw-stream-sink", + "soketto", + "url 2.1.1", + "webpki", + "webpki-roots 0.18.0", +] + +[[package]] +name = "libp2p-yamux" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da33e7b5f49c75c6a8afb0b8d1e229f5fa48be9f39bd14cdbc21459a02ac6fc" +dependencies = [ + "futures 0.3.4", + "libp2p-core", + "parking_lot 0.10.2", + "thiserror", + "yamux", +] + +[[package]] +name = "librocksdb-sys" +version = "6.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "883213ae3d09bfc3d104aefe94b25ebb183b6f4d3a515b23b14817e1f4854005" +dependencies = [ + "bindgen", + "cc", + "glob", + "libc", +] + +[[package]] +name = "libsecp256k1" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc1e2c808481a63dc6da2074752fdd4336a3c8fcc68b83db6f1fd5224ae7962" +dependencies = [ + "arrayref", + "crunchy", + "digest 0.8.1", + "hmac-drbg", + "rand 0.7.3", + "sha2 0.8.1", + "subtle 2.2.2", + "typenum", +] + +[[package]] +name = "libz-sys" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" + +[[package]] +name = "linked_hash_set" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "linregress" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9290cf6f928576eeb9c096c6fad9d8d452a0a1a70a2bbffa6e36064eedc0aac9" +dependencies = [ + "failure", + "nalgebra", "statrs", ] [[package]] name = "lock_api" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" dependencies = [ "scopeguard", ] @@ -1365,6 +2748,16 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +[[package]] +name = "memmap" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" +dependencies = [ + "libc", + "winapi 0.3.8", +] + [[package]] name = "memoffset" version = "0.5.5" @@ -1404,6 +2797,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "miniz_oxide" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f" +dependencies = [ + "adler", +] + [[package]] name = "mio" version = "0.6.22" @@ -1417,12 +2819,36 @@ dependencies = [ "kernel32-sys", "libc", "log", - "miow", + "miow 0.2.1", "net2", "slab", "winapi 0.2.8", ] +[[package]] +name = "mio-extras" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" +dependencies = [ + "lazycell", + "log", + "mio", + "slab", +] + +[[package]] +name = "mio-named-pipes" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" +dependencies = [ + "log", + "mio", + "miow 0.3.5", + "winapi 0.3.8", +] + [[package]] name = "mio-uds" version = "0.6.7" @@ -1446,6 +2872,16 @@ dependencies = [ "ws2_32-sys", ] +[[package]] +name = "miow" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e" +dependencies = [ + "socket2", + "winapi 0.3.8", +] + [[package]] name = "mockall" version = "0.7.1" @@ -1469,8 +2905,8 @@ checksum = "826e14e8643cb12103b56efb963e5f9640b69b0f7bdcc460002092df4b0e959f" dependencies = [ "cfg-if", "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] @@ -1481,9 +2917,9 @@ checksum = "f75db05d738947aa5389863aadafbcf2e509d7ba099dc2ddcdf4fc66bf7a9e03" dependencies = [ "blake2b_simd", "blake2s_simd", - "digest", + "digest 0.8.1", "sha-1", - "sha2", + "sha2 0.8.1", "sha3", "unsigned-varint 0.3.3", ] @@ -1500,8 +2936,8 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9157e87afbc2ef0d84cc0345423d715f445edde00141c93721c162de35a05e5" dependencies = [ - "bytes", - "futures", + "bytes 0.5.6", + "futures 0.3.4", "log", "pin-project", "smallvec 1.4.1", @@ -1516,15 +2952,24 @@ checksum = "aaa9fddbc34c8c35dd2108515587b8ce0cab396f17977b8c738568e4edb521a2" dependencies = [ "alga", "approx", - "generic-array", + "generic-array 0.12.3", "matrixmultiply", "num-complex", "num-rational", - "num-traits", + "num-traits 0.2.11", "rand 0.6.5", "typenum", ] +[[package]] +name = "names" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef320dab323286b50fb5cdda23f61c796a72a89998ab565ca32525c5c556f2da" +dependencies = [ + "rand 0.3.23", +] + [[package]] name = "net2" version = "0.2.34" @@ -1537,15 +2982,47 @@ dependencies = [ ] [[package]] -name = "node-primitives" -version = "2.0.0-rc4" +name = "netstat2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29449d242064c48d3057a194b049a2bdcccadda16faa18a91468677b44e8d422" +dependencies = [ + "bitflags", + "byteorder", + "enum-primitive-derive", + "libc", + "num-traits 0.2.11", + "thiserror", +] + +[[package]] +name = "nix" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" +dependencies = [ + "bitflags", + "cc", + "cfg-if", + "libc", + "void", +] + +[[package]] +name = "node-inspect" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "frame-system", + "derive_more", + "log", "parity-scale-codec", - "sp-application-crypto", + "sc-cli", + "sc-client-api", + "sc-service", + "sp-blockchain", "sp-core", "sp-runtime", + "structopt", ] [[package]] @@ -1555,30 +3032,55 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] -name = "normalize-line-endings" -version = "0.3.0" +name = "nohash-hasher" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" [[package]] -name = "num-bigint" -version = "0.2.6" +name = "nom" +version = "5.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" dependencies = [ - "autocfg 1.0.0", - "num-integer", - "num-traits", + "memchr", + "version_check", ] [[package]] -name = "num-complex" -version = "0.2.4" +name = "normalize-line-endings" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" -dependencies = [ +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "ntapi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a31937dea023539c72ddae0e3571deadc1414b300483fa7aaec176168cfa9d2" +dependencies = [ + "winapi 0.3.8", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg 1.0.0", + "num-integer", + "num-traits 0.2.11", +] + +[[package]] +name = "num-complex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +dependencies = [ "autocfg 1.0.0", - "num-traits", + "num-traits 0.2.11", ] [[package]] @@ -1588,7 +3090,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" dependencies = [ "autocfg 1.0.0", - "num-traits", + "num-traits 0.2.11", ] [[package]] @@ -1600,7 +3102,16 @@ dependencies = [ "autocfg 1.0.0", "num-bigint", "num-integer", - "num-traits", + "num-traits 0.2.11", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +dependencies = [ + "num-traits 0.2.11", ] [[package]] @@ -1615,9 +3126,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6" +checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" dependencies = [ "hermit-abi", "libc", @@ -1629,7 +3140,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" dependencies = [ - "parking_lot 0.10.0", + "parking_lot 0.10.2", ] [[package]] @@ -1638,6 +3149,27 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl-probe" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" + +[[package]] +name = "owning_ref" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" +dependencies = [ + "stable_deref_trait", +] + [[package]] name = "pallet-authority-discovery" version = "2.0.0-rc4" @@ -1757,6 +3289,67 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-contracts" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "frame-support", + "frame-system", + "pallet-contracts-primitives", + "parity-scale-codec", + "parity-wasm", + "pwasm-utils", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-sandbox", + "sp-std", + "wasmi-validation", +] + +[[package]] +name = "pallet-contracts-primitives" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-contracts-rpc" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "pallet-contracts-primitives", + "pallet-contracts-rpc-runtime-api", + "parity-scale-codec", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", +] + +[[package]] +name = "pallet-contracts-rpc-runtime-api" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "pallet-contracts-primitives", + "parity-scale-codec", + "sp-api", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-finality-tracker" version = "2.0.0-rc4" @@ -2115,8 +3708,8 @@ source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478 dependencies = [ "proc-macro-crate", "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] @@ -2203,6 +3796,24 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-transaction-payment-rpc" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "pallet-transaction-payment-rpc-runtime-api", + "parity-scale-codec", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", +] + [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "2.0.0-rc4" @@ -2270,6 +3881,38 @@ dependencies = [ "sp-std", ] +[[package]] +name = "parity-db" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d595e372d119261593297debbe4193811a4dc811d2a1ccbb8caaa6666ad7ab" +dependencies = [ + "blake2-rfc", + "crc32fast", + "libc", + "log", + "memmap", + "parking_lot 0.10.2", +] + +[[package]] +name = "parity-multiaddr" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f77055f9e81921a8cc7bebeb6cded3d128931d51f1e3dd6251f0770a6d431477" +dependencies = [ + "arrayref", + "bs58", + "byteorder", + "data-encoding", + "parity-multihash", + "percent-encoding 2.1.0", + "serde", + "static_assertions", + "unsigned-varint 0.3.3", + "url 2.1.1", +] + [[package]] name = "parity-multiaddr" version = "0.9.1" @@ -2281,11 +3924,26 @@ dependencies = [ "byteorder", "data-encoding", "multihash", - "percent-encoding", + "percent-encoding 2.1.0", "serde", "static_assertions", "unsigned-varint 0.4.0", - "url", + "url 2.1.1", +] + +[[package]] +name = "parity-multihash" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a1cd2ba02391b81367bec529fb209019d718684fdc8ad6a712c2b536e46f775" +dependencies = [ + "blake2 0.8.1", + "bytes 0.5.6", + "rand 0.7.3", + "sha-1", + "sha2 0.8.1", + "sha3", + "unsigned-varint 0.3.3", ] [[package]] @@ -2309,8 +3967,33 @@ checksum = "5a0ec292e92e8ec7c58e576adacc1e3f399c597c8f263c42f18420abe58e7245" dependencies = [ "proc-macro-crate", "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", +] + +[[package]] +name = "parity-send-wrapper" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" + +[[package]] +name = "parity-tokio-ipc" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e57fea504fea33f9fbb5f49f378359030e7e026a6ab849bb9e8f0787376f1bf" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.29", + "libc", + "log", + "mio-named-pipes", + "miow 0.3.5", + "rand 0.7.3", + "tokio 0.1.22", + "tokio-named-pipes", + "tokio-uds", + "winapi 0.3.8", ] [[package]] @@ -2322,8 +4005,9 @@ dependencies = [ "cfg-if", "impl-trait-for-tuples", "parity-util-mem-derive", - "parking_lot 0.10.0", + "parking_lot 0.10.2", "primitive-types", + "smallvec 1.4.1", "winapi 0.3.8", ] @@ -2334,7 +4018,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.17", "synstructure", ] @@ -2357,12 +4041,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc" +checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" dependencies = [ "lock_api", - "parking_lot_core 0.7.0", + "parking_lot_core 0.7.2", ] [[package]] @@ -2382,9 +4066,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1" +checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" dependencies = [ "cfg-if", "cloudabi", @@ -2412,8 +4096,8 @@ checksum = "a62486e111e571b1e93b710b61e8f493c0013be39629b714cb166bdb06aa5a8a" dependencies = [ "proc-macro-hack", "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] @@ -2423,9 +4107,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "006c038a43a45995a9670da19e67600114740e8511d4333bf97a56e66a7542d9" dependencies = [ "byteorder", - "crypto-mac", + "crypto-mac 0.7.0", ] +[[package]] +name = "pdqselect" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec91767ecc0a0bbe558ce8c9da33c068066c57ecc8bb8477ef8c1ad3ef77c27" + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" + [[package]] name = "percent-encoding" version = "2.1.0" @@ -2458,8 +4160,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a0ffd45cf79d88737d7cc85bfd5d2894bee1139b356e616fe85dc389c61aaf7" dependencies = [ "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] @@ -2474,6 +4176,31 @@ version = "0.1.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" +[[package]] +name = "pkg-config" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" + +[[package]] +name = "poly1305" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b42192ab143ed7619bf888a7f9c6733a9a2153b218e2cd557cfdb52fbf9bb1" +dependencies = [ + "universal-hash", +] + +[[package]] +name = "polyval" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9a50142b55ab3ed0e9f68dfb3709f1d90d29da24e91033f28b96330643107dc" +dependencies = [ + "cfg-if", + "universal-hash", +] + [[package]] name = "ppv-lite86" version = "0.2.6" @@ -2530,6 +4257,32 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-error" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc175e9777c3116627248584e8f8b3e2987405cabe1c0adf7d1dd28f09dc7880" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cc9795ca17eb581285ec44936da7fc2335a3f34f2ddd13118b6f4d515435c50" +dependencies = [ + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", + "syn-mid", + "version_check", +] + [[package]] name = "proc-macro-hack" version = "0.5.15" @@ -2548,7 +4301,22 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3" dependencies = [ - "unicode-xid", + "unicode-xid 0.2.0", +] + +[[package]] +name = "procfs" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c434e93ef69c216e68e4f417c927b4f31502c3560b72cfdb6827e2321c5c6b3e" +dependencies = [ + "bitflags", + "byteorder", + "chrono", + "hex", + "lazy_static", + "libc", + "libflate", ] [[package]] @@ -2571,7 +4339,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" dependencies = [ - "bytes", + "bytes 0.5.6", "prost-derive", ] @@ -2581,7 +4349,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02b10678c913ecbd69350e8535c3aef91a8676c0773fc1d7b95cdd196d7f2f26" dependencies = [ - "bytes", + "bytes 0.5.6", "heck", "itertools 0.8.2", "log", @@ -2602,8 +4370,8 @@ dependencies = [ "anyhow", "itertools 0.8.2", "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] @@ -2612,7 +4380,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1834f67c0697c001304b75be76f67add9c89742eda3a085ad8ee0bb38c3417aa" dependencies = [ - "bytes", + "bytes 0.5.6", "prost", ] @@ -2622,11 +4390,45 @@ version = "2.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d883f78645c21b7281d21305181aa1f4dd9e9363e7cf2566c93121552cff003e" +[[package]] +name = "pwasm-utils" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f7a12f176deee919f4ba55326ee17491c8b707d0987aed822682c821b660192" +dependencies = [ + "byteorder", + "log", + "parity-wasm", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quicksink" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" +dependencies = [ + "futures-core", + "futures-sink", + "pin-project-lite", +] + [[package]] name = "quote" -version = "1.0.3" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" +checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" + +[[package]] +name = "quote" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ "proc-macro2", ] @@ -2637,6 +4439,29 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +dependencies = [ + "libc", + "rand 0.4.6", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +dependencies = [ + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi 0.3.8", +] + [[package]] name = "rand" version = "0.5.6" @@ -2776,6 +4601,7 @@ dependencies = [ "libc", "rand_core 0.4.2", "rdrand", + "wasm-bindgen", "winapi 0.3.8", ] @@ -2813,6 +4639,31 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" +[[package]] +name = "rayon" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f02856753d04e03e26929f820d0a0a337ebe71f849801eea335d464b349080" +dependencies = [ + "autocfg 1.0.0", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e92e15d89083484e11353891f1af602cc661426deb9564c298b270c726973280" +dependencies = [ + "crossbeam-deque", + "crossbeam-queue", + "crossbeam-utils", + "lazy_static", + "num_cpus", +] + [[package]] name = "rdrand" version = "0.4.0" @@ -2828,6 +4679,17 @@ version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +[[package]] +name = "redox_users" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" +dependencies = [ + "getrandom", + "redox_syscall", + "rust-argon2", +] + [[package]] name = "ref-cast" version = "1.0.2" @@ -2844,8 +4706,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d21b475ab879ef0e315ad99067fa25778c3b0377f57f1b00207448dac1a3144" dependencies = [ "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] @@ -2892,18 +4754,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "475e68978dc5b743f2f40d8e0a8fdc83f1c5e78cbf4b8fa5e74e73beebc340de" dependencies = [ "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] name = "ring" -version = "0.16.12" +version = "0.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba5a8ec64ee89a76c98c549af81ff14813df09c3e6dc4766c3856da48597a0c" +checksum = "952cd6b98c85bbc30efa1ba5783b8abf12fec8b3287ffa52605b9432313e34e4" dependencies = [ "cc", "libc", + "once_cell", "spin", "untrusted", "web-sys", @@ -2911,910 +4774,2513 @@ dependencies = [ ] [[package]] -name = "rustc-demangle" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc-hex" -version = "2.1.0" +name = "rle-decode-fast" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +checksum = "cabe4fa914dec5870285fa7f71f602645da47c486e68486d2b4ceb4a343e90ac" [[package]] -name = "rustc_version" -version = "0.2.3" +name = "rocksdb" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +checksum = "61aa17a99a2413cd71c1106691bf59dad7de0cd5099127f90e9d99c429c40d4a" dependencies = [ - "semver", + "libc", + "librocksdb-sys", ] [[package]] -name = "rw-stream-sink" -version = "0.2.1" +name = "rpassword" +version = "4.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" +checksum = "99371657d3c8e4d816fb6221db98fa408242b0b53bac08f8676a41f8554fe99f" dependencies = [ - "futures", - "pin-project", - "static_assertions", + "libc", + "winapi 0.3.8", ] [[package]] -name = "safe-mix" -version = "1.0.1" +name = "rust-argon2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3d055a2582e6b00ed7a31c1524040aa391092bf636328350813f3a0605215c" +checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" dependencies = [ - "rustc_version", + "base64", + "blake2b_simd", + "constant_time_eq", + "crossbeam-utils", ] [[package]] -name = "schnorrkel" -version = "0.9.1" +name = "rustc-demangle" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" -dependencies = [ - "arrayref", - "arrayvec 0.5.1", - "curve25519-dalek", - "getrandom", - "merlin", - "rand 0.7.3", - "rand_core 0.5.1", - "sha2", - "subtle 2.2.2", - "zeroize", -] +checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" [[package]] -name = "scopeguard" +name = "rustc-hash" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "send_wrapper" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0eddf2e8f50ced781f288c19f18621fa72a3779e3cb58dbf23b07469b0abeb4" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] -name = "serde" -version = "1.0.106" +name = "rustc-hex" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399" -dependencies = [ - "serde_derive", -] +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] -name = "serde_derive" -version = "1.0.106" +name = "rustc_version" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ - "proc-macro2", - "quote", - "syn", + "semver", ] [[package]] -name = "sha-1" -version = "0.8.2" +name = "rustls" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +checksum = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1" dependencies = [ - "block-buffer", - "digest", - "fake-simd", - "opaque-debug", + "base64", + "log", + "ring", + "sct", + "webpki", ] [[package]] -name = "sha2" -version = "0.8.1" +name = "rustls-native-certs" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" +checksum = "a75ffeb84a6bd9d014713119542ce415db3a3e4748f0bfce1e1416cd224a23a5" dependencies = [ - "block-buffer", - "digest", - "fake-simd", - "opaque-debug", + "openssl-probe", + "rustls", + "schannel", + "security-framework", ] [[package]] -name = "sha3" -version = "0.8.2" +name = "rw-stream-sink" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" +checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "block-buffer", - "byte-tools", - "digest", - "keccak", - "opaque-debug", + "futures 0.3.4", + "pin-project", + "static_assertions", ] [[package]] -name = "slab" -version = "0.4.2" +name = "ryu" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" [[package]] -name = "smallvec" -version = "0.6.13" +name = "safe-mix" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +checksum = "6d3d055a2582e6b00ed7a31c1524040aa391092bf636328350813f3a0605215c" dependencies = [ - "maybe-uninit", + "rustc_version", ] [[package]] -name = "smallvec" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3757cb9d89161a2f24e1cf78efa0c1fcff485d18e3f55e0aa3480824ddaa0f3f" - -[[package]] -name = "sp-api" -version = "2.0.0-rc4" +name = "sc-authority-discovery" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "hash-db", + "bytes 0.5.6", + "derive_more", + "futures 0.3.4", + "futures-timer 3.0.2", + "libp2p", + "log", "parity-scale-codec", - "sp-api-proc-macro", + "prost", + "prost-build", + "rand 0.7.3", + "sc-client-api", + "sc-keystore", + "sc-network", + "serde_json", + "sp-api", + "sp-authority-discovery", + "sp-blockchain", "sp-core", "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-version", + "substrate-prometheus-endpoint", ] [[package]] -name = "sp-api-proc-macro" -version = "2.0.0-rc4" +name = "sc-basic-authorship" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "blake2-rfc", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "futures 0.3.4", + "futures-timer 3.0.2", + "log", + "parity-scale-codec", + "sc-block-builder", + "sc-client-api", + "sc-proposer-metrics", + "sc-telemetry", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-transaction-pool", + "substrate-prometheus-endpoint", + "tokio-executor 0.2.0-alpha.6", ] [[package]] -name = "sp-application-crypto" -version = "2.0.0-rc4" +name = "sc-block-builder" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ "parity-scale-codec", - "serde", + "sc-client-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", "sp-core", - "sp-io", - "sp-std", + "sp-runtime", + "sp-state-machine", ] [[package]] -name = "sp-arithmetic" +name = "sc-chain-spec" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "integer-sqrt", - "num-traits", - "parity-scale-codec", + "impl-trait-for-tuples", + "sc-chain-spec-derive", + "sc-network", + "sc-telemetry", "serde", - "sp-debug-derive", - "sp-std", + "serde_json", + "sp-chain-spec", + "sp-core", + "sp-runtime", ] [[package]] -name = "sp-authority-discovery" +name = "sc-chain-spec-derive" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "parity-scale-codec", - "sp-api", - "sp-application-crypto", - "sp-runtime", - "sp-std", + "proc-macro-crate", + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] -name = "sp-authorship" -version = "2.0.0-rc4" +name = "sc-cli" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "parity-scale-codec", - "sp-inherents", + "ansi_term 0.12.1", + "atty", + "chrono", + "derive_more", + "env_logger", + "fdlimit", + "futures 0.3.4", + "lazy_static", + "log", + "names", + "nix", + "parity-util-mem", + "regex", + "rpassword", + "sc-client-api", + "sc-informant", + "sc-network", + "sc-service", + "sc-telemetry", + "sc-tracing", + "serde_json", + "sp-blockchain", + "sp-core", + "sp-keyring", + "sp-panic-handler", "sp-runtime", - "sp-std", + "sp-state-machine", + "sp-utils", + "sp-version", + "structopt", + "substrate-prometheus-endpoint", + "time", + "tokio 0.2.22", ] [[package]] -name = "sp-block-builder" +name = "sc-client-api" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ + "derive_more", + "fnv", + "futures 0.3.4", + "hash-db", + "hex-literal", + "kvdb", + "lazy_static", + "log", "parity-scale-codec", + "parking_lot 0.10.2", + "sc-executor", + "sc-telemetry", "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-database", + "sp-externalities", "sp-inherents", + "sp-keyring", "sp-runtime", + "sp-state-machine", "sp-std", + "sp-storage", + "sp-transaction-pool", + "sp-trie", + "sp-utils", + "sp-version", + "substrate-prometheus-endpoint", ] [[package]] -name = "sp-blockchain" -version = "2.0.0-rc4" +name = "sc-client-db" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "derive_more", + "blake2-rfc", + "hash-db", + "kvdb", + "kvdb-memorydb", + "kvdb-rocksdb", + "linked-hash-map", "log", - "lru", + "parity-db", "parity-scale-codec", - "parking_lot 0.10.0", - "sp-block-builder", + "parity-util-mem", + "parking_lot 0.10.2", + "sc-client-api", + "sc-executor", + "sc-state-db", + "sp-blockchain", "sp-consensus", + "sp-core", + "sp-database", "sp-runtime", "sp-state-machine", + "sp-trie", + "substrate-prometheus-endpoint", ] [[package]] -name = "sp-consensus" +name = "sc-consensus" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "sc-client-api", + "sp-blockchain", + "sp-consensus", + "sp-runtime", +] + +[[package]] +name = "sc-consensus-babe" version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ "derive_more", - "futures", + "fork-tree", + "futures 0.3.4", "futures-timer 3.0.2", - "libp2p", "log", + "merlin", + "num-bigint", + "num-rational", + "num-traits 0.2.11", "parity-scale-codec", - "parking_lot 0.10.0", + "parking_lot 0.10.2", + "pdqselect", + "rand 0.7.3", + "sc-client-api", + "sc-consensus-epochs", + "sc-consensus-slots", + "sc-consensus-uncles", + "sc-keystore", + "sc-telemetry", + "schnorrkel", "serde", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-vrf", "sp-core", "sp-inherents", + "sp-io", "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-utils", + "sp-timestamp", "sp-version", "substrate-prometheus-endpoint", - "wasm-timer", ] [[package]] -name = "sp-consensus-babe" +name = "sc-consensus-babe-rpc" version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "merlin", + "derive_more", + "futures 0.3.4", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-keystore", + "sc-rpc-api", + "serde", + "sp-api", + "sp-application-crypto", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "sc-consensus-epochs" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "fork-tree", + "parity-scale-codec", + "parking_lot 0.10.2", + "sc-client-api", + "sp-blockchain", + "sp-runtime", +] + +[[package]] +name = "sc-consensus-slots" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "futures 0.3.4", + "futures-timer 3.0.2", + "log", "parity-scale-codec", + "parking_lot 0.10.2", + "sc-client-api", + "sc-telemetry", "sp-api", "sp-application-crypto", + "sp-blockchain", "sp-consensus", - "sp-consensus-vrf", "sp-core", "sp-inherents", "sp-runtime", - "sp-std", - "sp-timestamp", + "sp-state-machine", ] [[package]] -name = "sp-consensus-vrf" +name = "sc-consensus-uncles" version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "parity-scale-codec", - "schnorrkel", + "log", + "sc-client-api", + "sp-authorship", + "sp-consensus", "sp-core", + "sp-inherents", "sp-runtime", - "sp-std", ] [[package]] -name = "sp-core" -version = "2.0.0-rc4" +name = "sc-executor" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "base58", - "blake2-rfc", - "byteorder", "derive_more", - "ed25519-dalek", - "futures", - "hash-db", - "hash256-std-hasher", - "hex", - "impl-serde 0.3.0", "lazy_static", "libsecp256k1", "log", - "merlin", - "num-traits", "parity-scale-codec", - "parity-util-mem", - "parking_lot 0.10.0", - "primitive-types", - "rand 0.7.3", - "regex", - "schnorrkel", - "serde", - "sha2", - "sp-debug-derive", + "parity-wasm", + "parking_lot 0.10.2", + "sc-executor-common", + "sc-executor-wasmi", + "sp-api", + "sp-core", "sp-externalities", + "sp-io", + "sp-panic-handler", "sp-runtime-interface", - "sp-std", - "sp-storage", - "substrate-bip39", - "tiny-bip39", - "tiny-keccak", - "twox-hash", + "sp-serializer", + "sp-trie", + "sp-version", + "sp-wasm-interface", "wasmi", - "zeroize", ] [[package]] -name = "sp-debug-derive" -version = "2.0.0-rc4" +name = "sc-executor-common" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "proc-macro2", - "quote", - "syn", + "derive_more", + "log", + "parity-scale-codec", + "parity-wasm", + "sp-allocator", + "sp-core", + "sp-runtime-interface", + "sp-serializer", + "sp-wasm-interface", + "wasmi", ] [[package]] -name = "sp-externalities" +name = "sc-executor-wasmi" version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "environmental", + "log", "parity-scale-codec", - "sp-std", - "sp-storage", + "sc-executor-common", + "sp-allocator", + "sp-core", + "sp-runtime-interface", + "sp-wasm-interface", + "wasmi", ] [[package]] -name = "sp-finality-grandpa" -version = "2.0.0-rc4" +name = "sc-finality-grandpa" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ + "assert_matches", + "derive_more", "finality-grandpa", + "fork-tree", + "futures 0.3.4", + "futures-timer 3.0.2", "log", "parity-scale-codec", - "serde", + "parking_lot 0.10.2", + "pin-project", + "rand 0.7.3", + "sc-block-builder", + "sc-client-api", + "sc-consensus", + "sc-keystore", + "sc-network", + "sc-network-gossip", + "sc-telemetry", + "serde_json", "sp-api", "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", "sp-core", + "sp-finality-grandpa", + "sp-finality-tracker", + "sp-inherents", "sp-runtime", - "sp-std", + "sp-utils", + "substrate-prometheus-endpoint", ] [[package]] -name = "sp-finality-tracker" -version = "2.0.0-rc4" +name = "sc-finality-grandpa-rpc" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "parity-scale-codec", - "sp-inherents", - "sp-std", + "derive_more", + "finality-grandpa", + "futures 0.3.4", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "log", + "sc-finality-grandpa", + "serde", + "serde_json", ] [[package]] -name = "sp-inherents" -version = "2.0.0-rc4" +name = "sc-informant" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "derive_more", - "parity-scale-codec", - "parking_lot 0.10.0", - "sp-core", - "sp-std", + "ansi_term 0.12.1", + "futures 0.3.4", + "log", + "parity-util-mem", + "parking_lot 0.10.2", + "sc-client-api", + "sc-network", + "sp-blockchain", + "sp-runtime", + "sp-transaction-pool", + "sp-utils", + "wasm-timer", ] [[package]] -name = "sp-io" +name = "sc-keystore" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "futures", - "hash-db", - "libsecp256k1", - "log", - "parity-scale-codec", - "parking_lot 0.10.0", + "derive_more", + "hex", + "merlin", + "parking_lot 0.10.2", + "rand 0.7.3", + "serde_json", + "sp-application-crypto", "sp-core", - "sp-externalities", - "sp-runtime-interface", - "sp-state-machine", - "sp-std", - "sp-tracing", - "sp-trie", - "sp-wasm-interface", + "subtle 2.2.2", ] [[package]] -name = "sp-keyring" +name = "sc-light" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ + "hash-db", "lazy_static", + "parity-scale-codec", + "parking_lot 0.10.2", + "sc-client-api", + "sc-executor", + "sp-api", + "sp-blockchain", "sp-core", + "sp-externalities", "sp-runtime", - "strum", + "sp-state-machine", ] [[package]] -name = "sp-npos-elections" -version = "2.0.0-rc4" +name = "sc-network" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ + "bitflags", + "bs58", + "bytes 0.5.6", + "derive_more", + "either", + "erased-serde", + "fnv", + "fork-tree", + "futures 0.3.4", + "futures-timer 3.0.2", + "futures_codec 0.3.4", + "hex", + "ip_network", + "libp2p", + "linked-hash-map", + "linked_hash_set", + "log", + "lru", + "nohash-hasher", "parity-scale-codec", + "parking_lot 0.10.2", + "pin-project", + "prost", + "prost-build", + "rand 0.7.3", + "sc-block-builder", + "sc-client-api", + "sc-peerset", "serde", + "serde_json", + "slog", + "slog_derive", + "smallvec 0.6.13", "sp-arithmetic", - "sp-npos-elections-compact", - "sp-std", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-utils", + "substrate-prometheus-endpoint", + "thiserror", + "unsigned-varint 0.3.3", + "void", + "wasm-timer", + "zeroize", ] [[package]] -name = "sp-npos-elections-compact" -version = "2.0.0-rc4" +name = "sc-network-gossip" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "futures 0.3.4", + "futures-timer 3.0.2", + "libp2p", + "log", + "lru", + "sc-network", + "sp-runtime", + "wasm-timer", ] [[package]] -name = "sp-offchain" +name = "sc-offchain" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "sp-api", + "bytes 0.5.6", + "fnv", + "futures 0.3.4", + "futures-timer 3.0.2", + "hyper 0.13.7", + "hyper-rustls", + "log", + "num_cpus", + "parity-scale-codec", + "parking_lot 0.10.2", + "rand 0.7.3", + "sc-client-api", + "sc-keystore", + "sc-network", + "sp-api", "sp-core", + "sp-offchain", "sp-runtime", + "sp-utils", + "threadpool", ] [[package]] -name = "sp-panic-handler" +name = "sc-peerset" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "backtrace", + "futures 0.3.4", + "libp2p", "log", + "serde_json", + "sp-utils", + "wasm-timer", ] [[package]] -name = "sp-runtime" -version = "2.0.0-rc4" +name = "sc-proposer-metrics" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", "log", - "parity-scale-codec", - "parity-util-mem", - "paste", - "rand 0.7.3", - "serde", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-inherents", - "sp-io", - "sp-std", + "substrate-prometheus-endpoint", ] [[package]] -name = "sp-runtime-interface" +name = "sc-rpc" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ + "futures 0.3.4", + "hash-db", + "jsonrpc-core", + "jsonrpc-pubsub", + "log", "parity-scale-codec", - "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-tracing", - "sp-wasm-interface", - "static_assertions", -] - -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "2.0.0-rc4" -source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" -dependencies = [ - "Inflector", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "parking_lot 0.10.2", + "sc-block-builder", + "sc-client-api", + "sc-executor", + "sc-keystore", + "sc-rpc-api", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-chain-spec", + "sp-core", + "sp-offchain", + "sp-rpc", + "sp-runtime", + "sp-session", + "sp-state-machine", + "sp-transaction-pool", + "sp-utils", + "sp-version", ] [[package]] -name = "sp-session" -version = "2.0.0-rc4" +name = "sc-rpc-api" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ + "derive_more", + "futures 0.3.4", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "jsonrpc-pubsub", + "log", "parity-scale-codec", - "sp-api", + "parking_lot 0.10.2", + "serde", + "serde_json", + "sp-chain-spec", "sp-core", + "sp-rpc", "sp-runtime", - "sp-staking", - "sp-std", + "sp-transaction-pool", + "sp-version", ] [[package]] -name = "sp-staking" +name = "sc-rpc-server" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "parity-scale-codec", + "jsonrpc-core", + "jsonrpc-http-server", + "jsonrpc-ipc-server", + "jsonrpc-pubsub", + "jsonrpc-ws-server", + "log", + "serde", + "serde_json", "sp-runtime", - "sp-std", ] [[package]] -name = "sp-state-machine" +name = "sc-service" version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ + "derive_more", + "directories", + "exit-future", + "futures 0.1.29", + "futures 0.3.4", + "futures-timer 3.0.2", "hash-db", - "itertools 0.9.0", + "jsonrpc-pubsub", + "lazy_static", "log", - "num-traits", + "netstat2", + "parity-multiaddr 0.7.3", "parity-scale-codec", - "parking_lot 0.10.0", + "parity-util-mem", + "parking_lot 0.10.2", + "pin-project", + "procfs", "rand 0.7.3", - "smallvec 1.4.1", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-client-db", + "sc-executor", + "sc-informant", + "sc-keystore", + "sc-light", + "sc-network", + "sc-offchain", + "sc-rpc", + "sc-rpc-server", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "serde", + "serde_json", + "slog", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", "sp-core", "sp-externalities", - "sp-panic-handler", + "sp-io", + "sp-runtime", + "sp-session", + "sp-state-machine", + "sp-transaction-pool", "sp-trie", - "trie-db", - "trie-root", + "sp-utils", + "sp-version", + "substrate-prometheus-endpoint", + "sysinfo", + "tempfile", + "tracing", + "wasm-timer", ] [[package]] -name = "sp-std" -version = "2.0.0-rc4" -source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" - -[[package]] -name = "sp-storage" -version = "2.0.0-rc4" +name = "sc-state-db" +version = "0.8.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "impl-serde 0.2.3", - "ref-cast", - "serde", - "sp-debug-derive", - "sp-std", + "log", + "parity-scale-codec", + "parity-util-mem", + "parity-util-mem-derive", + "parking_lot 0.10.2", + "sc-client-api", + "sp-core", ] [[package]] -name = "sp-timestamp" +name = "sc-telemetry" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std", + "bytes 0.5.6", + "futures 0.3.4", + "futures-timer 3.0.2", + "libp2p", + "log", + "parking_lot 0.10.2", + "pin-project", + "rand 0.7.3", + "serde", + "slog", + "slog-json", + "slog-scope", + "take_mut", + "void", "wasm-timer", ] [[package]] -name = "sp-tracing" +name = "sc-tracing" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ + "erased-serde", "log", - "rental", - "tracing", + "parking_lot 0.10.2", + "rustc-hash", + "sc-telemetry", + "serde", + "serde_json", + "slog", + "sp-tracing", + "tracing-core", ] [[package]] -name = "sp-transaction-pool" +name = "sc-transaction-graph" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ "derive_more", - "futures", + "futures 0.3.4", + "linked-hash-map", "log", - "parity-scale-codec", + "parity-util-mem", + "parking_lot 0.10.2", "serde", - "sp-api", "sp-blockchain", + "sp-core", "sp-runtime", + "sp-transaction-pool", "sp-utils", + "wasm-timer", ] [[package]] -name = "sp-trie" +name = "sc-transaction-pool" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ - "hash-db", - "memory-db", + "derive_more", + "futures 0.3.4", + "futures-diagnose", + "intervalier", + "log", "parity-scale-codec", + "parity-util-mem", + "parking_lot 0.10.2", + "sc-client-api", + "sc-transaction-graph", + "sp-api", + "sp-blockchain", "sp-core", - "sp-std", - "trie-db", - "trie-root", + "sp-runtime", + "sp-tracing", + "sp-transaction-pool", + "sp-utils", + "substrate-prometheus-endpoint", + "wasm-timer", ] [[package]] -name = "sp-utils" -version = "2.0.0-rc4" -source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +name = "schannel" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ - "futures", - "futures-core", - "futures-timer 3.0.2", "lazy_static", - "prometheus", + "winapi 0.3.8", ] [[package]] -name = "sp-version" -version = "2.0.0-rc4" -source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +name = "schnorrkel" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" dependencies = [ - "impl-serde 0.2.3", - "parity-scale-codec", - "serde", - "sp-runtime", - "sp-std", + "arrayref", + "arrayvec 0.5.1", + "curve25519-dalek", + "getrandom", + "merlin", + "rand 0.7.3", + "rand_core 0.5.1", + "sha2 0.8.1", + "subtle 2.2.2", + "zeroize", ] [[package]] -name = "sp-wasm-interface" -version = "2.0.0-rc4" -source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", - "sp-std", - "wasmi", + "ring", + "untrusted", ] [[package]] -name = "spin" -version = "0.5.2" +name = "security-framework" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] [[package]] -name = "stable_deref_trait" -version = "1.1.1" +name = "security-framework-sys" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" +dependencies = [ + "core-foundation-sys", + "libc", +] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "semver" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "send_wrapper" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0eddf2e8f50ced781f288c19f18621fa72a3779e3cb58dbf23b07469b0abeb4" + +[[package]] +name = "send_wrapper" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686ef91cf020ad8d4aca9a7047641fd6add626b7b89e14546c2b6a76781cf822" + +[[package]] +name = "send_wrapper" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" + +[[package]] +name = "serde" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c" +dependencies = [ + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", +] + +[[package]] +name = "serde_json" +version = "1.0.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha-1" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" + +[[package]] +name = "sha2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2933378ddfeda7ea26f48c555bdad8bb446bf8a3d17832dc83e380d444cfb8c1" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpuid-bool", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha3" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" +dependencies = [ + "block-buffer 0.7.3", + "byte-tools", + "digest 0.8.1", + "keccak", + "opaque-debug 0.2.3", +] + +[[package]] +name = "shlex" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" + +[[package]] +name = "signal-hook-registry" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" +dependencies = [ + "arc-swap", + "libc", +] + +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" + +[[package]] +name = "slog" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cc9c640a4adbfbcc11ffb95efe5aa7af7309e002adab54b185507dbf2377b99" +dependencies = [ + "erased-serde", +] + +[[package]] +name = "slog-json" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc0d2aff1f8f325ef660d9a0eb6e6dcd20b30b3f581a5897f58bf42d061c37a" +dependencies = [ + "chrono", + "erased-serde", + "serde", + "serde_json", + "slog", +] + +[[package]] +name = "slog-scope" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c44c89dd8b0ae4537d1ae318353eaf7840b4869c536e31c41e963d1ea523ee6" +dependencies = [ + "arc-swap", + "lazy_static", + "slog", +] + +[[package]] +name = "slog_derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a945ec7f7ce853e89ffa36be1e27dce9a43e82ff9093bf3461c30d5da74ed11b" +dependencies = [ + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", +] + +[[package]] +name = "smallvec" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +dependencies = [ + "maybe-uninit", +] + +[[package]] +name = "smallvec" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3757cb9d89161a2f24e1cf78efa0c1fcff485d18e3f55e0aa3480824ddaa0f3f" + +[[package]] +name = "snow" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32bf8474159a95551661246cda4976e89356999e3cbfef36f493dacc3fae1e8e" +dependencies = [ + "aes-gcm", + "blake2 0.9.0", + "chacha20poly1305", + "rand 0.7.3", + "rand_core 0.5.1", + "ring", + "rustc_version", + "sha2 0.9.1", + "subtle 2.2.2", + "x25519-dalek", +] + +[[package]] +name = "socket2" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "winapi 0.3.8", +] + +[[package]] +name = "soketto" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c9dab3f95c9ebdf3a88268c19af668f637a3c5039c2c56ff2d40b1b2d64a25b" +dependencies = [ + "base64", + "bytes 0.5.6", + "flate2", + "futures 0.3.4", + "http 0.2.1", + "httparse", + "log", + "rand 0.7.3", + "sha1", + "smallvec 1.4.1", + "static_assertions", + "thiserror", +] + +[[package]] +name = "sp-allocator" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "derive_more", + "log", + "sp-core", + "sp-std", + "sp-wasm-interface", +] + +[[package]] +name = "sp-api" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "hash-db", + "parity-scale-codec", + "sp-api-proc-macro", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-version", +] + +[[package]] +name = "sp-api-proc-macro" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "blake2-rfc", + "proc-macro-crate", + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", +] + +[[package]] +name = "sp-application-crypto" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", + "serde", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sp-arithmetic" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "integer-sqrt", + "num-traits 0.2.11", + "parity-scale-codec", + "serde", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "sp-authority-discovery" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-application-crypto", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-authorship" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", + "sp-inherents", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-block-builder" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-inherents", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-blockchain" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "derive_more", + "log", + "lru", + "parity-scale-codec", + "parking_lot 0.10.2", + "sp-block-builder", + "sp-consensus", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "sp-chain-spec" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "sp-consensus" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "derive_more", + "futures 0.3.4", + "futures-timer 3.0.2", + "libp2p", + "log", + "parity-scale-codec", + "parking_lot 0.10.2", + "serde", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-utils", + "sp-version", + "substrate-prometheus-endpoint", + "wasm-timer", +] + +[[package]] +name = "sp-consensus-babe" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "merlin", + "parity-scale-codec", + "sp-api", + "sp-application-crypto", + "sp-consensus", + "sp-consensus-vrf", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-vrf" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", + "schnorrkel", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-core" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "base58", + "blake2-rfc", + "byteorder", + "derive_more", + "ed25519-dalek", + "futures 0.3.4", + "hash-db", + "hash256-std-hasher", + "hex", + "impl-serde 0.3.0", + "lazy_static", + "libsecp256k1", + "log", + "merlin", + "num-traits 0.2.11", + "parity-scale-codec", + "parity-util-mem", + "parking_lot 0.10.2", + "primitive-types", + "rand 0.7.3", + "regex", + "schnorrkel", + "serde", + "sha2 0.8.1", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "substrate-bip39", + "tiny-bip39", + "tiny-keccak", + "twox-hash", + "wasmi", + "zeroize", +] + +[[package]] +name = "sp-database" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "kvdb", + "parking_lot 0.10.2", +] + +[[package]] +name = "sp-debug-derive" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", +] + +[[package]] +name = "sp-externalities" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std", + "sp-storage", +] + +[[package]] +name = "sp-finality-grandpa" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "finality-grandpa", + "log", + "parity-scale-codec", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-finality-tracker" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", + "sp-inherents", + "sp-std", +] + +[[package]] +name = "sp-inherents" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "derive_more", + "parity-scale-codec", + "parking_lot 0.10.2", + "sp-core", + "sp-std", +] + +[[package]] +name = "sp-io" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "futures 0.3.4", + "hash-db", + "libsecp256k1", + "log", + "parity-scale-codec", + "parking_lot 0.10.2", + "sp-core", + "sp-externalities", + "sp-runtime-interface", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", + "sp-wasm-interface", +] + +[[package]] +name = "sp-keyring" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "lazy_static", + "sp-core", + "sp-runtime", + "strum", +] + +[[package]] +name = "sp-npos-elections" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", + "serde", + "sp-arithmetic", + "sp-npos-elections-compact", + "sp-std", +] + +[[package]] +name = "sp-npos-elections-compact" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", +] + +[[package]] +name = "sp-offchain" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "sp-api", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "sp-panic-handler" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "backtrace", + "log", +] + +[[package]] +name = "sp-rpc" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "serde", + "sp-core", +] + +[[package]] +name = "sp-runtime" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "parity-util-mem", + "paste", + "rand 0.7.3", + "serde", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-inherents", + "sp-io", + "sp-std", +] + +[[package]] +name = "sp-runtime-interface" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", + "primitive-types", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "Inflector", + "proc-macro-crate", + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", +] + +[[package]] +name = "sp-sandbox" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", + "sp-core", + "sp-io", + "sp-std", + "sp-wasm-interface", + "wasmi", +] + +[[package]] +name = "sp-serializer" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "sp-session" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-core", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "sp-staking" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-state-machine" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "hash-db", + "itertools 0.9.0", + "log", + "num-traits 0.2.11", + "parity-scale-codec", + "parking_lot 0.10.2", + "rand 0.7.3", + "smallvec 1.4.1", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-trie", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-std" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" + +[[package]] +name = "sp-storage" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "impl-serde 0.2.3", + "ref-cast", + "serde", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "sp-timestamp" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "sp-api", + "sp-inherents", + "sp-runtime", + "sp-std", + "wasm-timer", +] + +[[package]] +name = "sp-tracing" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "log", + "rental", + "tracing", +] + +[[package]] +name = "sp-transaction-pool" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "derive_more", + "futures 0.3.4", + "log", + "parity-scale-codec", + "serde", + "sp-api", + "sp-blockchain", + "sp-runtime", + "sp-utils", +] + +[[package]] +name = "sp-trie" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "hash-db", + "memory-db", + "parity-scale-codec", + "sp-core", + "sp-std", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-utils" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "futures 0.3.4", + "futures-core", + "futures-timer 3.0.2", + "lazy_static", + "prometheus", +] + +[[package]] +name = "sp-version" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "impl-serde 0.2.3", + "parity-scale-codec", + "serde", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-wasm-interface" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "sp-std", + "wasmi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "stable_deref_trait" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "statrs" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10102ac8d55e35db2b3fafc26f81ba8647da2e15879ab686a67e6d19af2685e8" +dependencies = [ + "rand 0.5.6", +] + +[[package]] +name = "stream-cipher" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f8ed9974042b8c3672ff3030a69fcc03b74c47c3d1ecb7755e8a3626011e88" +dependencies = [ + "generic-array 0.14.3", +] + +[[package]] +name = "string" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" +dependencies = [ + "bytes 0.4.12", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "structopt" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de2f5e239ee807089b62adce73e48c625e0ed80df02c7ab3f068f5db5281065c" +dependencies = [ + "clap", + "lazy_static", + "structopt-derive", +] + +[[package]] +name = "structopt-derive" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "510413f9de616762a4fbeab62509bf15c729603b72d7cd71280fbca431b1c118" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", +] + +[[package]] +name = "strum" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6138f8f88a16d90134763314e3fc76fa3ed6a7db4725d6acf9a3ef95a3188d22" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0054a7df764039a6cd8592b9de84be4bec368ff081d203a7d5371cbfa8e65c81" +dependencies = [ + "heck", + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", +] + +[[package]] +name = "substrate-bip39" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c004e8166d6e0aa3a9d5fa673e5b7098ff25f930de1013a21341988151e681bb" +dependencies = [ + "hmac", + "pbkdf2", + "schnorrkel", + "sha2 0.8.1", +] + +[[package]] +name = "substrate-browser-utils" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "chrono", + "clear_on_drop", + "console_error_panic_hook", + "console_log", + "futures 0.1.29", + "futures 0.3.4", + "futures-timer 3.0.2", + "js-sys", + "kvdb-web", + "libp2p-wasm-ext", + "log", + "rand 0.6.5", + "rand 0.7.3", + "sc-chain-spec", + "sc-informant", + "sc-network", + "sc-service", + "sp-database", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "substrate-frame-rpc-system" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "frame-system-rpc-runtime-api", + "futures 0.3.4", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-rpc-api", + "serde", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-runtime", + "sp-transaction-pool", +] + +[[package]] +name = "substrate-prometheus-endpoint" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "async-std", + "derive_more", + "futures-util", + "hyper 0.13.7", + "log", + "prometheus", + "tokio 0.2.22", +] + +[[package]] +name = "substrate-wasm-builder-runner" +version = "1.0.6" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" + +[[package]] +name = "subtle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" + +[[package]] +name = "subtle" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c65d530b10ccaeac294f349038a597e435b18fb456aadd0840a623f83b9e941" + +[[package]] +name = "syn" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" +dependencies = [ + "quote 0.3.15", + "synom", + "unicode-xid 0.0.4", +] + +[[package]] +name = "syn" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03" +dependencies = [ + "proc-macro2", + "quote 1.0.7", + "unicode-xid 0.2.0", +] + +[[package]] +name = "syn-mid" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" +dependencies = [ + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", +] + +[[package]] +name = "synom" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" +dependencies = [ + "unicode-xid 0.0.4", +] + +[[package]] +name = "synstructure" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" +dependencies = [ + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", + "unicode-xid 0.2.0", +] + +[[package]] +name = "sysinfo" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac193374347e7c263c5f547524f36ff8ec6702d56c8799c8331d26dffe8c1e" +dependencies = [ + "cfg-if", + "doc-comment", + "libc", + "ntapi", + "once_cell", + "rayon", + "winapi 0.3.8", +] + +[[package]] +name = "take_mut" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" + +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +dependencies = [ + "cfg-if", + "libc", + "rand 0.7.3", + "redox_syscall", + "remove_dir_all", + "winapi 0.3.8", +] + +[[package]] +name = "termcolor" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" +dependencies = [ + "proc-macro2", + "quote 1.0.7", + "syn 1.0.17", +] + +[[package]] +name = "thread_local" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "time" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" +dependencies = [ + "libc", + "redox_syscall", + "winapi 0.3.8", +] + +[[package]] +name = "tiny-bip39" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0165e045cc2ae1660270ca65e1676dbaab60feb0f91b10f7d0665e9b47e31f2" +dependencies = [ + "failure", + "hmac", + "once_cell", + "pbkdf2", + "rand 0.7.3", + "rustc-hash", + "sha2 0.8.1", + "unicode-normalization", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tokio" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.29", + "mio", + "num_cpus", + "tokio-codec", + "tokio-current-thread", + "tokio-executor 0.1.10", + "tokio-fs", + "tokio-io", + "tokio-reactor", + "tokio-sync 0.1.8", + "tokio-tcp", + "tokio-threadpool", + "tokio-timer", + "tokio-udp", + "tokio-uds", +] + +[[package]] +name = "tokio" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures-core", + "iovec", + "lazy_static", + "libc", + "memchr", + "mio", + "mio-uds", + "num_cpus", + "pin-project-lite", + "signal-hook-registry", + "slab", + "winapi 0.3.8", +] [[package]] -name = "statrs" -version = "0.10.0" +name = "tokio-buf" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10102ac8d55e35db2b3fafc26f81ba8647da2e15879ab686a67e6d19af2685e8" +checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" dependencies = [ - "rand 0.5.6", + "bytes 0.4.12", + "either", + "futures 0.1.29", ] [[package]] -name = "strum" -version = "0.16.0" +name = "tokio-codec" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6138f8f88a16d90134763314e3fc76fa3ed6a7db4725d6acf9a3ef95a3188d22" +checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" dependencies = [ - "strum_macros", + "bytes 0.4.12", + "futures 0.1.29", + "tokio-io", ] [[package]] -name = "strum_macros" -version = "0.16.0" +name = "tokio-current-thread" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0054a7df764039a6cd8592b9de84be4bec368ff081d203a7d5371cbfa8e65c81" +checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", + "futures 0.1.29", + "tokio-executor 0.1.10", ] [[package]] -name = "substrate-bip39" -version = "0.4.1" +name = "tokio-executor" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c004e8166d6e0aa3a9d5fa673e5b7098ff25f930de1013a21341988151e681bb" +checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" dependencies = [ - "hmac", - "pbkdf2", - "schnorrkel", - "sha2", + "crossbeam-utils", + "futures 0.1.29", ] [[package]] -name = "substrate-prometheus-endpoint" -version = "0.8.0-rc4" -source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +name = "tokio-executor" +version = "0.2.0-alpha.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ee9ceecf69145923834ea73f32ba40c790fd877b74a7817dd0b089f1eb9c7c8" dependencies = [ - "async-std", - "derive_more", - "futures-util", - "hyper", - "log", - "prometheus", - "tokio", + "futures-util-preview", + "lazy_static", + "tokio-sync 0.2.0-alpha.6", ] [[package]] -name = "substrate-wasm-builder-runner" -version = "1.0.6" -source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +name = "tokio-fs" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" +dependencies = [ + "futures 0.1.29", + "tokio-io", + "tokio-threadpool", +] [[package]] -name = "subtle" -version = "1.0.0" +name = "tokio-io" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" +checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.29", + "log", +] [[package]] -name = "subtle" -version = "2.2.2" +name = "tokio-named-pipes" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c65d530b10ccaeac294f349038a597e435b18fb456aadd0840a623f83b9e941" +checksum = "9d282d483052288b2308ba5ee795f5673b159c9bdf63c385a05609da782a5eae" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.29", + "mio", + "mio-named-pipes", + "tokio 0.1.22", +] [[package]] -name = "syn" -version = "1.0.17" +name = "tokio-reactor" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03" +checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", + "crossbeam-utils", + "futures 0.1.29", + "lazy_static", + "log", + "mio", + "num_cpus", + "parking_lot 0.9.0", + "slab", + "tokio-executor 0.1.10", + "tokio-io", + "tokio-sync 0.1.8", ] [[package]] -name = "synstructure" -version = "0.12.3" +name = "tokio-rustls" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" +checksum = "15cb62a0d2770787abc96e99c1cd98fcf17f94959f3af63ca85bdfb203f051b4" dependencies = [ - "proc-macro2", - "quote", - "syn", - "unicode-xid", + "futures-core", + "rustls", + "tokio 0.2.22", + "webpki", ] [[package]] -name = "tempfile" -version = "3.1.0" +name = "tokio-service" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +checksum = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" dependencies = [ - "cfg-if", - "libc", - "rand 0.7.3", - "redox_syscall", - "remove_dir_all", - "winapi 0.3.8", + "futures 0.1.29", ] [[package]] -name = "thiserror" -version = "1.0.20" +name = "tokio-sync" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" +checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" dependencies = [ - "thiserror-impl", + "fnv", + "futures 0.1.29", ] [[package]] -name = "thiserror-impl" -version = "1.0.20" +name = "tokio-sync" +version = "0.2.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" +checksum = "4f1aaeb685540f7407ea0e27f1c9757d258c7c6bf4e3eb19da6fc59b747239d2" dependencies = [ - "proc-macro2", - "quote", - "syn", + "fnv", + "futures-core-preview", + "futures-util-preview", ] [[package]] -name = "thread_local" -version = "1.0.1" +name = "tokio-tcp" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" dependencies = [ - "lazy_static", + "bytes 0.4.12", + "futures 0.1.29", + "iovec", + "mio", + "tokio-io", + "tokio-reactor", ] [[package]] -name = "time" -version = "0.1.42" +name = "tokio-threadpool" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" +checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" dependencies = [ - "libc", - "redox_syscall", - "winapi 0.3.8", + "crossbeam-deque", + "crossbeam-queue", + "crossbeam-utils", + "futures 0.1.29", + "lazy_static", + "log", + "num_cpus", + "slab", + "tokio-executor 0.1.10", ] [[package]] -name = "tiny-bip39" -version = "0.7.3" +name = "tokio-timer" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0165e045cc2ae1660270ca65e1676dbaab60feb0f91b10f7d0665e9b47e31f2" +checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" dependencies = [ - "failure", - "hmac", - "once_cell", - "pbkdf2", - "rand 0.7.3", - "rustc-hash", - "sha2", - "unicode-normalization", + "crossbeam-utils", + "futures 0.1.29", + "slab", + "tokio-executor 0.1.10", ] [[package]] -name = "tiny-keccak" -version = "2.0.2" +name = "tokio-udp" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" dependencies = [ - "crunchy", + "bytes 0.4.12", + "futures 0.1.29", + "log", + "mio", + "tokio-codec", + "tokio-io", + "tokio-reactor", ] [[package]] -name = "tokio" -version = "0.2.22" +name = "tokio-uds" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" +checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0" dependencies = [ - "bytes", - "fnv", - "futures-core", - "memchr", - "pin-project-lite", + "bytes 0.4.12", + "futures 0.1.29", + "iovec", + "libc", + "log", + "mio", + "mio-uds", + "tokio-codec", + "tokio-io", + "tokio-reactor", ] [[package]] @@ -3823,12 +7289,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" dependencies = [ - "bytes", + "bytes 0.5.6", "futures-core", "futures-sink", "log", "pin-project-lite", - "tokio", + "tokio 0.2.22", ] [[package]] @@ -3865,8 +7331,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0693bf8d6f2bf22c690fc61a9d21ac69efdbb894a17ed596b9af0f01e64b84b" dependencies = [ "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", ] [[package]] @@ -3939,6 +7405,15 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.4" @@ -3963,23 +7438,55 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" +[[package]] +name = "unicode-width" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" + +[[package]] +name = "unicode-xid" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" + [[package]] name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +[[package]] +name = "universal-hash" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" +dependencies = [ + "generic-array 0.14.3", + "subtle 2.2.2", +] + [[package]] name = "unsigned-varint" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f67332660eb59a6f1eb24ff1220c9e8d01738a8503c6002e30bcfe4bd9f2b4a9" +dependencies = [ + "bytes 0.5.6", + "futures-io", + "futures-util", + "futures_codec 0.3.4", +] [[package]] name = "unsigned-varint" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "669d776983b692a906c881fcd0cfb34271a48e197e4d6cb8df32b05bfc3d3fa5" +dependencies = [ + "bytes 0.5.6", + "futures_codec 0.4.0", +] [[package]] name = "untrusted" @@ -3987,23 +7494,73 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +dependencies = [ + "idna 0.1.5", + "matches", + "percent-encoding 1.0.1", +] + [[package]] name = "url" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" dependencies = [ - "idna", + "idna 0.2.0", "matches", - "percent-encoding", + "percent-encoding 2.1.0", ] +[[package]] +name = "vcpkg" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "vergen" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ce50d8996df1f85af15f2cd8d33daae6e479575123ef4314a51a70a230739cb" +dependencies = [ + "bitflags", + "chrono", +] + +[[package]] +name = "version_check" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" + [[package]] name = "void" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +[[package]] +name = "want" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" +dependencies = [ + "futures 0.1.29", + "log", + "try-lock", +] + [[package]] name = "want" version = "0.3.0" @@ -4040,8 +7597,8 @@ dependencies = [ "lazy_static", "log", "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", "wasm-bindgen-shared", ] @@ -4063,7 +7620,7 @@ version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bd151b63e1ea881bb742cd20e1d6127cef28399558f3b5d415289bc41eee3a4" dependencies = [ - "quote", + "quote 1.0.7", "wasm-bindgen-macro-support", ] @@ -4074,8 +7631,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d68a5b36eef1be7868f668632863292e37739656a80fc4b9acec7b0bd35a4931" dependencies = [ "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4092,11 +7649,11 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "324c5e65a08699c9c4334ba136597ab22b85dccd4b65dd1e36ccf8f723a95b54" dependencies = [ - "futures", + "futures 0.3.4", "js-sys", "parking_lot 0.9.0", "pin-utils", - "send_wrapper", + "send_wrapper 0.2.0", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -4111,7 +7668,7 @@ dependencies = [ "libc", "memory_units", "num-rational", - "num-traits", + "num-traits 0.2.11", "parity-wasm", "wasmi-validation", ] @@ -4135,6 +7692,34 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab146130f5f790d45f82aeeb09e55a256573373ec64409fc19a6fb82fb1032ae" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" +dependencies = [ + "webpki", +] + +[[package]] +name = "webpki-roots" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8eff4b7516a57307f9349c64bf34caa34b940b66fed4b2fb3136cb7386e5739" +dependencies = [ + "webpki", +] + [[package]] name = "which" version = "3.1.1" @@ -4172,12 +7757,39 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.8", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "ws" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51a2c47b5798ccc774ffb93ff536aec7c4275d722fd9c740c83cdd1af1f2d94" +dependencies = [ + "byteorder", + "bytes 0.4.12", + "httparse", + "log", + "mio", + "mio-extras", + "rand 0.7.3", + "sha-1", + "slab", + "url 2.1.1", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -4188,6 +7800,31 @@ dependencies = [ "winapi-build", ] +[[package]] +name = "x25519-dalek" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637ff90c9540fa3073bb577e65033069e4bae7c79d49d74aa3ffdf5342a53217" +dependencies = [ + "curve25519-dalek", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "yamux" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd37e58a1256a0b328ce9c67d8b62ecdd02f4803ba443df478835cb1a41a637c" +dependencies = [ + "futures 0.3.4", + "log", + "nohash-hasher", + "parking_lot 0.10.2", + "rand 0.7.3", + "static_assertions", +] + [[package]] name = "zeroize" version = "1.1.0" @@ -4204,7 +7841,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de251eec69fc7c1bc3923403d18ececb929380e016afe103da75f396704f8ca2" dependencies = [ "proc-macro2", - "quote", - "syn", + "quote 1.0.7", + "syn 1.0.17", "synstructure", ] diff --git a/Cargo.toml b/Cargo.toml index 7ed7a3c361..fa1b9d0512 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ members = [ "runtime-modules/versioned-store", "runtime-modules/versioned-store-permissions", "runtime-modules/working-group", -# "node", + "node", # "utils/chain-spec-builder/" ] diff --git a/node/Cargo.toml b/node/Cargo.toml index 704759f57e..ba720ac4ff 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,9 +1,9 @@ [package] -authors = ['Joystream'] +authors = ['Joystream contributors'] build = 'build.rs' edition = '2018' name = 'joystream-node' -version = '2.6.0' +version = '3.0.0' default-run = "joystream-node" [[bin]] @@ -13,144 +13,238 @@ path = 'bin/main.rs' [lib] crate-type = ["cdylib", "rlib"] +#[dependencies] +#derive_more = '0.14.0' +#exit-future = '0.1.4' + +#hex = '0.4' + [dependencies] -hex-literal = '0.2.1' -derive_more = '0.14.0' -exit-future = '0.1.4' -futures = '0.1.29' -log = '0.4.8' -parking_lot = '0.9.0' -tokio = '0.1.22' -jsonrpc-core = '13.2.0' -rand = '0.7.2' -structopt = '=0.3.5' +# third-party dependencies +codec = { package = "parity-scale-codec", version = "1.3.1" } +serde = { version = "1.0.102", features = ["derive"] } +futures = { version = "0.3.1", features = ["compat"] } +hex-literal = "0.2.1" +jsonrpc-core = "14.2.0" +log = "0.4.8" +rand = "0.7.2" +structopt = { version = "0.3.8"} +tracing = "0.1.10" +parking_lot = "0.10.0" + serde_json = '1.0' -serde = '1.0' -hex = '0.4' -# https://users.rust-lang.org/t/failure-derive-compilation-error/39062 -# quote = '<=1.0.2' - -[dependencies.node-runtime] -package = 'joystream-node-runtime' -path = '../runtime' - -[dependencies.substrate-basic-authorship] -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-basic-authorship' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.babe] -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-consensus-babe' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.babe-primitives] -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-consensus-babe-primitives' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.codec] -package = 'parity-scale-codec' -version = '1.0.0' - -[dependencies.ctrlc] -features = ['termination'] -version = '3.0' - -[dependencies.inherents] -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-inherents' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.network] -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-network' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.primitives] -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-primitives' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.sr-io] -git = 'https://github.com/paritytech/substrate.git' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.substrate-cli] -git = 'https://github.com/paritytech/substrate.git' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.substrate-client] -git = 'https://github.com/paritytech/substrate.git' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.substrate-executor] -git = 'https://github.com/paritytech/substrate.git' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.substrate-service] -git = 'https://github.com/paritytech/substrate.git' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.transaction-pool] -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-transaction-pool' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.substrate-telemetry] -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-telemetry' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.grandpa] -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-finality-grandpa' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.grandpa-primitives] -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-finality-grandpa-primitives' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.im-online] -default_features = false -git = 'https://github.com/paritytech/substrate.git' -package = 'srml-im-online' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.substrate-rpc] -default_features = false -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-rpc' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.authority-discovery] -default_features = false -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-authority-discovery' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.client-db] -default_features = false -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-client-db' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.runtime-primitives] -default_features = false -git = 'https://github.com/paritytech/substrate.git' -package = 'sr-primitives' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.offchain] -default_features = false -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-offchain' -rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' - -[dependencies.libp2p] -version = '0.13.2' -default-features = false +tokio = '0.1.22' + +# primitives +sp-authority-discovery = { package = 'sp-authority-discovery', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-consensus-babe = { package = 'sp-consensus-babe', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-finality-grandpa = { package = 'sp-finality-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-core = { package = 'sp-core', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-runtime = { package = 'sp-runtime', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-timestamp = { package = 'sp-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-finality-tracker = { package = 'sp-finality-tracker', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-inherents = { package = 'sp-inherents', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-keyring = { package = 'sp-keyring', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-io = { package = 'sp-io', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-consensus = { package = 'sp-consensus', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-transaction-pool = { package = 'sp-transaction-pool', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-api = { package = 'sp-api', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-blockchain = { package = 'sp-blockchain', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } + +# client dependencies +sc-client-api = { package = 'sc-client-api', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-chain-spec = { package = 'sc-chain-spec', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-consensus = { package = 'sc-consensus', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-transaction-pool = { package = 'sc-transaction-pool', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-network = { package = 'sc-network', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-consensus-babe = { package = 'sc-consensus-babe', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} +sc-finality-grandpa = { package = 'sc-finality-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-client-db = { package = 'sc-client-db', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-offchain = { package = 'sc-offchain', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-rpc = { package = 'sc-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-basic-authorship = { package = 'sc-basic-authorship', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-service = { package = 'sc-service', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-tracing = { package = 'sc-tracing', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-telemetry = { package = 'sc-telemetry', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-authority-discovery = { package = 'sc-authority-discovery', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-consensus-epochs = { package = 'sc-consensus-epochs', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-keystore = { package = 'sc-keystore', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-consensus-babe-rpc = { package = 'sc-consensus-babe-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-finality-grandpa-rpc = { package = 'sc-finality-grandpa-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-rpc-api = { package = 'sc-rpc-api', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-block-builder = { package = 'sp-block-builder', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-contracts-rpc = { package = 'pallet-contracts-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-transaction-payment-rpc = { package = 'pallet-transaction-payment-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +substrate-frame-rpc-system = { package = 'substrate-frame-rpc-system', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-executor = { package = 'sc-executor', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +frame-benchmarking = { package = 'frame-benchmarking', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } + +#sc-client-api = { version = "2.0.0-rc4", path = "../../../client/api" } +#jsonrpc-core = "14.2.0" +#node-primitives = { version = "2.0.0-rc4", path = "../primitives" } +#node-runtime = { version = "2.0.0-rc4", path = "../runtime" } +#sp-runtime = { version = "2.0.0-rc4", path = "../../../primitives/runtime" } +#sp-api = { version = "2.0.0-rc4", path = "../../../primitives/api" } +#pallet-contracts-rpc = { version = "0.8.0-rc4", path = "../../../frame/contracts/rpc/" } +#pallet-transaction-payment-rpc = { version = "2.0.0-rc4", path = "../../../frame/transaction-payment/rpc/" } +#substrate-frame-rpc-system = { version = "2.0.0-rc4", path = "../../../utils/frame/rpc/system" } +#sp-transaction-pool = { version = "2.0.0-rc4", path = "../../../primitives/transaction-pool" } +#sc-consensus-babe = { version = "0.8.0-rc4", path = "../../../client/consensus/babe" } +#sc-consensus-babe-rpc = { version = "0.8.0-rc4", path = "../../../client/consensus/babe/rpc" } +#sp-consensus-babe = { version = "0.8.0-rc4", path = "../../../primitives/consensus/babe" } +#sc-keystore = { version = "2.0.0-rc4", path = "../../../client/keystore" } +#sc-consensus-epochs = { version = "0.8.0-rc4", path = "../../../client/consensus/epochs" } +#sp-consensus = { version = "0.8.0-rc4", path = "../../../primitives/consensus/common" } +#sp-blockchain = { version = "2.0.0-rc4", path = "../../../primitives/blockchain" } +#sc-finality-grandpa = { version = "0.8.0-rc4", path = "../../../client/finality-grandpa" } +#sc-finality-grandpa-rpc = { version = "0.8.0-rc4", path = "../../../client/finality-grandpa/rpc" } +#sc-rpc-api = { version = "0.8.0-rc4", path = "../../../client/rpc-api" } +#sp-block-builder = { version = "2.0.0-rc4", path = "../../../primitives/block-builder" } + +# frame dependencies +pallet-indices = { package = 'pallet-indices', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-contracts = { package = 'pallet-contracts', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +frame-system = { package = 'frame-system', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-balances = { package = 'pallet-balances', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-transaction-payment = { package = 'pallet-transaction-payment', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-im-online = { package = 'pallet-im-online', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-authority-discovery = { package = 'pallet-authority-discovery', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-staking = { package = 'pallet-staking', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-grandpa = { package = 'pallet-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } + +# node-specific dependencies +node-runtime = { package= "joystream-node-runtime", path = "../runtime" } + +# CLI-specific dependencies +sc-cli = { package = 'sc-cli', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +frame-benchmarking-cli = { package = 'frame-benchmarking-cli', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +node-inspect = { package = 'node-inspect', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } + +# WASM-specific dependencies +wasm-bindgen = { version = "0.2.57", optional = true } +wasm-bindgen-futures = { version = "0.4.7", optional = true } +browser-utils = { package = 'substrate-browser-utils', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true} + + +#[dependencies.substrate-basic-authorship] +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-basic-authorship' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.babe] +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-consensus-babe' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.babe-primitives] +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-consensus-babe-primitives' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.codec] +#package = 'parity-scale-codec' +#version = '1.0.0' +# +#[dependencies.ctrlc] +#features = ['termination'] +#version = '3.0' +# +#[dependencies.inherents] +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-inherents' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.network] +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-network' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.primitives] +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-primitives' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.sr-io] +#git = 'https://github.com/paritytech/substrate.git' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.substrate-cli] +#git = 'https://github.com/paritytech/substrate.git' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.substrate-client] +#git = 'https://github.com/paritytech/substrate.git' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.substrate-executor] +#git = 'https://github.com/paritytech/substrate.git' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.substrate-service] +#git = 'https://github.com/paritytech/substrate.git' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.transaction-pool] +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-transaction-pool' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.substrate-telemetry] +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-telemetry' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.grandpa] +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-finality-grandpa' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.grandpa-primitives] +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-finality-grandpa-primitives' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.im-online] +#default_features = false +#git = 'https://github.com/paritytech/substrate.git' +#package = 'srml-im-online' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.substrate-rpc] +#default_features = false +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-rpc' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.authority-discovery] +#default_features = false +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-authority-discovery' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.client-db] +#default_features = false +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-client-db' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.runtime-primitives] +#default_features = false +#git = 'https://github.com/paritytech/substrate.git' +#package = 'sr-primitives' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.offchain] +#default_features = false +#git = 'https://github.com/paritytech/substrate.git' +#package = 'substrate-offchain' +#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' +# +#[dependencies.libp2p] +#version = '0.13.2' +#default-features = false [build-dependencies] vergen = '3' diff --git a/node/bin/main.rs b/node/bin/main.rs index 70006bf571..88b0057639 100644 --- a/node/bin/main.rs +++ b/node/bin/main.rs @@ -14,27 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Joystream node. If not, see . -//! Substrate Node Template CLI library. +//! Joystream Node. #![warn(missing_docs)] -#![warn(unused_extern_crates)] -use joystream_node::cli; -pub use substrate_cli::{error, IntoExit, VersionInfo}; - -fn main() { - let version = VersionInfo { - name: "Joystream Node", - commit: env!("VERGEN_SHA_SHORT"), - version: env!("CARGO_PKG_VERSION"), - executable_name: "joystream-node", - author: "Joystream", - description: "Joystream substrate node", - support_url: "https://www.joystream.org/", - }; - - if let Err(e) = cli::run(::std::env::args(), cli::Exit, version) { - eprintln!("Fatal error: {}\n\n{:?}", e, e); - std::process::exit(1) - } -} +fn main() -> sc_cli::Result<()> { + joystream_node::command::run() +} \ No newline at end of file diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index a602cfd1fe..685cfd52ca 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -19,30 +19,33 @@ // Example: voting_period: 1 * DAY #![allow(clippy::identity_op)] -use node_runtime::{ +use node_runtime::{AccountId, GenesisConfig}; +use sp_runtime::{Perbill}; +use sp_core::{Pair, Public, sr25519}; +use sp_runtime::traits::{IdentifyAccount, Verify}; +use sp_consensus_babe::AuthorityId as BabeId; +use sp_finality_grandpa::AuthorityId as GrandpaId; +use pallet_im_online::sr25519::AuthorityId as ImOnlineId; +use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; +use serde_json as json; + +use node_runtime::{ContractsConfig, versioned_store::InputValidationLengthConstraint as VsInputValidation, AuthorityDiscoveryConfig, BabeConfig, Balance, BalancesConfig, ContentWorkingGroupConfig, CouncilConfig, CouncilElectionConfig, DataObjectStorageRegistryConfig, DataObjectTypeRegistryConfig, ElectionParameters, GrandpaConfig, ImOnlineConfig, IndicesConfig, - MembersConfig, MigrationConfig, Perbill, ProposalsCodexConfig, SessionConfig, SessionKeys, + MembersConfig, MigrationConfig, ProposalsCodexConfig, SessionConfig, SessionKeys, Signature, StakerStatus, StakingConfig, StorageWorkingGroupConfig, SudoConfig, SystemConfig, VersionedStoreConfig, DAYS, WASM_BINARY, }; -pub use node_runtime::{AccountId, GenesisConfig}; -use primitives::{sr25519, Pair, Public}; -use runtime_primitives::traits::{IdentifyAccount, Verify}; - -use babe_primitives::AuthorityId as BabeId; -use grandpa_primitives::AuthorityId as GrandpaId; -use im_online::sr25519::AuthorityId as ImOnlineId; -use serde_json as json; type AccountPublic = ::Signer; /// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type. -pub type ChainSpec = substrate_service::ChainSpec; +pub type ChainSpec = sc_service::GenericChainSpec; use node_runtime::common::constraints::InputValidationLengthConstraint; +use sc_chain_spec::ChainType; /// The chain specification option. This is expected to come in from the CLI and /// is little more than one of a number of alternatives which can easily be converted @@ -73,22 +76,31 @@ where /// Helper function to generate stash, controller and session key from seed pub fn get_authority_keys_from_seed( seed: &str, -) -> (AccountId, AccountId, GrandpaId, BabeId, ImOnlineId) { +) -> ( + AccountId, + AccountId, + GrandpaId, + BabeId, + ImOnlineId, + AuthorityDiscoveryId, +) { ( get_account_id_from_seed::(&format!("{}//stash", seed)), get_account_id_from_seed::(seed), get_from_seed::(seed), get_from_seed::(seed), get_from_seed::(seed), + get_from_seed::(seed), ) } -fn session_keys(grandpa: GrandpaId, babe: BabeId, im_online: ImOnlineId) -> SessionKeys { - SessionKeys { - grandpa, - babe, - im_online, - } +fn session_keys( + grandpa: GrandpaId, + babe: BabeId, + im_online: ImOnlineId, + authority_discovery: AuthorityDiscoveryId, +) -> SessionKeys { + SessionKeys { grandpa, babe, im_online, authority_discovery } } impl Alternative { @@ -98,6 +110,7 @@ impl Alternative { Alternative::Development => ChainSpec::from_genesis( "Development", "dev", + ChainType::Development, || { testnet_genesis( vec![get_authority_keys_from_seed("Alice")], @@ -110,7 +123,7 @@ impl Alternative { ], ) }, - vec![], + Vec::new(), None, None, Some(chain_spec_properties()), @@ -119,6 +132,7 @@ impl Alternative { Alternative::LocalTestnet => ChainSpec::from_genesis( "Local Testnet", "local_testnet", + ChainType::Local, || { testnet_genesis( vec![ @@ -142,7 +156,7 @@ impl Alternative { ], ) }, - vec![], + Vec::new(), None, None, Some(chain_spec_properties()), @@ -150,14 +164,6 @@ impl Alternative { ), }) } - - pub(crate) fn from(s: &str) -> Option { - match s { - "dev" => Some(Alternative::Development), - "local" => Some(Alternative::LocalTestnet), - _ => None, - } - } } fn new_vs_validation(min: u16, max_min_diff: u16) -> VsInputValidation { @@ -178,7 +184,14 @@ pub fn chain_spec_properties() -> json::map::Map { } pub fn testnet_genesis( - initial_authorities: Vec<(AccountId, AccountId, GrandpaId, BabeId, ImOnlineId)>, + initial_authorities: Vec<( + AccountId, + AccountId, + GrandpaId, + BabeId, + ImOnlineId, + AuthorityDiscoveryId, + )>, root_key: AccountId, endowed_accounts: Vec, ) -> GenesisConfig { @@ -187,6 +200,8 @@ pub fn testnet_genesis( const STASH: Balance = 20 * DOLLARS; const ENDOWMENT: Balance = 100_000 * DOLLARS; + let enable_println = false; + // default codex proposals config parameters let cpcp = node_runtime::ProposalsConfigParameters::default(); let default_text_constraint = node_runtime::working_group::default_text_constraint(); @@ -196,29 +211,15 @@ pub fn testnet_genesis( code: WASM_BINARY.to_vec(), changes_trie_config: Default::default(), }), - balances: Some(BalancesConfig { + pallet_balances: Some(BalancesConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, ENDOWMENT)) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .collect(), - vesting: vec![], - }), - indices: Some(IndicesConfig { ids: vec![] }), - session: Some(SessionConfig { - keys: initial_authorities - .iter() - .map(|x| { - ( - x.0.clone(), - session_keys(x.2.clone(), x.3.clone(), x.4.clone()), - ) - }) - .collect::>(), }), - staking: Some(StakingConfig { - current_era: 0, + pallet_staking: Some(StakingConfig { validator_count: 20, minimum_validator_count: 1, stakers: initial_authorities @@ -229,15 +230,32 @@ pub fn testnet_genesis( slash_reward_fraction: Perbill::from_percent(10), ..Default::default() }), - sudo: Some(SudoConfig { key: root_key }), - babe: Some(BabeConfig { + pallet_sudo: Some(SudoConfig { key: root_key }), + pallet_babe: Some(BabeConfig { authorities: vec![], }), - im_online: Some(ImOnlineConfig { keys: vec![] }), - authority_discovery: Some(AuthorityDiscoveryConfig { keys: vec![] }), - grandpa: Some(GrandpaConfig { + pallet_im_online: Some(ImOnlineConfig { keys: vec![] }), + pallet_authority_discovery: Some(AuthorityDiscoveryConfig { keys: vec![] }), + pallet_grandpa: Some(GrandpaConfig { authorities: vec![], }), + pallet_indices: Some(IndicesConfig { indices: vec![] }), + pallet_session: Some(SessionConfig { + keys: initial_authorities.iter().map(|x| { + (x.0.clone(), x.0.clone(), session_keys( + x.2.clone(), + x.3.clone(), + x.4.clone(), + x.5.clone(), + )) + }).collect::>(), + }), + pallet_contracts: Some(ContractsConfig { + current_schedule: pallet_contracts::Schedule { + enable_println, // this should only be enabled on development chains + ..Default::default() + }, + }), council: Some(CouncilConfig { active_council: vec![], term_ends_at: 1, diff --git a/node/src/cli.rs b/node/src/cli.rs index 9c33d231aa..2272180966 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -1,128 +1,48 @@ -use crate::chain_spec; -use crate::new_full_start; -use crate::service; -use futures::{future, sync::oneshot, Future}; -use log::info; -use std::cell::RefCell; -pub use substrate_cli::{error, IntoExit, VersionInfo}; -use substrate_cli::{informant, parse_and_prepare, NoCustom, ParseAndPrepare}; -use substrate_service::{AbstractService, Configuration, Roles as ServiceRoles}; -use tokio::runtime::Runtime; - -/// Parse command line arguments into service configuration. -pub fn run(args: I, exit: E, version: VersionInfo) -> error::Result<()> -where - I: IntoIterator, - T: Into + Clone, - E: IntoExit, -{ - type Config = Configuration<(), T>; - match parse_and_prepare::(&version, "joystream-node", args) { - ParseAndPrepare::Run(cmd) => cmd.run( - load_spec, - exit, - |exit, _cli_args, _custom_args, config: Config<_>| { - info!("{}", version.name); - info!(" version {}", config.full_version()); - info!(" by {}, 2019", version.author); - info!("Chain specification: {}", config.chain_spec.name()); - info!("Node name: {}", config.name); - info!("Roles: {:?}", config.roles); - let runtime = Runtime::new().map_err(|e| format!("{:?}", e))?; - match config.roles { - ServiceRoles::LIGHT => run_until_exit( - runtime, - service::new_light(config).map_err(|e| format!("{:?}", e))?, - exit, - ), - _ => run_until_exit( - runtime, - service::new_full(config).map_err(|e| format!("{:?}", e))?, - exit, - ), - } - .map_err(|e| format!("{:?}", e)) - }, - ), - ParseAndPrepare::BuildSpec(cmd) => cmd.run::(load_spec), - ParseAndPrepare::ExportBlocks(cmd) => cmd.run_with_builder( - |config: Config<_>| Ok(new_full_start!(config).0), - load_spec, - exit, - ), - ParseAndPrepare::ImportBlocks(cmd) => cmd.run_with_builder( - |config: Config<_>| Ok(new_full_start!(config).0), - load_spec, - exit, - ), - ParseAndPrepare::PurgeChain(cmd) => cmd.run(load_spec), - ParseAndPrepare::RevertChain(cmd) => { - cmd.run_with_builder(|config: Config<_>| Ok(new_full_start!(config).0), load_spec) - } - ParseAndPrepare::CustomCommand(_) => Ok(()), - }?; - - Ok(()) -} - -fn load_spec(id: &str) -> Result, String> { - Ok(match chain_spec::Alternative::from(id) { - Some(spec) => Some(spec.load()?), - None => None, - }) -} - -fn run_until_exit(mut runtime: Runtime, service: T, e: E) -> error::Result<()> -where - T: AbstractService, - E: IntoExit, -{ - let (exit_send, exit) = exit_future::signal(); - - let informant = informant::build(&service); - runtime.executor().spawn(exit.until(informant).map(|_| ())); - - // we eagerly drop the service so that the internal exit future is fired, - // but we need to keep holding a reference to the global telemetry guard - let _telemetry = service.telemetry(); - - let service_res = { - let exit = e - .into_exit() - .map_err(|_| error::Error::Other("Exit future failed.".into())); - let service = service.map_err(error::Error::Service); - let select = service.select(exit).map(|_| ()).map_err(|(err, _)| err); - runtime.block_on(select) - }; - - exit_send.fire(); - - // TODO [andre]: timeout this future #1318 - let _ = runtime.shutdown_on_idle().wait(); - - service_res +// Copyright 2019 Joystream Contributors +// This file is part of Joystream node. + +// Joystream node 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. + +// Joystream node 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 Joystream node. If not, see . + +use sc_cli::RunCmd; +use structopt::StructOpt; + +/// An overarching CLI command definition. +#[derive(Debug, StructOpt)] +pub struct Cli { + /// Possible subcommand with parameters. + #[structopt(subcommand)] + pub subcommand: Option, + #[allow(missing_docs)] + #[structopt(flatten)] + pub run: RunCmd, } -// handles ctrl-c -pub struct Exit; -impl IntoExit for Exit { - type Exit = future::MapErr, fn(oneshot::Canceled) -> ()>; - fn into_exit(self) -> Self::Exit { - // can't use signal directly here because CtrlC takes only `Fn`. - let (exit_send, exit) = oneshot::channel(); - - let exit_send_cell = RefCell::new(Some(exit_send)); - ctrlc::set_handler(move || { - let exit_send = exit_send_cell - .try_borrow_mut() - .expect("signal handler not reentrant; qed") - .take(); - if let Some(exit_send) = exit_send { - exit_send.send(()).expect("Error sending exit notification"); - } - }) - .expect("Error setting Ctrl-C handler"); - - exit.map_err(drop) - } +/// Possible subcommands of the main binary. +#[derive(Debug, StructOpt)] +pub enum Subcommand { + /// A set of base subcommands handled by `sc_cli`. + #[structopt(flatten)] + Base(sc_cli::Subcommand), + + /// The custom inspect subcommmand for decoding blocks and extrinsics. + #[structopt( + name = "inspect", + about = "Decode given block or extrinsic using current native runtime." + )] + Inspect(node_inspect::cli::InspectCmd), + + /// The custom benchmark subcommmand benchmarking runtime pallets. + #[structopt(name = "benchmark", about = "Benchmark runtime pallets.")] + Benchmark(frame_benchmarking_cli::BenchmarkCmd), } diff --git a/node/src/command.rs b/node/src/command.rs new file mode 100644 index 0000000000..0f4d3ec06d --- /dev/null +++ b/node/src/command.rs @@ -0,0 +1,104 @@ +// Copyright 2019 Joystream Contributors +// This file is part of Joystream node. + +// Joystream node 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. + +// Joystream node 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 Joystream node. If not, see . + +use crate::{chain_spec, service}; +use crate::cli::{Cli, Subcommand}; +use crate::node_rpc; +use crate::node_executor; + +use node_executor::Executor; +use node_runtime::{opaque::Block, RuntimeApi}; +use sc_cli::{Result, SubstrateCli}; +use sc_finality_grandpa::{ + self as grandpa, +}; + +impl SubstrateCli for Cli { + fn impl_name() -> &'static str { + "Joystream Node" + } + + fn impl_version() -> &'static str { + "3.0.0" + } + + fn description() -> &'static str { + "Joystream substrate node" + } + + fn author() -> &'static str { + "Joystream contributors" + } + + fn support_url() -> &'static str { + "https://www.joystream.org/" + } + + fn copyright_start_year() -> i32 { + 2019 + } + + fn executable_name() -> &'static str { + "joystream-node" + } + + fn load_spec(&self, id: &str) -> std::result::Result, String> { + Ok(match id { + "dev" => Box::new(chain_spec::Alternative::Development.load().unwrap()), //TODO + "local" => Box::new(chain_spec::Alternative::LocalTestnet.load().unwrap()), + path => Box::new(chain_spec::ChainSpec::from_json_file( + std::path::PathBuf::from(path), + )?), + }) + } +} + +/// Parse command line arguments into service configuration. +pub fn run() -> Result<()> { + let cli = Cli::from_args(); + + match &cli.subcommand { + None => { + let runner = cli.create_runner(&cli.run)?; + runner.run_node( + service::new_light, + service::new_full, + node_runtime::VERSION + ) + } + Some(Subcommand::Inspect(cmd)) => { + let runner = cli.create_runner(cmd)?; + + runner.sync_run(|config| cmd.run::(config)) + } + Some(Subcommand::Benchmark(cmd)) => { + if cfg!(feature = "runtime-benchmarks") { + let runner = cli.create_runner(cmd)?; + + runner.sync_run(|config| cmd.run::(config)) + } else { + println!("Benchmarking wasn't enabled when building the node. \ + You can enable it with `--features runtime-benchmarks`."); + Ok(()) + } + } + Some(Subcommand::Base(subcommand)) => { + let runner = cli.create_runner(subcommand)?; + + runner.run_subcommand(subcommand, |config| Ok(new_full_start!(config).0)) + } + } +} diff --git a/node/src/lib.rs b/node/src/lib.rs index d0b23aa71a..0f492584cd 100644 --- a/node/src/lib.rs +++ b/node/src/lib.rs @@ -2,4 +2,8 @@ pub mod chain_spec; pub mod cli; pub mod forum_config; pub mod members_config; +#[macro_use] pub mod service; +pub mod command; +pub mod node_rpc; +pub mod node_executor; diff --git a/node/src/members_config.rs b/node/src/members_config.rs index 23172e9918..7b33e21b9b 100644 --- a/node/src/members_config.rs +++ b/node/src/members_config.rs @@ -1,7 +1,7 @@ use serde::Deserialize; use serde_json::Result; -use primitives::crypto::{AccountId32, Ss58Codec}; +use sp_core::crypto::{AccountId32, Ss58Codec}; #[derive(Deserialize)] struct Member { @@ -12,18 +12,6 @@ struct Member { about: String, } -// fn test_load_members() -> Result> { -// let data = r#" -// [{ -// "address": "5Gn9n7SDJ7VgHqHQWYzkSA4vX6DCmS5TFWdHxikTXp9b4L32", -// "handle": "mokhtar", -// "avatar_uri": "http://mokhtar.net/avatar.png", -// "about": "Mokhtar" -// }]"#; - -// serde_json::from_str(data) -// } - fn parse_members_json() -> Result> { let data = include_str!("../res/acropolis_members.json"); serde_json::from_str(data) diff --git a/node/src/node_executor.rs b/node/src/node_executor.rs new file mode 100644 index 0000000000..ca414e130a --- /dev/null +++ b/node/src/node_executor.rs @@ -0,0 +1,10 @@ +use sc_executor::native_executor_instance; + +// Declare an instance of the native executor named `Executor`. Include the wasm binary as the +// equivalent wasm code. +native_executor_instance!( + pub Executor, + node_runtime::api::dispatch, + node_runtime::native_version, + frame_benchmarking::benchmarking::HostFunctions, +); diff --git a/node/src/node_rpc.rs b/node/src/node_rpc.rs new file mode 100644 index 0000000000..f384e3ed4b --- /dev/null +++ b/node/src/node_rpc.rs @@ -0,0 +1,193 @@ +// This file is part of Substrate. + +// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! A collection of node-specific RPC methods. +//! +//! Since `substrate` core functionality makes no assumptions +//! about the modules used inside the runtime, so do +//! RPC methods defined in `sc-rpc` crate. +//! It means that `client/rpc` can't have any methods that +//! need some strong assumptions about the particular runtime. +//! +//! The RPCs available in this crate however can make some assumptions +//! about how the runtime is constructed and what FRAME pallets +//! are part of it. Therefore all node-runtime-specific RPCs can +//! be placed here or imported from corresponding FRAME RPC definitions. + +#![warn(missing_docs)] + +use std::sync::Arc; + +use node_runtime::{opaque::Block, BlockNumber, AccountId, Index, Balance, Hash}; +use node_runtime::UncheckedExtrinsic; +use sp_api::ProvideRuntimeApi; +use sp_transaction_pool::TransactionPool; +use sp_blockchain::{Error as BlockChainError, HeaderMetadata, HeaderBackend}; +use sp_consensus::SelectChain; +use sc_keystore::KeyStorePtr; +use sp_consensus_babe::BabeApi; +use sc_consensus_epochs::SharedEpochChanges; +use sc_consensus_babe::{Config, Epoch}; +use sc_consensus_babe_rpc::BabeRpcHandler; +use sc_finality_grandpa::{SharedVoterState, SharedAuthoritySet}; +use sc_finality_grandpa_rpc::GrandpaRpcHandler; +use sc_rpc_api::DenyUnsafe; +use sp_block_builder::BlockBuilder; + +/// Light client extra dependencies. +pub struct LightDeps { + /// The client instance to use. + pub client: Arc, + /// Transaction pool instance. + pub pool: Arc

, + /// Remote access to the blockchain (async). + pub remote_blockchain: Arc>, + /// Fetcher instance. + pub fetcher: Arc, +} + +/// Extra dependencies for BABE. +pub struct BabeDeps { + /// BABE protocol config. + pub babe_config: Config, + /// BABE pending epoch changes. + pub shared_epoch_changes: SharedEpochChanges, + /// The keystore that manages the keys of the node. + pub keystore: KeyStorePtr, +} + +/// Extra dependencies for GRANDPA +pub struct GrandpaDeps { + /// Voting round info. + pub shared_voter_state: SharedVoterState, + /// Authority set info. + pub shared_authority_set: SharedAuthoritySet, +} + +/// Full client dependencies. +pub struct FullDeps { + /// The client instance to use. + pub client: Arc, + /// Transaction pool instance. + pub pool: Arc

, + /// The SelectChain Strategy + pub select_chain: SC, + /// Whether to deny unsafe calls + pub deny_unsafe: DenyUnsafe, + /// BABE specific dependencies. + pub babe: BabeDeps, + /// GRANDPA specific dependencies. + pub grandpa: GrandpaDeps, +} + +/// Instantiate all Full RPC extensions. +pub fn create_full( + deps: FullDeps, +) -> jsonrpc_core::IoHandler where + C: ProvideRuntimeApi, + C: HeaderBackend + HeaderMetadata + 'static, + C: Send + Sync + 'static, + C::Api: substrate_frame_rpc_system::AccountNonceApi, + C::Api: pallet_contracts_rpc::ContractsRuntimeApi, + C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, + C::Api: BabeApi, + C::Api: BlockBuilder, + P: TransactionPool + 'static, + M: jsonrpc_core::Metadata + Default, + SC: SelectChain +'static, +{ + use substrate_frame_rpc_system::{FullSystem, SystemApi}; + use pallet_contracts_rpc::{Contracts, ContractsApi}; + use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; + + let mut io = jsonrpc_core::IoHandler::default(); + let FullDeps { + client, + pool, + select_chain, + deny_unsafe, + babe, + grandpa, + } = deps; + let BabeDeps { + keystore, + babe_config, + shared_epoch_changes, + } = babe; + let GrandpaDeps { + shared_voter_state, + shared_authority_set, + } = grandpa; + + io.extend_with( + SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe)) + ); + // Making synchronous calls in light client freezes the browser currently, + // more context: https://github.com/paritytech/substrate/pull/3480 + // These RPCs should use an asynchronous caller instead. + io.extend_with( + ContractsApi::to_delegate(Contracts::new(client.clone())) + ); + io.extend_with( + TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone())) + ); + io.extend_with( + sc_consensus_babe_rpc::BabeApi::to_delegate( + BabeRpcHandler::new( + client, + shared_epoch_changes, + keystore, + babe_config, + select_chain, + deny_unsafe, + ), + ) + ); + io.extend_with( + sc_finality_grandpa_rpc::GrandpaApi::to_delegate( + GrandpaRpcHandler::new(shared_authority_set, shared_voter_state) + ) + ); + + io +} + +/// Instantiate all Light RPC extensions. +pub fn create_light( + deps: LightDeps, +) -> jsonrpc_core::IoHandler where + C: sp_blockchain::HeaderBackend, + C: Send + Sync + 'static, + F: sc_client_api::light::Fetcher + 'static, + P: TransactionPool + 'static, + M: jsonrpc_core::Metadata + Default, +{ + use substrate_frame_rpc_system::{LightSystem, SystemApi}; + + let LightDeps { + client, + pool, + remote_blockchain, + fetcher + } = deps; + let mut io = jsonrpc_core::IoHandler::default(); + io.extend_with( + SystemApi::::to_delegate(LightSystem::new(client, remote_blockchain, fetcher, pool)) + ); + + io +} diff --git a/node/src/service.rs b/node/src/service.rs index 64bf0a03d9..73abbddf95 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -16,108 +16,137 @@ #![warn(unused_extern_crates)] -// Clippy linter warning. -#![allow(clippy::type_complexity)] // disable it because this is foreign code and can be changed any time - -// Clippy linter warning. -#![allow(clippy::redundant_closure_call)] // disable it because of the substrate lib design - -//! Service and ServiceFactory implementation. Specialized wrapper over substrate service. - -use client_db::Backend; -use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider}; -use inherents::InherentDataProviders; -use network::{construct_simple_protocol, NetworkService}; -use node_runtime::{self, opaque::Block, GenesisConfig, RuntimeApi}; -use offchain::OffchainWorkers; -use primitives::Blake2Hasher; -use runtime_primitives::traits::Block as BlockT; +// Substrate implementation issue. +#![allow(clippy::redundant_closure_call)] + +//! Service implementation. Specialized wrapper over substrate service. + use std::sync::Arc; -use substrate_client::{Client, LocalCallExecutor, LongestChain}; -pub use substrate_executor::{native_executor_instance, NativeExecutor}; -use substrate_service::{ - error::Error as ServiceError, AbstractService, Configuration, NetworkStatus, Service, - ServiceBuilder, +use sc_finality_grandpa::{ + self as grandpa, FinalityProofProvider as GrandpaFinalityProofProvider, StorageAndProofProvider, }; -use transaction_pool::{self, txpool::Pool as TransactionPool}; - -construct_simple_protocol! { - /// Demo protocol attachment for substrate. - pub struct NodeProtocol where Block = Block { } -} +use node_runtime::opaque::Block; +use node_runtime::RuntimeApi; +use sc_service::{ + AbstractService, ServiceBuilder, config::Configuration, error::{Error as ServiceError}, +}; +use sp_inherents::InherentDataProviders; +use sc_consensus::LongestChain; -// Declare an instance of the native executor named `Executor`. Include the wasm binary as the -// equivalent wasm code. -native_executor_instance!( - pub Executor, - node_runtime::api::dispatch, - node_runtime::native_version -); +use crate::node_rpc; +use crate::node_executor; /// Starts a `ServiceBuilder` for a full service. /// /// Use this macro if you don't actually need the full service, but just the builder in order to /// be able to perform chain operations. -#[macro_export] macro_rules! new_full_start { - ($config:expr) => {{ - // type RpcExtension = jsonrpc_core::IoHandler; - let mut import_setup = None; - let inherent_data_providers = inherents::InherentDataProviders::new(); - - let builder = substrate_service::ServiceBuilder::new_full::< - node_runtime::opaque::Block, - node_runtime::RuntimeApi, - crate::service::Executor, - >($config)? - .with_select_chain(|_config, backend| { - Ok(substrate_client::LongestChain::new(backend.clone())) - })? - .with_transaction_pool(|config, client| { - Ok(transaction_pool::txpool::Pool::new( - config, - transaction_pool::FullChainApi::new(client), - )) - })? - .with_import_queue(|_config, client, mut select_chain, _transaction_pool| { - let select_chain = select_chain - .take() - .ok_or_else(|| substrate_service::Error::SelectChainRequired)?; - let (grandpa_block_import, grandpa_link) = - grandpa::block_import::<_, _, _, node_runtime::RuntimeApi, _>( - client.clone(), - &*client, - select_chain, - )?; - let justification_import = grandpa_block_import.clone(); - - let (block_import, babe_link) = babe::block_import( - babe::Config::get_or_compute(&*client)?, - grandpa_block_import, - client.clone(), - client.clone(), - )?; - - let import_queue = babe::import_queue( - babe_link.clone(), - block_import.clone(), - Some(Box::new(justification_import)), - None, - client.clone(), - client, - inherent_data_providers.clone(), - )?; - - import_setup = Some((block_import, grandpa_link, babe_link)); - Ok(import_queue) - })?; - // We don't have any custom rpc commands... - // .with_rpc_extensions(|client, pool| -> RpcExtension { - // node_rpc::create(client, pool) - // })?; - - (builder, import_setup, inherent_data_providers) - }}; + ($config:expr) => {{ + use std::sync::Arc; + + let mut import_setup = None; + let mut rpc_setup = None; + let inherent_data_providers = sp_inherents::InherentDataProviders::new(); + + let builder = sc_service::ServiceBuilder::new_full::< + Block, RuntimeApi, node_executor::Executor + >($config)? + .with_select_chain(|_config, backend| { + Ok(sc_consensus::LongestChain::new(backend.clone())) + })? + .with_transaction_pool(|builder| { + let pool_api = sc_transaction_pool::FullChainApi::new( + builder.client().clone(), + ); + let config = builder.config(); + + Ok(sc_transaction_pool::BasicPool::new( + config.transaction_pool.clone(), + std::sync::Arc::new(pool_api), + builder.prometheus_registry(), + )) + })? + .with_import_queue(| + _config, + client, + mut select_chain, + _transaction_pool, + spawn_task_handle, + prometheus_registry, + | { + let select_chain = select_chain.take() + .ok_or_else(|| sc_service::Error::SelectChainRequired)?; + let (grandpa_block_import, grandpa_link) = grandpa::block_import( + client.clone(), + &(client.clone() as Arc<_>), + select_chain, + )?; + let justification_import = grandpa_block_import.clone(); + + let (block_import, babe_link) = sc_consensus_babe::block_import( + sc_consensus_babe::Config::get_or_compute(&*client)?, + grandpa_block_import, + client.clone(), + )?; + + let import_queue = sc_consensus_babe::import_queue( + babe_link.clone(), + block_import.clone(), + Some(Box::new(justification_import)), + None, + client, + inherent_data_providers.clone(), + spawn_task_handle, + prometheus_registry, + )?; + + import_setup = Some((block_import, grandpa_link, babe_link)); + Ok(import_queue) + })? + .with_rpc_extensions_builder(|builder| { + let grandpa_link = import_setup.as_ref().map(|s| &s.1) + .expect("GRANDPA LinkHalf is present for full services or set up failed; qed."); + + let shared_authority_set = grandpa_link.shared_authority_set().clone(); + let shared_voter_state = grandpa::SharedVoterState::empty(); + + rpc_setup = Some((shared_voter_state.clone())); + + let babe_link = import_setup.as_ref().map(|s| &s.2) + .expect("BabeLink is present for full services or set up failed; qed."); + + let babe_config = babe_link.config().clone(); + let shared_epoch_changes = babe_link.epoch_changes().clone(); + + let client = builder.client().clone(); + let pool = builder.pool().clone(); + let select_chain = builder.select_chain().cloned() + .expect("SelectChain is present for full services or set up failed; qed."); + let keystore = builder.keystore().clone(); + + Ok(move |deny_unsafe| { + let deps = node_rpc::FullDeps { + client: client.clone(), + pool: pool.clone(), + select_chain: select_chain.clone(), + deny_unsafe, + babe: node_rpc::BabeDeps { + babe_config: babe_config.clone(), + shared_epoch_changes: shared_epoch_changes.clone(), + keystore: keystore.clone(), + }, + grandpa: node_rpc::GrandpaDeps { + shared_voter_state: shared_voter_state.clone(), + shared_authority_set: shared_authority_set.clone(), + }, + }; + + node_rpc::create_full(deps) + }) + })?; + + (builder, import_setup, inherent_data_providers, rpc_setup) + }} } /// Creates a full service from the configuration. @@ -126,58 +155,57 @@ macro_rules! new_full_start { /// concrete types instead. macro_rules! new_full { ($config:expr, $with_startup_data: expr) => {{ - use futures::sync::mpsc; - use network::DhtEvent; + use futures::prelude::*; + use sc_network::Event; + use sc_client_api::ExecutorProvider; + use sp_core::traits::BareCryptoStorePtr; let ( - is_authority, + role, force_authoring, name, - disable_grandpa + disable_grandpa, ) = ( - $config.roles.is_authority(), + $config.role.clone(), $config.force_authoring, - $config.name.clone(), - $config.disable_grandpa + $config.network.node_name.clone(), + $config.disable_grandpa, ); - // sentry nodes announce themselves as authorities to the network - // and should run the same protocols authorities do, but it should - // never actively participate in any consensus process. - let participates_in_consensus = is_authority && !$config.sentry_mode; - - let (builder, mut import_setup, inherent_data_providers) = new_full_start!($config); + let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) = + new_full_start!($config); - // Dht event channel from the network to the authority discovery module. Use bounded channel to ensure - // back-pressure. Authority discovery is triggering one event per authority within the current authority set. - // This estimates the authority set size to be somewhere below 10 000 thereby setting the channel buffer size to - // 10 000. - let (dht_event_tx, _dht_event_rx) = - mpsc::channel::(10_000); - - let service = builder.with_network_protocol(|_| Ok(crate::service::NodeProtocol::new()))? - .with_finality_proof_provider(|client, backend| - Ok(Arc::new(grandpa::FinalityProofProvider::new(backend, client)) as _) - )? - .with_dht_event_tx(dht_event_tx)? - .build()?; + let service = builder + .with_finality_proof_provider(|client, backend| { + // GenesisAuthoritySetProvider is implemented for StorageAndProofProvider + let provider = client as Arc>; + Ok(Arc::new(grandpa::FinalityProofProvider::new(backend, provider)) as _) + })? + .build_full()?; let (block_import, grandpa_link, babe_link) = import_setup.take() - .expect("Link Half and Block Import are present for Full Services or setup failed before. qed"); + .expect("Link Half and Block Import are present for Full Services or setup failed before. qed"); + + let shared_voter_state = rpc_setup.take() + .expect("The SharedVoterState is present for Full Services or setup failed before. qed"); ($with_startup_data)(&block_import, &babe_link); - if participates_in_consensus { - let proposer = substrate_basic_authorship::ProposerFactory { - client: service.client(), - transaction_pool: service.transaction_pool(), - }; + if let sc_service::config::Role::Authority { .. } = &role { + let proposer = sc_basic_authorship::ProposerFactory::new( + service.client(), + service.transaction_pool(), + service.prometheus_registry().as_ref(), + ); let client = service.client(); let select_chain = service.select_chain() - .ok_or(substrate_service::Error::SelectChainRequired)?; + .ok_or(sc_service::Error::SelectChainRequired)?; - let babe_config = babe::BabeParams { + let can_author_with = + sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()); + + let babe_config = sc_consensus_babe::BabeParams { keystore: service.keystore(), client, select_chain, @@ -187,62 +215,95 @@ macro_rules! new_full { inherent_data_providers: inherent_data_providers.clone(), force_authoring, babe_link, + can_author_with, + }; + + let babe = sc_consensus_babe::start_babe(babe_config)?; + service.spawn_essential_task_handle().spawn_blocking("babe-proposer", babe); + } + + // Spawn authority discovery module. + if matches!(role, sc_service::config::Role::Authority{..} | sc_service::config::Role::Sentry {..}) { + let (sentries, authority_discovery_role) = match role { + sc_service::config::Role::Authority { ref sentry_nodes } => ( + sentry_nodes.clone(), + sc_authority_discovery::Role::Authority ( + service.keystore(), + ), + ), + sc_service::config::Role::Sentry {..} => ( + vec![], + sc_authority_discovery::Role::Sentry, + ), + _ => unreachable!("Due to outer matches! constraint; qed.") }; - let babe = babe::start_babe(babe_config)?; - service.spawn_essential_task(babe); - } + let network = service.network(); + let dht_event_stream = network.event_stream("authority-discovery").filter_map(|e| async move { match e { + Event::Dht(e) => Some(e), + _ => None, + }}).boxed(); + let authority_discovery = sc_authority_discovery::AuthorityDiscovery::new( + service.client(), + network, + sentries, + dht_event_stream, + authority_discovery_role, + service.prometheus_registry(), + ); + + service.spawn_task_handle().spawn("authority-discovery", authority_discovery); + } - // if the node isn't actively participating in consensus then it doesn't + // if the node isn't actively participating in consensus then it doesn't // need a keystore, regardless of which protocol we use below. - let keystore = if participates_in_consensus { - Some(service.keystore()) + let keystore = if role.is_authority() { + Some(service.keystore() as BareCryptoStorePtr) } else { None - }; - - let config = grandpa::Config { - // FIXME #1578 make this available through chainspec - gossip_duration: std::time::Duration::from_millis(333), - justification_period: 512, - name: Some(name), - observer_enabled: true, - keystore, - is_authority, - }; - - match (is_authority, disable_grandpa) { - (false, false) => { - // start the lightweight GRANDPA observer - service.spawn_task(Box::new(grandpa::run_grandpa_observer( - config, - grandpa_link, - service.network(), - service.on_exit(), - )?)); - }, - (true, false) => { - // start the full GRANDPA voter - let grandpa_config = grandpa::GrandpaParams { - config, - link: grandpa_link, - network: service.network(), - inherent_data_providers: inherent_data_providers.clone(), - on_exit: service.on_exit(), - telemetry_on_connect: Some(service.telemetry_on_connect_stream()), - voting_rule: grandpa::VotingRulesBuilder::default().build(), - }; - // the GRANDPA voter task is considered infallible, i.e. - // if it fails we take down the service with it. - service.spawn_essential_task(grandpa::run_grandpa_voter(grandpa_config)?); - }, - (_, true) => { - grandpa::setup_disabled_grandpa( - service.client(), - &inherent_data_providers, - service.network(), - )?; - }, + }; + + let config = grandpa::Config { + // FIXME #1578 make this available through chainspec + gossip_duration: std::time::Duration::from_millis(333), + justification_period: 512, + name: Some(name), + observer_enabled: false, + keystore, + is_authority: role.is_network_authority(), + }; + + let enable_grandpa = !disable_grandpa; + if enable_grandpa { + // start the full GRANDPA voter + // NOTE: non-authorities could run the GRANDPA observer protocol, but at + // this point the full voter should provide better guarantees of block + // and vote data availability than the observer. The observer has not + // been tested extensively yet and having most nodes in a network run it + // could lead to finality stalls. + let grandpa_config = grandpa::GrandpaParams { + config, + link: grandpa_link, + network: service.network(), + inherent_data_providers: inherent_data_providers.clone(), + telemetry_on_connect: Some(service.telemetry_on_connect_stream()), + voting_rule: grandpa::VotingRulesBuilder::default().build(), + prometheus_registry: service.prometheus_registry(), + shared_voter_state, + }; + + // the GRANDPA voter task is considered infallible, i.e. + // if it fails we take down the service with it. + service.spawn_essential_task_handle().spawn_blocking( + "grandpa-voter", + grandpa::run_grandpa_voter(grandpa_config)? + ); + } else { + grandpa::setup_disabled_grandpa( + service.client(), + &inherent_data_providers, + service.network(), + )?; } Ok((service, inherent_data_providers)) @@ -252,106 +313,325 @@ macro_rules! new_full { }} } -#[allow(dead_code)] -type ConcreteBlock = node_runtime::opaque::Block; -#[allow(dead_code)] -type ConcreteClient = Client< - Backend, - LocalCallExecutor, NativeExecutor>, - ConcreteBlock, - node_runtime::RuntimeApi, ->; -#[allow(dead_code)] -type ConcreteBackend = Backend; - -/// A specialized configuration object for setting up the node.. -pub type NodeConfiguration = - Configuration; - /// Builds a new service for a full client. -pub fn new_full(config: NodeConfiguration) --> Result< - Service< - ConcreteBlock, - ConcreteClient, - LongestChain, - NetworkStatus, - NetworkService::Hash>, - TransactionPool>, - OffchainWorkers< - ConcreteClient, - >::OffchainStorage, - ConcreteBlock, - > - >, - ServiceError, -> +pub fn new_full(config: Configuration) + -> Result { - new_full!(config).map(|(service, _)| service) + new_full!(config).map(|(service, _)| service) } /// Builds a new service for a light client. -pub fn new_light( - config: NodeConfiguration, -) -> Result { - // type RpcExtension = jsonrpc_core::IoHandler; - let inherent_data_providers = InherentDataProviders::new(); - - let service = ServiceBuilder::new_light::(config)? - .with_select_chain(|_config, backend| Ok(LongestChain::new(backend.clone())))? - .with_transaction_pool(|config, client| { - Ok(TransactionPool::new( - config, - transaction_pool::FullChainApi::new(client), - )) - })? - .with_import_queue_and_fprb( - |_config, client, backend, fetcher, _select_chain, _tx_pool| { - let fetch_checker = fetcher - .map(|fetcher| fetcher.checker().clone()) - .ok_or_else(|| { - "Trying to start light import queue without active fetch checker" - })?; - let grandpa_block_import = grandpa::light_block_import::<_, _, _, RuntimeApi>( - client.clone(), - backend, - &*client, - Arc::new(fetch_checker), - )?; - - let finality_proof_import = grandpa_block_import.clone(); - let finality_proof_request_builder = - finality_proof_import.create_finality_proof_request_builder(); - - let (babe_block_import, babe_link) = babe::block_import( - babe::Config::get_or_compute(&*client)?, - grandpa_block_import, - client.clone(), - client.clone(), - )?; - - let import_queue = babe::import_queue( - babe_link, - babe_block_import, - None, - Some(Box::new(finality_proof_import)), - client.clone(), - client, - inherent_data_providers.clone(), - )?; - - Ok((import_queue, finality_proof_request_builder)) - }, - )? - .with_network_protocol(|_| Ok(NodeProtocol::new()))? - .with_finality_proof_provider(|client, backend| { - Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, client)) as _) - })? - // We don't have any custom rpc extensions - // .with_rpc_extensions(|client, pool| -> RpcExtension { - // node_rpc::create(client, pool) - // })? - .build()?; - - Ok(service) +pub fn new_light(config: Configuration) + -> Result { + let inherent_data_providers = InherentDataProviders::new(); + + let service = ServiceBuilder::new_light::(config)? + .with_select_chain(|_config, backend| { + Ok(LongestChain::new(backend.clone())) + })? + .with_transaction_pool(|builder| { + let fetcher = builder.fetcher() + .ok_or_else(|| "Trying to start light transaction pool without active fetcher")?; + let pool_api = sc_transaction_pool::LightChainApi::new( + builder.client().clone(), + fetcher, + ); + let pool = sc_transaction_pool::BasicPool::with_revalidation_type( + builder.config().transaction_pool.clone(), + Arc::new(pool_api), + builder.prometheus_registry(), + sc_transaction_pool::RevalidationType::Light, + ); + Ok(pool) + })? + .with_import_queue_and_fprb(| + _config, + client, + backend, + fetcher, + _select_chain, + _tx_pool, + spawn_task_handle, + registry, + | { + let fetch_checker = fetcher + .map(|fetcher| fetcher.checker().clone()) + .ok_or_else(|| "Trying to start light import queue without active fetch checker")?; + let grandpa_block_import = grandpa::light_block_import( + client.clone(), + backend, + &(client.clone() as Arc<_>), + Arc::new(fetch_checker), + )?; + + let finality_proof_import = grandpa_block_import.clone(); + let finality_proof_request_builder = + finality_proof_import.create_finality_proof_request_builder(); + + let (babe_block_import, babe_link) = sc_consensus_babe::block_import( + sc_consensus_babe::Config::get_or_compute(&*client)?, + grandpa_block_import, + client.clone(), + )?; + + let import_queue = sc_consensus_babe::import_queue( + babe_link, + babe_block_import, + None, + Some(Box::new(finality_proof_import)), + client, + inherent_data_providers.clone(), + spawn_task_handle, + registry, + )?; + + Ok((import_queue, finality_proof_request_builder)) + })? + .with_finality_proof_provider(|client, backend| { + // GenesisAuthoritySetProvider is implemented for StorageAndProofProvider + let provider = client as Arc>; + Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _) + })? + .with_rpc_extensions(|builder| { + let fetcher = builder.fetcher() + .ok_or_else(|| "Trying to start node RPC without active fetcher")?; + let remote_blockchain = builder.remote_backend() + .ok_or_else(|| "Trying to start node RPC without active remote blockchain")?; + + let light_deps = node_rpc::LightDeps { + remote_blockchain, + fetcher, + client: builder.client().clone(), + pool: builder.pool(), + }; + + Ok(node_rpc::create_light(light_deps)) + })? + .build_light()?; + + Ok(service) +} + +#[cfg(test)] +mod tests { + use std::{sync::Arc, borrow::Cow, any::Any}; + use sc_consensus_babe::{ + CompatibleDigestItem, BabeIntermediate, INTERMEDIATE_KEY + }; + use sc_consensus_epochs::descendent_query; + use sp_consensus::{ + Environment, Proposer, BlockImportParams, BlockOrigin, ForkChoiceStrategy, BlockImport, + RecordProof, + }; + use node_primitives::{Block, DigestItem, Signature}; + use node_runtime::{BalancesCall, Call, UncheckedExtrinsic, Address}; + use node_runtime::constants::{currency::CENTS, time::SLOT_DURATION}; + use codec::{Encode, Decode}; + use sp_core::{crypto::Pair as CryptoPair, H256}; + use sp_runtime::{ + generic::{BlockId, Era, Digest, SignedPayload}, + traits::{Block as BlockT, Header as HeaderT}, + traits::Verify, + OpaqueExtrinsic, + }; + use sp_timestamp; + use sp_finality_tracker; + use sp_keyring::AccountKeyring; + use sc_service::AbstractService; + use crate::service::{new_full, new_light}; + use sp_runtime::traits::IdentifyAccount; + use sp_transaction_pool::{MaintainedTransactionPool, ChainEvent}; + + type AccountPublic = ::Signer; + + #[test] + // It is "ignored", but the node-cli ignored tests are running on the CI. + // This can be run locally with `cargo test --release -p node-cli test_sync -- --ignored`. + #[ignore] + fn test_sync() { + let keystore_path = tempfile::tempdir().expect("Creates keystore path"); + let keystore = sc_keystore::Store::open(keystore_path.path(), None) + .expect("Creates keystore"); + let alice = keystore.write().insert_ephemeral_from_seed::("//Alice") + .expect("Creates authority pair"); + + let chain_spec = crate::chain_spec::tests::integration_test_config_with_single_authority(); + + // For the block factory + let mut slot_num = 1u64; + + // For the extrinsics factory + let bob = Arc::new(AccountKeyring::Bob.pair()); + let charlie = Arc::new(AccountKeyring::Charlie.pair()); + let mut index = 0; + + sc_service_test::sync( + chain_spec, + |config| { + let mut setup_handles = None; + new_full!(config, | + block_import: &sc_consensus_babe::BabeBlockImport, + babe_link: &sc_consensus_babe::BabeLink, + | { + setup_handles = Some((block_import.clone(), babe_link.clone())); + }).map(move |(node, x)| (node, (x, setup_handles.unwrap()))) + }, + |config| new_light(config), + |service, &mut (ref inherent_data_providers, (ref mut block_import, ref babe_link))| { + let mut inherent_data = inherent_data_providers + .create_inherent_data() + .expect("Creates inherent data."); + inherent_data.replace_data(sp_finality_tracker::INHERENT_IDENTIFIER, &1u64); + + let parent_id = BlockId::number(service.client().chain_info().best_number); + let parent_header = service.client().header(&parent_id).unwrap().unwrap(); + let parent_hash = parent_header.hash(); + let parent_number = *parent_header.number(); + + futures::executor::block_on( + service.transaction_pool().maintain( + ChainEvent::NewBlock { + is_new_best: true, + hash: parent_header.hash(), + tree_route: None, + header: parent_header.clone(), + }, + ) + ); + + let mut proposer_factory = sc_basic_authorship::ProposerFactory::new( + service.client(), + service.transaction_pool(), + None, + ); + + let epoch_descriptor = babe_link.epoch_changes().lock().epoch_descriptor_for_child_of( + descendent_query(&*service.client()), + &parent_hash, + parent_number, + slot_num, + ).unwrap().unwrap(); + + let mut digest = Digest::::default(); + + // even though there's only one authority some slots might be empty, + // so we must keep trying the next slots until we can claim one. + let babe_pre_digest = loop { + inherent_data.replace_data(sp_timestamp::INHERENT_IDENTIFIER, &(slot_num * SLOT_DURATION)); + if let Some(babe_pre_digest) = sc_consensus_babe::test_helpers::claim_slot( + slot_num, + &parent_header, + &*service.client(), + &keystore, + &babe_link, + ) { + break babe_pre_digest; + } + + slot_num += 1; + }; + + digest.push(::babe_pre_digest(babe_pre_digest)); + + let new_block = futures::executor::block_on(async move { + let proposer = proposer_factory.init(&parent_header).await; + proposer.unwrap().propose( + inherent_data, + digest, + std::time::Duration::from_secs(1), + RecordProof::Yes, + ).await + }).expect("Error making test block").block; + + let (new_header, new_body) = new_block.deconstruct(); + let pre_hash = new_header.hash(); + // sign the pre-sealed hash of the block and then + // add it to a digest item. + let to_sign = pre_hash.encode(); + let signature = alice.sign(&to_sign[..]); + let item = ::babe_seal( + signature.into(), + ); + slot_num += 1; + + let mut params = BlockImportParams::new(BlockOrigin::File, new_header); + params.post_digests.push(item); + params.body = Some(new_body); + params.intermediates.insert( + Cow::from(INTERMEDIATE_KEY), + Box::new(BabeIntermediate:: { epoch_descriptor }) as Box, + ); + params.fork_choice = Some(ForkChoiceStrategy::LongestChain); + + block_import.import_block(params, Default::default()) + .expect("error importing test block"); + }, + |service, _| { + let amount = 5 * CENTS; + let to: Address = AccountPublic::from(bob.public()).into_account().into(); + let from: Address = AccountPublic::from(charlie.public()).into_account().into(); + let genesis_hash = service.client().block_hash(0).unwrap().unwrap(); + let best_block_id = BlockId::number(service.client().chain_info().best_number); + let (spec_version, transaction_version) = { + let version = service.client().runtime_version_at(&best_block_id).unwrap(); + (version.spec_version, version.transaction_version) + }; + let signer = charlie.clone(); + + let function = Call::Balances(BalancesCall::transfer(to.into(), amount)); + + let check_spec_version = frame_system::CheckSpecVersion::new(); + let check_tx_version = frame_system::CheckTxVersion::new(); + let check_genesis = frame_system::CheckGenesis::new(); + let check_era = frame_system::CheckEra::from(Era::Immortal); + let check_nonce = frame_system::CheckNonce::from(index); + let check_weight = frame_system::CheckWeight::new(); + let payment = pallet_transaction_payment::ChargeTransactionPayment::from(0); + let validate_grandpa_equivocation = pallet_grandpa::ValidateEquivocationReport::new(); + let extra = ( + check_spec_version, + check_tx_version, + check_genesis, + check_era, + check_nonce, + check_weight, + payment, + validate_grandpa_equivocation, + ); + let raw_payload = SignedPayload::from_raw( + function, + extra, + (spec_version, transaction_version, genesis_hash, genesis_hash, (), (), (), ()) + ); + let signature = raw_payload.using_encoded(|payload| { + signer.sign(payload) + }); + let (function, extra, _) = raw_payload.deconstruct(); + let xt = UncheckedExtrinsic::new_signed( + function, + from.into(), + signature.into(), + extra, + ).encode(); + let v: Vec = Decode::decode(&mut xt.as_slice()).unwrap(); + + index += 1; + OpaqueExtrinsic(v) + }, + ); + } + + #[test] + #[ignore] + fn test_consensus() { + sc_service_test::consensus( + crate::chain_spec::tests::integration_test_config_with_two_authorities(), + |config| new_full(config), + |config| new_light(config), + vec![ + "//Alice".into(), + "//Bob".into(), + ], + ) + } } diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 6aabcf1749..52c711d4cb 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -25,7 +25,7 @@ sp-block-builder = { package = 'sp-block-builder', default-features = false, git sp-api = { package = 'sp-api', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} sp-version = { package = 'sp-version', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} sp-staking = { package = 'sp-staking', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} -node-primitives = { package = 'node-primitives', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} +sp-application-crypto = { package = 'sp-application-crypto', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} # Frame frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} @@ -52,6 +52,9 @@ pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git pallet-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} pallet-im-online = { package = 'pallet-im-online', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} pallet-collective = { package = 'pallet-collective', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} +pallet-contracts = { package = 'pallet-contracts', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} +pallet-contracts-rpc-runtime-api = { package = 'pallet-contracts-rpc-runtime-api', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} +pallet-contracts-primitives = { package = 'pallet-contracts-primitives', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} # Joystream common = { package = 'pallet-common', default-features = false, path = '../runtime-modules/common'} @@ -101,7 +104,7 @@ std = [ 'sp-block-builder/std', 'sp-session/std', 'sp-staking/std', - 'node-primitives/std', + 'sp-application-crypto/std', # Frame 'frame-support/std', @@ -128,6 +131,9 @@ std = [ 'pallet-im-online/std', 'pallet-collective/std', 'pallet-offences/std', + 'pallet-contracts/std', + 'pallet-contracts-rpc-runtime-api/std', + 'pallet-contracts-primitives/std', # Joystream 'common/std', diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index ffd592fb01..fe6bdf15c3 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -14,13 +14,14 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); mod integration; +mod primitives; mod migration; #[cfg(test)] mod tests; // Runtime integration tests use codec::Encode; use frame_support::inherent::{CheckInherentsResult, InherentData}; -use frame_support::traits::KeyOwnerProofSystem; +use frame_support::traits::{KeyOwnerProofSystem}; use frame_support::weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}, IdentityFee, Weight, @@ -38,103 +39,35 @@ use sp_core::crypto::KeyTypeId; use sp_core::OpaqueMetadata; use sp_runtime::curve::PiecewiseLinear; use sp_runtime::generic::SignedPayload; -use sp_runtime::traits::{ - BlakeTwo256, Block as BlockT, IdentifyAccount, NumberFor, Saturating, StaticLookup, Verify, +use sp_runtime::traits::{OpaqueKeys, + BlakeTwo256, Block as BlockT, NumberFor, Saturating, StaticLookup, }; use sp_runtime::transaction_validity::{TransactionSource, TransactionValidity}; -use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, ApplyExtrinsicResult, FixedPointNumber, - MultiSignature, Perbill, Perquintill, SaturatedConversion, -}; +use sp_runtime::{create_runtime_str, generic, impl_opaque_keys, ApplyExtrinsicResult, FixedPointNumber, Perbill, Perquintill, SaturatedConversion}; use sp_std::boxed::Box; use sp_std::vec::Vec; #[cfg(feature = "std")] use sp_version::NativeVersion; use sp_version::RuntimeVersion; use system::EnsureRoot; +use pallet_contracts_rpc_runtime_api::ContractExecResult; use integration::proposals::{CouncilManager, ExtrinsicProposalEncoder, MembershipOriginValidator}; +pub use primitives::*; use content_working_group as content_wg; use governance::{council, election}; use storage::{data_directory, data_object_storage_registry, data_object_type_registry}; -/// Priority for a transaction. Additive. Higher is better. -pub type TransactionPriority = u64; - -/// Alias for ContentId, used in various places. -pub type ContentId = sp_core::H256; - -/// An index to a block. -pub type BlockNumber = u32; - -/// Alias to 512-bit hash when used in the context of a transaction signature on the chain. -pub type Signature = MultiSignature; - -/// Some way of identifying an account on the chain. We intentionally make it equivalent -/// to the public key of our transaction signing scheme. -pub type AccountId = <::Signer as IdentifyAccount>::AccountId; - -/// The type for looking up accounts. We don't expect more than 4 billion of them, but you -/// never know... -pub type AccountIndex = u32; - -/// Balance of an account. -pub type Balance = u128; - -/// Index of a transaction in the chain. -pub type Index = u32; - -/// A hash of some data used by the chain. -pub type Hash = sp_core::H256; - -/// Moment type -pub type Moment = u64; - -/// Credential type -pub type Credential = u64; - -/// Represents a thread identifier for both Forum and Proposals Discussion -/// -/// Note: Both modules expose type names ThreadId and PostId (which are defined on their Trait) and -/// used in state storage and dispatchable method's argument types, -/// and are therefore part of the public API/metadata of the runtime. -/// In the current version the polkadot-js/api that is used and is compatible with the runtime, -/// the type registry has flat namespace and its not possible -/// to register identically named types from different modules, separately. And so we MUST configure -/// the underlying types to be identicaly to avoid issues with encoding/decoding these types on the client side. -pub type ThreadId = u64; - -/// Represents a post identifier for both Forum and Proposals Discussion -/// -/// See the Note about ThreadId -pub type PostId = u64; - -/// Represent an actor in membership group, which is the same in the working groups. -pub type ActorId = u64; - -/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know -/// the specifics of the runtime. They can then be made to be agnostic over specific formats -/// of data like extrinsics, allowing for them to continue syncing the network through upgrades -/// to even the core data structures. -pub mod opaque { - use super::*; - - pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; +// Node dependencies +pub use common; +pub use versioned_store; +pub use forum; +pub use working_group; +pub use governance::election_params::ElectionParameters; +pub use pallet_staking::StakerStatus; +pub use proposals_codex::ProposalsConfigParameters; - pub type Header = generic::Header; - pub type Block = generic::Block; - pub type BlockId = generic::BlockId; - pub type SessionHandlers = (Grandpa, Babe, ImOnline); - - impl_opaque_keys! { - pub struct SessionKeys { - pub grandpa: Grandpa, - pub babe: Babe, - pub im_online: ImOnline, - } - } -} /// This runtime version. pub const VERSION: RuntimeVersion = RuntimeVersion { @@ -258,7 +191,7 @@ impl pallet_grandpa::Trait for Runtime { type HandleEquivocation = pallet_grandpa::EquivocationHandler< Self::KeyOwnerIdentification, - node_primitives::report::ReporterAppCrypto, + primitives::report::ReporterAppCrypto, Runtime, Offences, >; @@ -366,9 +299,28 @@ parameter_types! { pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128); } +// type NegativeImbalance = >::NegativeImbalance; +// +// pub struct DealWithFees; +// impl OnUnbalanced for DealWithFees { +// fn on_unbalanceds(mut fees_then_tips: impl Iterator) { +// if let Some(fees) = fees_then_tips.next() { +// // // for fees, 80% to treasury, 20% to author +// // let mut split = fees.ration(80, 20); +// // if let Some(tips) = fees_then_tips.next() { +// // // for tips, if any, 80% to treasury, 20% to author (though this can be anything) +// // tips.ration_merge_into(80, 20, &mut split); +// // } +// // Treasury::on_unbalanced(split.0); +// // Author::on_unbalanced(split.1); +// } +// } +// } + + impl pallet_transaction_payment::Trait for Runtime { type Currency = Balances; - type OnTransactionPayment = (); + type OnTransactionPayment = (); // TODO: adjust fee type TransactionByteFee = TransactionByteFee; type WeightToFee = IdentityFee; // TODO: adjust weight type FeeMultiplierUpdate = @@ -391,16 +343,14 @@ impl pallet_authorship::Trait for Runtime { type EventHandler = Staking; } -type SessionHandlers = (Grandpa, Babe, ImOnline); - impl_opaque_keys! { - pub struct SessionKeys { - pub grandpa: Grandpa, - pub babe: Babe, - pub im_online: ImOnline, - } + pub struct SessionKeys { + pub grandpa: Grandpa, + pub babe: Babe, + pub im_online: ImOnline, + pub authority_discovery: AuthorityDiscovery, + } } - // NOTE: `SessionHandler` and `SessionKeys` are co-dependent: One key will be used for each handler. // The number and order of items in `SessionHandler` *MUST* be the same number and order of keys in // `SessionKeys`. @@ -417,7 +367,7 @@ impl pallet_session::Trait for Runtime { type ShouldEndSession = Babe; type NextSessionRotation = Babe; type SessionManager = pallet_session::historical::NoteHistoricalRoot; - type SessionHandler = SessionHandlers; + type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type DisabledValidatorsThreshold = DisabledValidatorsThreshold; } @@ -700,6 +650,49 @@ impl proposals_codex::Trait for Runtime { type ProposalEncoder = ExtrinsicProposalEncoder; } +parameter_types! { + pub const TombstoneDeposit: Balance = 1; // TODO: adjust fee + pub const RentByteFee: Balance = 1; // TODO: adjust fee + pub const RentDepositOffset: Balance = 0; // no rent deposit + pub const SurchargeReward: Balance = 0; // no reward +} + +impl pallet_contracts::Trait for Runtime { + type Time = Timestamp; + type Randomness = RandomnessCollectiveFlip; + type Currency = Balances; + type Event = Event; + type DetermineContractAddress = pallet_contracts::SimpleAddressDeterminer; + type TrieIdGenerator = pallet_contracts::TrieIdFromParentCounter; + type RentPayment = (); + type SignedClaimHandicap = pallet_contracts::DefaultSignedClaimHandicap; + type TombstoneDeposit = TombstoneDeposit; + type StorageSizeOffset = pallet_contracts::DefaultStorageSizeOffset; + type RentByteFee = RentByteFee; + type RentDepositOffset = RentDepositOffset; + type SurchargeReward = SurchargeReward; + type MaxDepth = pallet_contracts::DefaultMaxDepth; + type MaxValueSize = pallet_contracts::DefaultMaxValueSize; + type WeightPrice = pallet_transaction_payment::Module; +} + +/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know +/// the specifics of the runtime. They can then be made to be agnostic over specific formats +/// of data like extrinsics, allowing for them to continue syncing the network through upgrades +/// to even the core datastructures. +pub mod opaque { + use super::*; + + pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; + + /// Opaque block header type. + pub type Header = generic::Header; + /// Opaque block type. + pub type Block = generic::Block; + /// Opaque block identifier type. + pub type BlockId = generic::BlockId; +} + construct_runtime!( pub enum Runtime where Block = Block, @@ -724,6 +717,7 @@ construct_runtime!( Offences: pallet_offences::{Module, Call, Storage, Event}, RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage}, Sudo: pallet_sudo::{Module, Call, Config, Storage, Event}, + Contracts: pallet_contracts::{Module, Call, Config, Storage, Event}, // Joystream Migration: migration::{Module, Call, Storage, Event, Config}, CouncilElection: election::{Module, Call, Storage, Event, Config}, @@ -755,14 +749,6 @@ construct_runtime!( /// The address format for describing accounts. pub type Address = ::Source; -/// Block header type as expected by this runtime. -pub type Header = generic::Header; -/// Block type as expected by this runtime. -pub type Block = generic::Block; -/// A Block signed with a Justification -pub type SignedBlock = generic::SignedBlock; -/// BlockId type as expected by this runtime. -pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. pub type SignedExtra = ( system::CheckSpecVersion, @@ -775,11 +761,24 @@ pub type SignedExtra = ( pallet_grandpa::ValidateEquivocationReport, ); +/// Block header type as expected by this runtime. +pub type Header = generic::Header; + +/// Block type as expected by this runtime. +pub type Block = generic::Block; + +/// A Block signed with a Justification +pub type SignedBlock = generic::SignedBlock; + +/// BlockId type as expected by this runtime. +pub type BlockId = generic::BlockId; + /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; + /// Executive: handles dispatch to the various modules. pub type Executive = - frame_executive::Executive, Runtime, AllModules>; +frame_executive::Executive, Runtime, AllModules>; impl_runtime_apis! { impl sp_api::Core for Runtime { @@ -905,6 +904,53 @@ impl_runtime_apis! { } } + + impl pallet_contracts_rpc_runtime_api::ContractsApi + for Runtime + { + fn call( + origin: AccountId, + dest: AccountId, + value: Balance, + gas_limit: u64, + input_data: Vec, + ) -> ContractExecResult { + let exec_result = + Contracts::bare_call(origin, dest, value, gas_limit, input_data); + match exec_result { + Ok(v) => ContractExecResult::Success { + status: v.status, + data: v.data, + }, + Err(_) => ContractExecResult::Error, + } + } + + fn get_storage( + address: AccountId, + key: [u8; 32], + ) -> pallet_contracts_primitives::GetStorageResult { + Contracts::get_storage(address, key) + } + + fn rent_projection( + address: AccountId, + ) -> pallet_contracts_primitives::RentProjectionResult { + Contracts::rent_projection(address) + } + } + + + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< + Block, + Balance, + UncheckedExtrinsic, + > for Runtime { + fn query_info(uxt: UncheckedExtrinsic, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_info(uxt, len) + } + } + impl sp_session::SessionKeys for Runtime { fn generate_session_keys(seed: Option>) -> Vec { SessionKeys::generate(seed) @@ -915,14 +961,4 @@ impl_runtime_apis! { SessionKeys::decode_into_raw_public_keys(&encoded) } } - - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< - Block, - Balance, - UncheckedExtrinsic, - > for Runtime { - fn query_info(uxt: UncheckedExtrinsic, len: u32) -> RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) - } - } } diff --git a/runtime/src/primitives.rs b/runtime/src/primitives.rs new file mode 100644 index 0000000000..0f837498bf --- /dev/null +++ b/runtime/src/primitives.rs @@ -0,0 +1,92 @@ +//! Low-level types used throughout the Substrate code. + +#![warn(missing_docs)] + +#![cfg_attr(not(feature = "std"), no_std)] + +use sp_runtime::{traits::{Verify, IdentifyAccount}, MultiSignature}; + +/// Priority for a transaction. Additive. Higher is better. +pub type TransactionPriority = u64; + +/// Alias for ContentId, used in various places. +pub type ContentId = sp_core::H256; + +/// An index to a block. +pub type BlockNumber = u32; + +/// Alias to 512-bit hash when used in the context of a transaction signature on the chain. +pub type Signature = MultiSignature; + +/// Some way of identifying an account on the chain. We intentionally make it equivalent +/// to the public key of our transaction signing scheme. +pub type AccountId = <::Signer as IdentifyAccount>::AccountId; + +/// The type for looking up accounts. We don't expect more than 4 billion of them, but you +/// never know... +pub type AccountIndex = u32; + +/// Balance of an account. +pub type Balance = u128; + +/// Index of a transaction in the chain. +pub type Index = u32; + +/// A hash of some data used by the chain. +pub type Hash = sp_core::H256; + +/// Moment type +pub type Moment = u64; + +/// Credential type +pub type Credential = u64; + +/// Represents a thread identifier for both Forum and Proposals Discussion +/// +/// Note: Both modules expose type names ThreadId and PostId (which are defined on their Trait) and +/// used in state storage and dispatchable method's argument types, +/// and are therefore part of the public API/metadata of the runtime. +/// In the current version the polkadot-js/api that is used and is compatible with the runtime, +/// the type registry has flat namespace and its not possible +/// to register identically named types from different modules, separately. And so we MUST configure +/// the underlying types to be identicaly to avoid issues with encoding/decoding these types on the client side. +pub type ThreadId = u64; + +/// Represents a post identifier for both Forum and Proposals Discussion +/// +/// See the Note about ThreadId +pub type PostId = u64; + +/// Represent an actor in membership group, which is the same in the working groups. +pub type ActorId = u64; + +/// App-specific crypto used for reporting equivocation/misbehavior in BABE and +/// GRANDPA. Any rewards for misbehavior reporting will be paid out to this +/// account. +pub mod report { + use super::{Signature, Verify}; + use system::offchain::AppCrypto; + use sp_core::crypto::{key_types, KeyTypeId}; + + /// Key type for the reporting module. Used for reporting BABE and GRANDPA + /// equivocations. + pub const KEY_TYPE: KeyTypeId = key_types::REPORTING; + + mod app { + use sp_application_crypto::{app_crypto, sr25519}; + app_crypto!(sr25519, super::KEY_TYPE); + } + + /// Identity of the equivocation/misbehavior reporter. + pub type ReporterId = app::Public; + + /// An `AppCrypto` type to allow submitting signed transactions using the reporting + /// application key as signer. + pub struct ReporterAppCrypto; + + impl AppCrypto<::Signer, Signature> for ReporterAppCrypto { + type RuntimeAppPublic = ReporterId; + type GenericSignature = sp_core::sr25519::Signature; + type GenericPublic = sp_core::sr25519::Public; + } +} From 13664bb7a1c0c2267195f6abdae8f84b3b2e7056 Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Tue, 4 Aug 2020 11:55:55 +0300 Subject: [PATCH 2/6] node: Fix node tests. --- Cargo.lock | 136 ++++++ node/Cargo.toml | 13 + node/bin/main.rs | 2 +- node/src/chain_spec.rs | 114 ++++- node/src/cli.rs | 4 +- node/src/command.rs | 146 +++---- node/src/lib.rs | 2 +- node/src/node_executor.rs | 8 +- node/src/node_rpc.rs | 256 ++++++----- node/src/service.rs | 876 ++++++++++++++++++++------------------ runtime/src/constants.rs | 49 +++ runtime/src/lib.rs | 209 ++++----- runtime/src/primitives.rs | 55 +-- 13 files changed, 1067 insertions(+), 803 deletions(-) create mode 100644 runtime/src/constants.rs diff --git a/Cargo.lock b/Cargo.lock index dc44112197..4c5e5449b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1985,6 +1985,7 @@ dependencies = [ "sc-rpc", "sc-rpc-api", "sc-service", + "sc-service-test", "sc-telemetry", "sc-tracing", "sc-transaction-pool", @@ -2008,6 +2009,7 @@ dependencies = [ "structopt", "substrate-browser-utils", "substrate-frame-rpc-system", + "tempfile", "tokio 0.1.22", "tracing", "vergen", @@ -5633,6 +5635,43 @@ dependencies = [ "wasm-timer", ] +[[package]] +name = "sc-service-test" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "env_logger", + "fdlimit", + "futures 0.1.29", + "futures 0.3.4", + "hex-literal", + "log", + "parity-scale-codec", + "parking_lot 0.10.2", + "sc-block-builder", + "sc-client-api", + "sc-client-db", + "sc-executor", + "sc-light", + "sc-network", + "sc-service", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-runtime", + "sp-state-machine", + "sp-storage", + "sp-transaction-pool", + "sp-trie", + "substrate-test-runtime", + "substrate-test-runtime-client", + "tempfile", + "tokio 0.1.22", +] + [[package]] name = "sc-state-db" version = "0.8.0-rc4" @@ -6198,6 +6237,20 @@ dependencies = [ "wasm-timer", ] +[[package]] +name = "sp-consensus-aura" +version = "0.8.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-application-crypto", + "sp-inherents", + "sp-runtime", + "sp-std", + "sp-timestamp", +] + [[package]] name = "sp-consensus-babe" version = "0.8.0-rc4" @@ -6814,6 +6867,89 @@ dependencies = [ "tokio 0.2.22", ] +[[package]] +name = "substrate-test-client" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "futures 0.3.4", + "hash-db", + "parity-scale-codec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-executor", + "sc-light", + "sc-service", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-keyring", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "substrate-test-runtime" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "cfg-if", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-rpc-runtime-api", + "log", + "memory-db", + "pallet-babe", + "pallet-timestamp", + "parity-scale-codec", + "parity-util-mem", + "sc-service", + "serde", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-core", + "sp-finality-grandpa", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-offchain", + "sp-runtime", + "sp-runtime-interface", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-trie", + "sp-version", + "substrate-wasm-builder-runner", + "trie-db", +] + +[[package]] +name = "substrate-test-runtime-client" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "futures 0.3.4", + "parity-scale-codec", + "sc-block-builder", + "sc-client-api", + "sc-consensus", + "sc-light", + "sc-service", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "substrate-test-client", + "substrate-test-runtime", +] + [[package]] name = "substrate-wasm-builder-runner" version = "1.0.6" diff --git a/node/Cargo.toml b/node/Cargo.toml index ba720ac4ff..d0b2703216 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -127,6 +127,19 @@ wasm-bindgen = { version = "0.2.57", optional = true } wasm-bindgen-futures = { version = "0.4.7", optional = true } browser-utils = { package = 'substrate-browser-utils', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true} +[dev-dependencies] +#sc-keystore = { version = "2.0.0-rc4", path = "../../../client/keystore" } +#sc-consensus = { version = "0.8.0-rc4", path = "../../../client/consensus/common" } +sc-consensus-babe = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', features = ["test-helpers"]} +#sc-consensus-epochs = { version = "0.8.0-rc4", path = "../../../client/consensus/epochs" } +sc-service-test = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +#futures = "0.3.4" +tempfile = "3.1.0" +#assert_cmd = "1.0" +#nix = "0.17" +#serde_json = "1.0" +#regex = "1" +#platforms = "0.2.1" #[dependencies.substrate-basic-authorship] #git = 'https://github.com/paritytech/substrate.git' diff --git a/node/bin/main.rs b/node/bin/main.rs index 88b0057639..9298282e3a 100644 --- a/node/bin/main.rs +++ b/node/bin/main.rs @@ -20,4 +20,4 @@ fn main() -> sc_cli::Result<()> { joystream_node::command::run() -} \ No newline at end of file +} diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 685cfd52ca..e641b4ed8d 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -20,22 +20,22 @@ #![allow(clippy::identity_op)] use node_runtime::{AccountId, GenesisConfig}; -use sp_runtime::{Perbill}; -use sp_core::{Pair, Public, sr25519}; -use sp_runtime::traits::{IdentifyAccount, Verify}; -use sp_consensus_babe::AuthorityId as BabeId; -use sp_finality_grandpa::AuthorityId as GrandpaId; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; -use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use serde_json as json; +use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; +use sp_consensus_babe::AuthorityId as BabeId; +use sp_core::{sr25519, Pair, Public}; +use sp_finality_grandpa::AuthorityId as GrandpaId; +use sp_runtime::traits::{IdentifyAccount, Verify}; +use sp_runtime::Perbill; -use node_runtime::{ContractsConfig, +use node_runtime::{ versioned_store::InputValidationLengthConstraint as VsInputValidation, AuthorityDiscoveryConfig, BabeConfig, Balance, BalancesConfig, ContentWorkingGroupConfig, - CouncilConfig, CouncilElectionConfig, DataObjectStorageRegistryConfig, + ContractsConfig, CouncilConfig, CouncilElectionConfig, DataObjectStorageRegistryConfig, DataObjectTypeRegistryConfig, ElectionParameters, GrandpaConfig, ImOnlineConfig, IndicesConfig, - MembersConfig, MigrationConfig, ProposalsCodexConfig, SessionConfig, SessionKeys, - Signature, StakerStatus, StakingConfig, StorageWorkingGroupConfig, SudoConfig, SystemConfig, + MembersConfig, MigrationConfig, ProposalsCodexConfig, SessionConfig, SessionKeys, Signature, + StakerStatus, StakingConfig, StorageWorkingGroupConfig, SudoConfig, SystemConfig, VersionedStoreConfig, DAYS, WASM_BINARY, }; @@ -100,7 +100,12 @@ fn session_keys( im_online: ImOnlineId, authority_discovery: AuthorityDiscoveryId, ) -> SessionKeys { - SessionKeys { grandpa, babe, im_online, authority_discovery } + SessionKeys { + grandpa, + babe, + im_online, + authority_discovery, + } } impl Alternative { @@ -241,14 +246,16 @@ pub fn testnet_genesis( }), pallet_indices: Some(IndicesConfig { indices: vec![] }), pallet_session: Some(SessionConfig { - keys: initial_authorities.iter().map(|x| { - (x.0.clone(), x.0.clone(), session_keys( - x.2.clone(), - x.3.clone(), - x.4.clone(), - x.5.clone(), - )) - }).collect::>(), + keys: initial_authorities + .iter() + .map(|x| { + ( + x.0.clone(), + x.0.clone(), + session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone()), + ) + }) + .collect::>(), }), pallet_contracts: Some(ContractsConfig { current_schedule: pallet_contracts::Schedule { @@ -384,3 +391,72 @@ pub fn testnet_genesis( }), } } + +#[cfg(test)] +pub(crate) mod tests { + use super::*; + use crate::service::{new_full, new_light}; + use sc_service_test; + + fn local_testnet_genesis_instant_single() -> GenesisConfig { + testnet_genesis( + vec![get_authority_keys_from_seed("Alice")], + get_account_id_from_seed::("Alice"), + vec![get_authority_keys_from_seed("Alice").0], + ) + } + + /// Local testnet config (single validator - Alice) + pub fn integration_test_config_with_single_authority() -> ChainSpec { + ChainSpec::from_genesis( + "Integration Test", + "test", + ChainType::Development, + local_testnet_genesis_instant_single, + vec![], + None, + None, + None, + Default::default(), + ) + } + + fn local_testnet_genesis() -> GenesisConfig { + testnet_genesis( + vec![ + get_authority_keys_from_seed("Alice"), + get_authority_keys_from_seed("Bob"), + ], + get_account_id_from_seed::("Alice"), + vec![ + get_authority_keys_from_seed("Alice").0, + get_authority_keys_from_seed("Bob").0, + ], + ) + } + + /// Local testnet config (multivalidator Alice + Bob) + pub fn integration_test_config_with_two_authorities() -> ChainSpec { + ChainSpec::from_genesis( + "Integration Test", + "test", + ChainType::Development, + local_testnet_genesis, + vec![], + None, + None, + None, + Default::default(), + ) + } + + #[test] + #[ignore] + fn test_connectivity() { + sc_service_test::connectivity( + integration_test_config_with_two_authorities(), + |config| new_full(config), + |config| new_light(config), + ); + } +} diff --git a/node/src/cli.rs b/node/src/cli.rs index 2272180966..6acca3e920 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -37,8 +37,8 @@ pub enum Subcommand { /// The custom inspect subcommmand for decoding blocks and extrinsics. #[structopt( - name = "inspect", - about = "Decode given block or extrinsic using current native runtime." + name = "inspect", + about = "Decode given block or extrinsic using current native runtime." )] Inspect(node_inspect::cli::InspectCmd), diff --git a/node/src/command.rs b/node/src/command.rs index 0f4d3ec06d..2195aa6501 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -14,91 +14,87 @@ // You should have received a copy of the GNU General Public License // along with Joystream node. If not, see . -use crate::{chain_spec, service}; use crate::cli::{Cli, Subcommand}; -use crate::node_rpc; use crate::node_executor; +use crate::node_rpc; +use crate::{chain_spec, service}; use node_executor::Executor; use node_runtime::{opaque::Block, RuntimeApi}; use sc_cli::{Result, SubstrateCli}; -use sc_finality_grandpa::{ - self as grandpa, -}; +use sc_finality_grandpa::{self as grandpa}; impl SubstrateCli for Cli { - fn impl_name() -> &'static str { - "Joystream Node" - } - - fn impl_version() -> &'static str { - "3.0.0" - } - - fn description() -> &'static str { - "Joystream substrate node" - } - - fn author() -> &'static str { - "Joystream contributors" - } - - fn support_url() -> &'static str { - "https://www.joystream.org/" - } - - fn copyright_start_year() -> i32 { - 2019 - } - - fn executable_name() -> &'static str { - "joystream-node" - } - - fn load_spec(&self, id: &str) -> std::result::Result, String> { - Ok(match id { - "dev" => Box::new(chain_spec::Alternative::Development.load().unwrap()), //TODO - "local" => Box::new(chain_spec::Alternative::LocalTestnet.load().unwrap()), - path => Box::new(chain_spec::ChainSpec::from_json_file( - std::path::PathBuf::from(path), - )?), - }) - } + fn impl_name() -> &'static str { + "Joystream Node" + } + + fn impl_version() -> &'static str { + "3.0.0" + } + + fn description() -> &'static str { + "Joystream substrate node" + } + + fn author() -> &'static str { + "Joystream contributors" + } + + fn support_url() -> &'static str { + "https://www.joystream.org/" + } + + fn copyright_start_year() -> i32 { + 2019 + } + + fn executable_name() -> &'static str { + "joystream-node" + } + + fn load_spec(&self, id: &str) -> std::result::Result, String> { + Ok(match id { + "dev" => Box::new(chain_spec::Alternative::Development.load().unwrap()), //TODO + "local" => Box::new(chain_spec::Alternative::LocalTestnet.load().unwrap()), + path => Box::new(chain_spec::ChainSpec::from_json_file( + std::path::PathBuf::from(path), + )?), + }) + } } /// Parse command line arguments into service configuration. pub fn run() -> Result<()> { - let cli = Cli::from_args(); - - match &cli.subcommand { - None => { - let runner = cli.create_runner(&cli.run)?; - runner.run_node( - service::new_light, - service::new_full, - node_runtime::VERSION - ) - } - Some(Subcommand::Inspect(cmd)) => { - let runner = cli.create_runner(cmd)?; - - runner.sync_run(|config| cmd.run::(config)) - } - Some(Subcommand::Benchmark(cmd)) => { - if cfg!(feature = "runtime-benchmarks") { - let runner = cli.create_runner(cmd)?; - - runner.sync_run(|config| cmd.run::(config)) - } else { - println!("Benchmarking wasn't enabled when building the node. \ - You can enable it with `--features runtime-benchmarks`."); - Ok(()) - } - } - Some(Subcommand::Base(subcommand)) => { - let runner = cli.create_runner(subcommand)?; - - runner.run_subcommand(subcommand, |config| Ok(new_full_start!(config).0)) - } - } + let cli = Cli::from_args(); + + match &cli.subcommand { + None => { + let runner = cli.create_runner(&cli.run)?; + runner.run_node(service::new_light, service::new_full, node_runtime::VERSION) + } + Some(Subcommand::Inspect(cmd)) => { + let runner = cli.create_runner(cmd)?; + + runner.sync_run(|config| cmd.run::(config)) + } + Some(Subcommand::Benchmark(cmd)) => { + if cfg!(feature = "runtime-benchmarks") { + let runner = cli.create_runner(cmd)?; + + runner.sync_run(|config| cmd.run::(config)) + } else { + println!( + "Benchmarking wasn't enabled when building the node. \ + You can enable it with `--features runtime-benchmarks`." + ); + Ok(()) + } + } + Some(Subcommand::Base(subcommand)) => { + let runner = cli.create_runner(subcommand)?; + + runner.run_subcommand(subcommand, |config| Ok(new_full_start!(config).0)) + } + } } diff --git a/node/src/lib.rs b/node/src/lib.rs index 0f492584cd..8a77fe5cba 100644 --- a/node/src/lib.rs +++ b/node/src/lib.rs @@ -5,5 +5,5 @@ pub mod members_config; #[macro_use] pub mod service; pub mod command; -pub mod node_rpc; pub mod node_executor; +pub mod node_rpc; diff --git a/node/src/node_executor.rs b/node/src/node_executor.rs index ca414e130a..665ca94898 100644 --- a/node/src/node_executor.rs +++ b/node/src/node_executor.rs @@ -3,8 +3,8 @@ use sc_executor::native_executor_instance; // Declare an instance of the native executor named `Executor`. Include the wasm binary as the // equivalent wasm code. native_executor_instance!( - pub Executor, - node_runtime::api::dispatch, - node_runtime::native_version, - frame_benchmarking::benchmarking::HostFunctions, + pub Executor, + node_runtime::api::dispatch, + node_runtime::native_version, + frame_benchmarking::benchmarking::HostFunctions, ); diff --git a/node/src/node_rpc.rs b/node/src/node_rpc.rs index f384e3ed4b..5a6a055402 100644 --- a/node/src/node_rpc.rs +++ b/node/src/node_rpc.rs @@ -32,162 +32,160 @@ use std::sync::Arc; -use node_runtime::{opaque::Block, BlockNumber, AccountId, Index, Balance, Hash}; use node_runtime::UncheckedExtrinsic; -use sp_api::ProvideRuntimeApi; -use sp_transaction_pool::TransactionPool; -use sp_blockchain::{Error as BlockChainError, HeaderMetadata, HeaderBackend}; -use sp_consensus::SelectChain; -use sc_keystore::KeyStorePtr; -use sp_consensus_babe::BabeApi; -use sc_consensus_epochs::SharedEpochChanges; +use node_runtime::{opaque::Block, AccountId, Balance, BlockNumber, Hash, Index}; use sc_consensus_babe::{Config, Epoch}; use sc_consensus_babe_rpc::BabeRpcHandler; -use sc_finality_grandpa::{SharedVoterState, SharedAuthoritySet}; +use sc_consensus_epochs::SharedEpochChanges; +use sc_finality_grandpa::{SharedAuthoritySet, SharedVoterState}; use sc_finality_grandpa_rpc::GrandpaRpcHandler; +use sc_keystore::KeyStorePtr; use sc_rpc_api::DenyUnsafe; +use sp_api::ProvideRuntimeApi; use sp_block_builder::BlockBuilder; +use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; +use sp_consensus::SelectChain; +use sp_consensus_babe::BabeApi; +use sp_transaction_pool::TransactionPool; /// Light client extra dependencies. pub struct LightDeps { - /// The client instance to use. - pub client: Arc, - /// Transaction pool instance. - pub pool: Arc

, - /// Remote access to the blockchain (async). - pub remote_blockchain: Arc>, - /// Fetcher instance. - pub fetcher: Arc, + /// The client instance to use. + pub client: Arc, + /// Transaction pool instance. + pub pool: Arc

, + /// Remote access to the blockchain (async). + pub remote_blockchain: Arc>, + /// Fetcher instance. + pub fetcher: Arc, } /// Extra dependencies for BABE. pub struct BabeDeps { - /// BABE protocol config. - pub babe_config: Config, - /// BABE pending epoch changes. - pub shared_epoch_changes: SharedEpochChanges, - /// The keystore that manages the keys of the node. - pub keystore: KeyStorePtr, + /// BABE protocol config. + pub babe_config: Config, + /// BABE pending epoch changes. + pub shared_epoch_changes: SharedEpochChanges, + /// The keystore that manages the keys of the node. + pub keystore: KeyStorePtr, } /// Extra dependencies for GRANDPA pub struct GrandpaDeps { - /// Voting round info. - pub shared_voter_state: SharedVoterState, - /// Authority set info. - pub shared_authority_set: SharedAuthoritySet, + /// Voting round info. + pub shared_voter_state: SharedVoterState, + /// Authority set info. + pub shared_authority_set: SharedAuthoritySet, } /// Full client dependencies. pub struct FullDeps { - /// The client instance to use. - pub client: Arc, - /// Transaction pool instance. - pub pool: Arc

, - /// The SelectChain Strategy - pub select_chain: SC, - /// Whether to deny unsafe calls - pub deny_unsafe: DenyUnsafe, - /// BABE specific dependencies. - pub babe: BabeDeps, - /// GRANDPA specific dependencies. - pub grandpa: GrandpaDeps, + /// The client instance to use. + pub client: Arc, + /// Transaction pool instance. + pub pool: Arc

, + /// The SelectChain Strategy + pub select_chain: SC, + /// Whether to deny unsafe calls + pub deny_unsafe: DenyUnsafe, + /// BABE specific dependencies. + pub babe: BabeDeps, + /// GRANDPA specific dependencies. + pub grandpa: GrandpaDeps, } /// Instantiate all Full RPC extensions. -pub fn create_full( - deps: FullDeps, -) -> jsonrpc_core::IoHandler where - C: ProvideRuntimeApi, - C: HeaderBackend + HeaderMetadata + 'static, - C: Send + Sync + 'static, - C::Api: substrate_frame_rpc_system::AccountNonceApi, - C::Api: pallet_contracts_rpc::ContractsRuntimeApi, - C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, - C::Api: BabeApi, - C::Api: BlockBuilder, - P: TransactionPool + 'static, - M: jsonrpc_core::Metadata + Default, - SC: SelectChain +'static, +pub fn create_full(deps: FullDeps) -> jsonrpc_core::IoHandler +where + C: ProvideRuntimeApi, + C: HeaderBackend + HeaderMetadata + 'static, + C: Send + Sync + 'static, + C::Api: substrate_frame_rpc_system::AccountNonceApi, + C::Api: pallet_contracts_rpc::ContractsRuntimeApi, + C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi< + Block, + Balance, + UncheckedExtrinsic, + >, + C::Api: BabeApi, + C::Api: BlockBuilder, + P: TransactionPool + 'static, + M: jsonrpc_core::Metadata + Default, + SC: SelectChain + 'static, { - use substrate_frame_rpc_system::{FullSystem, SystemApi}; - use pallet_contracts_rpc::{Contracts, ContractsApi}; - use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; - - let mut io = jsonrpc_core::IoHandler::default(); - let FullDeps { - client, - pool, - select_chain, - deny_unsafe, - babe, - grandpa, - } = deps; - let BabeDeps { - keystore, - babe_config, - shared_epoch_changes, - } = babe; - let GrandpaDeps { - shared_voter_state, - shared_authority_set, - } = grandpa; - - io.extend_with( - SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe)) - ); - // Making synchronous calls in light client freezes the browser currently, - // more context: https://github.com/paritytech/substrate/pull/3480 - // These RPCs should use an asynchronous caller instead. - io.extend_with( - ContractsApi::to_delegate(Contracts::new(client.clone())) - ); - io.extend_with( - TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone())) - ); - io.extend_with( - sc_consensus_babe_rpc::BabeApi::to_delegate( - BabeRpcHandler::new( - client, - shared_epoch_changes, - keystore, - babe_config, - select_chain, - deny_unsafe, - ), - ) - ); - io.extend_with( - sc_finality_grandpa_rpc::GrandpaApi::to_delegate( - GrandpaRpcHandler::new(shared_authority_set, shared_voter_state) - ) - ); - - io + use pallet_contracts_rpc::{Contracts, ContractsApi}; + use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; + use substrate_frame_rpc_system::{FullSystem, SystemApi}; + + let mut io = jsonrpc_core::IoHandler::default(); + let FullDeps { + client, + pool, + select_chain, + deny_unsafe, + babe, + grandpa, + } = deps; + let BabeDeps { + keystore, + babe_config, + shared_epoch_changes, + } = babe; + let GrandpaDeps { + shared_voter_state, + shared_authority_set, + } = grandpa; + + io.extend_with(SystemApi::to_delegate(FullSystem::new( + client.clone(), + pool, + deny_unsafe, + ))); + // Making synchronous calls in light client freezes the browser currently, + // more context: https://github.com/paritytech/substrate/pull/3480 + // These RPCs should use an asynchronous caller instead. + io.extend_with(ContractsApi::to_delegate(Contracts::new(client.clone()))); + io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new( + client.clone(), + ))); + io.extend_with(sc_consensus_babe_rpc::BabeApi::to_delegate( + BabeRpcHandler::new( + client, + shared_epoch_changes, + keystore, + babe_config, + select_chain, + deny_unsafe, + ), + )); + io.extend_with(sc_finality_grandpa_rpc::GrandpaApi::to_delegate( + GrandpaRpcHandler::new(shared_authority_set, shared_voter_state), + )); + + io } /// Instantiate all Light RPC extensions. -pub fn create_light( - deps: LightDeps, -) -> jsonrpc_core::IoHandler where - C: sp_blockchain::HeaderBackend, - C: Send + Sync + 'static, - F: sc_client_api::light::Fetcher + 'static, - P: TransactionPool + 'static, - M: jsonrpc_core::Metadata + Default, +pub fn create_light(deps: LightDeps) -> jsonrpc_core::IoHandler +where + C: sp_blockchain::HeaderBackend, + C: Send + Sync + 'static, + F: sc_client_api::light::Fetcher + 'static, + P: TransactionPool + 'static, + M: jsonrpc_core::Metadata + Default, { - use substrate_frame_rpc_system::{LightSystem, SystemApi}; - - let LightDeps { - client, - pool, - remote_blockchain, - fetcher - } = deps; - let mut io = jsonrpc_core::IoHandler::default(); - io.extend_with( - SystemApi::::to_delegate(LightSystem::new(client, remote_blockchain, fetcher, pool)) - ); - - io + use substrate_frame_rpc_system::{LightSystem, SystemApi}; + + let LightDeps { + client, + pool, + remote_blockchain, + fetcher, + } = deps; + let mut io = jsonrpc_core::IoHandler::default(); + io.extend_with(SystemApi::::to_delegate( + LightSystem::new(client, remote_blockchain, fetcher, pool), + )); + + io } diff --git a/node/src/service.rs b/node/src/service.rs index 73abbddf95..9a3f9f32ab 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -21,132 +21,137 @@ //! Service implementation. Specialized wrapper over substrate service. -use std::sync::Arc; -use sc_finality_grandpa::{ - self as grandpa, FinalityProofProvider as GrandpaFinalityProofProvider, StorageAndProofProvider, -}; use node_runtime::opaque::Block; use node_runtime::RuntimeApi; +use sc_consensus::LongestChain; +use sc_finality_grandpa::{ + self as grandpa, FinalityProofProvider as GrandpaFinalityProofProvider, StorageAndProofProvider, +}; use sc_service::{ - AbstractService, ServiceBuilder, config::Configuration, error::{Error as ServiceError}, + config::Configuration, error::Error as ServiceError, AbstractService, ServiceBuilder, }; use sp_inherents::InherentDataProviders; -use sc_consensus::LongestChain; +use std::sync::Arc; -use crate::node_rpc; use crate::node_executor; +use crate::node_rpc; /// Starts a `ServiceBuilder` for a full service. /// /// Use this macro if you don't actually need the full service, but just the builder in order to /// be able to perform chain operations. macro_rules! new_full_start { - ($config:expr) => {{ - use std::sync::Arc; - - let mut import_setup = None; - let mut rpc_setup = None; - let inherent_data_providers = sp_inherents::InherentDataProviders::new(); - - let builder = sc_service::ServiceBuilder::new_full::< - Block, RuntimeApi, node_executor::Executor - >($config)? - .with_select_chain(|_config, backend| { - Ok(sc_consensus::LongestChain::new(backend.clone())) - })? - .with_transaction_pool(|builder| { - let pool_api = sc_transaction_pool::FullChainApi::new( - builder.client().clone(), - ); - let config = builder.config(); - - Ok(sc_transaction_pool::BasicPool::new( - config.transaction_pool.clone(), - std::sync::Arc::new(pool_api), - builder.prometheus_registry(), - )) - })? - .with_import_queue(| - _config, - client, - mut select_chain, - _transaction_pool, - spawn_task_handle, - prometheus_registry, - | { - let select_chain = select_chain.take() - .ok_or_else(|| sc_service::Error::SelectChainRequired)?; - let (grandpa_block_import, grandpa_link) = grandpa::block_import( - client.clone(), - &(client.clone() as Arc<_>), - select_chain, - )?; - let justification_import = grandpa_block_import.clone(); - - let (block_import, babe_link) = sc_consensus_babe::block_import( - sc_consensus_babe::Config::get_or_compute(&*client)?, - grandpa_block_import, - client.clone(), - )?; - - let import_queue = sc_consensus_babe::import_queue( - babe_link.clone(), - block_import.clone(), - Some(Box::new(justification_import)), - None, - client, - inherent_data_providers.clone(), - spawn_task_handle, - prometheus_registry, - )?; - - import_setup = Some((block_import, grandpa_link, babe_link)); - Ok(import_queue) - })? - .with_rpc_extensions_builder(|builder| { - let grandpa_link = import_setup.as_ref().map(|s| &s.1) - .expect("GRANDPA LinkHalf is present for full services or set up failed; qed."); - - let shared_authority_set = grandpa_link.shared_authority_set().clone(); - let shared_voter_state = grandpa::SharedVoterState::empty(); - - rpc_setup = Some((shared_voter_state.clone())); - - let babe_link = import_setup.as_ref().map(|s| &s.2) - .expect("BabeLink is present for full services or set up failed; qed."); - - let babe_config = babe_link.config().clone(); - let shared_epoch_changes = babe_link.epoch_changes().clone(); - - let client = builder.client().clone(); - let pool = builder.pool().clone(); - let select_chain = builder.select_chain().cloned() - .expect("SelectChain is present for full services or set up failed; qed."); - let keystore = builder.keystore().clone(); - - Ok(move |deny_unsafe| { - let deps = node_rpc::FullDeps { - client: client.clone(), - pool: pool.clone(), - select_chain: select_chain.clone(), - deny_unsafe, - babe: node_rpc::BabeDeps { - babe_config: babe_config.clone(), - shared_epoch_changes: shared_epoch_changes.clone(), - keystore: keystore.clone(), - }, - grandpa: node_rpc::GrandpaDeps { - shared_voter_state: shared_voter_state.clone(), - shared_authority_set: shared_authority_set.clone(), - }, - }; - - node_rpc::create_full(deps) - }) - })?; - - (builder, import_setup, inherent_data_providers, rpc_setup) - }} + ($config:expr) => {{ + use std::sync::Arc; + + let mut import_setup = None; + let mut rpc_setup = None; + let inherent_data_providers = sp_inherents::InherentDataProviders::new(); + + let builder = sc_service::ServiceBuilder::new_full::< + Block, + RuntimeApi, + node_executor::Executor, + >($config)? + .with_select_chain(|_config, backend| Ok(sc_consensus::LongestChain::new(backend.clone())))? + .with_transaction_pool(|builder| { + let pool_api = sc_transaction_pool::FullChainApi::new(builder.client().clone()); + let config = builder.config(); + + Ok(sc_transaction_pool::BasicPool::new( + config.transaction_pool.clone(), + std::sync::Arc::new(pool_api), + builder.prometheus_registry(), + )) + })? + .with_import_queue( + |_config, + client, + mut select_chain, + _transaction_pool, + spawn_task_handle, + prometheus_registry| { + let select_chain = select_chain + .take() + .ok_or_else(|| sc_service::Error::SelectChainRequired)?; + let (grandpa_block_import, grandpa_link) = grandpa::block_import( + client.clone(), + &(client.clone() as Arc<_>), + select_chain, + )?; + let justification_import = grandpa_block_import.clone(); + + let (block_import, babe_link) = sc_consensus_babe::block_import( + sc_consensus_babe::Config::get_or_compute(&*client)?, + grandpa_block_import, + client.clone(), + )?; + + let import_queue = sc_consensus_babe::import_queue( + babe_link.clone(), + block_import.clone(), + Some(Box::new(justification_import)), + None, + client, + inherent_data_providers.clone(), + spawn_task_handle, + prometheus_registry, + )?; + + import_setup = Some((block_import, grandpa_link, babe_link)); + Ok(import_queue) + }, + )? + .with_rpc_extensions_builder(|builder| { + let grandpa_link = import_setup + .as_ref() + .map(|s| &s.1) + .expect("GRANDPA LinkHalf is present for full services or set up failed; qed."); + + let shared_authority_set = grandpa_link.shared_authority_set().clone(); + let shared_voter_state = grandpa::SharedVoterState::empty(); + + rpc_setup = Some((shared_voter_state.clone())); + + let babe_link = import_setup + .as_ref() + .map(|s| &s.2) + .expect("BabeLink is present for full services or set up failed; qed."); + + let babe_config = babe_link.config().clone(); + let shared_epoch_changes = babe_link.epoch_changes().clone(); + + let client = builder.client().clone(); + let pool = builder.pool().clone(); + let select_chain = builder + .select_chain() + .cloned() + .expect("SelectChain is present for full services or set up failed; qed."); + let keystore = builder.keystore().clone(); + + Ok(move |deny_unsafe| { + let deps = node_rpc::FullDeps { + client: client.clone(), + pool: pool.clone(), + select_chain: select_chain.clone(), + deny_unsafe, + babe: node_rpc::BabeDeps { + babe_config: babe_config.clone(), + shared_epoch_changes: shared_epoch_changes.clone(), + keystore: keystore.clone(), + }, + grandpa: node_rpc::GrandpaDeps { + shared_voter_state: shared_voter_state.clone(), + shared_authority_set: shared_authority_set.clone(), + }, + }; + + node_rpc::create_full(deps) + }) + })?; + + (builder, import_setup, inherent_data_providers, rpc_setup) + }}; } /// Creates a full service from the configuration. @@ -314,324 +319,343 @@ macro_rules! new_full { } /// Builds a new service for a full client. -pub fn new_full(config: Configuration) - -> Result -{ - new_full!(config).map(|(service, _)| service) +pub fn new_full(config: Configuration) -> Result { + new_full!(config).map(|(service, _)| service) } /// Builds a new service for a light client. -pub fn new_light(config: Configuration) - -> Result { - let inherent_data_providers = InherentDataProviders::new(); - - let service = ServiceBuilder::new_light::(config)? - .with_select_chain(|_config, backend| { - Ok(LongestChain::new(backend.clone())) - })? - .with_transaction_pool(|builder| { - let fetcher = builder.fetcher() - .ok_or_else(|| "Trying to start light transaction pool without active fetcher")?; - let pool_api = sc_transaction_pool::LightChainApi::new( - builder.client().clone(), - fetcher, - ); - let pool = sc_transaction_pool::BasicPool::with_revalidation_type( - builder.config().transaction_pool.clone(), - Arc::new(pool_api), - builder.prometheus_registry(), - sc_transaction_pool::RevalidationType::Light, - ); - Ok(pool) - })? - .with_import_queue_and_fprb(| - _config, - client, - backend, - fetcher, - _select_chain, - _tx_pool, - spawn_task_handle, - registry, - | { - let fetch_checker = fetcher - .map(|fetcher| fetcher.checker().clone()) - .ok_or_else(|| "Trying to start light import queue without active fetch checker")?; - let grandpa_block_import = grandpa::light_block_import( - client.clone(), - backend, - &(client.clone() as Arc<_>), - Arc::new(fetch_checker), - )?; - - let finality_proof_import = grandpa_block_import.clone(); - let finality_proof_request_builder = - finality_proof_import.create_finality_proof_request_builder(); - - let (babe_block_import, babe_link) = sc_consensus_babe::block_import( - sc_consensus_babe::Config::get_or_compute(&*client)?, - grandpa_block_import, - client.clone(), - )?; - - let import_queue = sc_consensus_babe::import_queue( - babe_link, - babe_block_import, - None, - Some(Box::new(finality_proof_import)), - client, - inherent_data_providers.clone(), - spawn_task_handle, - registry, - )?; - - Ok((import_queue, finality_proof_request_builder)) - })? - .with_finality_proof_provider(|client, backend| { - // GenesisAuthoritySetProvider is implemented for StorageAndProofProvider - let provider = client as Arc>; - Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _) - })? - .with_rpc_extensions(|builder| { - let fetcher = builder.fetcher() - .ok_or_else(|| "Trying to start node RPC without active fetcher")?; - let remote_blockchain = builder.remote_backend() - .ok_or_else(|| "Trying to start node RPC without active remote blockchain")?; - - let light_deps = node_rpc::LightDeps { - remote_blockchain, - fetcher, - client: builder.client().clone(), - pool: builder.pool(), - }; - - Ok(node_rpc::create_light(light_deps)) - })? - .build_light()?; - - Ok(service) +pub fn new_light(config: Configuration) -> Result { + let inherent_data_providers = InherentDataProviders::new(); + + let service = ServiceBuilder::new_light::(config)? + .with_select_chain(|_config, backend| Ok(LongestChain::new(backend.clone())))? + .with_transaction_pool(|builder| { + let fetcher = builder + .fetcher() + .ok_or_else(|| "Trying to start light transaction pool without active fetcher")?; + let pool_api = + sc_transaction_pool::LightChainApi::new(builder.client().clone(), fetcher); + let pool = sc_transaction_pool::BasicPool::with_revalidation_type( + builder.config().transaction_pool.clone(), + Arc::new(pool_api), + builder.prometheus_registry(), + sc_transaction_pool::RevalidationType::Light, + ); + Ok(pool) + })? + .with_import_queue_and_fprb( + |_config, + client, + backend, + fetcher, + _select_chain, + _tx_pool, + spawn_task_handle, + registry| { + let fetch_checker = fetcher + .map(|fetcher| fetcher.checker().clone()) + .ok_or_else(|| { + "Trying to start light import queue without active fetch checker" + })?; + let grandpa_block_import = grandpa::light_block_import( + client.clone(), + backend, + &(client.clone() as Arc<_>), + Arc::new(fetch_checker), + )?; + + let finality_proof_import = grandpa_block_import.clone(); + let finality_proof_request_builder = + finality_proof_import.create_finality_proof_request_builder(); + + let (babe_block_import, babe_link) = sc_consensus_babe::block_import( + sc_consensus_babe::Config::get_or_compute(&*client)?, + grandpa_block_import, + client.clone(), + )?; + + let import_queue = sc_consensus_babe::import_queue( + babe_link, + babe_block_import, + None, + Some(Box::new(finality_proof_import)), + client, + inherent_data_providers.clone(), + spawn_task_handle, + registry, + )?; + + Ok((import_queue, finality_proof_request_builder)) + }, + )? + .with_finality_proof_provider(|client, backend| { + // GenesisAuthoritySetProvider is implemented for StorageAndProofProvider + let provider = client as Arc>; + Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _) + })? + .with_rpc_extensions(|builder| { + let fetcher = builder + .fetcher() + .ok_or_else(|| "Trying to start node RPC without active fetcher")?; + let remote_blockchain = builder + .remote_backend() + .ok_or_else(|| "Trying to start node RPC without active remote blockchain")?; + + let light_deps = node_rpc::LightDeps { + remote_blockchain, + fetcher, + client: builder.client().clone(), + pool: builder.pool(), + }; + + Ok(node_rpc::create_light(light_deps)) + })? + .build_light()?; + + Ok(service) } #[cfg(test)] mod tests { - use std::{sync::Arc, borrow::Cow, any::Any}; - use sc_consensus_babe::{ - CompatibleDigestItem, BabeIntermediate, INTERMEDIATE_KEY - }; - use sc_consensus_epochs::descendent_query; - use sp_consensus::{ - Environment, Proposer, BlockImportParams, BlockOrigin, ForkChoiceStrategy, BlockImport, - RecordProof, - }; - use node_primitives::{Block, DigestItem, Signature}; - use node_runtime::{BalancesCall, Call, UncheckedExtrinsic, Address}; - use node_runtime::constants::{currency::CENTS, time::SLOT_DURATION}; - use codec::{Encode, Decode}; - use sp_core::{crypto::Pair as CryptoPair, H256}; - use sp_runtime::{ - generic::{BlockId, Era, Digest, SignedPayload}, - traits::{Block as BlockT, Header as HeaderT}, - traits::Verify, - OpaqueExtrinsic, - }; - use sp_timestamp; - use sp_finality_tracker; - use sp_keyring::AccountKeyring; - use sc_service::AbstractService; - use crate::service::{new_full, new_light}; - use sp_runtime::traits::IdentifyAccount; - use sp_transaction_pool::{MaintainedTransactionPool, ChainEvent}; - - type AccountPublic = ::Signer; - - #[test] - // It is "ignored", but the node-cli ignored tests are running on the CI. - // This can be run locally with `cargo test --release -p node-cli test_sync -- --ignored`. - #[ignore] - fn test_sync() { - let keystore_path = tempfile::tempdir().expect("Creates keystore path"); - let keystore = sc_keystore::Store::open(keystore_path.path(), None) - .expect("Creates keystore"); - let alice = keystore.write().insert_ephemeral_from_seed::("//Alice") - .expect("Creates authority pair"); - - let chain_spec = crate::chain_spec::tests::integration_test_config_with_single_authority(); - - // For the block factory - let mut slot_num = 1u64; - - // For the extrinsics factory - let bob = Arc::new(AccountKeyring::Bob.pair()); - let charlie = Arc::new(AccountKeyring::Charlie.pair()); - let mut index = 0; - - sc_service_test::sync( - chain_spec, - |config| { - let mut setup_handles = None; - new_full!(config, | - block_import: &sc_consensus_babe::BabeBlockImport, - babe_link: &sc_consensus_babe::BabeLink, - | { - setup_handles = Some((block_import.clone(), babe_link.clone())); - }).map(move |(node, x)| (node, (x, setup_handles.unwrap()))) - }, - |config| new_light(config), - |service, &mut (ref inherent_data_providers, (ref mut block_import, ref babe_link))| { - let mut inherent_data = inherent_data_providers - .create_inherent_data() - .expect("Creates inherent data."); - inherent_data.replace_data(sp_finality_tracker::INHERENT_IDENTIFIER, &1u64); - - let parent_id = BlockId::number(service.client().chain_info().best_number); - let parent_header = service.client().header(&parent_id).unwrap().unwrap(); - let parent_hash = parent_header.hash(); - let parent_number = *parent_header.number(); - - futures::executor::block_on( - service.transaction_pool().maintain( - ChainEvent::NewBlock { - is_new_best: true, - hash: parent_header.hash(), - tree_route: None, - header: parent_header.clone(), - }, - ) - ); - - let mut proposer_factory = sc_basic_authorship::ProposerFactory::new( - service.client(), - service.transaction_pool(), - None, - ); - - let epoch_descriptor = babe_link.epoch_changes().lock().epoch_descriptor_for_child_of( - descendent_query(&*service.client()), - &parent_hash, - parent_number, - slot_num, - ).unwrap().unwrap(); - - let mut digest = Digest::::default(); - - // even though there's only one authority some slots might be empty, - // so we must keep trying the next slots until we can claim one. - let babe_pre_digest = loop { - inherent_data.replace_data(sp_timestamp::INHERENT_IDENTIFIER, &(slot_num * SLOT_DURATION)); - if let Some(babe_pre_digest) = sc_consensus_babe::test_helpers::claim_slot( - slot_num, - &parent_header, - &*service.client(), - &keystore, - &babe_link, - ) { - break babe_pre_digest; - } - - slot_num += 1; - }; - - digest.push(::babe_pre_digest(babe_pre_digest)); - - let new_block = futures::executor::block_on(async move { - let proposer = proposer_factory.init(&parent_header).await; - proposer.unwrap().propose( - inherent_data, - digest, - std::time::Duration::from_secs(1), - RecordProof::Yes, - ).await - }).expect("Error making test block").block; - - let (new_header, new_body) = new_block.deconstruct(); - let pre_hash = new_header.hash(); - // sign the pre-sealed hash of the block and then - // add it to a digest item. - let to_sign = pre_hash.encode(); - let signature = alice.sign(&to_sign[..]); - let item = ::babe_seal( - signature.into(), - ); - slot_num += 1; - - let mut params = BlockImportParams::new(BlockOrigin::File, new_header); - params.post_digests.push(item); - params.body = Some(new_body); - params.intermediates.insert( - Cow::from(INTERMEDIATE_KEY), - Box::new(BabeIntermediate:: { epoch_descriptor }) as Box, - ); - params.fork_choice = Some(ForkChoiceStrategy::LongestChain); - - block_import.import_block(params, Default::default()) - .expect("error importing test block"); - }, - |service, _| { - let amount = 5 * CENTS; - let to: Address = AccountPublic::from(bob.public()).into_account().into(); - let from: Address = AccountPublic::from(charlie.public()).into_account().into(); - let genesis_hash = service.client().block_hash(0).unwrap().unwrap(); - let best_block_id = BlockId::number(service.client().chain_info().best_number); - let (spec_version, transaction_version) = { - let version = service.client().runtime_version_at(&best_block_id).unwrap(); - (version.spec_version, version.transaction_version) - }; - let signer = charlie.clone(); - - let function = Call::Balances(BalancesCall::transfer(to.into(), amount)); - - let check_spec_version = frame_system::CheckSpecVersion::new(); - let check_tx_version = frame_system::CheckTxVersion::new(); - let check_genesis = frame_system::CheckGenesis::new(); - let check_era = frame_system::CheckEra::from(Era::Immortal); - let check_nonce = frame_system::CheckNonce::from(index); - let check_weight = frame_system::CheckWeight::new(); - let payment = pallet_transaction_payment::ChargeTransactionPayment::from(0); - let validate_grandpa_equivocation = pallet_grandpa::ValidateEquivocationReport::new(); - let extra = ( - check_spec_version, - check_tx_version, - check_genesis, - check_era, - check_nonce, - check_weight, - payment, - validate_grandpa_equivocation, - ); - let raw_payload = SignedPayload::from_raw( - function, - extra, - (spec_version, transaction_version, genesis_hash, genesis_hash, (), (), (), ()) - ); - let signature = raw_payload.using_encoded(|payload| { - signer.sign(payload) - }); - let (function, extra, _) = raw_payload.deconstruct(); - let xt = UncheckedExtrinsic::new_signed( - function, - from.into(), - signature.into(), - extra, - ).encode(); - let v: Vec = Decode::decode(&mut xt.as_slice()).unwrap(); - - index += 1; - OpaqueExtrinsic(v) - }, - ); - } - - #[test] - #[ignore] - fn test_consensus() { - sc_service_test::consensus( - crate::chain_spec::tests::integration_test_config_with_two_authorities(), - |config| new_full(config), - |config| new_light(config), - vec![ - "//Alice".into(), - "//Bob".into(), - ], - ) - } + use crate::node_executor; + use crate::node_rpc; + use crate::service::{new_full, new_light}; + use codec::{Decode, Encode}; + use node_runtime::RuntimeApi; + use node_runtime::{currency::CENTS, SLOT_DURATION}; + use node_runtime::{opaque::Block, DigestItem, Signature}; + use node_runtime::{Address, BalancesCall, Call, UncheckedExtrinsic}; + use sc_consensus_babe::{BabeIntermediate, CompatibleDigestItem, INTERMEDIATE_KEY}; + use sc_consensus_epochs::descendent_query; + use sc_finality_grandpa::{self as grandpa}; + use sc_service::AbstractService; + use sp_consensus::{ + BlockImport, BlockImportParams, BlockOrigin, Environment, ForkChoiceStrategy, Proposer, + RecordProof, + }; + use sp_core::{crypto::Pair as CryptoPair, H256}; + use sp_finality_tracker; + use sp_keyring::AccountKeyring; + use sp_runtime::traits::IdentifyAccount; + use sp_runtime::{ + generic::{BlockId, Digest, Era, SignedPayload}, + traits::Verify, + traits::{Block as BlockT, Header as HeaderT}, + OpaqueExtrinsic, + }; + use sp_timestamp; + use sp_transaction_pool::{ChainEvent, MaintainedTransactionPool}; + use std::{any::Any, borrow::Cow, sync::Arc}; + + type AccountPublic = ::Signer; + + // Long running test. Run it locally only after the node changes. + #[test] + // It is "ignored", but the node-cli ignored tests are running on the CI. + // This can be run locally with `cargo test --release -p node-cli test_sync -- --ignored`. + #[ignore] + fn test_sync() { + let keystore_path = tempfile::tempdir().expect("Creates keystore path"); + let keystore = + sc_keystore::Store::open(keystore_path.path(), None).expect("Creates keystore"); + let alice = keystore + .write() + .insert_ephemeral_from_seed::("//Alice") + .expect("Creates authority pair"); + + let chain_spec = crate::chain_spec::tests::integration_test_config_with_single_authority(); + + // For the block factory + let mut slot_num = 1u64; + + // For the extrinsics factory + let bob = Arc::new(AccountKeyring::Bob.pair()); + let charlie = Arc::new(AccountKeyring::Charlie.pair()); + let mut index = 0; + + sc_service_test::sync( + chain_spec, + |config| { + let mut setup_handles = None; + new_full!( + config, + |block_import: &sc_consensus_babe::BabeBlockImport, + babe_link: &sc_consensus_babe::BabeLink| { + setup_handles = Some((block_import.clone(), babe_link.clone())); + } + ) + .map(move |(node, x)| (node, (x, setup_handles.unwrap()))) + }, + |config| new_light(config), + |service, &mut (ref inherent_data_providers, (ref mut block_import, ref babe_link))| { + let mut inherent_data = inherent_data_providers + .create_inherent_data() + .expect("Creates inherent data."); + inherent_data.replace_data(sp_finality_tracker::INHERENT_IDENTIFIER, &1u64); + + let parent_id = BlockId::number(service.client().chain_info().best_number); + let parent_header = service.client().header(&parent_id).unwrap().unwrap(); + let parent_hash = parent_header.hash(); + let parent_number = *parent_header.number(); + + futures::executor::block_on(service.transaction_pool().maintain( + ChainEvent::NewBlock { + is_new_best: true, + hash: parent_header.hash(), + tree_route: None, + header: parent_header.clone(), + }, + )); + + let mut proposer_factory = sc_basic_authorship::ProposerFactory::new( + service.client(), + service.transaction_pool(), + None, + ); + + let epoch_descriptor = babe_link + .epoch_changes() + .lock() + .epoch_descriptor_for_child_of( + descendent_query(&*service.client()), + &parent_hash, + parent_number, + slot_num, + ) + .unwrap() + .unwrap(); + + let mut digest = Digest::::default(); + + // even though there's only one authority some slots might be empty, + // so we must keep trying the next slots until we can claim one. + let babe_pre_digest = loop { + inherent_data.replace_data( + sp_timestamp::INHERENT_IDENTIFIER, + &(slot_num * SLOT_DURATION), + ); + if let Some(babe_pre_digest) = sc_consensus_babe::test_helpers::claim_slot( + slot_num, + &parent_header, + &*service.client(), + &keystore, + &babe_link, + ) { + break babe_pre_digest; + } + + slot_num += 1; + }; + + digest.push(::babe_pre_digest( + babe_pre_digest, + )); + + let new_block = futures::executor::block_on(async move { + let proposer = proposer_factory.init(&parent_header).await; + proposer + .unwrap() + .propose( + inherent_data, + digest, + std::time::Duration::from_secs(1), + RecordProof::Yes, + ) + .await + }) + .expect("Error making test block") + .block; + + let (new_header, new_body) = new_block.deconstruct(); + let pre_hash = new_header.hash(); + // sign the pre-sealed hash of the block and then + // add it to a digest item. + let to_sign = pre_hash.encode(); + let signature = alice.sign(&to_sign[..]); + let item = ::babe_seal(signature.into()); + slot_num += 1; + + let mut params = BlockImportParams::new(BlockOrigin::File, new_header); + params.post_digests.push(item); + params.body = Some(new_body); + params.intermediates.insert( + Cow::from(INTERMEDIATE_KEY), + Box::new(BabeIntermediate:: { epoch_descriptor }) as Box, + ); + params.fork_choice = Some(ForkChoiceStrategy::LongestChain); + + block_import + .import_block(params, Default::default()) + .expect("error importing test block"); + }, + |service, _| { + let amount = 5 * CENTS; + let to: Address = AccountPublic::from(bob.public()).into_account().into(); + let from: Address = AccountPublic::from(charlie.public()).into_account().into(); + let genesis_hash = service.client().block_hash(0).unwrap().unwrap(); + let best_block_id = BlockId::number(service.client().chain_info().best_number); + let (spec_version, transaction_version) = { + let version = service.client().runtime_version_at(&best_block_id).unwrap(); + (version.spec_version, version.transaction_version) + }; + let signer = charlie.clone(); + + let function = Call::Balances(BalancesCall::transfer(to.into(), amount)); + + let check_spec_version = frame_system::CheckSpecVersion::new(); + let check_tx_version = frame_system::CheckTxVersion::new(); + let check_genesis = frame_system::CheckGenesis::new(); + let check_era = frame_system::CheckEra::from(Era::Immortal); + let check_nonce = frame_system::CheckNonce::from(index); + let check_weight = frame_system::CheckWeight::new(); + let payment = pallet_transaction_payment::ChargeTransactionPayment::from(0); + let validate_grandpa_equivocation = + pallet_grandpa::ValidateEquivocationReport::new(); + let extra = ( + check_spec_version, + check_tx_version, + check_genesis, + check_era, + check_nonce, + check_weight, + payment, + validate_grandpa_equivocation, + ); + let raw_payload = SignedPayload::from_raw( + function, + extra, + ( + spec_version, + transaction_version, + genesis_hash, + genesis_hash, + (), + (), + (), + (), + ), + ); + let signature = raw_payload.using_encoded(|payload| signer.sign(payload)); + let (function, extra, _) = raw_payload.deconstruct(); + let xt = + UncheckedExtrinsic::new_signed(function, from.into(), signature.into(), extra) + .encode(); + let v: Vec = Decode::decode(&mut xt.as_slice()).unwrap(); + + index += 1; + OpaqueExtrinsic(v) + }, + ); + } + + #[test] + #[ignore] + fn test_consensus() { + sc_service_test::consensus( + crate::chain_spec::tests::integration_test_config_with_two_authorities(), + |config| new_full(config), + |config| new_light(config), + vec!["//Alice".into(), "//Bob".into()], + ) + } } diff --git a/runtime/src/constants.rs b/runtime/src/constants.rs new file mode 100644 index 0000000000..b6c32ae829 --- /dev/null +++ b/runtime/src/constants.rs @@ -0,0 +1,49 @@ +use crate::{BlockNumber, Moment}; + +/// Constants for Babe. + +/// Since BABE is probabilistic this is the average expected block time that +/// we are targetting. Blocks will be produced at a minimum duration defined +/// by `SLOT_DURATION`, but some slots will not be allocated to any +/// authority and hence no block will be produced. We expect to have this +/// block time on average following the defined slot duration and the value +/// of `c` configured for BABE (where `1 - c` represents the probability of +/// a slot being empty). +/// This value is only used indirectly to define the unit constants below +/// that are expressed in blocks. The rest of the code should use +/// `SLOT_DURATION` instead (like the timestamp module for calculating the +/// minimum period). +/// +pub const MILLISECS_PER_BLOCK: Moment = 6000; +pub const SECS_PER_BLOCK: Moment = MILLISECS_PER_BLOCK / 1000; + +pub const SLOT_DURATION: Moment = 6000; + +pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10 * MINUTES; +pub const EPOCH_DURATION_IN_SLOTS: u64 = { + const SLOT_FILL_RATE: f64 = MILLISECS_PER_BLOCK as f64 / SLOT_DURATION as f64; + + (EPOCH_DURATION_IN_BLOCKS as f64 * SLOT_FILL_RATE) as u64 +}; + +// These time units are defined in number of blocks. +pub const MINUTES: BlockNumber = 60 / (SECS_PER_BLOCK as BlockNumber); +pub const HOURS: BlockNumber = MINUTES * 60; +pub const DAYS: BlockNumber = HOURS * 24; + +// 1 in 4 blocks (on average, not counting collisions) will be primary babe blocks. +pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4); + +/// Tests only +#[cfg(any(feature = "std", test))] +pub mod currency { + use crate::primitives::Balance; + + pub const MILLICENTS: Balance = 1_000_000_000; + pub const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent. + pub const DOLLARS: Balance = 100 * CENTS; + + pub const fn deposit(items: u32, bytes: u32) -> Balance { + items as Balance * 15 * CENTS + (bytes as Balance) * 6 * CENTS + } +} diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index fe6bdf15c3..ddb076cf3d 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -13,25 +13,27 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +mod constants; mod integration; -mod primitives; mod migration; +mod primitives; #[cfg(test)] mod tests; // Runtime integration tests use codec::Encode; use frame_support::inherent::{CheckInherentsResult, InherentData}; -use frame_support::traits::{KeyOwnerProofSystem}; +use frame_support::traits::KeyOwnerProofSystem; use frame_support::weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}, - IdentityFee, Weight, + Weight, WeightToFeeCoefficients, WeightToFeePolynomial, }; use frame_support::{construct_runtime, debug, parameter_types, traits::Randomness}; +use pallet_contracts_rpc_runtime_api::ContractExecResult; use pallet_grandpa::fg_primitives; use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList}; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use pallet_session::historical as pallet_session_historical; -use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; +use pallet_transaction_payment::Multiplier; use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; use sp_api::impl_runtime_apis; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; @@ -39,19 +41,22 @@ use sp_core::crypto::KeyTypeId; use sp_core::OpaqueMetadata; use sp_runtime::curve::PiecewiseLinear; use sp_runtime::generic::SignedPayload; -use sp_runtime::traits::{OpaqueKeys, - BlakeTwo256, Block as BlockT, NumberFor, Saturating, StaticLookup, +use sp_runtime::traits::{ + BlakeTwo256, Block as BlockT, NumberFor, OpaqueKeys, Saturating, StaticLookup, }; use sp_runtime::transaction_validity::{TransactionSource, TransactionValidity}; -use sp_runtime::{create_runtime_str, generic, impl_opaque_keys, ApplyExtrinsicResult, FixedPointNumber, Perbill, Perquintill, SaturatedConversion}; +use sp_runtime::{ + create_runtime_str, generic, impl_opaque_keys, ApplyExtrinsicResult, FixedPointNumber, Perbill, + Perquintill, SaturatedConversion, +}; use sp_std::boxed::Box; use sp_std::vec::Vec; #[cfg(feature = "std")] use sp_version::NativeVersion; use sp_version::RuntimeVersion; use system::EnsureRoot; -use pallet_contracts_rpc_runtime_api::ContractExecResult; +pub use constants::*; use integration::proposals::{CouncilManager, ExtrinsicProposalEncoder, MembershipOriginValidator}; pub use primitives::*; @@ -61,13 +66,12 @@ use storage::{data_directory, data_object_storage_registry, data_object_type_reg // Node dependencies pub use common; -pub use versioned_store; pub use forum; -pub use working_group; pub use governance::election_params::ElectionParameters; pub use pallet_staking::StakerStatus; pub use proposals_codex::ProposalsConfigParameters; - +pub use versioned_store; +pub use working_group; /// This runtime version. pub const VERSION: RuntimeVersion = RuntimeVersion { @@ -80,40 +84,6 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { transaction_version: 1, }; -/// Constants for Babe. - -/// Since BABE is probabilistic this is the average expected block time that -/// we are targetting. Blocks will be produced at a minimum duration defined -/// by `SLOT_DURATION`, but some slots will not be allocated to any -/// authority and hence no block will be produced. We expect to have this -/// block time on average following the defined slot duration and the value -/// of `c` configured for BABE (where `1 - c` represents the probability of -/// a slot being empty). -/// This value is only used indirectly to define the unit constants below -/// that are expressed in blocks. The rest of the code should use -/// `SLOT_DURATION` instead (like the timestamp module for calculating the -/// minimum period). -/// -pub const MILLISECS_PER_BLOCK: Moment = 6000; -pub const SECS_PER_BLOCK: Moment = MILLISECS_PER_BLOCK / 1000; - -pub const SLOT_DURATION: Moment = 6000; - -pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10 * MINUTES; -pub const EPOCH_DURATION_IN_SLOTS: u64 = { - const SLOT_FILL_RATE: f64 = MILLISECS_PER_BLOCK as f64 / SLOT_DURATION as f64; - - (EPOCH_DURATION_IN_BLOCKS as f64 * SLOT_FILL_RATE) as u64 -}; - -// These time units are defined in number of blocks. -pub const MINUTES: BlockNumber = 60 / (SECS_PER_BLOCK as BlockNumber); -pub const HOURS: BlockNumber = MINUTES * 60; -pub const DAYS: BlockNumber = HOURS * 24; - -// 1 in 4 blocks (on average, not counting collisions) will be primary babe blocks. -pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4); - /// The version information used to identify this runtime when compiled natively. #[cfg(feature = "std")] pub fn native_version() -> NativeVersion { @@ -293,38 +263,31 @@ impl pallet_balances::Trait for Runtime { } parameter_types! { - pub const TransactionByteFee: Balance = 1; // TODO: adjust fee + pub const TransactionByteFee: Balance = 0; // TODO: adjust fee pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25); pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(1, 100_000); pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128); } -// type NegativeImbalance = >::NegativeImbalance; -// -// pub struct DealWithFees; -// impl OnUnbalanced for DealWithFees { -// fn on_unbalanceds(mut fees_then_tips: impl Iterator) { -// if let Some(fees) = fees_then_tips.next() { -// // // for fees, 80% to treasury, 20% to author -// // let mut split = fees.ration(80, 20); -// // if let Some(tips) = fees_then_tips.next() { -// // // for tips, if any, 80% to treasury, 20% to author (though this can be anything) -// // tips.ration_merge_into(80, 20, &mut split); -// // } -// // Treasury::on_unbalanced(split.0); -// // Author::on_unbalanced(split.1); -// } -// } -// } - - impl pallet_transaction_payment::Trait for Runtime { type Currency = Balances; - type OnTransactionPayment = (); // TODO: adjust fee + type OnTransactionPayment = (); type TransactionByteFee = TransactionByteFee; - type WeightToFee = IdentityFee; // TODO: adjust weight - type FeeMultiplierUpdate = - TargetedFeeAdjustment; + type WeightToFee = NoWeights; // TODO: adjust weight + type FeeMultiplierUpdate = (); // TODO: adjust fee +} + +pub struct NoWeights; +impl WeightToFeePolynomial for NoWeights { + type Balance = Balance; + + fn polynomial() -> WeightToFeeCoefficients { + Default::default() + } + + fn calc(_weight: &u64) -> Self::Balance { + Default::default() + } } impl pallet_sudo::Trait for Runtime { @@ -344,12 +307,12 @@ impl pallet_authorship::Trait for Runtime { } impl_opaque_keys! { - pub struct SessionKeys { - pub grandpa: Grandpa, - pub babe: Babe, - pub im_online: ImOnline, - pub authority_discovery: AuthorityDiscovery, - } + pub struct SessionKeys { + pub grandpa: Grandpa, + pub babe: Babe, + pub im_online: ImOnline, + pub authority_discovery: AuthorityDiscovery, + } } // NOTE: `SessionHandler` and `SessionKeys` are co-dependent: One key will be used for each handler. // The number and order of items in `SessionHandler` *MUST* be the same number and order of keys in @@ -651,10 +614,10 @@ impl proposals_codex::Trait for Runtime { } parameter_types! { - pub const TombstoneDeposit: Balance = 1; // TODO: adjust fee - pub const RentByteFee: Balance = 1; // TODO: adjust fee - pub const RentDepositOffset: Balance = 0; // no rent deposit - pub const SurchargeReward: Balance = 0; // no reward + pub const TombstoneDeposit: Balance = 1; // TODO: adjust fee + pub const RentByteFee: Balance = 1; // TODO: adjust fee + pub const RentDepositOffset: Balance = 0; // no rent deposit + pub const SurchargeReward: Balance = 0; // no reward } impl pallet_contracts::Trait for Runtime { @@ -761,6 +724,9 @@ pub type SignedExtra = ( pallet_grandpa::ValidateEquivocationReport, ); +/// Digest item type. +pub type DigestItem = generic::DigestItem; + /// Block header type as expected by this runtime. pub type Header = generic::Header; @@ -778,7 +744,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic, Runtime, AllModules>; + frame_executive::Executive, Runtime, AllModules>; + +#[cfg(any(feature = "std", test))] +pub use pallet_balances::Call as BalancesCall; impl_runtime_apis! { impl sp_api::Core for Runtime { @@ -907,49 +876,49 @@ impl_runtime_apis! { impl pallet_contracts_rpc_runtime_api::ContractsApi for Runtime - { - fn call( - origin: AccountId, - dest: AccountId, - value: Balance, - gas_limit: u64, - input_data: Vec, - ) -> ContractExecResult { - let exec_result = - Contracts::bare_call(origin, dest, value, gas_limit, input_data); - match exec_result { - Ok(v) => ContractExecResult::Success { - status: v.status, - data: v.data, - }, - Err(_) => ContractExecResult::Error, - } - } - - fn get_storage( - address: AccountId, - key: [u8; 32], - ) -> pallet_contracts_primitives::GetStorageResult { - Contracts::get_storage(address, key) - } - - fn rent_projection( - address: AccountId, - ) -> pallet_contracts_primitives::RentProjectionResult { - Contracts::rent_projection(address) - } - } + { + fn call( + origin: AccountId, + dest: AccountId, + value: Balance, + gas_limit: u64, + input_data: Vec, + ) -> ContractExecResult { + let exec_result = + Contracts::bare_call(origin, dest, value, gas_limit, input_data); + match exec_result { + Ok(v) => ContractExecResult::Success { + status: v.status, + data: v.data, + }, + Err(_) => ContractExecResult::Error, + } + } + + fn get_storage( + address: AccountId, + key: [u8; 32], + ) -> pallet_contracts_primitives::GetStorageResult { + Contracts::get_storage(address, key) + } + + fn rent_projection( + address: AccountId, + ) -> pallet_contracts_primitives::RentProjectionResult { + Contracts::rent_projection(address) + } + } impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< - Block, - Balance, - UncheckedExtrinsic, - > for Runtime { - fn query_info(uxt: UncheckedExtrinsic, len: u32) -> RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) - } - } + Block, + Balance, + UncheckedExtrinsic, + > for Runtime { + fn query_info(uxt: UncheckedExtrinsic, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_info(uxt, len) + } + } impl sp_session::SessionKeys for Runtime { fn generate_session_keys(seed: Option>) -> Vec { diff --git a/runtime/src/primitives.rs b/runtime/src/primitives.rs index 0f837498bf..99ea7258e3 100644 --- a/runtime/src/primitives.rs +++ b/runtime/src/primitives.rs @@ -4,7 +4,10 @@ #![cfg_attr(not(feature = "std"), no_std)] -use sp_runtime::{traits::{Verify, IdentifyAccount}, MultiSignature}; +use sp_runtime::{ + traits::{IdentifyAccount, Verify}, + MultiSignature, +}; /// Priority for a transaction. Additive. Higher is better. pub type TransactionPriority = u64; @@ -64,29 +67,29 @@ pub type ActorId = u64; /// GRANDPA. Any rewards for misbehavior reporting will be paid out to this /// account. pub mod report { - use super::{Signature, Verify}; - use system::offchain::AppCrypto; - use sp_core::crypto::{key_types, KeyTypeId}; - - /// Key type for the reporting module. Used for reporting BABE and GRANDPA - /// equivocations. - pub const KEY_TYPE: KeyTypeId = key_types::REPORTING; - - mod app { - use sp_application_crypto::{app_crypto, sr25519}; - app_crypto!(sr25519, super::KEY_TYPE); - } - - /// Identity of the equivocation/misbehavior reporter. - pub type ReporterId = app::Public; - - /// An `AppCrypto` type to allow submitting signed transactions using the reporting - /// application key as signer. - pub struct ReporterAppCrypto; - - impl AppCrypto<::Signer, Signature> for ReporterAppCrypto { - type RuntimeAppPublic = ReporterId; - type GenericSignature = sp_core::sr25519::Signature; - type GenericPublic = sp_core::sr25519::Public; - } + use super::{Signature, Verify}; + use sp_core::crypto::{key_types, KeyTypeId}; + use system::offchain::AppCrypto; + + /// Key type for the reporting module. Used for reporting BABE and GRANDPA + /// equivocations. + pub const KEY_TYPE: KeyTypeId = key_types::REPORTING; + + mod app { + use sp_application_crypto::{app_crypto, sr25519}; + app_crypto!(sr25519, super::KEY_TYPE); + } + + /// Identity of the equivocation/misbehavior reporter. + pub type ReporterId = app::Public; + + /// An `AppCrypto` type to allow submitting signed transactions using the reporting + /// application key as signer. + pub struct ReporterAppCrypto; + + impl AppCrypto<::Signer, Signature> for ReporterAppCrypto { + type RuntimeAppPublic = ReporterId; + type GenericSignature = sp_core::sr25519::Signature; + type GenericPublic = sp_core::sr25519::Public; + } } From 45657b9d9c330e608cd7c01ff67668620be4b3ef Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Tue, 4 Aug 2020 13:01:26 +0300 Subject: [PATCH 3/6] runtime: Move out code from the lib.rs to the integration module --- runtime/src/integration/mod.rs | 1 + runtime/src/integration/transactions.rs | 71 +++++++++++++++++++++++++ runtime/src/lib.rs | 54 ++----------------- 3 files changed, 77 insertions(+), 49 deletions(-) create mode 100644 runtime/src/integration/transactions.rs diff --git a/runtime/src/integration/mod.rs b/runtime/src/integration/mod.rs index 592b56f838..35774a7c6c 100644 --- a/runtime/src/integration/mod.rs +++ b/runtime/src/integration/mod.rs @@ -2,5 +2,6 @@ pub mod content_working_group; pub mod forum; pub mod proposals; pub mod storage; +pub mod transactions; pub mod versioned_store_permissions; pub mod working_group; diff --git a/runtime/src/integration/transactions.rs b/runtime/src/integration/transactions.rs new file mode 100644 index 0000000000..4ce4916813 --- /dev/null +++ b/runtime/src/integration/transactions.rs @@ -0,0 +1,71 @@ +use codec::Encode; +use frame_support::debug; +use frame_support::weights::{WeightToFeeCoefficients, WeightToFeePolynomial}; +use sp_runtime::generic; +use sp_runtime::generic::SignedPayload; +use sp_runtime::traits::StaticLookup; +use sp_runtime::SaturatedConversion; + +use crate::{AccountId, Balance, BlockHashCount, Index, SignedExtra, UncheckedExtrinsic}; +use crate::{Call, Indices, Runtime, System}; + +/// Stub for zero transaction weights. +pub struct NoWeights; +impl WeightToFeePolynomial for NoWeights { + type Balance = Balance; + + fn polynomial() -> WeightToFeeCoefficients { + Default::default() + } + + fn calc(_weight: &u64) -> Self::Balance { + Default::default() + } +} + +/// 'Create transaction' default implementation. +pub(crate) fn create_transaction< + C: system::offchain::AppCrypto< + ::Public, + ::Signature, + >, +>( + call: Call, + public: <::Signature as sp_runtime::traits::Verify>::Signer, + account: AccountId, + nonce: Index, +) -> Option<( + Call, + ::SignaturePayload, +)> { + // take the biggest period possible. + let period = BlockHashCount::get() + .checked_next_power_of_two() + .map(|c| c / 2) + .unwrap_or(2) as u64; + let current_block = System::block_number() + .saturated_into::() + // The `System::block_number` is initialized with `n+1`, + // so the actual block number is `n`. + .saturating_sub(1); + let tip = 0; + let extra: SignedExtra = ( + system::CheckSpecVersion::::new(), + system::CheckTxVersion::::new(), + system::CheckGenesis::::new(), + system::CheckEra::::from(generic::Era::mortal(period, current_block)), + system::CheckNonce::::from(nonce), + system::CheckWeight::::new(), + pallet_transaction_payment::ChargeTransactionPayment::::from(tip), + pallet_grandpa::ValidateEquivocationReport::::new(), + ); + let raw_payload = SignedPayload::new(call, extra) + .map_err(|e| { + debug::warn!("Unable to create signed payload: {:?}", e); + }) + .ok()?; + let signature = raw_payload.using_encoded(|payload| C::sign(payload, public))?; + let address = Indices::unlookup(account); + let (call, extra, _) = raw_payload.deconstruct(); + Some((call, (address, signature, extra))) +} diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index ddb076cf3d..20b0054f8a 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -20,14 +20,13 @@ mod primitives; #[cfg(test)] mod tests; // Runtime integration tests -use codec::Encode; use frame_support::inherent::{CheckInherentsResult, InherentData}; use frame_support::traits::KeyOwnerProofSystem; use frame_support::weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}, - Weight, WeightToFeeCoefficients, WeightToFeePolynomial, + Weight, }; -use frame_support::{construct_runtime, debug, parameter_types, traits::Randomness}; +use frame_support::{construct_runtime, parameter_types, traits::Randomness}; use pallet_contracts_rpc_runtime_api::ContractExecResult; use pallet_grandpa::fg_primitives; use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList}; @@ -40,14 +39,13 @@ use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_core::crypto::KeyTypeId; use sp_core::OpaqueMetadata; use sp_runtime::curve::PiecewiseLinear; -use sp_runtime::generic::SignedPayload; use sp_runtime::traits::{ BlakeTwo256, Block as BlockT, NumberFor, OpaqueKeys, Saturating, StaticLookup, }; use sp_runtime::transaction_validity::{TransactionSource, TransactionValidity}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, ApplyExtrinsicResult, FixedPointNumber, Perbill, - Perquintill, SaturatedConversion, + Perquintill, }; use sp_std::boxed::Box; use sp_std::vec::Vec; @@ -180,36 +178,7 @@ where Call, ::SignaturePayload, )> { - // take the biggest period possible. - let period = BlockHashCount::get() - .checked_next_power_of_two() - .map(|c| c / 2) - .unwrap_or(2) as u64; - let current_block = System::block_number() - .saturated_into::() - // The `System::block_number` is initialized with `n+1`, - // so the actual block number is `n`. - .saturating_sub(1); - let tip = 0; - let extra: SignedExtra = ( - system::CheckSpecVersion::::new(), - system::CheckTxVersion::::new(), - system::CheckGenesis::::new(), - system::CheckEra::::from(generic::Era::mortal(period, current_block)), - system::CheckNonce::::from(nonce), - system::CheckWeight::::new(), - pallet_transaction_payment::ChargeTransactionPayment::::from(tip), - pallet_grandpa::ValidateEquivocationReport::::new(), - ); - let raw_payload = SignedPayload::new(call, extra) - .map_err(|e| { - debug::warn!("Unable to create signed payload: {:?}", e); - }) - .ok()?; - let signature = raw_payload.using_encoded(|payload| C::sign(payload, public))?; - let address = Indices::unlookup(account); - let (call, extra, _) = raw_payload.deconstruct(); - Some((call, (address, signature, extra))) + integration::transactions::create_transaction::(call, public, account, nonce) } } @@ -273,23 +242,10 @@ impl pallet_transaction_payment::Trait for Runtime { type Currency = Balances; type OnTransactionPayment = (); type TransactionByteFee = TransactionByteFee; - type WeightToFee = NoWeights; // TODO: adjust weight + type WeightToFee = integration::transactions::NoWeights; // TODO: adjust weight type FeeMultiplierUpdate = (); // TODO: adjust fee } -pub struct NoWeights; -impl WeightToFeePolynomial for NoWeights { - type Balance = Balance; - - fn polynomial() -> WeightToFeeCoefficients { - Default::default() - } - - fn calc(_weight: &u64) -> Self::Balance { - Default::default() - } -} - impl pallet_sudo::Trait for Runtime { type Event = Event; type Call = Call; From 15e1181c3e1fcc81858e0f5a1a6d97db75871100 Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Tue, 4 Aug 2020 13:44:31 +0300 Subject: [PATCH 4/6] runtime: Move runtime api code to the separate module --- runtime/src/lib.rs | 247 ++----------------------------------- runtime/src/runtime_api.rs | 244 ++++++++++++++++++++++++++++++++++++ 2 files changed, 254 insertions(+), 237 deletions(-) create mode 100644 runtime/src/runtime_api.rs diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 20b0054f8a..ef34ca3c3a 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -17,35 +17,26 @@ mod constants; mod integration; mod migration; mod primitives; +mod runtime_api; #[cfg(test)] mod tests; // Runtime integration tests -use frame_support::inherent::{CheckInherentsResult, InherentData}; use frame_support::traits::KeyOwnerProofSystem; use frame_support::weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}, Weight, }; -use frame_support::{construct_runtime, parameter_types, traits::Randomness}; -use pallet_contracts_rpc_runtime_api::ContractExecResult; -use pallet_grandpa::fg_primitives; +use frame_support::{construct_runtime, parameter_types}; use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList}; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use pallet_session::historical as pallet_session_historical; use pallet_transaction_payment::Multiplier; -use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; -use sp_api::impl_runtime_apis; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_core::crypto::KeyTypeId; -use sp_core::OpaqueMetadata; use sp_runtime::curve::PiecewiseLinear; -use sp_runtime::traits::{ - BlakeTwo256, Block as BlockT, NumberFor, OpaqueKeys, Saturating, StaticLookup, -}; -use sp_runtime::transaction_validity::{TransactionSource, TransactionValidity}; +use sp_runtime::traits::{BlakeTwo256, Block as BlockT, OpaqueKeys, Saturating}; use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, ApplyExtrinsicResult, FixedPointNumber, Perbill, - Perquintill, + create_runtime_str, generic, impl_opaque_keys, FixedPointNumber, Perbill, Perquintill, }; use sp_std::boxed::Box; use sp_std::vec::Vec; @@ -55,8 +46,10 @@ use sp_version::RuntimeVersion; use system::EnsureRoot; pub use constants::*; -use integration::proposals::{CouncilManager, ExtrinsicProposalEncoder, MembershipOriginValidator}; pub use primitives::*; +pub use runtime_api::*; + +use integration::proposals::{CouncilManager, ExtrinsicProposalEncoder, MembershipOriginValidator}; use content_working_group as content_wg; use governance::{council, election}; @@ -66,6 +59,8 @@ use storage::{data_directory, data_object_storage_registry, data_object_type_reg pub use common; pub use forum; pub use governance::election_params::ElectionParameters; +#[cfg(any(feature = "std", test))] +pub use pallet_balances::Call as BalancesCall; pub use pallet_staking::StakerStatus; pub use proposals_codex::ProposalsConfigParameters; pub use versioned_store; @@ -78,7 +73,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { authoring_version: 7, spec_version: 0, impl_version: 0, - apis: RUNTIME_API_VERSIONS, + apis: crate::runtime_api::EXPORTED_RUNTIME_API_VERSIONS, transaction_version: 1, }; @@ -665,225 +660,3 @@ construct_runtime!( StorageWorkingGroup: working_group::::{Module, Call, Storage, Config, Event}, } ); - -/// The address format for describing accounts. -pub type Address = ::Source; -/// The SignedExtension to the basic transaction logic. -pub type SignedExtra = ( - system::CheckSpecVersion, - system::CheckTxVersion, - system::CheckGenesis, - system::CheckEra, - system::CheckNonce, - system::CheckWeight, - pallet_transaction_payment::ChargeTransactionPayment, - pallet_grandpa::ValidateEquivocationReport, -); - -/// Digest item type. -pub type DigestItem = generic::DigestItem; - -/// Block header type as expected by this runtime. -pub type Header = generic::Header; - -/// Block type as expected by this runtime. -pub type Block = generic::Block; - -/// A Block signed with a Justification -pub type SignedBlock = generic::SignedBlock; - -/// BlockId type as expected by this runtime. -pub type BlockId = generic::BlockId; - -/// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; - -/// Executive: handles dispatch to the various modules. -pub type Executive = - frame_executive::Executive, Runtime, AllModules>; - -#[cfg(any(feature = "std", test))] -pub use pallet_balances::Call as BalancesCall; - -impl_runtime_apis! { - impl sp_api::Core for Runtime { - fn version() -> RuntimeVersion { - VERSION - } - - fn execute_block(block: Block) { - Executive::execute_block(block) - } - - fn initialize_block(header: &::Header) { - Executive::initialize_block(header) - } - } - - impl sp_api::Metadata for Runtime { - fn metadata() -> OpaqueMetadata { - Runtime::metadata().into() - } - } - - impl sp_block_builder::BlockBuilder for Runtime { - fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { - Executive::apply_extrinsic(extrinsic) - } - - fn finalize_block() -> ::Header { - Executive::finalize_block() - } - - fn inherent_extrinsics(data: InherentData) -> Vec<::Extrinsic> { - data.create_extrinsics() - } - - fn check_inherents(block: Block, data: InherentData) -> CheckInherentsResult { - data.check_extrinsics(&block) - } - - fn random_seed() -> ::Hash { - RandomnessCollectiveFlip::random_seed() - } - } - - impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { - fn validate_transaction( - source: TransactionSource, - tx: ::Extrinsic, - ) -> TransactionValidity { - Executive::validate_transaction(source, tx) - } - } - - impl sp_offchain::OffchainWorkerApi for Runtime { - fn offchain_worker(header: &::Header) { - Executive::offchain_worker(header) - } - } - - impl fg_primitives::GrandpaApi for Runtime { - fn grandpa_authorities() -> GrandpaAuthorityList { - Grandpa::grandpa_authorities() - } - - fn submit_report_equivocation_extrinsic( - equivocation_proof: fg_primitives::EquivocationProof< - ::Hash, - NumberFor, - >, - key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof, - ) -> Option<()> { - let key_owner_proof = key_owner_proof.decode()?; - - Grandpa::submit_report_equivocation_extrinsic( - equivocation_proof, - key_owner_proof, - ) - } - - fn generate_key_ownership_proof( - _set_id: fg_primitives::SetId, - authority_id: GrandpaId, - ) -> Option { - use codec::Encode; - - Historical::prove((fg_primitives::KEY_TYPE, authority_id)) - .map(|p| p.encode()) - .map(fg_primitives::OpaqueKeyOwnershipProof::new) - } - } - - impl sp_consensus_babe::BabeApi for Runtime { - fn configuration() -> sp_consensus_babe::BabeGenesisConfiguration { - // The choice of `c` parameter (where `1 - c` represents the - // probability of a slot being empty), is done in accordance to the - // slot duration and expected target block time, for safely - // resisting network delays of maximum two seconds. - // - sp_consensus_babe::BabeGenesisConfiguration { - slot_duration: Babe::slot_duration(), - epoch_length: EpochDuration::get(), - c: PRIMARY_PROBABILITY, - genesis_authorities: Babe::authorities(), - randomness: Babe::randomness(), - allowed_slots: sp_consensus_babe::AllowedSlots::PrimaryAndSecondaryPlainSlots, - } - } - - fn current_epoch_start() -> sp_consensus_babe::SlotNumber { - Babe::current_epoch_start() - } - } - - impl sp_authority_discovery::AuthorityDiscoveryApi for Runtime { - fn authorities() -> Vec { - AuthorityDiscovery::authorities() - } - } - - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { - System::account_nonce(account) - } - } - - - impl pallet_contracts_rpc_runtime_api::ContractsApi - for Runtime - { - fn call( - origin: AccountId, - dest: AccountId, - value: Balance, - gas_limit: u64, - input_data: Vec, - ) -> ContractExecResult { - let exec_result = - Contracts::bare_call(origin, dest, value, gas_limit, input_data); - match exec_result { - Ok(v) => ContractExecResult::Success { - status: v.status, - data: v.data, - }, - Err(_) => ContractExecResult::Error, - } - } - - fn get_storage( - address: AccountId, - key: [u8; 32], - ) -> pallet_contracts_primitives::GetStorageResult { - Contracts::get_storage(address, key) - } - - fn rent_projection( - address: AccountId, - ) -> pallet_contracts_primitives::RentProjectionResult { - Contracts::rent_projection(address) - } - } - - - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< - Block, - Balance, - UncheckedExtrinsic, - > for Runtime { - fn query_info(uxt: UncheckedExtrinsic, len: u32) -> RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) - } - } - - impl sp_session::SessionKeys for Runtime { - fn generate_session_keys(seed: Option>) -> Vec { - SessionKeys::generate(seed) - } - fn decode_session_keys( - encoded: Vec, - ) -> Option, KeyTypeId)>> { - SessionKeys::decode_into_raw_public_keys(&encoded) - } - } -} diff --git a/runtime/src/runtime_api.rs b/runtime/src/runtime_api.rs new file mode 100644 index 0000000000..a7dc3fcb86 --- /dev/null +++ b/runtime/src/runtime_api.rs @@ -0,0 +1,244 @@ +use frame_support::inherent::{CheckInherentsResult, InherentData}; +use frame_support::traits::{KeyOwnerProofSystem, Randomness}; +use frame_support::unsigned::{TransactionSource, TransactionValidity}; +use pallet_contracts_rpc_runtime_api::ContractExecResult; +use pallet_grandpa::fg_primitives; +use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; +use sp_api::impl_runtime_apis; +use sp_core::crypto::KeyTypeId; +use sp_core::OpaqueMetadata; +use sp_runtime::traits::{BlakeTwo256, Block as BlockT, NumberFor, StaticLookup}; +use sp_runtime::{generic, ApplyExtrinsicResult}; +use sp_std::vec::Vec; + +use crate::constants::PRIMARY_PROBABILITY; +use crate::{ + AccountId, AuthorityDiscoveryId, Balance, BlockNumber, EpochDuration, GrandpaAuthorityList, + GrandpaId, Hash, Index, RuntimeVersion, Signature, VERSION, +}; +use crate::{ + AllModules, AuthorityDiscovery, Babe, Call, Contracts, Grandpa, Historical, Indices, + InherentDataExt, RandomnessCollectiveFlip, Runtime, SessionKeys, System, TransactionPayment, +}; + +/// The address format for describing accounts. +pub type Address = ::Source; +/// The SignedExtension to the basic transaction logic. +pub type SignedExtra = ( + system::CheckSpecVersion, + system::CheckTxVersion, + system::CheckGenesis, + system::CheckEra, + system::CheckNonce, + system::CheckWeight, + pallet_transaction_payment::ChargeTransactionPayment, + pallet_grandpa::ValidateEquivocationReport, +); + +/// Digest item type. +pub type DigestItem = generic::DigestItem; + +/// Block header type as expected by this runtime. +pub type Header = generic::Header; + +/// Block type as expected by this runtime. +pub type Block = generic::Block; + +/// A Block signed with a Justification +pub type SignedBlock = generic::SignedBlock; + +/// BlockId type as expected by this runtime. +pub type BlockId = generic::BlockId; + +/// Unchecked extrinsic type as expected by this runtime. +pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; + +/// Executive: handles dispatch to the various modules. +pub type Executive = + frame_executive::Executive, Runtime, AllModules>; + +/// Export of the private const generated within the macro. +pub const EXPORTED_RUNTIME_API_VERSIONS: sp_version::ApisVec = RUNTIME_API_VERSIONS; + +impl_runtime_apis! { + impl sp_api::Core for Runtime { + fn version() -> RuntimeVersion { + VERSION + } + + fn execute_block(block: Block) { + Executive::execute_block(block) + } + + fn initialize_block(header: &::Header) { + Executive::initialize_block(header) + } + } + + impl sp_api::Metadata for Runtime { + fn metadata() -> OpaqueMetadata { + Runtime::metadata().into() + } + } + + impl sp_block_builder::BlockBuilder for Runtime { + fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { + Executive::apply_extrinsic(extrinsic) + } + + fn finalize_block() -> ::Header { + Executive::finalize_block() + } + + fn inherent_extrinsics(data: InherentData) -> Vec<::Extrinsic> { + data.create_extrinsics() + } + + fn check_inherents(block: Block, data: InherentData) -> CheckInherentsResult { + data.check_extrinsics(&block) + } + + fn random_seed() -> ::Hash { + RandomnessCollectiveFlip::random_seed() + } + } + + impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { + fn validate_transaction( + source: TransactionSource, + tx: ::Extrinsic, + ) -> TransactionValidity { + Executive::validate_transaction(source, tx) + } + } + + impl sp_offchain::OffchainWorkerApi for Runtime { + fn offchain_worker(header: &::Header) { + Executive::offchain_worker(header) + } + } + + impl fg_primitives::GrandpaApi for Runtime { + fn grandpa_authorities() -> GrandpaAuthorityList { + Grandpa::grandpa_authorities() + } + + fn submit_report_equivocation_extrinsic( + equivocation_proof: fg_primitives::EquivocationProof< + ::Hash, + NumberFor, + >, + key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof, + ) -> Option<()> { + let key_owner_proof = key_owner_proof.decode()?; + + Grandpa::submit_report_equivocation_extrinsic( + equivocation_proof, + key_owner_proof, + ) + } + + fn generate_key_ownership_proof( + _set_id: fg_primitives::SetId, + authority_id: GrandpaId, + ) -> Option { + use codec::Encode; + + Historical::prove((fg_primitives::KEY_TYPE, authority_id)) + .map(|p| p.encode()) + .map(fg_primitives::OpaqueKeyOwnershipProof::new) + } + } + + impl sp_consensus_babe::BabeApi for Runtime { + fn configuration() -> sp_consensus_babe::BabeGenesisConfiguration { + // The choice of `c` parameter (where `1 - c` represents the + // probability of a slot being empty), is done in accordance to the + // slot duration and expected target block time, for safely + // resisting network delays of maximum two seconds. + // + sp_consensus_babe::BabeGenesisConfiguration { + slot_duration: Babe::slot_duration(), + epoch_length: EpochDuration::get(), + c: PRIMARY_PROBABILITY, + genesis_authorities: Babe::authorities(), + randomness: Babe::randomness(), + allowed_slots: sp_consensus_babe::AllowedSlots::PrimaryAndSecondaryPlainSlots, + } + } + + fn current_epoch_start() -> sp_consensus_babe::SlotNumber { + Babe::current_epoch_start() + } + } + + impl sp_authority_discovery::AuthorityDiscoveryApi for Runtime { + fn authorities() -> Vec { + AuthorityDiscovery::authorities() + } + } + + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Index { + System::account_nonce(account) + } + } + + + impl pallet_contracts_rpc_runtime_api::ContractsApi + for Runtime + { + fn call( + origin: AccountId, + dest: AccountId, + value: Balance, + gas_limit: u64, + input_data: Vec, + ) -> ContractExecResult { + let exec_result = + Contracts::bare_call(origin, dest, value, gas_limit, input_data); + match exec_result { + Ok(v) => ContractExecResult::Success { + status: v.status, + data: v.data, + }, + Err(_) => ContractExecResult::Error, + } + } + + fn get_storage( + address: AccountId, + key: [u8; 32], + ) -> pallet_contracts_primitives::GetStorageResult { + Contracts::get_storage(address, key) + } + + fn rent_projection( + address: AccountId, + ) -> pallet_contracts_primitives::RentProjectionResult { + Contracts::rent_projection(address) + } + } + + + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< + Block, + Balance, + UncheckedExtrinsic, + > for Runtime { + fn query_info(uxt: UncheckedExtrinsic, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_info(uxt, len) + } + } + + impl sp_session::SessionKeys for Runtime { + fn generate_session_keys(seed: Option>) -> Vec { + SessionKeys::generate(seed) + } + fn decode_session_keys( + encoded: Vec, + ) -> Option, KeyTypeId)>> { + SessionKeys::decode_into_raw_public_keys(&encoded) + } + } +} From 10fa8dd43f556b7e253181594722fc43ef3f2964 Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Tue, 4 Aug 2020 20:15:27 +0300 Subject: [PATCH 5/6] node: Remove unnecessary dependencies. --- Cargo.lock | 77 ++++++++++++---- node/Cargo.toml | 225 +++++++-------------------------------------- runtime/Cargo.toml | 22 ++++- 3 files changed, 115 insertions(+), 209 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c5e5449b0..c93e6630fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1197,6 +1197,20 @@ dependencies = [ "sp-version", ] +[[package]] +name = "frame-system-benchmarking" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "frame-system-rpc-runtime-api" version = "2.0.0-rc4" @@ -1944,34 +1958,23 @@ version = "3.0.0" dependencies = [ "frame-benchmarking", "frame-benchmarking-cli", - "frame-support", "frame-system", "futures 0.3.4", - "hex-literal", "joystream-node-runtime", "jsonrpc-core", - "log", "node-inspect", - "pallet-authority-discovery", - "pallet-balances", "pallet-contracts", "pallet-contracts-rpc", "pallet-grandpa", "pallet-im-online", - "pallet-indices", - "pallet-staking", - "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc", "parity-scale-codec", - "parking_lot 0.10.2", - "rand 0.7.3", "sc-authority-discovery", "sc-basic-authorship", "sc-chain-spec", "sc-cli", "sc-client-api", - "sc-client-db", "sc-consensus", "sc-consensus-babe", "sc-consensus-babe-rpc", @@ -1981,13 +1984,9 @@ dependencies = [ "sc-finality-grandpa-rpc", "sc-keystore", "sc-network", - "sc-offchain", - "sc-rpc", "sc-rpc-api", "sc-service", "sc-service-test", - "sc-telemetry", - "sc-tracing", "sc-transaction-pool", "serde", "serde_json", @@ -2001,7 +2000,6 @@ dependencies = [ "sp-finality-grandpa", "sp-finality-tracker", "sp-inherents", - "sp-io", "sp-keyring", "sp-runtime", "sp-timestamp", @@ -2010,8 +2008,6 @@ dependencies = [ "substrate-browser-utils", "substrate-frame-rpc-system", "tempfile", - "tokio 0.1.22", - "tracing", "vergen", "wasm-bindgen", "wasm-bindgen-futures", @@ -2021,9 +2017,11 @@ dependencies = [ name = "joystream-node-runtime" version = "7.0.0" dependencies = [ + "frame-benchmarking", "frame-executive", "frame-support", "frame-system", + "frame-system-benchmarking", "frame-system-rpc-runtime-api", "pallet-authority-discovery", "pallet-authorship", @@ -2045,6 +2043,7 @@ dependencies = [ "pallet-membership", "pallet-memo", "pallet-offences", + "pallet-offences-benchmarking", "pallet-proposals-codex", "pallet-proposals-discussion", "pallet-proposals-engine", @@ -2052,6 +2051,7 @@ dependencies = [ "pallet-recurring-reward", "pallet-service-discovery", "pallet-session", + "pallet-session-benchmarking", "pallet-stake", "pallet-staking", "pallet-staking-reward-curve", @@ -3244,6 +3244,7 @@ name = "pallet-collective" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", @@ -3449,6 +3450,7 @@ name = "pallet-im-online" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "pallet-authorship", @@ -3468,6 +3470,7 @@ name = "pallet-indices" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", @@ -3524,6 +3527,27 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-offences-benchmarking" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-babe", + "pallet-balances", + "pallet-grandpa", + "pallet-im-online", + "pallet-offences", + "pallet-session", + "pallet-staking", + "parity-scale-codec", + "sp-runtime", + "sp-staking", + "sp-std", +] + [[package]] name = "pallet-proposals-codex" version = "3.0.0" @@ -3667,6 +3691,20 @@ dependencies = [ "sp-trie", ] +[[package]] +name = "pallet-session-benchmarking" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-session", + "pallet-staking", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-stake" version = "3.0.0" @@ -3688,11 +3726,13 @@ name = "pallet-staking" version = "2.0.0-rc4" source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "pallet-authorship", "pallet-session", "parity-scale-codec", + "rand_chacha 0.2.2", "serde", "sp-application-crypto", "sp-io", @@ -3764,6 +3804,7 @@ dependencies = [ "parity-scale-codec", "serde", "sp-inherents", + "sp-io", "sp-runtime", "sp-std", "sp-timestamp", diff --git a/node/Cargo.toml b/node/Cargo.toml index d0b2703216..dcc697e07d 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -13,27 +13,13 @@ path = 'bin/main.rs' [lib] crate-type = ["cdylib", "rlib"] -#[dependencies] -#derive_more = '0.14.0' -#exit-future = '0.1.4' - -#hex = '0.4' - [dependencies] # third-party dependencies -codec = { package = "parity-scale-codec", version = "1.3.1" } serde = { version = "1.0.102", features = ["derive"] } futures = { version = "0.3.1", features = ["compat"] } -hex-literal = "0.2.1" jsonrpc-core = "14.2.0" -log = "0.4.8" -rand = "0.7.2" -structopt = { version = "0.3.8"} -tracing = "0.1.10" -parking_lot = "0.10.0" - +structopt = { version = "0.3.8", optional = true} serde_json = '1.0' -tokio = '0.1.22' # primitives sp-authority-discovery = { package = 'sp-authority-discovery', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } @@ -41,15 +27,13 @@ sp-consensus-babe = { package = 'sp-consensus-babe', git = 'https://github.com/p sp-finality-grandpa = { package = 'sp-finality-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sp-core = { package = 'sp-core', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sp-runtime = { package = 'sp-runtime', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -sp-timestamp = { package = 'sp-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sp-finality-tracker = { package = 'sp-finality-tracker', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sp-inherents = { package = 'sp-inherents', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -sp-keyring = { package = 'sp-keyring', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -sp-io = { package = 'sp-io', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sp-consensus = { package = 'sp-consensus', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sp-transaction-pool = { package = 'sp-transaction-pool', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sp-api = { package = 'sp-api', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sp-blockchain = { package = 'sp-blockchain', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-block-builder = { package = 'sp-block-builder', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } # client dependencies sc-client-api = { package = 'sc-client-api', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } @@ -59,68 +43,31 @@ sc-transaction-pool = { package = 'sc-transaction-pool', git = 'https://github.c sc-network = { package = 'sc-network', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sc-consensus-babe = { package = 'sc-consensus-babe', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} sc-finality-grandpa = { package = 'sc-finality-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -sc-client-db = { package = 'sc-client-db', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -sc-offchain = { package = 'sc-offchain', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -sc-rpc = { package = 'sc-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sc-basic-authorship = { package = 'sc-basic-authorship', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sc-service = { package = 'sc-service', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -sc-tracing = { package = 'sc-tracing', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -sc-telemetry = { package = 'sc-telemetry', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sc-authority-discovery = { package = 'sc-authority-discovery', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sc-consensus-epochs = { package = 'sc-consensus-epochs', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sc-keystore = { package = 'sc-keystore', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sc-consensus-babe-rpc = { package = 'sc-consensus-babe-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sc-finality-grandpa-rpc = { package = 'sc-finality-grandpa-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sc-rpc-api = { package = 'sc-rpc-api', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -sp-block-builder = { package = 'sp-block-builder', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -pallet-contracts-rpc = { package = 'pallet-contracts-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -pallet-transaction-payment-rpc = { package = 'pallet-transaction-payment-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -substrate-frame-rpc-system = { package = 'substrate-frame-rpc-system', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sc-executor = { package = 'sc-executor', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -frame-benchmarking = { package = 'frame-benchmarking', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } - -#sc-client-api = { version = "2.0.0-rc4", path = "../../../client/api" } -#jsonrpc-core = "14.2.0" -#node-primitives = { version = "2.0.0-rc4", path = "../primitives" } -#node-runtime = { version = "2.0.0-rc4", path = "../runtime" } -#sp-runtime = { version = "2.0.0-rc4", path = "../../../primitives/runtime" } -#sp-api = { version = "2.0.0-rc4", path = "../../../primitives/api" } -#pallet-contracts-rpc = { version = "0.8.0-rc4", path = "../../../frame/contracts/rpc/" } -#pallet-transaction-payment-rpc = { version = "2.0.0-rc4", path = "../../../frame/transaction-payment/rpc/" } -#substrate-frame-rpc-system = { version = "2.0.0-rc4", path = "../../../utils/frame/rpc/system" } -#sp-transaction-pool = { version = "2.0.0-rc4", path = "../../../primitives/transaction-pool" } -#sc-consensus-babe = { version = "0.8.0-rc4", path = "../../../client/consensus/babe" } -#sc-consensus-babe-rpc = { version = "0.8.0-rc4", path = "../../../client/consensus/babe/rpc" } -#sp-consensus-babe = { version = "0.8.0-rc4", path = "../../../primitives/consensus/babe" } -#sc-keystore = { version = "2.0.0-rc4", path = "../../../client/keystore" } -#sc-consensus-epochs = { version = "0.8.0-rc4", path = "../../../client/consensus/epochs" } -#sp-consensus = { version = "0.8.0-rc4", path = "../../../primitives/consensus/common" } -#sp-blockchain = { version = "2.0.0-rc4", path = "../../../primitives/blockchain" } -#sc-finality-grandpa = { version = "0.8.0-rc4", path = "../../../client/finality-grandpa" } -#sc-finality-grandpa-rpc = { version = "0.8.0-rc4", path = "../../../client/finality-grandpa/rpc" } -#sc-rpc-api = { version = "0.8.0-rc4", path = "../../../client/rpc-api" } -#sp-block-builder = { version = "2.0.0-rc4", path = "../../../primitives/block-builder" } # frame dependencies -pallet-indices = { package = 'pallet-indices', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } pallet-contracts = { package = 'pallet-contracts', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -frame-system = { package = 'frame-system', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -pallet-balances = { package = 'pallet-balances', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -pallet-transaction-payment = { package = 'pallet-transaction-payment', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } pallet-im-online = { package = 'pallet-im-online', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -pallet-authority-discovery = { package = 'pallet-authority-discovery', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -pallet-staking = { package = 'pallet-staking', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -pallet-grandpa = { package = 'pallet-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-contracts-rpc = { package = 'pallet-contracts-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-transaction-payment-rpc = { package = 'pallet-transaction-payment-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +substrate-frame-rpc-system = { package = 'substrate-frame-rpc-system', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +frame-benchmarking = { package = 'frame-benchmarking', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } # node-specific dependencies node-runtime = { package= "joystream-node-runtime", path = "../runtime" } # CLI-specific dependencies -sc-cli = { package = 'sc-cli', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -frame-benchmarking-cli = { package = 'frame-benchmarking-cli', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -node-inspect = { package = 'node-inspect', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sc-cli = { package = 'sc-cli', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true } +frame-benchmarking-cli = { package = 'frame-benchmarking-cli', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true } +node-inspect = { package = 'node-inspect', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true } # WASM-specific dependencies wasm-bindgen = { version = "0.2.57", optional = true } @@ -128,136 +75,34 @@ wasm-bindgen-futures = { version = "0.4.7", optional = true } browser-utils = { package = 'substrate-browser-utils', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true} [dev-dependencies] -#sc-keystore = { version = "2.0.0-rc4", path = "../../../client/keystore" } -#sc-consensus = { version = "0.8.0-rc4", path = "../../../client/consensus/common" } +tempfile = "3.1.0" +codec = { package = "parity-scale-codec", version = "1.3.1" } +sp-timestamp = { package = 'sp-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +sp-keyring = { package = 'sp-keyring', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } sc-consensus-babe = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', features = ["test-helpers"]} -#sc-consensus-epochs = { version = "0.8.0-rc4", path = "../../../client/consensus/epochs" } sc-service-test = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } -#futures = "0.3.4" -tempfile = "3.1.0" -#assert_cmd = "1.0" -#nix = "0.17" -#serde_json = "1.0" -#regex = "1" -#platforms = "0.2.1" - -#[dependencies.substrate-basic-authorship] -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-basic-authorship' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.babe] -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-consensus-babe' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.babe-primitives] -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-consensus-babe-primitives' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.codec] -#package = 'parity-scale-codec' -#version = '1.0.0' -# -#[dependencies.ctrlc] -#features = ['termination'] -#version = '3.0' -# -#[dependencies.inherents] -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-inherents' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.network] -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-network' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.primitives] -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-primitives' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.sr-io] -#git = 'https://github.com/paritytech/substrate.git' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.substrate-cli] -#git = 'https://github.com/paritytech/substrate.git' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.substrate-client] -#git = 'https://github.com/paritytech/substrate.git' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.substrate-executor] -#git = 'https://github.com/paritytech/substrate.git' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.substrate-service] -#git = 'https://github.com/paritytech/substrate.git' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.transaction-pool] -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-transaction-pool' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.substrate-telemetry] -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-telemetry' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.grandpa] -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-finality-grandpa' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.grandpa-primitives] -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-finality-grandpa-primitives' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.im-online] -#default_features = false -#git = 'https://github.com/paritytech/substrate.git' -#package = 'srml-im-online' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.substrate-rpc] -#default_features = false -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-rpc' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.authority-discovery] -#default_features = false -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-authority-discovery' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.client-db] -#default_features = false -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-client-db' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.runtime-primitives] -#default_features = false -#git = 'https://github.com/paritytech/substrate.git' -#package = 'sr-primitives' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.offchain] -#default_features = false -#git = 'https://github.com/paritytech/substrate.git' -#package = 'substrate-offchain' -#rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8' -# -#[dependencies.libp2p] -#version = '0.13.2' -#default-features = false +frame-system = { package = 'frame-system', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-transaction-payment = { package = 'pallet-transaction-payment', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } +pallet-grandpa = { package = 'pallet-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' } [build-dependencies] vergen = '3' + +[features] +default = [ "cli" ] +browser = [ + "browser-utils", + "wasm-bindgen", + "wasm-bindgen-futures", +] +cli = [ + "node-inspect", + "sc-cli", + "frame-benchmarking-cli", + "sc-service/db", + "structopt", +] +runtime-benchmarks = [ + "node-runtime/runtime-benchmarks", + "frame-benchmarking-cli", +] diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 52c711d4cb..60549123ab 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -56,6 +56,12 @@ pallet-contracts = { package = 'pallet-contracts', default-features = false, git pallet-contracts-rpc-runtime-api = { package = 'pallet-contracts-rpc-runtime-api', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} pallet-contracts-primitives = { package = 'pallet-contracts-primitives', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} +# Benchmarking +frame-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', default-features = false, optional = true } +frame-system-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', default-features = false, optional = true } +pallet-offences-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', default-features = false, optional = true } +pallet-session-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', default-features = false, optional = true } + # Joystream common = { package = 'pallet-common', default-features = false, path = '../runtime-modules/common'} memo = { package = 'pallet-memo', default-features = false, path = '../runtime-modules/memo'} @@ -155,6 +161,20 @@ std = [ 'proposals-discussion/std', 'proposals-codex/std', ] - +runtime-benchmarks = [ + "system/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-im-online/runtime-benchmarks", + "pallet-indices/runtime-benchmarks", + "pallet-staking/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "frame-benchmarking", + "frame-system-benchmarking", + "pallet-offences-benchmarking", + "pallet-session-benchmarking", +] From fb9845beb7773e2282057572488259bf32487218 Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Wed, 5 Aug 2020 18:57:05 +0300 Subject: [PATCH 6/6] runtime: Remove migration and indices module. --- Cargo.lock | 18 ----- node/src/chain_spec.rs | 9 +-- node/src/service.rs | 8 +- .../proposals/codex/src/tests/mock.rs | 23 ------ runtime-modules/working-group/src/lib.rs | 3 +- runtime/Cargo.toml | 3 - runtime/src/integration/transactions.rs | 6 +- runtime/src/lib.rs | 29 +------ runtime/src/migration.rs | 75 ------------------- runtime/src/runtime_api.rs | 10 +-- 10 files changed, 18 insertions(+), 166 deletions(-) delete mode 100644 runtime/src/migration.rs diff --git a/Cargo.lock b/Cargo.lock index c93e6630fe..eb14550702 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2039,7 +2039,6 @@ dependencies = [ "pallet-grandpa", "pallet-hiring", "pallet-im-online", - "pallet-indices", "pallet-membership", "pallet-memo", "pallet-offences", @@ -3465,23 +3464,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-indices" -version = "2.0.0-rc4" -source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "serde", - "sp-core", - "sp-io", - "sp-keyring", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-membership" version = "3.0.0" diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index e641b4ed8d..76b188397e 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -33,10 +33,9 @@ use node_runtime::{ versioned_store::InputValidationLengthConstraint as VsInputValidation, AuthorityDiscoveryConfig, BabeConfig, Balance, BalancesConfig, ContentWorkingGroupConfig, ContractsConfig, CouncilConfig, CouncilElectionConfig, DataObjectStorageRegistryConfig, - DataObjectTypeRegistryConfig, ElectionParameters, GrandpaConfig, ImOnlineConfig, IndicesConfig, - MembersConfig, MigrationConfig, ProposalsCodexConfig, SessionConfig, SessionKeys, Signature, - StakerStatus, StakingConfig, StorageWorkingGroupConfig, SudoConfig, SystemConfig, - VersionedStoreConfig, DAYS, WASM_BINARY, + DataObjectTypeRegistryConfig, ElectionParameters, GrandpaConfig, ImOnlineConfig, MembersConfig, + ProposalsCodexConfig, SessionConfig, SessionKeys, Signature, StakerStatus, StakingConfig, + StorageWorkingGroupConfig, SudoConfig, SystemConfig, VersionedStoreConfig, DAYS, WASM_BINARY, }; type AccountPublic = ::Signer; @@ -244,7 +243,6 @@ pub fn testnet_genesis( pallet_grandpa: Some(GrandpaConfig { authorities: vec![], }), - pallet_indices: Some(IndicesConfig { indices: vec![] }), pallet_session: Some(SessionConfig { keys: initial_authorities .iter() @@ -334,7 +332,6 @@ pub fn testnet_genesis( channel_banner_constraint: InputValidationLengthConstraint::new(5, 1024), channel_title_constraint: InputValidationLengthConstraint::new(5, 1024), }), - migration: Some(MigrationConfig {}), proposals_codex: Some(ProposalsCodexConfig { set_validator_count_proposal_voting_period: cpcp .set_validator_count_proposal_voting_period, diff --git a/node/src/service.rs b/node/src/service.rs index 9a3f9f32ab..a1ebae62c5 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -423,8 +423,8 @@ mod tests { use codec::{Decode, Encode}; use node_runtime::RuntimeApi; use node_runtime::{currency::CENTS, SLOT_DURATION}; - use node_runtime::{opaque::Block, DigestItem, Signature}; - use node_runtime::{Address, BalancesCall, Call, UncheckedExtrinsic}; + use node_runtime::{opaque::Block, AccountId, DigestItem, Signature}; + use node_runtime::{BalancesCall, Call, UncheckedExtrinsic}; use sc_consensus_babe::{BabeIntermediate, CompatibleDigestItem, INTERMEDIATE_KEY}; use sc_consensus_epochs::descendent_query; use sc_finality_grandpa::{self as grandpa}; @@ -590,8 +590,8 @@ mod tests { }, |service, _| { let amount = 5 * CENTS; - let to: Address = AccountPublic::from(bob.public()).into_account().into(); - let from: Address = AccountPublic::from(charlie.public()).into_account().into(); + let to: AccountId = AccountPublic::from(bob.public()).into_account().into(); + let from: AccountId = AccountPublic::from(charlie.public()).into_account().into(); let genesis_hash = service.client().block_hash(0).unwrap().unwrap(); let best_block_id = BlockId::number(service.client().chain_info().best_number); let (spec_version, transaction_version) = { diff --git a/runtime-modules/proposals/codex/src/tests/mock.rs b/runtime-modules/proposals/codex/src/tests/mock.rs index ccef3b3a10..071e58a4ba 100644 --- a/runtime-modules/proposals/codex/src/tests/mock.rs +++ b/runtime-modules/proposals/codex/src/tests/mock.rs @@ -230,29 +230,6 @@ where pub type Extrinsic = TestXt; -/* - type Currency = Balances; - type UnixTime = Timestamp; - type CurrencyToVote = CurrencyToVoteHandler; - type RewardRemainder = RewardRemainderMock; - type Event = MetaEvent; - type Slash = (); - type Reward = (); - type SessionsPerEra = SessionsPerEra; - type SlashDeferDuration = SlashDeferDuration; - type SlashCancelOrigin = frame_system::EnsureRoot; - type BondingDuration = BondingDuration; - type SessionInterface = Self; - type RewardCurve = RewardCurve; - type NextNewSession = Session; - type ElectionLookahead = ElectionLookahead; - type Call = Call; - type MaxIterations = MaxIterations; - type MinSolutionScoreBump = MinSolutionScoreBump; - type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator; - type UnsignedPriority = UnsignedPriority; -*/ - impl staking::SessionInterface for Test { fn disable_validator(_: &u64) -> Result { unimplemented!() diff --git a/runtime-modules/working-group/src/lib.rs b/runtime-modules/working-group/src/lib.rs index e057b7a575..d4206a67c5 100644 --- a/runtime-modules/working-group/src/lib.rs +++ b/runtime-modules/working-group/src/lib.rs @@ -1475,7 +1475,8 @@ impl, I: Instance> Module { Ok(()) } - fn initialize_working_group( + // Initialize working group constraints and mint. + pub(crate) fn initialize_working_group( opening_human_readable_text_constraint: InputValidationLengthConstraint, worker_application_human_readable_text_constraint: InputValidationLengthConstraint, worker_exit_rationale_text_constraint: InputValidationLengthConstraint, diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 60549123ab..80298d58ae 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -37,7 +37,6 @@ system = { package = 'frame-system', default-features = false, git = 'https://gi pallet-grandpa = { package = 'pallet-grandpa', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} pallet-staking-reward-curve = { package = 'pallet-staking-reward-curve', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} pallet-babe = { package = 'pallet-babe', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} -pallet-indices = { package = 'pallet-indices', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} pallet-transaction-payment = { package = 'pallet-transaction-payment', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} pallet-transaction-payment-rpc-runtime-api = { package = 'pallet-transaction-payment-rpc-runtime-api', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} pallet-authorship = { package = 'pallet-authorship', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} @@ -133,7 +132,6 @@ std = [ 'pallet-staking/std', # 'pallet-staking-reward-curve/std', // don't have 'std' features 'pallet-sudo/std', - 'pallet-indices/std', 'pallet-im-online/std', 'pallet-collective/std', 'pallet-offences/std', @@ -168,7 +166,6 @@ runtime-benchmarks = [ "pallet-balances/runtime-benchmarks", "pallet-collective/runtime-benchmarks", "pallet-im-online/runtime-benchmarks", - "pallet-indices/runtime-benchmarks", "pallet-staking/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "frame-benchmarking", diff --git a/runtime/src/integration/transactions.rs b/runtime/src/integration/transactions.rs index 4ce4916813..865e09bd2f 100644 --- a/runtime/src/integration/transactions.rs +++ b/runtime/src/integration/transactions.rs @@ -3,11 +3,10 @@ use frame_support::debug; use frame_support::weights::{WeightToFeeCoefficients, WeightToFeePolynomial}; use sp_runtime::generic; use sp_runtime::generic::SignedPayload; -use sp_runtime::traits::StaticLookup; use sp_runtime::SaturatedConversion; use crate::{AccountId, Balance, BlockHashCount, Index, SignedExtra, UncheckedExtrinsic}; -use crate::{Call, Indices, Runtime, System}; +use crate::{Call, Runtime, System}; /// Stub for zero transaction weights. pub struct NoWeights; @@ -65,7 +64,6 @@ pub(crate) fn create_transaction< }) .ok()?; let signature = raw_payload.using_encoded(|payload| C::sign(payload, public))?; - let address = Indices::unlookup(account); let (call, extra, _) = raw_payload.deconstruct(); - Some((call, (address, signature, extra))) + Some((call, (account, signature, extra))) } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index ef34ca3c3a..e89630bdc0 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -15,7 +15,6 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); mod constants; mod integration; -mod migration; mod primitives; mod runtime_api; #[cfg(test)] @@ -30,14 +29,11 @@ use frame_support::{construct_runtime, parameter_types}; use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList}; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use pallet_session::historical as pallet_session_historical; -use pallet_transaction_payment::Multiplier; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_core::crypto::KeyTypeId; use sp_runtime::curve::PiecewiseLinear; -use sp_runtime::traits::{BlakeTwo256, Block as BlockT, OpaqueKeys, Saturating}; -use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, FixedPointNumber, Perbill, Perquintill, -}; +use sp_runtime::traits::{BlakeTwo256, Block as BlockT, IdentityLookup, OpaqueKeys, Saturating}; +use sp_runtime::{create_runtime_str, generic, impl_opaque_keys, Perbill}; use sp_std::boxed::Box; use sp_std::vec::Vec; #[cfg(feature = "std")] @@ -110,7 +106,7 @@ impl system::Trait for Runtime { type Hash = Hash; type Hashing = BlakeTwo256; type AccountId = AccountId; - type Lookup = Indices; + type Lookup = IdentityLookup; type Header = generic::Header; type Event = Event; type BlockHashCount = BlockHashCount; @@ -190,17 +186,6 @@ where type OverarchingCall = Call; } -parameter_types! { - pub const IndexDeposit: Balance = 0; // no minimum deposit -} - -impl pallet_indices::Trait for Runtime { - type AccountIndex = AccountIndex; - type Currency = Balances; - type Deposit = IndexDeposit; - type Event = Event; -} - parameter_types! { pub const MinimumPeriod: Moment = SLOT_DURATION / 2; } @@ -228,9 +213,6 @@ impl pallet_balances::Trait for Runtime { parameter_types! { pub const TransactionByteFee: Balance = 0; // TODO: adjust fee - pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25); - pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(1, 100_000); - pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128); } impl pallet_transaction_payment::Trait for Runtime { @@ -487,9 +469,6 @@ impl forum::Trait for Runtime { type PostId = PostId; } -impl migration::Trait for Runtime { - type Event = Event; -} // The storage working group instance alias. pub type StorageWorkingGroupInstance = working_group::Instance2; @@ -618,7 +597,6 @@ construct_runtime!( Babe: pallet_babe::{Module, Call, Storage, Config, Inherent(Timestamp)}, Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, Authorship: pallet_authorship::{Module, Call, Storage, Inherent}, - Indices: pallet_indices::{Module, Call, Storage, Config, Event}, Balances: pallet_balances::{Module, Call, Storage, Config, Event}, TransactionPayment: pallet_transaction_payment::{Module, Storage}, Staking: pallet_staking::{Module, Call, Config, Storage, Event, ValidateUnsigned}, @@ -633,7 +611,6 @@ construct_runtime!( Sudo: pallet_sudo::{Module, Call, Config, Storage, Event}, Contracts: pallet_contracts::{Module, Call, Config, Storage, Event}, // Joystream - Migration: migration::{Module, Call, Storage, Event, Config}, CouncilElection: election::{Module, Call, Storage, Event, Config}, Council: council::{Module, Call, Storage, Event, Config}, Memo: memo::{Module, Call, Storage, Event}, diff --git a/runtime/src/migration.rs b/runtime/src/migration.rs deleted file mode 100644 index 64e527b541..0000000000 --- a/runtime/src/migration.rs +++ /dev/null @@ -1,75 +0,0 @@ -// Clippy linter warning -#![allow(clippy::redundant_closure_call)] // disable it because of the substrate lib design - -use crate::VERSION; -use frame_support::weights::Weight; -use frame_support::{debug, decl_event, decl_module, decl_storage}; - -impl Module { - /// This method is called from on_initialize() when a runtime upgrade is detected. This - /// happens when the runtime spec version is found to be higher than the stored value. - /// Important to note this method should be carefully maintained, because it runs on every runtime - /// upgrade. - fn runtime_upgraded() { - debug::print!("Running runtime upgraded handler"); - - // Add initialization of modules introduced in new runtime release. Typically this - // would be any new storage values that need an initial value which would not - // have been initialized with config() or build() chainspec construction mechanism. - // Other tasks like resetting values, migrating values etc. - } -} - -pub trait Trait: - system::Trait - + minting::Trait - + proposals_codex::Trait - + working_group::Trait - + storage::data_directory::Trait - + storage::data_object_storage_registry::Trait -{ - type Event: From> + Into<::Event>; -} - -decl_storage! { - trait Store for Module as Migration { - /// Records at what runtime spec version the store was initialized. At genesis this will be - /// initialized to Some(VERSION.spec_version). It is an Option because the first time the module - /// was introduced was as a runtime upgrade and type was never changed. - /// When the runtime is upgraded the spec version be updated. - pub SpecVersion get(fn spec_version) build(|_config: &GenesisConfig| { - Some(VERSION.spec_version) - }) : Option; - } -} - -decl_event! { - pub enum Event where ::BlockNumber { - Migrated(BlockNumber, u32), - } -} - -decl_module! { - pub struct Module for enum Call where origin: T::Origin { - fn deposit_event() = default; - - fn on_initialize(_now: T::BlockNumber) -> Weight { - if Self::spec_version().map_or(true, |spec_version| VERSION.spec_version > spec_version) { - // Mark store version with current version of the runtime - SpecVersion::put(VERSION.spec_version); - - // Run migrations and store initializers - Self::runtime_upgraded(); - - Self::deposit_event(RawEvent::Migrated( - >::block_number(), - VERSION.spec_version, - )); - } - - 10_000_000 // TODO adjust weight - } - } -} - -impl Module {} diff --git a/runtime/src/runtime_api.rs b/runtime/src/runtime_api.rs index a7dc3fcb86..8e4e7298df 100644 --- a/runtime/src/runtime_api.rs +++ b/runtime/src/runtime_api.rs @@ -7,7 +7,7 @@ use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; use sp_api::impl_runtime_apis; use sp_core::crypto::KeyTypeId; use sp_core::OpaqueMetadata; -use sp_runtime::traits::{BlakeTwo256, Block as BlockT, NumberFor, StaticLookup}; +use sp_runtime::traits::{BlakeTwo256, Block as BlockT, NumberFor}; use sp_runtime::{generic, ApplyExtrinsicResult}; use sp_std::vec::Vec; @@ -17,12 +17,10 @@ use crate::{ GrandpaId, Hash, Index, RuntimeVersion, Signature, VERSION, }; use crate::{ - AllModules, AuthorityDiscovery, Babe, Call, Contracts, Grandpa, Historical, Indices, - InherentDataExt, RandomnessCollectiveFlip, Runtime, SessionKeys, System, TransactionPayment, + AllModules, AuthorityDiscovery, Babe, Call, Contracts, Grandpa, Historical, InherentDataExt, + RandomnessCollectiveFlip, Runtime, SessionKeys, System, TransactionPayment, }; -/// The address format for describing accounts. -pub type Address = ::Source; /// The SignedExtension to the basic transaction logic. pub type SignedExtra = ( system::CheckSpecVersion, @@ -51,7 +49,7 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive =