diff --git a/Cargo.lock b/Cargo.lock index 1bcdb7c2..438bfdb8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,7 +18,16 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" dependencies = [ - "gimli", + "gimli 0.23.0", +] + +[[package]] +name = "addr2line" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +dependencies = [ + "gimli 0.24.0", ] [[package]] @@ -89,9 +98,9 @@ checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" [[package]] name = "aho-corasick" -version = "0.7.15" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] @@ -116,15 +125,24 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.40" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" +checksum = "15af2628f6890fe2609a3b91bef4c83450512802e59489f9c1cb1fa5df064a61" [[package]] name = "approx" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" +checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" +dependencies = [ + "num-traits", +] + +[[package]] +name = "approx" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "072df7202e63b127ab55acfe16ce97013d5b97bf160489336d3f1840fd78e99e" dependencies = [ "num-traits", ] @@ -157,6 +175,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +[[package]] +name = "arrayvec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd" + [[package]] name = "asn1_der" version = "0.6.3" @@ -189,16 +213,16 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb877970c7b440ead138f6321a3b5395d6061183af779340b65e20c0fede9146" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" dependencies = [ "async-task", "concurrent-queue", "fastrand", "futures-lite", "once_cell", - "vec-arena", + "slab", ] [[package]] @@ -219,29 +243,29 @@ dependencies = [ [[package]] name = "async-io" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9315f8f07556761c3e48fec2e6b276004acf426e6dc068b2c2251854d65ee0fd" +checksum = "4bbfd5cf2794b1e908ea8457e6c45f8f8f1f6ec5f74617bf4662623f47503c3b" dependencies = [ "concurrent-queue", "fastrand", "futures-lite", "libc", "log", - "nb-connect", "once_cell", "parking", "polling", - "vec-arena", + "slab", + "socket2 0.4.0", "waker-fn", "winapi 0.3.9", ] [[package]] name = "async-lock" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1996609732bde4a9988bc42125f55f2af5f3c36370e27c778d5191a4a1b63bfb" +checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" dependencies = [ "event-listener", ] @@ -257,15 +281,16 @@ dependencies = [ [[package]] name = "async-process" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef37b86e2fa961bae5a4d212708ea0154f904ce31d1a4a7f47e1bbc33a0c040b" +checksum = "a8f38756dd9ac84671c428afbf7c9f7495feff9ec5b0710f17100098e5b354ac" dependencies = [ "async-io", "blocking", "cfg-if 1.0.0", "event-listener", "futures-lite", + "libc", "once_cell", "signal-hook", "winapi 0.3.9", @@ -282,7 +307,7 @@ dependencies = [ "async-io", "async-lock", "async-process", - "crossbeam-utils 0.8.3", + "crossbeam-utils 0.8.5", "futures-channel", "futures-core", "futures-io", @@ -307,9 +332,9 @@ checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" [[package]] name = "async-trait" -version = "0.1.48" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ea56748e10732c49404c153638a15ec3d6211ec5ff35d9bb20e13b93576adf" +checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722" dependencies = [ "proc-macro2", "quote", @@ -376,15 +401,16 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.56" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" +checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" dependencies = [ - "addr2line", + "addr2line 0.15.2", + "cc", "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.23.0", + "object 0.25.3", "rustc-demangle", ] @@ -414,36 +440,30 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bincode" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d175dfa69e619905c4c3cdb7c3c203fa3bdd5d51184e3afdb2742c0280493772" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "byteorder", "serde", ] [[package]] name = "bindgen" -version = "0.54.0" +version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c0bb6167449588ff70803f4127f0684f9063097eca5016f37eb52b92c2cf36" +checksum = "fd4865004a46a0aafb2a0a5eb19d3c9fc46ee5f063a6cfc605c69ac9ecf5263d" dependencies = [ "bitflags", "cexpr", - "cfg-if 0.1.10", "clang-sys", - "clap", - "env_logger", "lazy_static", "lazycell", - "log", "peeking_take_while", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "which 3.1.1", ] [[package]] @@ -454,12 +474,22 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bitvec" -version = "0.20.2" +version = "0.17.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f682656975d3a682daff957be4ddeb65d6ad656737cd821f2d00685ae466af1" +checksum = "41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5c" +dependencies = [ + "either", + "radium 0.3.0", +] + +[[package]] +name = "bitvec" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" dependencies = [ "funty", - "radium", + "radium 0.6.2", "tap", "wyz", ] @@ -509,9 +539,9 @@ dependencies = [ [[package]] name = "blake3" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ff35b701f3914bdb8fad3368d822c766ef2858b2583198e41639b936f09d3f" +checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" dependencies = [ "arrayref", "arrayvec 0.5.2", @@ -590,9 +620,9 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" +checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279" dependencies = [ "memchr", ] @@ -608,9 +638,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.6.1" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" + +[[package]] +name = "byte-slice-cast" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" +checksum = "b0a5e3906bcbf133e33c1d4d95afc664ad37fbdb9f6568d8043e7ea8c27d93d3" [[package]] name = "byte-slice-cast" @@ -626,9 +662,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" @@ -683,9 +719,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.67" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" +checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" dependencies = [ "jobserver", ] @@ -769,13 +805,13 @@ dependencies = [ [[package]] name = "clang-sys" -version = "0.29.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" +checksum = "853eda514c284c2287f4bf20ae614f8781f40a81d32ecda6e91449304dfe077c" dependencies = [ "glob", "libc", - "libloading", + "libloading 0.7.0", ] [[package]] @@ -850,10 +886,13 @@ dependencies = [ ] [[package]] -name = "cpuid-bool" -version = "0.1.2" +name = "cpufeatures" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" +checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8" +dependencies = [ + "libc", +] [[package]] name = "cpuid-bool" @@ -881,7 +920,7 @@ dependencies = [ "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli", + "gimli 0.23.0", "log", "regalloc", "serde", @@ -966,12 +1005,12 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.3", + "crossbeam-utils 0.8.5", ] [[package]] @@ -992,8 +1031,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch 0.9.3", - "crossbeam-utils 0.8.3", + "crossbeam-epoch 0.9.5", + "crossbeam-utils 0.8.5", ] [[package]] @@ -1013,14 +1052,14 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12" +checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.3", + "crossbeam-utils 0.8.5", "lazy_static", - "memoffset 0.6.2", + "memoffset 0.6.4", "scopeguard", ] @@ -1048,15 +1087,20 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" +checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" dependencies = [ - "autocfg", "cfg-if 1.0.0", "lazy_static", ] +[[package]] +name = "crunchy" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" + [[package]] name = "crunchy" version = "0.2.2" @@ -1128,9 +1172,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.0.2" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f627126b946c25a4638eec0ea634fc52506dea98db118aae985118ce7c3d723f" +checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" dependencies = [ "byteorder", "digest 0.9.0", @@ -1147,9 +1191,9 @@ checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" [[package]] name = "data-encoding-macro" -version = "0.1.10" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a94feec3d2ba66c0b6621bca8bc6f68415b1e5c69af3586fdd0af9fd9f29b17" +checksum = "86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029aca" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -1157,9 +1201,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f83e699727abca3c56e187945f303389590305ab2f0185ea445aa66e8d5f2a" +checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" dependencies = [ "data-encoding", "syn", @@ -1167,9 +1211,9 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.13" +version = "0.99.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b1b72f1263f214c0f823371768776c4f5841b942c9883aa8e5ec584fd0ba6" +checksum = "5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320" dependencies = [ "convert_case", "proc-macro2", @@ -1197,9 +1241,9 @@ dependencies = [ [[package]] name = "directories" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fed639d60b58d0f53498ab13d26f621fd77569cc6edb031f4cc36a2ad9da0f" +checksum = "e69600ff1703123957937708eb27f7a564e48885c537782722ed0ba3189ce1d7" dependencies = [ "dirs-sys", ] @@ -1216,12 +1260,12 @@ dependencies = [ [[package]] name = "dirs-sys" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" dependencies = [ "libc", - "redox_users 0.3.5", + "redox_users", "winapi 0.3.9", ] @@ -1232,7 +1276,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", - "redox_users 0.4.0", + "redox_users", "winapi 0.3.9", ] @@ -1275,9 +1319,9 @@ checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" [[package]] name = "ed25519" -version = "1.0.3" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c66a534cbb46ab4ea03477eae19d5c22c01da8258030280b7bd9d8433fb6ef" +checksum = "8d0860415b12243916284c67a9be413e044ee6668247b99ba26d94b2bc06c8f6" dependencies = [ "signature", ] @@ -1288,11 +1332,11 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek 3.0.2", + "curve25519-dalek 3.1.0", "ed25519", "rand 0.7.3", "serde", - "sha2 0.9.3", + "sha2 0.9.5", "zeroize", ] @@ -1317,15 +1361,15 @@ dependencies = [ [[package]] name = "environmental" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6576a1755ddffd988788025e75bce9e74b018f7cc226198fe931d077911c6d7e" +checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" [[package]] name = "erased-serde" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0465971a8cc1fa2455c8465aaa377131e1f1cf4983280f474a13e68793aa770c" +checksum = "e5b36e6f2295f393f44894c6031f67df4d185b984cd54d08f768ce678007efcd" dependencies = [ "serde", ] @@ -1351,16 +1395,64 @@ dependencies = [ "libc", ] +[[package]] +name = "ethash" +version = "1.12.0" +dependencies = [ + "crunchy 0.1.6", + "either", + "ethereum-types 0.9.2", + "keccak-hash", + "log", + "memmap", + "parking_lot 0.11.1", + "primal", + "rustc-hex 1.0.0", + "serde_json", + "tempdir", + "tiny-keccak", +] + +[[package]] +name = "ethash-rpc" +version = "1.0.0" +dependencies = [ + "derive_more", + "ethash", + "futures 0.3.15", + "jsonrpc-core 15.1.0", + "jsonrpc-derive 15.1.0", + "log", + "parity-scale-codec 2.1.3", + "serde", + "serde_derive", + "serde_json", + "sp-core", +] + +[[package]] +name = "ethbloom" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71a6567e6fd35589fea0c63b94b4cf2e55573e413901bdbe60ab15cf0e25e5df" +dependencies = [ + "crunchy 0.2.2", + "fixed-hash 0.6.1", + "impl-rlp 0.2.1", + "impl-serde", + "tiny-keccak", +] + [[package]] name = "ethbloom" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "779864b9c7f7ead1f092972c3257496c6a84b46dba2ce131dd8a282cb2cc5972" dependencies = [ - "crunchy", - "fixed-hash", - "impl-codec", - "impl-rlp", + "crunchy 0.2.2", + "fixed-hash 0.7.0", + "impl-codec 0.5.0", + "impl-rlp 0.3.0", "impl-serde", "tiny-keccak", ] @@ -1371,31 +1463,66 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567ce064a8232c16e2b2c2173a936b91fbe35c2f2c5278871f5a1a31688b42e9" dependencies = [ - "ethereum-types", + "ethereum-types 0.11.0", "funty", "hash-db", "hash256-std-hasher", - "parity-scale-codec", - "rlp", + "parity-scale-codec 2.1.3", + "rlp 0.5.0", "rlp-derive", "serde", "sha3 0.9.1", "triehash", ] +[[package]] +name = "ethereum-types" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "473aecff686bd8e7b9db0165cbbb53562376b39bf35b427f0c60446a9e1634b0" +dependencies = [ + "ethbloom 0.9.2", + "fixed-hash 0.6.1", + "impl-rlp 0.2.1", + "impl-serde", + "primitive-types 0.7.3", + "uint 0.8.5", +] + [[package]] name = "ethereum-types" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f64b5df66a228d85e4b17e5d6c6aa43b0310898ffe8a85988c4c032357aaabfd" dependencies = [ - "ethbloom", - "fixed-hash", - "impl-codec", - "impl-rlp", + "ethbloom 0.11.0", + "fixed-hash 0.7.0", + "impl-codec 0.5.0", + "impl-rlp 0.3.0", "impl-serde", - "primitive-types", - "uint", + "primitive-types 0.9.0", + "uint 0.9.0", +] + +[[package]] +name = "ethpow" +version = "1.0.0" +dependencies = [ + "derive_more", + "ethash", + "ethereum-types 0.9.2", + "log", + "parity-scale-codec 2.1.3", + "sc-consensus-pow", + "serde", + "serde_derive", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-consensus-pow", + "sp-core", + "sp-runtime", + "tempdir", ] [[package]] @@ -1415,22 +1542,22 @@ dependencies = [ "evm-gasometer", "evm-runtime", "log", - "parity-scale-codec", - "primitive-types", - "rlp", + "parity-scale-codec 2.1.3", + "primitive-types 0.9.0", + "rlp 0.5.0", "serde", "sha3 0.8.2", ] [[package]] name = "evm-core" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4eea3882c798813a6f92e8855ec1fc3f5ababd8b274cb81d4bedee701b478e" +checksum = "e1e6640dd44ba663316c7121e0c6fee38000d8249127fd9221bfdc331f75cbfe" dependencies = [ "funty", - "parity-scale-codec", - "primitive-types", + "parity-scale-codec 2.1.3", + "primitive-types 0.9.0", "serde", ] @@ -1442,7 +1569,7 @@ checksum = "0a8f04dcc8b0296652eabfa443a08ebed6071a1178e0f42a7f7b63a612bddf0b" dependencies = [ "evm-core", "evm-runtime", - "primitive-types", + "primitive-types 0.9.0", ] [[package]] @@ -1452,7 +1579,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54c302f29ca8bba82a382aa52d427869964179e4f24eae57bde70958ce9b7607" dependencies = [ "evm-core", - "primitive-types", + "primitive-types 0.9.0", "sha3 0.8.2", ] @@ -1462,7 +1589,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", ] [[package]] @@ -1501,9 +1628,9 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5faf057445ce5c9d4329e382b2ce7ca38550ef3b73a5348362d5f24e0c7fe3" +checksum = "77b705829d1e87f762c2df6da140b26af5839e1033aa84aa5f56bb688e4e1bdb" dependencies = [ "instant", ] @@ -1518,9 +1645,9 @@ dependencies = [ "fc-db", "fp-consensus", "fp-rpc", - "futures 0.3.13", + "futures 0.3.15", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sc-client-api", "sp-api", "sp-block-builder", @@ -1541,7 +1668,7 @@ checksum = "5447bcaec37cde97f067060e449347948a72e594cda064625aa394bfab8c23b8" dependencies = [ "kvdb", "kvdb-rocksdb", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "sp-core", "sp-database", @@ -1558,7 +1685,7 @@ dependencies = [ "fc-db", "fp-consensus", "fp-rpc", - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "log", "sc-client-api", @@ -1574,7 +1701,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5682990c26ec58939c6f80955dfe5069b57b87fab8884a193508b00f59e8c2f2" dependencies = [ "ethereum", - "ethereum-types", + "ethereum-types 0.11.0", "evm", "fc-consensus", "fc-db", @@ -1583,7 +1710,7 @@ dependencies = [ "fp-evm", "fp-rpc", "fp-storage", - "futures 0.3.13", + "futures 0.3.15", "jsonrpc-core 15.1.0", "jsonrpc-core-client 14.2.0", "jsonrpc-derive 14.2.2", @@ -1592,10 +1719,10 @@ dependencies = [ "log", "pallet-ethereum", "pallet-evm", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "rand 0.7.3", - "rlp", - "rustc-hex", + "rlp 0.5.0", + "rustc-hex 2.1.0", "sc-client-api", "sc-network", "sc-rpc", @@ -1615,12 +1742,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19349ccb13096ea4a33c93d7b90e2d11403285039c502d74a87cd127c83430e3" dependencies = [ - "ethereum-types", + "ethereum-types 0.11.0", "jsonrpc-core 15.1.0", "jsonrpc-core-client 14.2.0", "jsonrpc-derive 14.2.2", "jsonrpc-pubsub 15.1.0", - "rustc-hex", + "rustc-hex 2.1.0", "serde", "serde_json", ] @@ -1651,14 +1778,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2cd795898c348a8ec9edc66ec9e014031c764d4c88cc26d09b492cd93eb41339" dependencies = [ "either", - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "log", "num-traits", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", ] +[[package]] +name = "fixed-hash" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11498d382790b7a8f2fd211780bec78619bba81cdad3a283997c0c41f836759c" +dependencies = [ + "byteorder", + "rand 0.7.3", + "rustc-hex 2.1.0", + "static_assertions", +] + [[package]] name = "fixed-hash" version = "0.7.0" @@ -1666,8 +1805,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", - "rand 0.8.3", - "rustc-hex", + "rand 0.8.4", + "rustc-hex 2.1.0", "static_assertions", ] @@ -1702,7 +1841,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "632b95f97f332b2ff5bc3a42bc8e28772b067e333830e03fd046504f11cd0fb8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", ] [[package]] @@ -1722,8 +1861,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1299a98963d09d7bc196e42d2a156abb3ea9c2c262771ba2f30d47ed6f5c678a" dependencies = [ "ethereum", - "parity-scale-codec", - "rlp", + "parity-scale-codec 2.1.3", + "rlp 0.5.0", "sha3 0.8.2", "sp-core", "sp-runtime", @@ -1738,7 +1877,7 @@ checksum = "29862d19f1ad6ad2956dfe157964005dd7f8af3caf1e6f1fa194695ef14a3be3" dependencies = [ "evm", "impl-trait-for-tuples 0.1.3", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-core", "sp-std 3.0.0", @@ -1751,9 +1890,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c58fe2c9fe2f296ad363bdd552bad8718ebf675735c02ef857ae2713bdea4822" dependencies = [ "ethereum", - "ethereum-types", + "ethereum-types 0.11.0", "fp-evm", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-api", "sp-core", "sp-io", @@ -1763,19 +1902,9 @@ dependencies = [ [[package]] name = "fp-storage" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65fe4d695f44d5fbcfcefa77b4192d402e1c3bfed1c27afdd19b60ead757ece" -dependencies = [ - "ethereum", - "ethereum-types", - "fp-evm", - "parity-scale-codec", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std 3.0.0", -] +checksum = "41357d4af97038b092e6f568259772cdb959df132d6241076499db69f38a2de9" [[package]] name = "frame-benchmarking" @@ -1786,8 +1915,8 @@ dependencies = [ "frame-support", "frame-system", "linregress", - "parity-scale-codec", - "paste 1.0.5", + "parity-scale-codec 2.1.3", + "paste", "sp-api", "sp-io", "sp-runtime", @@ -1806,7 +1935,7 @@ dependencies = [ "chrono", "frame-benchmarking", "handlebars", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sc-cli", "sc-client-db", "sc-executor", @@ -1828,7 +1957,7 @@ checksum = "1da8fd471442bee91b9b3f587ec832e3f47800374fdb89b4a66591cd7c42b29f" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-core", "sp-io", @@ -1843,7 +1972,7 @@ version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "073f7bef18421362441a1708f8528e442234954611f95bdc554b313fb321948e" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-core", "sp-std 3.0.0", @@ -1861,8 +1990,8 @@ dependencies = [ "impl-trait-for-tuples 0.2.1", "log", "once_cell", - "parity-scale-codec", - "paste 1.0.5", + "parity-scale-codec 2.1.3", + "paste", "serde", "smallvec 1.6.1", "sp-arithmetic", @@ -1896,7 +2025,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4f88cfd111e004590f4542b75e6d3302137b9067d7e7219e4ac47a535c3b5c1" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -1921,7 +2050,7 @@ checksum = "f5fedbff05d665c00bf4e089b4377fcb15b8bd37ebc3e5fc06665474cf6e25d7" dependencies = [ "frame-support", "impl-trait-for-tuples 0.2.1", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-core", "sp-io", @@ -1939,7 +2068,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-core", "sp-runtime", "sp-std 3.0.0", @@ -1951,7 +2080,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cb9d2f86a903fdee4ca3d660c767e69a743cee8aeb103563a14ea52e9f0001d" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-api", ] @@ -1963,7 +2092,7 @@ checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" dependencies = [ "lazy_static", "libc", - "libloading", + "libloading 0.5.2", "winapi 0.3.9", ] @@ -2013,9 +2142,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f55667319111d593ba876406af7c409c0ebb44dc4be6132a783ccf163ea14c1" +checksum = "0e7e43a803dae2fa37c1f6a8fe121e1f7bf9548b4dfc0522a42f34145dadfc27" dependencies = [ "futures-channel", "futures-core", @@ -2028,9 +2157,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2dd2df839b57db9ab69c2c9d8f3e8c81984781937fe2807dc6dcf3b2ad2939" +checksum = "e682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2" dependencies = [ "futures-core", "futures-sink", @@ -2038,9 +2167,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15496a72fabf0e62bdc3df11a59a3787429221dd0710ba8ef163d6f7a9112c94" +checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1" [[package]] name = "futures-cpupool" @@ -2059,20 +2188,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdcef58a173af8148b182684c9f2d5250875adbcaff7b5794073894f9d8634a9" dependencies = [ "futures 0.1.31", - "futures 0.3.13", + "futures 0.3.15", "lazy_static", "log", "parking_lot 0.9.0", - "pin-project 0.4.27", + "pin-project 0.4.28", "serde", "serde_json", ] [[package]] name = "futures-executor" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891a4b7b96d84d5940084b2a37632dd65deeae662c114ceaa2c879629c9c0ad1" +checksum = "badaa6a909fac9e7236d0620a2f57f7664640c56575b71a7552fbd68deafab79" dependencies = [ "futures-core", "futures-task", @@ -2082,15 +2211,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71c2c65c57704c32f5241c1223167c2c3294fd34ac020c807ddbe6db287ba59" +checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" [[package]] name = "futures-lite" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4481d0cd0de1d204a4fa55e7d45f07b1d958abcb06714b3446438e2eff695fb" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" dependencies = [ "fastrand", "futures-core", @@ -2103,10 +2232,11 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea405816a5139fb39af82c2beb921d52143f556038378d6db21183a5c37fbfb7" +checksum = "a4c40298486cdf52cc00cd6d6987892ba502c7656a16a4192a9992b1ccedd121" dependencies = [ + "autocfg", "proc-macro-hack", "proc-macro2", "quote", @@ -2120,21 +2250,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a1387e07917c711fb4ee4f48ea0adb04a3c9739e53ef85bf43ae1edc2937a8b" dependencies = [ "futures-io", - "rustls 0.19.0", + "rustls 0.19.1", "webpki", ] [[package]] name = "futures-sink" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85754d98985841b7d4f5e8e6fbfa4a4ac847916893ec511a2917ccd8525b8bb3" +checksum = "a57bead0ceff0d6dde8f465ecd96c9338121bb7717d3e7b108059531870c4282" [[package]] name = "futures-task" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa189ef211c15ee602667a6fcfe1c1fd9e07d42250d2156382820fba33c9df80" +checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae" [[package]] name = "futures-timer" @@ -2150,10 +2280,11 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1812c7ab8aedf8d6f2701a43e1243acdbcc2b36ab26e2ad421eb99ac963d96d1" +checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967" dependencies = [ + "autocfg", "futures 0.1.31", "futures-channel", "futures-core", @@ -2184,15 +2315,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "generic-array" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f797e67af32588215eaaab8327027ee8e71b9dd0b2b26996aedf20c030fce309" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.4" @@ -2216,9 +2338,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ "cfg-if 1.0.0", "libc", @@ -2246,6 +2368,12 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "gimli" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" + [[package]] name = "glob" version = "0.3.0" @@ -2254,9 +2382,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "globset" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c152169ef1e421390738366d2f796655fec62621dabbd0fd476f905934061e4a" +checksum = "f0fc1b9fa0e64ffb1aa5b95daa0f0f167734fd528b7c02eabc581d9d843649b1" dependencies = [ "aho-corasick", "bstr", @@ -2307,7 +2435,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.3", + "http 0.2.4", "indexmap", "slab", "tokio 0.2.25", @@ -2316,16 +2444,22 @@ dependencies = [ "tracing-futures", ] +[[package]] +name = "hamming" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65043da274378d68241eb9a8f8f8aa54e349136f7b8e12f63e3ef44043cc30e1" + [[package]] name = "handlebars" -version = "3.5.4" +version = "3.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "580b6f551b29a3a02436318aed09ba1c58eea177dc49e39beac627ad356730a5" +checksum = "4498fc115fa7d34de968184e473529abb40eeb6be8bc5f7faba3d08c316cb3e3" dependencies = [ "log", "pest", "pest_derive", - "quick-error 2.0.0", + "quick-error 2.0.1", "serde", "serde_json", ] @@ -2342,7 +2476,7 @@ version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" dependencies = [ - "crunchy", + "crunchy 0.2.2", ] [[package]] @@ -2356,9 +2490,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ "unicode-segmentation", ] @@ -2434,9 +2568,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" dependencies = [ "bytes 1.0.1", "fnv", @@ -2462,14 +2596,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ "bytes 0.5.6", - "http 0.2.3", + "http 0.2.4", ] [[package]] name = "httparse" -version = "1.3.5" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" +checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68" [[package]] name = "httpdate" @@ -2527,12 +2661,12 @@ dependencies = [ "futures-core", "futures-util", "h2 0.2.7", - "http 0.2.3", + "http 0.2.4", "http-body 0.3.1", "httparse", "httpdate", "itoa", - "pin-project 1.0.6", + "pin-project 1.0.7", "socket2 0.3.19", "tokio 0.2.25", "tower-service", @@ -2571,9 +2705,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", @@ -2608,7 +2742,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b8538953a3f0d0d3868f0a706eb4273535e10d72acb5c82c1c23ae48835c85" dependencies = [ "async-io", - "futures 0.3.13", + "futures 0.3.15", "futures-lite", "if-addrs", "ipnet", @@ -2617,13 +2751,31 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "impl-codec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1be51a921b067b0eaca2fad532d9400041561aa922221cc65f95a85641c6bf53" +dependencies = [ + "parity-scale-codec 1.3.7", +] + [[package]] name = "impl-codec" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df170efa359aebdd5cb7fe78edcc67107748e4737bdca8a8fb40d15ea7a877ed" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", +] + +[[package]] +name = "impl-rlp" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f7a72f11830b52333f36e3b09a288333888bf54380fd0ac0790a3c31ab0f3c5" +dependencies = [ + "rlp 0.4.6", ] [[package]] @@ -2632,7 +2784,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" dependencies = [ - "rlp", + "rlp 0.5.0", ] [[package]] @@ -2701,7 +2853,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "futures-timer 2.0.2", ] @@ -2722,9 +2874,9 @@ checksum = "2ee15951c035f79eddbef745611ec962f63f4558f1dadf98ab723cc603487c6f" [[package]] name = "ipnet" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" +checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" [[package]] name = "itertools" @@ -2743,18 +2895,18 @@ checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "jobserver" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" +checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.49" +version = "0.3.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc15e39392125075f60c95ba416f5381ff6c3a948ff02ab12464715adf56c821" +checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" dependencies = [ "wasm-bindgen", ] @@ -2841,7 +2993,7 @@ version = "14.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0e77e8812f02155b85a677a96e1d16b60181950c0636199bc4528524fba98dc" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -2853,7 +3005,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99a847f9ec7bb52149b2786a17c9cb260d6effc6b8eeb8c16b343a487a7563a3" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -2950,6 +3102,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" +[[package]] +name = "keccak-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f58a51ef3df9398cf2434bea8d4eb61fb748d0feb1571f87388579a120a4c8f" +dependencies = [ + "primitive-types 0.7.3", + "tiny-keccak", +] + [[package]] name = "kernel32-sys" version = "0.2.2" @@ -2992,9 +3154,9 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34446c373ccc494c2124439281c198c7636ccdc2752c06722bbffd56d459c1e4" +checksum = "94b27cdb788bf1c8ade782289f9dbee626940be2961fd75c7cde993fa2f1ded1" dependencies = [ "fs-swap", "kvdb", @@ -3031,9 +3193,9 @@ checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" [[package]] name = "libc" -version = "0.2.91" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8916b1f6ca17130ec6568feccee27c156ad12037880833a3b842a823236502e7" +checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" [[package]] name = "libloading" @@ -3045,6 +3207,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "libloading" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +dependencies = [ + "cfg-if 1.0.0", + "winapi 0.3.9", +] + [[package]] name = "libm" version = "0.2.1" @@ -3059,7 +3231,7 @@ checksum = "d5133112ce42be9482f6a87be92a605dd6bbc9e93c297aee77d172ff06908f3a" dependencies = [ "atomic", "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.15", "lazy_static", "libp2p-core", "libp2p-core-derive", @@ -3084,7 +3256,7 @@ dependencies = [ "libp2p-yamux", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.6", + "pin-project 1.0.7", "smallvec 1.6.1", "wasm-timer", ] @@ -3100,7 +3272,7 @@ dependencies = [ "ed25519-dalek", "either", "fnv", - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "lazy_static", "libsecp256k1", @@ -3109,13 +3281,13 @@ dependencies = [ "multistream-select", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.6", + "pin-project 1.0.7", "prost", "prost-build", "rand 0.7.3", "ring", "rw-stream-sink", - "sha2 0.9.3", + "sha2 0.9.5", "smallvec 1.6.1", "thiserror", "unsigned-varint 0.7.0", @@ -3140,7 +3312,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d42eed63305f0420736fa487f9acef720c4528bd7852a6a760f5ccde4813345" dependencies = [ "flate2", - "futures 0.3.13", + "futures 0.3.15", "libp2p-core", ] @@ -3150,7 +3322,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5153b6db68fd4baa3b304e377db744dd8fea8ff4e4504509ee636abcde88d3e3" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "libp2p-core", "log", ] @@ -3163,7 +3335,7 @@ checksum = "b3c63dfa06581b24b1d12bf9815b43689a784424be217d6545c800c7c75a207f" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.13", + "futures 0.3.15", "libp2p-core", "libp2p-swarm", "log", @@ -3184,7 +3356,7 @@ dependencies = [ "byteorder", "bytes 1.0.1", "fnv", - "futures 0.3.13", + "futures 0.3.15", "hex_fmt", "libp2p-core", "libp2p-swarm", @@ -3193,7 +3365,7 @@ dependencies = [ "prost-build", "rand 0.7.3", "regex", - "sha2 0.9.3", + "sha2 0.9.5", "smallvec 1.6.1", "unsigned-varint 0.6.0", "wasm-timer", @@ -3205,7 +3377,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b40fb36a059b7a8cce1514bd8b546fa612e006c9937caa7f5950cb20021fe91e" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "libp2p-core", "libp2p-swarm", "log", @@ -3226,16 +3398,16 @@ dependencies = [ "bytes 1.0.1", "either", "fnv", - "futures 0.3.13", + "futures 0.3.15", "libp2p-core", "libp2p-swarm", "log", "prost", "prost-build", "rand 0.7.3", - "sha2 0.9.3", + "sha2 0.9.5", "smallvec 1.6.1", - "uint", + "uint 0.9.0", "unsigned-varint 0.7.0", "void", "wasm-timer", @@ -3250,7 +3422,7 @@ dependencies = [ "async-io", "data-encoding", "dns-parser", - "futures 0.3.13", + "futures 0.3.15", "if-watch", "lazy_static", "libp2p-core", @@ -3270,7 +3442,7 @@ checksum = "350ce8b3923594aedabd5d6e3f875d058435052a29c3f32df378bc70d10be464" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.15", "libp2p-core", "log", "nohash-hasher", @@ -3287,15 +3459,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4aca322b52a0c5136142a7c3971446fb1e9964923a526c9cc6ef3b7c94e57778" dependencies = [ "bytes 1.0.1", - "curve25519-dalek 3.0.2", - "futures 0.3.13", + "curve25519-dalek 3.1.0", + "futures 0.3.15", "lazy_static", "libp2p-core", "log", "prost", "prost-build", "rand 0.7.3", - "sha2 0.9.3", + "sha2 0.9.5", "snow", "static_assertions", "x25519-dalek", @@ -3308,7 +3480,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f3813276d0708c8db0f500d8beda1bda9ad955723b9cb272c41f4727256f73c" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "libp2p-core", "libp2p-swarm", "log", @@ -3325,7 +3497,7 @@ checksum = "9d58defcadb646ae4b033e130b48d87410bf76394dc3335496cae99dac803e61" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.15", "libp2p-core", "log", "prost", @@ -3340,9 +3512,9 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce3374f3b28162db9d3442c9347c4f14cb01e8290052615c7d341d40eae0599" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "log", - "pin-project 1.0.6", + "pin-project 1.0.7", "rand 0.7.3", "salsa20", "sha3 0.9.1", @@ -3356,7 +3528,7 @@ checksum = "10e5552827c33d8326502682da73a0ba4bfa40c1b55b216af3c303f32169dd89" dependencies = [ "async-trait", "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.15", "libp2p-core", "libp2p-swarm", "log", @@ -3375,7 +3547,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7955b973e1fd2bd61ffd43ce261c1223f61f4aacd5bae362a924993f9a25fd98" dependencies = [ "either", - "futures 0.3.13", + "futures 0.3.15", "libp2p-core", "log", "rand 0.7.3", @@ -3391,7 +3563,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88a5aef80e519a6cb8e2663605142f97baaaea1a252eecbf8756184765f7471b" dependencies = [ "async-io", - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "if-watch", "ipnet", @@ -3408,7 +3580,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80ac51ce419f60be966e02103c17f67ff5dc4422ba83ba54d251d6c62a4ed487" dependencies = [ "async-std", - "futures 0.3.13", + "futures 0.3.15", "libp2p-core", "log", ] @@ -3419,7 +3591,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6149c46cb76935c80bc8be6ec6e3ebd5f5e1679765a255fb34331d54610f15dd" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -3434,14 +3606,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3b1c6a3431045da8b925ed83384e4c5163e14b990572307fca9c507435d4d22" dependencies = [ "either", - "futures 0.3.13", + "futures 0.3.15", "futures-rustls", "libp2p-core", "log", "quicksink", "rw-stream-sink", "soketto", - "url 2.2.1", + "url 2.2.2", "webpki-roots", ] @@ -3451,7 +3623,7 @@ version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4819358c542a86ff95f6ae691efb4b94ddaf477079b01a686f5705b79bfc232a" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "libp2p-core", "parking_lot 0.11.1", "thiserror", @@ -3460,9 +3632,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "6.11.4" +version = "6.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b56f651c204634b936be2f92dbb42c36867e00ff7fe2405591f3b9fa66f09" +checksum = "5da125e1c0f22c7cae785982115523a0738728498547f415c9054cb17c7e89f9" dependencies = [ "bindgen", "cc", @@ -3477,7 +3649,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fc1e2c808481a63dc6da2074752fdd4336a3c8fcc68b83db6f1fd5224ae7962" dependencies = [ "arrayref", - "crunchy", + "crunchy 0.2.2", "digest 0.8.1", "hmac-drbg", "rand 0.7.3", @@ -3488,9 +3660,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" +checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66" dependencies = [ "cc", "pkg-config", @@ -3514,11 +3686,11 @@ dependencies = [ [[package]] name = "linregress" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0ad4b5cc8385a881c561fac3501353d63d2a2b7a357b5064d71815c9a92724" +checksum = "b1ff7f341d23e1275eec0656a9a07225fcc86216c4322392868adffe59023d1a" dependencies = [ - "nalgebra", + "nalgebra 0.27.1", "statrs", ] @@ -3533,9 +3705,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" +checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" dependencies = [ "scopeguard", ] @@ -3591,9 +3763,9 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "matrixmultiply" -version = "0.2.4" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916806ba0031cd542105d916a97c8572e1fa6dd79c9c51e7eb43a09ec2dd84c1" +checksum = "5a8a15b776d9dfaecd44b03c5828c2199cddff5247215858aac14624f8d6b741" dependencies = [ "rawpointer", ] @@ -3606,15 +3778,25 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.3.4" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" + +[[package]] +name = "memmap" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff" +dependencies = [ + "libc", + "winapi 0.3.9", +] [[package]] name = "memmap2" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6" +checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4" dependencies = [ "libc", ] @@ -3630,9 +3812,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc14fc54a812b4472b4113facc3e44d099fbc0ea2ce0551fa5c703f8edfbfd38" +checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" dependencies = [ "autocfg", ] @@ -3695,7 +3877,7 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-api", "sp-block-builder", @@ -3716,6 +3898,10 @@ name = "metaversevm" version = "0.12.1" dependencies = [ "array-bytes", + "ethash", + "ethash-rpc", + "ethereum-types 0.9.2", + "ethpow", "fc-db", "fc-mapping-sync", "fc-rpc", @@ -3723,7 +3909,7 @@ dependencies = [ "fp-rpc", "frame-benchmarking", "frame-benchmarking-cli", - "futures 0.3.13", + "futures 0.3.15", "jsonrpc-core 15.1.0", "jsonrpc-pubsub 15.1.0", "log", @@ -3731,11 +3917,14 @@ dependencies = [ "pallet-ethereum", "pallet-evm", "pallet-transaction-payment-rpc", + "parity-scale-codec 2.1.3", + "parking_lot 0.11.1", "sc-basic-authorship", "sc-cli", "sc-client-api", "sc-consensus", "sc-consensus-aura", + "sc-consensus-pow", "sc-executor", "sc-finality-grandpa", "sc-keystore", @@ -3754,6 +3943,7 @@ dependencies = [ "sp-finality-grandpa", "sp-inherents", "sp-runtime", + "sp-timestamp", "sp-transaction-pool", "structopt", "substrate-build-script-utils", @@ -3771,9 +3961,9 @@ dependencies = [ [[package]] name = "minicbor-derive" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce18b5423c573a13e80cb3046ea0af6379ef725dc3af4886bdb8f4e5093068" +checksum = "7f2b9e8883d58e34b18facd16c4564a77ea50fce028ad3d0ee6753440e37acc8" dependencies = [ "proc-macro2", "quote", @@ -3894,18 +4084,18 @@ dependencies = [ "digest 0.9.0", "generic-array 0.14.4", "multihash-derive", - "sha2 0.9.3", + "sha2 0.9.5", "sha3 0.9.1", "unsigned-varint 0.5.1", ] [[package]] name = "multihash-derive" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85ee3c48cb9d9b275ad967a0e96715badc13c6029adb92f34fa17b9ff28fd81f" +checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro-error", "proc-macro2", "quote", @@ -3926,48 +4116,64 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d91ec0a2440aaff5f78ec35631a7027d50386c6163aa975f7caa0d5da4b6ff8" dependencies = [ "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.15", "log", - "pin-project 1.0.6", + "pin-project 1.0.7", "smallvec 1.6.1", "unsigned-varint 0.7.0", ] [[package]] name = "nalgebra" -version = "0.21.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b6147c3d50b4f3cdabfe2ecc94a0191fd3d6ad58aefd9664cf396285883486" +checksum = "476d1d59fe02fe54c86356e91650cd892f392782a1cb9fc524ec84f7aa9e1d06" dependencies = [ - "approx", - "generic-array 0.13.3", + "approx 0.4.0", "matrixmultiply", - "num-complex 0.2.4", - "num-rational 0.2.4", + "num-complex 0.3.1", + "num-rational 0.3.2", "num-traits", - "rand 0.7.3", + "rand 0.8.4", "rand_distr", - "simba", + "simba 0.4.0", "typenum", ] [[package]] -name = "names" -version = "0.11.0" +name = "nalgebra" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef320dab323286b50fb5cdda23f61c796a72a89998ab565ca32525c5c556f2da" +checksum = "462fffe4002f4f2e1f6a9dcf12cc1a6fc0e15989014efc02a941d3e0f5dc2120" dependencies = [ - "rand 0.3.23", + "approx 0.5.0", + "matrixmultiply", + "nalgebra-macros", + "num-complex 0.4.0", + "num-rational 0.4.0", + "num-traits", + "simba 0.5.1", + "typenum", ] [[package]] -name = "nb-connect" -version = "1.1.0" +name = "nalgebra-macros" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19900e7eee95eb2b3c2e26d12a874cc80aaf750e31be6fcbe743ead369fa45d" +checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" dependencies = [ - "libc", - "socket2 0.4.0", + "proc-macro2", + "quote", + "syn", +] + +[[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]] @@ -4041,19 +4247,18 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.2.4" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-complex" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" +checksum = "26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085" dependencies = [ "num-traits", ] @@ -4093,12 +4298,23 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.3.2" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-bigint 0.3.2", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" dependencies = [ "autocfg", - "num-bigint 0.3.2", "num-integer", "num-traits", ] @@ -4135,15 +4351,18 @@ dependencies = [ [[package]] name = "object" -version = "0.23.0" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" +checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +dependencies = [ + "memchr", +] [[package]] name = "once_cell" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" dependencies = [ "parking_lot 0.11.1", ] @@ -4162,9 +4381,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl-probe" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" [[package]] name = "owning_ref" @@ -4185,7 +4404,7 @@ dependencies = [ "frame-system", "pallet-session", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-application-crypto", "sp-consensus-aura", @@ -4203,7 +4422,7 @@ dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples 0.2.1", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-authorship", "sp-inherents", "sp-runtime", @@ -4219,7 +4438,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-runtime", "sp-std 3.0.0", @@ -4232,7 +4451,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "141af8771928ad054850f38dc4c23747b532254bdeeb1aeaf9288c7ad37241e0" dependencies = [ "ethereum", - "ethereum-types", + "ethereum-types 0.11.0", "evm", "fp-consensus", "fp-evm", @@ -4244,9 +4463,9 @@ dependencies = [ "pallet-balances", "pallet-evm", "pallet-timestamp", - "parity-scale-codec", - "rlp", - "rustc-hex", + "parity-scale-codec 2.1.3", + "rlp 0.5.0", + "rustc-hex 2.1.0", "serde", "sha3 0.8.2", "sp-io", @@ -4269,9 +4488,9 @@ dependencies = [ "log", "pallet-balances", "pallet-timestamp", - "parity-scale-codec", - "primitive-types", - "rlp", + "parity-scale-codec 2.1.3", + "primitive-types 0.9.0", + "rlp 0.5.0", "serde", "sha3 0.8.2", "sp-core", @@ -4315,7 +4534,7 @@ dependencies = [ "fp-evm", "frame-support", "pallet-evm", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-core", "sp-io", ] @@ -4370,7 +4589,7 @@ dependencies = [ "frame-system", "pallet-authorship", "pallet-session", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-application-crypto", "sp-core", @@ -4389,7 +4608,7 @@ checksum = "ca3ea6fa9aa36735ec11d7ec4d97dd6472650c0656fdc6d4adaca2578bd71134" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "safe-mix", "sp-runtime", "sp-std 3.0.0", @@ -4405,7 +4624,7 @@ dependencies = [ "frame-system", "impl-trait-for-tuples 0.2.1", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-core", "sp-io", @@ -4424,7 +4643,7 @@ checksum = "c4a96774302e3824b7924c2465935ca4d558ea5f6a762c043fbc45fd2646ce89" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-io", "sp-runtime", @@ -4438,7 +4657,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-core", "sp-io", @@ -4456,7 +4675,7 @@ dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples 0.2.1", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-inherents", "sp-io", @@ -4473,7 +4692,7 @@ checksum = "48e10dc1a10dd3f52edb20d3885cf5b2b16f26273a4d93e61331c6691fb13ab3" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "smallvec 1.6.1", "sp-core", @@ -4492,7 +4711,7 @@ dependencies = [ "jsonrpc-core-client 15.1.0", "jsonrpc-derive 15.1.0", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-api", "sp-blockchain", "sp-core", @@ -4507,16 +4726,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a92d3383260d0d19d9a36f40766d48d779fd19baccba8b20c3e7d2670a26ee1" dependencies = [ "pallet-transaction-payment", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-api", "sp-runtime", ] [[package]] name = "parity-db" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495197c078e54b8735181aa35c00a327f7f3a3cc00a1ee8c95926dd010f0ec6b" +checksum = "2e337f62db341435f0da05b8f6b97e984ef4ea5800510cd07c2d624688c40b47" dependencies = [ "blake2-rfc", "crc32fast", @@ -4526,7 +4745,7 @@ dependencies = [ "log", "memmap2", "parking_lot 0.11.1", - "rand 0.8.3", + "rand 0.8.4", ] [[package]] @@ -4544,29 +4763,41 @@ dependencies = [ "serde", "static_assertions", "unsigned-varint 0.7.0", - "url 2.2.1", + "url 2.2.2", ] [[package]] name = "parity-scale-codec" -version = "2.0.1" +version = "1.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cd3dab59b5cf4bc81069ade0fc470341a1ef3ad5fa73e5a8943bed2ec12b2e8" +checksum = "a4b26b16c7687c3075982af47719e481815df30bc544f7a6690763a25ca16e9d" dependencies = [ "arrayvec 0.5.2", - "bitvec", - "byte-slice-cast", + "bitvec 0.17.4", + "byte-slice-cast 0.3.5", + "serde", +] + +[[package]] +name = "parity-scale-codec" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b310f220c335f9df1b3d2e9fbe3890bbfeef5030dad771620f48c5c229877cd3" +dependencies = [ + "arrayvec 0.7.1", + "bitvec 0.20.4", + "byte-slice-cast 1.0.0", "parity-scale-codec-derive", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "2.0.1" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa04976a81fde04924b40cc4036c4d12841e8bb04325a5cf2ada75731a150a7d" +checksum = "81038e13ca2c32587201d544ea2e6b6c47120f1e4eae04478f9f60b6bcb89145" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -4608,7 +4839,7 @@ dependencies = [ "impl-trait-for-tuples 0.2.1", "parity-util-mem-derive", "parking_lot 0.11.1", - "primitive-types", + "primitive-types 0.9.0", "smallvec 1.6.1", "winapi 0.3.9", ] @@ -4654,7 +4885,7 @@ dependencies = [ "rand 0.7.3", "sha-1 0.8.2", "slab", - "url 2.2.1", + "url 2.2.2", ] [[package]] @@ -4691,7 +4922,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ "instant", - "lock_api 0.4.2", + "lock_api 0.4.4", "parking_lot_core 0.8.3", ] @@ -4733,36 +4964,17 @@ dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall 0.2.5", + "redox_syscall 0.2.9", "smallvec 1.6.1", "winapi 0.3.9", ] -[[package]] -name = "paste" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" -dependencies = [ - "paste-impl", - "proc-macro-hack", -] - [[package]] name = "paste" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" -[[package]] -name = "paste-impl" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6" -dependencies = [ - "proc-macro-hack", -] - [[package]] name = "pbkdf2" version = "0.3.0" @@ -4861,27 +5073,27 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" +checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f" dependencies = [ - "pin-project-internal 0.4.27", + "pin-project-internal 0.4.28", ] [[package]] name = "pin-project" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc174859768806e91ae575187ada95c91a29e96a98dc5d2cd9a1fed039501ba6" +checksum = "c7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4" dependencies = [ - "pin-project-internal 1.0.6", + "pin-project-internal 1.0.7", ] [[package]] name = "pin-project-internal" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" +checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" dependencies = [ "proc-macro2", "quote", @@ -4890,9 +5102,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a490329918e856ed1b083f244e3bfe2d8c4f336407e4ea9e1a9f479ff09049e5" +checksum = "48c950132583b500556b1efd71d45b319029f2b71518d979fcc208e16b42426f" dependencies = [ "proc-macro2", "quote", @@ -4931,14 +5143,14 @@ checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325" [[package]] name = "polling" -version = "2.0.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc12d774e799ee9ebae13f4076ca003b40d18a11ac0f3641e6f899618580b7b" +checksum = "92341d779fa34ea8437ef4d82d440d5e1ce3f3ff7f824aa64424cd481f9a1f25" dependencies = [ "cfg-if 1.0.0", "libc", "log", - "wepoll-sys", + "wepoll-ffi", "winapi 0.3.9", ] @@ -4948,7 +5160,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b7456bc1ad2d4cf82b3a016be4c2ac48daf11bf990c1603ebd447fe6f30fca8" dependencies = [ - "cpuid-bool 0.2.0", + "cpuid-bool", "universal-hash", ] @@ -4958,7 +5170,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" dependencies = [ - "cpuid-bool 0.2.0", + "cpuid-bool", "opaque-debug 0.3.0", "universal-hash", ] @@ -4969,17 +5181,77 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +[[package]] +name = "primal" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e31b86efadeaeb1235452171a66689682783149a6249ff334a2c5d8218d00a4" +dependencies = [ + "primal-check", + "primal-estimate", + "primal-sieve", +] + +[[package]] +name = "primal-bit" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686a64e2f50194c64942992af5799e6b6e8775b8f88c607d72ed0a2fd58b9b21" +dependencies = [ + "hamming", +] + +[[package]] +name = "primal-check" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e65f96c0a171f887198c274392c99a116ef65aa7f53f3b6d4902f493965c2d1" +dependencies = [ + "num-integer", +] + +[[package]] +name = "primal-estimate" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ea4531dde757b56906493c8604641da14607bf9cdaa80fb9c9cabd2429f8d5" + +[[package]] +name = "primal-sieve" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da2d6ed369bb4b0273aeeb43f07c105c0117717cbae827b20719438eb2eb798c" +dependencies = [ + "hamming", + "primal-bit", + "primal-estimate", + "smallvec 0.6.14", +] + +[[package]] +name = "primitive-types" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd39dcacf71411ba488570da7bbc89b717225e46478b30ba99b92db6b149809" +dependencies = [ + "fixed-hash 0.6.1", + "impl-codec 0.4.2", + "impl-rlp 0.2.1", + "impl-serde", + "uint 0.8.5", +] + [[package]] name = "primitive-types" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2415937401cb030a2a0a4d922483f945fa068f52a7dbb22ce0fe5f2b6f6adace" dependencies = [ - "fixed-hash", - "impl-codec", - "impl-rlp", + "fixed-hash 0.7.0", + "impl-codec 0.5.0", + "impl-rlp 0.3.0", "impl-serde", - "uint", + "uint 0.9.0", ] [[package]] @@ -4991,6 +5263,16 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-crate" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92" +dependencies = [ + "thiserror", + "toml", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -5029,9 +5311,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" dependencies = [ "unicode-xid", ] @@ -5075,7 +5357,7 @@ dependencies = [ "prost", "prost-types", "tempfile", - "which 4.0.2", + "which", ] [[package]] @@ -5103,9 +5385,9 @@ dependencies = [ [[package]] name = "psm" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3abf49e5417290756acfd26501536358560c4a5cc4a0934d390939acb3e7083a" +checksum = "21ff0279b4a85e576b97e4a21d13e437ebcd56612706cde5d3f0d5c9399490c0" dependencies = [ "cc", ] @@ -5129,9 +5411,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quick-error" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ac73b1112776fc109b2e61909bc46c7e1bf0d7f690ffb1676553acce16d5cda" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quicksink" @@ -5153,6 +5435,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" + [[package]] name = "radium" version = "0.6.2" @@ -5207,14 +5495,14 @@ dependencies = [ [[package]] name = "rand" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" dependencies = [ "libc", - "rand_chacha 0.3.0", - "rand_core 0.6.2", - "rand_hc 0.3.0", + "rand_chacha 0.3.1", + "rand_core 0.6.3", + "rand_hc 0.3.1", ] [[package]] @@ -5229,12 +5517,12 @@ dependencies = [ [[package]] name = "rand_chacha" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.2", + "rand_core 0.6.3", ] [[package]] @@ -5263,20 +5551,21 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.2", + "getrandom 0.2.3", ] [[package]] name = "rand_distr" -version = "0.2.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96977acbdd3a6576fb1d27391900035bf3863d4a16422973a409b488cf29ffb2" +checksum = "051b398806e42b9cd04ad9ec8f81e355d0a382c543ac6672c62f5a5b452ef142" dependencies = [ - "rand 0.7.3", + "num-traits", + "rand 0.8.4", ] [[package]] @@ -5290,11 +5579,11 @@ dependencies = [ [[package]] name = "rand_hc" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" dependencies = [ - "rand_core 0.6.2", + "rand_core 0.6.3", ] [[package]] @@ -5325,9 +5614,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" +checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" dependencies = [ "autocfg", "crossbeam-deque 0.8.0", @@ -5337,13 +5626,13 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" +checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" dependencies = [ "crossbeam-channel", "crossbeam-deque 0.8.0", - "crossbeam-utils 0.8.3", + "crossbeam-utils 0.8.5", "lazy_static", "num_cpus", ] @@ -5365,32 +5654,21 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" dependencies = [ "bitflags", ] -[[package]] -name = "redox_users" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" -dependencies = [ - "getrandom 0.1.16", - "redox_syscall 0.1.57", - "rust-argon2", -] - [[package]] name = "redox_users" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ - "getrandom 0.2.2", - "redox_syscall 0.2.5", + "getrandom 0.2.3", + "redox_syscall 0.2.9", ] [[package]] @@ -5426,9 +5704,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.4.5" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" dependencies = [ "aho-corasick", "memchr", @@ -5437,19 +5715,18 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "byteorder", "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.23" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "region" @@ -5474,9 +5751,9 @@ dependencies = [ [[package]] name = "retain_mut" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53552c6c49e1e13f1a203ef0080ab3bbef0beb570a528993e83df057a9d9bba1" +checksum = "e9c17925a9027d298a4603d286befe3f9dc0e8ed02523141914eb628798d6e5b" [[package]] name = "ring" @@ -5493,6 +5770,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "rlp" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190dcc8c3a512f1eef5d09bb8c84c7f39e1054e174d1795482e18f5272f2e73" +dependencies = [ + "rustc-hex 2.1.0", +] + [[package]] name = "rlp" version = "0.5.0" @@ -5500,7 +5786,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e54369147e3e7796c9b885c7304db87ca3d09a0a98f72843d532868675bbfba8" dependencies = [ "bytes 1.0.1", - "rustc-hex", + "rustc-hex 2.1.0", ] [[package]] @@ -5516,9 +5802,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d83c02c429044d58474eaf5ae31e062d0de894e21125b47437ec0edc1397e6" +checksum = "c749134fda8bfc90d0de643d59bfc841dcb3ac8a1062e12b6754bd60235c48b3" dependencies = [ "libc", "librocksdb-sys", @@ -5534,23 +5820,11 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "rust-argon2" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" -dependencies = [ - "base64 0.13.0", - "blake2b_simd", - "constant_time_eq", - "crossbeam-utils 0.8.3", -] - [[package]] name = "rustc-demangle" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" +checksum = "410f7acf3cb3a44527c5d9546bad4bf4e6c460915d5f9f2fc524498bfe8f70ce" [[package]] name = "rustc-hash" @@ -5558,6 +5832,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hex" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ceb8ce7a5e520de349e1fa172baeba4a9e8d5ef06c47471863530bc4972ee1e" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -5588,9 +5868,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ "base64 0.13.0", "log", @@ -5617,8 +5897,8 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.13", - "pin-project 0.4.27", + "futures 0.3.15", + "pin-project 0.4.28", "static_assertions", ] @@ -5661,10 +5941,10 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de86afb63617599821312bda08882451ff2b49d9c45e22513ddff5a07c6d966e" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sc-block-builder", "sc-client-api", "sc-proposer-metrics", @@ -5685,7 +5965,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9862161f9d09d870401c7256c89ad1eb3afa56a61f7d7135c2bac76ff7152955" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sc-client-api", "sp-api", "sp-block-builder", @@ -5704,7 +5984,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50d97030776b49bc9c109e2d349212d8f2500637761048e1af5b7ce2dfd994c7" dependencies = [ "impl-trait-for-tuples 0.2.1", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sc-chain-spec-derive", "sc-consensus-babe", "sc-consensus-epochs", @@ -5725,7 +6005,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f14985513db9798fcedea58bdc8a08f1c6b3a515d6546ced7467b059b7982c4" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -5739,12 +6019,12 @@ checksum = "7ec1647b5c1483fa05f7f32e436d0e378e2f3d5696a5a30bddf66f5faf28acb4" dependencies = [ "chrono", "fdlimit", - "futures 0.3.13", + "futures 0.3.15", "hex", "libp2p", "log", "names", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "rand 0.7.3", "regex", "rpassword", @@ -5778,12 +6058,12 @@ checksum = "56d8b2c8dc0cee9ac56e87ad50c980edbdeb35bdd5b5d9da4ae90567423363be" dependencies = [ "derive_more", "fnv", - "futures 0.3.13", + "futures 0.3.15", "hash-db", "kvdb", "lazy_static", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "sc-executor", "sp-api", @@ -5819,7 +6099,7 @@ dependencies = [ "linked-hash-map", "log", "parity-db", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parity-util-mem", "parking_lot 0.11.1", "sc-client-api", @@ -5855,10 +6135,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e0d32ccddef567a0fe373729aa4da51b2d437cbb102b9810400c9e77e040c1d" dependencies = [ "derive_more", - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "sc-block-builder", "sc-client-api", @@ -5889,14 +6169,14 @@ checksum = "98d52048476e0fcb53feae8ca919a602104f1ba0b89a729b496440f36b332961" dependencies = [ "derive_more", "fork-tree", - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "log", "merlin", "num-bigint 0.2.6", "num-rational 0.2.4", "num-traits", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "pdqselect", "rand 0.7.3", @@ -5935,11 +6215,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "326313ffb249a526e8ee8e08af9fdf0c4459cebeaa760b934e9df3985b68e4df" dependencies = [ "fork-tree", - "parity-scale-codec", + "parity-scale-codec 2.1.3", + "parking_lot 0.11.1", + "sc-client-api", + "sp-blockchain", + "sp-runtime", +] + +[[package]] +name = "sc-consensus-pow" +version = "0.9.0" +dependencies = [ + "derive_more", + "futures 0.3.15", + "futures-timer 3.0.2", + "log", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "sc-client-api", + "sp-api", + "sp-block-builder", "sp-blockchain", + "sp-consensus", + "sp-consensus-pow", + "sp-core", + "sp-inherents", "sp-runtime", + "sp-timestamp", + "substrate-prometheus-endpoint", ] [[package]] @@ -5948,10 +6251,10 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76e09ff8b680d449102da9717a70c3bbbbb981fd4cf1bfbafc1739d954eb0898" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "sc-client-api", "sc-telemetry", @@ -5994,7 +6297,7 @@ dependencies = [ "lazy_static", "libsecp256k1", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parity-wasm 0.41.0", "parking_lot 0.11.1", "sc-executor-common", @@ -6021,7 +6324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87004102a8e95f432f1c624c7fa7fb0edc5995db2e0fcbabbb697f1955e7c1d2" dependencies = [ "derive_more", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parity-wasm 0.41.0", "sp-allocator", "sp-core", @@ -6038,7 +6341,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3d7b6db2df5f2c24848883a855a8276363f00cef5b49744974f7e1203bf274" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sc-executor-common", "sp-allocator", "sp-core", @@ -6054,7 +6357,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24673c981fad2dff4398a09a1086579e2774f18d81639fa2bd9cb215e6dd9e36" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parity-wasm 0.41.0", "pwasm-utils", "sc-executor-common", @@ -6075,13 +6378,13 @@ dependencies = [ "derive_more", "finality-grandpa", "fork-tree", - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "linked-hash-map", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", - "pin-project 1.0.6", + "pin-project 1.0.7", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -6112,7 +6415,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f4c8994853e1158dc4f448b014aa83eef56ced214ec0af316eecf4a6ca3268f" dependencies = [ "ansi_term 0.12.1", - "futures 0.3.13", + "futures 0.3.15", "log", "parity-util-mem", "sc-client-api", @@ -6132,7 +6435,7 @@ checksum = "d966ed36c404eced656bd63aad8a30d2c1a14633f07cd1d7d9c11b62f75a7905" dependencies = [ "async-trait", "derive_more", - "futures 0.3.13", + "futures 0.3.15", "futures-util", "hex", "merlin", @@ -6153,7 +6456,7 @@ checksum = "04e8dbcb2951f7cf76ddf97ed26dcef0dab79d76745de4a8f169d58236ea8704" dependencies = [ "hash-db", "lazy_static", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "sc-client-api", "sc-executor", @@ -6183,7 +6486,7 @@ dependencies = [ "erased-serde", "fnv", "fork-tree", - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "hex", "ip_network", @@ -6193,9 +6496,9 @@ dependencies = [ "log", "lru", "nohash-hasher", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", - "pin-project 1.0.6", + "pin-project 1.0.7", "prost", "prost-build", "rand 0.7.3", @@ -6225,7 +6528,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2cd5487d6f8051863a186e2aea4c233a07bb691780d3b117c9d6ffe1ff9a8fe" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "libp2p", "log", @@ -6244,13 +6547,13 @@ checksum = "7bc91fc71c128748a3393cb3421e12a7759ccffcc1cc4a9e6ff4ead6cc68ba48" dependencies = [ "bytes 0.5.6", "fnv", - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "hyper 0.13.10", "hyper-rustls", "log", "num_cpus", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "rand 0.7.3", "sc-client-api", @@ -6270,7 +6573,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce454e528e7797a239e734d0d66bf904d48be47aa92691ac7546a45ec32a64cf" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "libp2p", "log", "serde_json", @@ -6294,12 +6597,12 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "750397c6aa5a4f922cac99599ad74a4082e3e87553d51ceb4c48abfa056ff32c" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "hash-db", "jsonrpc-core 15.1.0", "jsonrpc-pubsub 15.1.0", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "sc-block-builder", "sc-client-api", @@ -6330,13 +6633,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc8393410297df2885efec20d0629a9833b4fd9e4ad83a92471e1ea0c11a0a54" dependencies = [ "derive_more", - "futures 0.3.13", + "futures 0.3.15", "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", "jsonrpc-derive 15.1.0", "jsonrpc-pubsub 15.1.0", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "serde", "serde_json", @@ -6376,17 +6679,17 @@ dependencies = [ "directories", "exit-future", "futures 0.1.31", - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "hash-db", "jsonrpc-core 15.1.0", "jsonrpc-pubsub 15.1.0", "lazy_static", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parity-util-mem", "parking_lot 0.11.1", - "pin-project 1.0.6", + "pin-project 1.0.7", "rand 0.7.3", "sc-block-builder", "sc-chain-spec", @@ -6438,7 +6741,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f144043d5860ce133f701fa78679d6278f2dfc698686beb5f6d892c267e9d92" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parity-util-mem", "parity-util-mem-derive", "parking_lot 0.11.1", @@ -6454,11 +6757,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05040c594b331d90d7341e82c6dc6a3eb7bb2afb4e5dc9c36a79a6754166057" dependencies = [ "chrono", - "futures 0.3.13", + "futures 0.3.15", "libp2p", "log", "parking_lot 0.11.1", - "pin-project 1.0.6", + "pin-project 1.0.7", "rand 0.7.3", "serde", "serde_json", @@ -6505,7 +6808,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec18b0506911e6d624d9ea8f8cc5f503e7944a0fe7d37de95ee84033cf160ebc" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -6518,7 +6821,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87b385b8f66cce185478c500ad3de8f4775ab0e948c31561aeac78a27bedc654" dependencies = [ "derive_more", - "futures 0.3.13", + "futures 0.3.15", "linked-hash-map", "log", "parity-util-mem", @@ -6540,11 +6843,11 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09f4331ea8da2ff45a9466637f90f5cc89f9d31fcd1cd20f74f2520b33bff069" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "futures-diagnose", "intervalier", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parity-util-mem", "parking_lot 0.11.1", "sc-client-api", @@ -6624,9 +6927,9 @@ dependencies = [ [[package]] name = "sct" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" dependencies = [ "ring", "untrusted", @@ -6709,18 +7012,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.125" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171" +checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.125" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" +checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" dependencies = [ "proc-macro2", "quote", @@ -6752,13 +7055,13 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.9.4" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfebf75d25bd900fd1e7d11501efab59bc846dbc76196839663e6637bba9f25f" +checksum = "8c4cfa741c5832d0ef7fab46cabed29c2aae926db0b11bb2069edd8db5e64e16" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpuid-bool 0.1.2", + "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", ] @@ -6777,13 +7080,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" +checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpuid-bool 0.1.2", + "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", ] @@ -6830,9 +7133,9 @@ checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" [[package]] name = "signal-hook" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aa894ef3fade0ee7243422f4fbbd6c2b48e6de767e621d37ef65f2310f53cea" +checksum = "470c5a6397076fae0094aaf06a08e6ba6f37acb77d3b1b91ea92b4d6c8650c39" dependencies = [ "libc", "signal-hook-registry", @@ -6840,9 +7143,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ "libc", ] @@ -6855,21 +7158,33 @@ checksum = "0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68" [[package]] name = "simba" -version = "0.1.5" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5132a955559188f3d13c9ba831e77c802ddc8782783f050ed0c52f5988b95f4c" +dependencies = [ + "approx 0.4.0", + "num-complex 0.3.1", + "num-traits", + "paste", +] + +[[package]] +name = "simba" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb931b1367faadea6b1ab1c306a860ec17aaa5fa39f367d0c744e69d971a1fb2" +checksum = "8e82063457853d00243beda9952e910b82593e4b07ae9f721b9278a99a0d3d5c" dependencies = [ - "approx", - "num-complex 0.2.4", + "approx 0.5.0", + "num-complex 0.4.0", "num-traits", - "paste 0.1.18", + "paste", ] [[package]] name = "slab" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" [[package]] name = "smallvec" @@ -6899,7 +7214,7 @@ dependencies = [ "rand_core 0.5.1", "ring", "rustc_version", - "sha2 0.9.3", + "sha2 0.9.5", "subtle 2.4.0", "x25519-dalek", ] @@ -6934,11 +7249,11 @@ dependencies = [ "base64 0.12.3", "bytes 0.5.6", "flate2", - "futures 0.3.13", + "futures 0.3.15", "httparse", "log", "rand 0.7.3", - "sha-1 0.9.4", + "sha-1 0.9.6", ] [[package]] @@ -6961,7 +7276,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e63c3460d5daecf67df542c34c2bbd636214a5a200d4bddcfa2ffb9e72c346af" dependencies = [ "hash-db", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-api-proc-macro", "sp-core", "sp-runtime", @@ -6978,7 +7293,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "289624f4fe0f61e63a5019ed26c3bc732b5145eb52796ac6053cd72656d947a1" dependencies = [ "blake2-rfc", - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -6990,7 +7305,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c52e2e6d43036b97c4fce1ed87c5262c1ffdc78c655ada4d3024a3f8094bdd2c" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-core", "sp-io", @@ -7005,7 +7320,7 @@ checksum = "d0f1c69966c192d1dee8521f0b29ece2b14db07b9b44d801a94e295234761645" dependencies = [ "integer-sqrt", "num-traits", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-debug-derive", "sp-std 3.0.0", @@ -7017,7 +7332,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ec68fb8e5a37548b06c14ee91a9c574cc330324c86d37810ec29dd4f8bc68d7" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-inherents", "sp-runtime", "sp-std 3.0.0", @@ -7029,7 +7344,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0adc979dbe619f56d664ebd1293dce13fcad6b8a47bcdd620ed53a454d330d12" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-api", "sp-inherents", "sp-runtime", @@ -7042,10 +7357,10 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8007c1ad8e9fb6cd8eed4e0fc91504a9ca4b228e1315302a2fbb0ac7f509f1b" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "log", "lru", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "sp-api", "sp-consensus", @@ -7071,11 +7386,11 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884db6c4b03f0f2fb2993127a2db95fc740fcd3496746dcaa6829c9868e7dc75" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "futures-timer 3.0.2", "libp2p", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "serde", "sp-api", @@ -7098,7 +7413,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bd00fc95b26393522be1394fb67cc536736cc5a902dec0d3e2827909b7c1118" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-api", "sp-application-crypto", "sp-consensus-slots", @@ -7115,7 +7430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a153085b1542b5cbe23686433cd36d1a634964f1b707671d0ffb01d8d9313047" dependencies = [ "merlin", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-api", "sp-application-crypto", "sp-consensus", @@ -7129,13 +7444,26 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "sp-consensus-pow" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2aa1ffa45f7ad66c613fa3906823a0cc0d33ce2d0e7495f2037c5c4c3211481" +dependencies = [ + "parity-scale-codec 2.1.3", + "sp-api", + "sp-core", + "sp-runtime", + "sp-std 3.0.0", +] + [[package]] name = "sp-consensus-slots" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32bd501ab76c827d74f145063cd8cb993a9f634dac93c9b0d909111cd5900a6a" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-arithmetic", "sp-runtime", ] @@ -7146,7 +7474,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "030895d70bf3095c857f4727a7cce7c43af29efe3413bb547ee28700f7d78766" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", "schnorrkel", "sp-core", "sp-runtime", @@ -7164,7 +7492,7 @@ dependencies = [ "byteorder", "dyn-clonable", "ed25519-dalek", - "futures 0.3.13", + "futures 0.3.15", "hash-db", "hash256-std-hasher", "hex", @@ -7174,16 +7502,16 @@ dependencies = [ "log", "merlin", "num-traits", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parity-util-mem", "parking_lot 0.11.1", - "primitive-types", + "primitive-types 0.9.0", "rand 0.7.3", "regex", "schnorrkel", "secrecy", "serde", - "sha2 0.9.3", + "sha2 0.9.5", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", @@ -7226,7 +7554,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fdc625f8c7b13b9a136d334888b21b5743d2081cb666cb03efca1dc9b8f74d1" dependencies = [ "environmental", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-std 3.0.0", "sp-storage", ] @@ -7239,7 +7567,7 @@ checksum = "702e0be150e1b557df42326ec9b82c2010366631d03be27c69912d446abbf87a" dependencies = [ "finality-grandpa", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-api", "sp-application-crypto", @@ -7255,7 +7583,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2542380b535c6941502a0a3069a657eb5abb70fd67b11afa164d4a4b038ba73a" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "sp-core", "sp-std 3.0.0", @@ -7268,11 +7596,11 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33fd69f0a6e91bedc2fb1c5cc3689c212474b6c918274cb4cb14dbbe3c428c14" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "hash-db", "libsecp256k1", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "sp-core", "sp-externalities", @@ -7307,9 +7635,9 @@ checksum = "db6ccd2baf189112355338e8b224dc513cd239b974dbd717f12b3dc7a7248c3b" dependencies = [ "async-trait", "derive_more", - "futures 0.3.13", + "futures 0.3.15", "merlin", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "schnorrkel", "serde", @@ -7357,9 +7685,9 @@ dependencies = [ "hash256-std-hasher", "impl-trait-for-tuples 0.2.1", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parity-util-mem", - "paste 1.0.5", + "paste", "rand 0.7.3", "serde", "sp-application-crypto", @@ -7376,8 +7704,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2e5c88b4bc8d607e4e2ff767a85db58cf7101f3dd6064f06929342ea67fe8fb" dependencies = [ "impl-trait-for-tuples 0.2.1", - "parity-scale-codec", - "primitive-types", + "parity-scale-codec 2.1.3", + "primitive-types 0.9.0", "sp-externalities", "sp-runtime-interface-proc-macro", "sp-std 3.0.0", @@ -7394,7 +7722,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19a6c7c2251512c9e533d15db8a863b06ece1cbee778130dd9adbe44b6b39aa9" dependencies = [ "Inflector", - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -7416,7 +7744,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c7cf161533725a78083b04f3269effe4c3b4b6ce5f655019b3eec3e729ba4d4" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-api", "sp-core", "sp-runtime", @@ -7430,7 +7758,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc729eb10f8809c61a1fe439ac118a4413de004aaf863003ee8752ac0b596e73" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-runtime", "sp-std 3.0.0", ] @@ -7444,7 +7772,7 @@ dependencies = [ "hash-db", "log", "num-traits", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "rand 0.7.3", "smallvec 1.6.1", @@ -7476,7 +7804,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86af458d4a0251c490cdde9dcaaccb88d398f3b97ac6694cdd49ed9337e6b961" dependencies = [ "impl-serde", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "ref-cast", "serde", "sp-debug-derive", @@ -7504,7 +7832,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27387c541197b9f47f3d9ddcab5649a3ecdca582d2f2ea2b511af24a3d3cbf83" dependencies = [ "impl-trait-for-tuples 0.2.1", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-api", "sp-inherents", "sp-runtime", @@ -7519,7 +7847,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567382d8d4e14fb572752863b5cd57a78f9e9a6583332b590b726f061f3ea957" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-std 3.0.0", "tracing", "tracing-core", @@ -7533,9 +7861,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3264d3b7ea31483eddffa2cc7f28c4d9c022598e456a985fd1cb5879a4609853" dependencies = [ "derive_more", - "futures 0.3.13", + "futures 0.3.15", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-api", "sp-blockchain", @@ -7551,7 +7879,7 @@ checksum = "b85b7f745da41ef825c6f7b93f1fdc897b03df94a4884adfbb70fbcd0aed1298" dependencies = [ "hash-db", "memory-db", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-core", "sp-std 3.0.0", "trie-db", @@ -7564,7 +7892,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ec2a5f924f7affd1e959f8f3c02bd87cdfa0e11c71a4cbc075f955ead8c1a1" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "futures-core", "futures-timer 3.0.2", "lazy_static", @@ -7578,7 +7906,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbeffa538a13d715d30e01d57a2636ba32845b737a29a3ea32403576588222e7" dependencies = [ "impl-serde", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "serde", "sp-runtime", "sp-std 3.0.0", @@ -7591,7 +7919,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b214e125666a6416cf30a70cc6a5dacd34a4e5197f8a3d479f714af7e1dc7a47" dependencies = [ "impl-trait-for-tuples 0.2.1", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sp-std 3.0.0", "wasmi", ] @@ -7616,11 +7944,15 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "statrs" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce16f6de653e88beca7bd13780d08e09d4489dbca1f9210e041bc4852481382" +checksum = "1e0c1f144861fbfd2a8cc82d564ccbf7fb3b7834d4fa128b84e9c2a73371aead" dependencies = [ - "rand 0.7.3", + "approx 0.4.0", + "lazy_static", + "nalgebra 0.26.2", + "num-traits", + "rand 0.8.4", ] [[package]] @@ -7713,10 +8045,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acb439bec2318e98b83f1e12ddaaf2082d6fc29becc3117714ccb575fa343bc1" dependencies = [ "byteorder", - "crunchy", + "crunchy 0.2.2", "lazy_static", "rand 0.5.6", - "rustc-hex", + "rustc-hex 2.1.0", ] [[package]] @@ -7735,12 +8067,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e46123ec4a690d91967de07cd6af4dde90d14519a1a8d43f61bd3f78dd3d0ef" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.13", + "futures 0.3.15", "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", "jsonrpc-derive 15.1.0", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.3", "sc-client-api", "sc-rpc-api", "serde", @@ -7797,9 +8129,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.65" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a1d708c221c5a612956ef9f75b37e454e88d1f7b899fbd3a18d4252012d663" +checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" dependencies = [ "proc-macro2", "quote", @@ -7836,6 +8168,16 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "422045212ea98508ae3d28025bc5aaa2bd4a9cdaecd442a08da2ee620ee9ea95" +[[package]] +name = "tempdir" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +dependencies = [ + "rand 0.4.6", + "remove_dir_all", +] + [[package]] name = "tempfile" version = "3.2.0" @@ -7844,8 +8186,8 @@ checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ "cfg-if 1.0.0", "libc", - "rand 0.8.3", - "redox_syscall 0.2.5", + "rand 0.8.4", + "redox_syscall 0.2.9", "remove_dir_all", "winapi 0.3.9", ] @@ -7870,18 +8212,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +checksum = "fa6f76457f59514c7eeb4e59d891395fab0b2fd1d40723ae737d64153392e9c6" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +checksum = "8a36768c0fbf1bb15eca10defa29526bda730a2376c2ab4393ccfa16fb1a318d" dependencies = [ "proc-macro2", "quote", @@ -7929,7 +8271,7 @@ dependencies = [ "pbkdf2 0.4.0", "rand 0.7.3", "rustc-hash", - "sha2 0.9.3", + "sha2 0.9.5", "thiserror", "unicode-normalization", "zeroize", @@ -7941,14 +8283,14 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" dependencies = [ - "crunchy", + "crunchy 0.2.2", ] [[package]] name = "tinyvec" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" +checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" dependencies = [ "tinyvec_macros", ] @@ -8239,9 +8581,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" +checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" dependencies = [ "cfg-if 1.0.0", "log", @@ -8263,9 +8605,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" +checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" dependencies = [ "lazy_static", ] @@ -8276,7 +8618,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.0.6", + "pin-project 1.0.7", "tracing", ] @@ -8303,9 +8645,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705096c6f83bf68ea5d357a6aa01829ddbdac531b357b45abeca842938085baa" +checksum = "aa5553bf0883ba7c9cbe493b085c29926bd41b66afc31ff72cf17ff4fb60dcd5" dependencies = [ "ansi_term 0.12.1", "chrono", @@ -8325,14 +8667,14 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.22.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec051edf7f0fc9499a2cb0947652cab2148b9d7f61cee7605e312e9f970dacaf" +checksum = "cd81fe0c8bc2b528a51c9d2c31dae4483367a26a723a3c9a4a8120311d7774e3" dependencies = [ "hash-db", "hashbrown", "log", - "rustc-hex", + "rustc-hex 2.1.0", "smallvec 1.6.1", ] @@ -8352,7 +8694,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" dependencies = [ "hash-db", - "rlp", + "rlp 0.5.0", ] [[package]] @@ -8384,6 +8726,18 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +[[package]] +name = "uint" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9db035e67dfaf7edd9aebfe8676afcd63eed53c8a4044fed514c8cccf1835177" +dependencies = [ + "byteorder", + "crunchy 0.2.2", + "rustc-hex 2.1.0", + "static_assertions", +] + [[package]] name = "uint" version = "0.9.0" @@ -8391,7 +8745,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e11fe9a9348741cf134085ad57c249508345fe16411b3d7fb4ff2da2f1d6382e" dependencies = [ "byteorder", - "crunchy", + "crunchy 0.2.2", "hex", "static_assertions", ] @@ -8407,18 +8761,18 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" dependencies = [ "matches", ] [[package]] name = "unicode-normalization" -version = "0.1.17" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] @@ -8437,9 +8791,9 @@ checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" [[package]] name = "unicode-xid" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "universal-hash" @@ -8500,36 +8854,31 @@ dependencies = [ [[package]] name = "url" -version = "2.2.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", - "idna 0.2.2", + "idna 0.2.3", "matches", "percent-encoding 2.1.0", ] [[package]] name = "value-bag" -version = "1.0.0-alpha.6" +version = "1.0.0-alpha.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b676010e055c99033117c2343b33a40a30b91fecd6c49055ac9cd2d6c305ab1" +checksum = "dd320e1520f94261153e96f7534476ad869c14022aee1e59af7c778075d840ae" dependencies = [ "ctor", + "version_check", ] [[package]] name = "vcpkg" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" - -[[package]] -name = "vec-arena" -version = "1.1.0" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34b2f665b594b07095e3ac3f718e13c2197143416fae4c5706cffb7b1af8d7f1" +checksum = "70455df2fdf4e9bf580a92e443f1eb0303c390d682e2ea817312c9e81f8c3399" [[package]] name = "vec_map" @@ -8601,9 +8950,9 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" -version = "0.2.72" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fe8f61dba8e5d645a4d8132dc7a0a66861ed5e1045d2c0ed940fab33bac0fbe" +checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -8611,9 +8960,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.72" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046ceba58ff062da072c7cb4ba5b22a37f00a302483f7e2a6cdc18fedbdc1fd3" +checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" dependencies = [ "bumpalo", "lazy_static", @@ -8626,9 +8975,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.22" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73157efb9af26fb564bb59a009afd1c7c334a44db171d280690d0c3faaec3468" +checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -8638,9 +8987,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.72" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9aa01d36cda046f797c57959ff5f3c615c9cc63997a8d545831ec7976819b" +checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8648,9 +8997,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.72" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96eb45c1b2ee33545a813a92dbb53856418bf7eb54ab34f7f7ff1448a5b3735d" +checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" dependencies = [ "proc-macro2", "quote", @@ -8661,9 +9010,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.72" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7148f4696fb4960a346eaa60bbfb42a1ac4ebba21f750f75fc1375b098d5ffa" +checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" [[package]] name = "wasm-gc-api" @@ -8682,7 +9031,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "js-sys", "parking_lot 0.11.1", "pin-utils", @@ -8764,7 +9113,7 @@ dependencies = [ "libc", "log", "serde", - "sha2 0.9.3", + "sha2 0.9.5", "toml", "winapi 0.3.9", "zstd", @@ -8790,7 +9139,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91fa931df6dd8af2b02606307674d3bad23f55473d5f4c809dddf7e4c4dc411" dependencies = [ "anyhow", - "gimli", + "gimli 0.23.0", "more-asserts", "object 0.22.0", "target-lexicon", @@ -8810,7 +9159,7 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-wasm", - "gimli", + "gimli 0.23.0", "indexmap", "log", "more-asserts", @@ -8825,7 +9174,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "738bfcd1561ede8bb174215776fd7d9a95d5f0a47ca3deabe0282c55f9a89f68" dependencies = [ - "addr2line", + "addr2line 0.14.1", "anyhow", "cfg-if 1.0.0", "cranelift-codegen", @@ -8833,7 +9182,7 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli", + "gimli 0.23.0", "log", "more-asserts", "object 0.22.0", @@ -8874,7 +9223,7 @@ checksum = "60bb672c9d894776d7b9250dd9b4fe890f8760201ee4f53e5f2da772b6c4debb" dependencies = [ "anyhow", "cfg-if 1.0.0", - "gimli", + "gimli 0.23.0", "lazy_static", "libc", "object 0.22.0", @@ -8898,7 +9247,7 @@ dependencies = [ "lazy_static", "libc", "log", - "memoffset 0.6.2", + "memoffset 0.6.4", "more-asserts", "psm", "region", @@ -8909,27 +9258,27 @@ dependencies = [ [[package]] name = "wast" -version = "35.0.1" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5800e9f86a1eae935e38bea11e60fd253f6d514d153fb39b3e5535a7b37b56" +checksum = "8b5d7ba374a364571da1cb0a379a3dc302582a2d9937a183bfe35b68ad5bb9c4" dependencies = [ "leb128", ] [[package]] name = "wat" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b0fa059022c5dabe129f02b429d67086400deb8277f89c975555dacc1dadbcc" +checksum = "16383df7f0e3901484c2dda6294ed6895caa3627ce4f6584141dcf30a33a23e6" dependencies = [ "wast", ] [[package]] name = "web-sys" -version = "0.3.49" +version = "0.3.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fe19d70f5dacc03f6e46777213facae5ac3801575d56ca6cbd4c93dcd12310" +checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582" dependencies = [ "js-sys", "wasm-bindgen", @@ -8947,39 +9296,30 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" +checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" dependencies = [ "webpki", ] [[package]] -name = "wepoll-sys" -version = "3.0.1" +name = "wepoll-ffi" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb14dea929042224824779fbc82d9fab8d2e6d3cbc0ac404de8edf489e77ff" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" dependencies = [ "cc", ] [[package]] name = "which" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" -dependencies = [ - "libc", -] - -[[package]] -name = "which" -version = "4.0.2" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" +checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" dependencies = [ + "either", "libc", - "thiserror", ] [[package]] @@ -9043,11 +9383,11 @@ checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" [[package]] name = "x25519-dalek" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc614d95359fd7afc321b66d2107ede58b246b844cf5d8a0adcca413e439f088" +checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" dependencies = [ - "curve25519-dalek 3.0.2", + "curve25519-dalek 3.1.0", "rand_core 0.5.1", "zeroize", ] @@ -9058,7 +9398,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cc7bd8c983209ed5d527f44b01c41b7dc146fd960c61cf9e1d25399841dc271" dependencies = [ - "futures 0.3.13", + "futures 0.3.15", "log", "nohash-hasher", "parking_lot 0.11.1", @@ -9068,18 +9408,18 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a974bcdd357f0dca4d41677db03436324d45a4c9ed2d0b873a5a360ce41c36" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3f369ddb18862aba61aa49bf31e74d29f0f162dec753063200e1dc084345d16" +checksum = "a2c1e130bebaeab2f23886bf9acbaca14b092408c452543c857f66399cd6dab1" dependencies = [ "proc-macro2", "quote", diff --git a/Dockerfile b/Dockerfile index 66c1c785..18719249 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,16 @@ +### build stage +FROM rust:1.51-slim as builder +ENV USER root +ENV CI_PROJECT_NAME docker +RUN apt-get update && apt-get install -y git cmake pkg-config libssl-dev git clang libclang-dev +RUN rustup default nightly && rustup target add wasm32-unknown-unknown +RUN rustup default nightly && rustup target add wasm32-unknown-unknown +COPY . . +RUN CI_PROJECT_NAME=docker sh scripts/init.sh +RUN cargo build --release + ### package stage -FROM debian:bullseye-slim +FROM debian:stretch-slim # metadata ARG VCS_REF ARG BUILD_DATE @@ -11,7 +22,6 @@ RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ libssl1.1 \ ca-certificates \ - glibc \ curl && \ # apt cleanup apt-get autoremove -y && \ @@ -20,9 +30,7 @@ RUN apt-get update && \ # add user useradd -m -u 1000 -U -s /bin/sh -d /metaverse mvs # add binary to docker image -COPY ./target/release/metaverse /usr/local/bin/metaverse -COPY ./mainnet.json ./mainnet -COPY ./mainnet.json . +COPY --from=builder /target/release/metaversevm /usr/local/bin/metaverse USER mvs # check if executable works in this container RUN /usr/local/bin/metaverse --version diff --git a/README.md b/README.md index 432536c2..bc801a2d 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,133 @@ Follow the steps below to take control and compile your own node. :hammer_and_wr First, complete the [basic Rust setup instructions](./doc/rust-setup.md). +### Build + +The `cargo run` command will perform an initial build. Use the following command to build the node +without launching it: + +```sh +cargo build --release +``` + ### Run -Use Rust's native `cargo` command to build and launch the template node: +Launch one metaverse node: ```sh -cargo run --release -- --dev --tmp +./target/release/metaversevm --validator --tmp --rpc-cors all ``` -### Build -The `cargo run` command will perform an initial build. Use the following command to build the node -without launching it: + +Launch a test net with 3 metaverse node at localhost : + +On console for node01: ```sh -cargo build --release +./target/release/metaversevm --validator --tmp --rpc-cors all \ + --node-key 0000000000000000000000000000000000000000000000000000000000000111 +``` + +On console for node02: + +``` +./target/release/metaversevm --validator --tmp --rpc-cors all \ + --port 30334 \ + --ws-port 9946 \ + --rpc-port 9934 \ + --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWRBaMZHnFYtT1B143sSLHkx8G6ysPSg8PMzqXkymm38Ld +``` + +On console for node03: +``` +./target/release/metaversevm --validator --tmp --rpc-cors all \ + --port 30335 \ + --ws-port 9947 \ + --rpc-port 9935 \ + --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWRBaMZHnFYtT1B143sSLHkx8G6ysPSg8PMzqXkymm38Ld +``` + +### GPU mining + +**Install miner** + +Access the project's [releases page](https://github.com/ethereum-mining/ethminer/releases), and pick up the latest Linux tarball. Unpack the tarball in the directory where you want to run Ethminer. It's a pre-compiled binary, so that's all you need to do before you start using it. + +```sh +$ mkdir ethminer +$ wget -O ethminer/ethminer.tar.gz https://github.com/ethereum-mining/ethminer/releases/download/v0.18.0/ethminer-0.18.0-cuda-9-linux-x86_64.tar.gz +$ tar xzf ethminer/ethminer.tar.gz -C ethminer/ +$ ethminer/bin/ethminer --help +ethminer 0.18.0 +Build: linux/release/gnu + +Ethminer - GPU ethash miner +minimal usage : ethminer [DEVICES_TYPE] [OPTIONS] -P... [-P...] +``` + +**Run miner** + +```sh +// Change to correct RPC port to get work +ethminer/bin/ethminer -P http://127.0.0.1:9933 +``` + +### CPU mining(only for test) + +**Dependencies:** + +Linux-based: + +``` +sudo apt-get install libleveldb-dev libcurl4-openssl-dev libmicrohttpd-dev libudev-dev cmake +``` + +macOS: + +``` +brew install leveldb libmicrohttpd +``` + +**Install:** + +``` +git clone --depth=1 https://github.com/avatar-lavventura/ethminer.git +cd ethminer +./scripts/install_deps.sh +``` + +**Build:** + +``` +cmake -H. -Bbuild +cd build/ethminer +make -j $(nproc) +``` + +**Run miner** + +```sh +// Change to correct RPC port to get work +./ethminer -F http://localhost:9933 --mining-threads 4 +``` + +**Notice** + +If the compilation doesn't work through, it could be the C++ compiler version problem, please follow these step: + +```sh +vi cmake/EthCompilerSettings.cmake +... +# comment out this line +#add_compile_options(-Werror) +... +... +# at last line add +add_compile_options($<$:-Wno-deprecated-copy>) +add_compile_options($<$:-Wno-implicit-fallthrough>) +add_compile_options($<$:-Wno-maybe-uninitialized>) +... ``` ### Embedded Docs diff --git a/client/consensus/consensus-pow/Cargo.lock b/client/consensus/consensus-pow/Cargo.lock new file mode 100644 index 00000000..47ea2df4 --- /dev/null +++ b/client/consensus/consensus-pow/Cargo.lock @@ -0,0 +1,3456 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03345e98af8f3d786b6d9f656ccfa6ac316d954e92bc4841f0bba20789d5fb5a" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +dependencies = [ + "nodrop", +] + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a2f58b0bb10c380af2b26e57212856b8c9a59e0925b4c20f4a174a49734eaf7" + +[[package]] +name = "asn1_der" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fce6b6a0ffdafebd82c87e79e3f40e8d2c523e5fea5566ff6b90509bf98d638" +dependencies = [ + "asn1_der_derive", +] + +[[package]] +name = "asn1_der_derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d0864d84b8e07b145449be9a8537db86bf9de5ce03b913214694643b4743502" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "async-channel" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "once_cell", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" +dependencies = [ + "async-channel", + "async-executor", + "async-io", + "async-mutex", + "blocking", + "futures-lite", + "num_cpus", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bbfd5cf2794b1e908ea8457e6c45f8f8f1f6ec5f74617bf4662623f47503c3b" +dependencies = [ + "concurrent-queue", + "fastrand", + "futures-lite", + "libc", + "log", + "once_cell", + "parking", + "polling", + "slab", + "socket2", + "waker-fn", + "winapi", +] + +[[package]] +name = "async-lock" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-mutex" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-process" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f38756dd9ac84671c428afbf7c9f7495feff9ec5b0710f17100098e5b354ac" +dependencies = [ + "async-io", + "blocking", + "cfg-if 1.0.0", + "event-listener", + "futures-lite", + "libc", + "once_cell", + "signal-hook", + "winapi", +] + +[[package]] +name = "async-std" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f06685bad74e0570f5213741bea82158279a4103d988e57bfada11ad230341" +dependencies = [ + "async-channel", + "async-global-executor", + "async-io", + "async-lock", + "async-process", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "num_cpus", + "once_cell", + "pin-project-lite 0.2.6", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" + +[[package]] +name = "async-trait" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3410529e8288c463bedb5930f82833bc0c90e5d2fe639a56582a4d09220b281" +dependencies = [ + "autocfg", +] + +[[package]] +name = "atomic-waker" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "backtrace" +version = "0.3.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4717cfcbfaa661a0fd48f8453951837ae7e8f81e481fbb136e3202d72805a744" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base58" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "bitvec" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2-rfc" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" +dependencies = [ + "arrayvec 0.4.12", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + +[[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.4", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "blocking" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e170dbede1f740736619b776d7251cb1b9095c435c34d8ca9f57fcd2f335e9" +dependencies = [ + "async-channel", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "once_cell", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bumpalo" +version = "3.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" + +[[package]] +name = "byte-slice-cast" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c1bf4a04a88c54f589125563643d773f3254b5c38571395e2b591c693bbc81" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + +[[package]] +name = "bytes" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" + +[[package]] +name = "cache-padded" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" + +[[package]] +name = "cc" +version = "1.0.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits", + "winapi", +] + +[[package]] +name = "concurrent-queue" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +dependencies = [ + "cache-padded", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cpufeatures" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4feb231f0d4d6af81aed15928e58ecf5816aa62a2393e2c82f46973e92a9a278" +dependencies = [ + "autocfg", + "cfg-if 1.0.0", + "lazy_static", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-mac" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +dependencies = [ + "generic-array 0.12.4", + "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.4", + "subtle 2.4.0", +] + +[[package]] +name = "ctor" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "curve25519-dalek" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434e1720189a637d44fe464f4df1e6eb900b4835255b14354497c78af37d9bb8" +dependencies = [ + "byteorder", + "digest 0.8.1", + "rand_core 0.5.1", + "subtle 2.4.0", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle 2.4.0", + "zeroize", +] + +[[package]] +name = "data-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" + +[[package]] +name = "derive_more" +version = "0.99.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.4", +] + +[[package]] +name = "dyn-clonable" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" +dependencies = [ + "dyn-clonable-impl", + "dyn-clone", +] + +[[package]] +name = "dyn-clonable-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dyn-clone" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" + +[[package]] +name = "ed25519" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d0860415b12243916284c67a9be413e044ee6668247b99ba26d94b2bc06c8f6" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek 3.1.0", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.5", + "zeroize", +] + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "environmental" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" + +[[package]] +name = "event-listener" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fastrand" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77b705829d1e87f762c2df6da140b26af5839e1033aa84aa5f56bb688e4e1bdb" +dependencies = [ + "instant", +] + +[[package]] +name = "fixed-hash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +dependencies = [ + "byteorder", + "rand 0.8.3", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fixedbitset" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "funty" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" + +[[package]] +name = "futures" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" + +[[package]] +name = "futures" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7e43a803dae2fa37c1f6a8fe121e1f7bf9548b4dfc0522a42f34145dadfc27" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1" + +[[package]] +name = "futures-executor" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "badaa6a909fac9e7236d0620a2f57f7664640c56575b71a7552fbd68deafab79" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" + +[[package]] +name = "futures-lite" +version = "1.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4481d0cd0de1d204a4fa55e7d45f07b1d958abcb06714b3446438e2eff695fb" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite 0.2.6", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c40298486cdf52cc00cd6d6987892ba502c7656a16a4192a9992b1ccedd121" +dependencies = [ + "autocfg", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a57bead0ceff0d6dde8f465ecd96c9338121bb7717d3e7b108059531870c4282" + +[[package]] +name = "futures-task" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae" + +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + +[[package]] +name = "futures-util" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967" +dependencies = [ + "autocfg", + "futures 0.1.31", + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite 0.2.6", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" + +[[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.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", + "tracing-futures", +] + +[[package]] +name = "hash-db" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +dependencies = [ + "ahash", +] + +[[package]] +name = "heck" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "hermit-abi" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" +dependencies = [ + "crypto-mac 0.7.0", + "digest 0.8.1", +] + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac-drbg" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b" +dependencies = [ + "digest 0.8.1", + "generic-array 0.12.4", + "hmac 0.7.1", +] + +[[package]] +name = "http" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" +dependencies = [ + "bytes 1.0.1", + "fnv", + "itoa", +] + +[[package]] +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", +] + +[[package]] +name = "httparse" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68" + +[[package]] +name = "httpdate" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" + +[[package]] +name = "hyper" +version = "0.13.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb" +dependencies = [ + "bytes 0.5.6", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project 1.0.7", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df170efa359aebdd5cb7fe78edcc67107748e4737bdca8a8fb40d15ea7a877ed" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-serde" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b47ca4d2b6931707a55fce5cf66aff80e2178c8b63bbb4ecb5695cbc870ddf6f" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5dacb10c5b3bb92d46ba347505a9041e676bb20ad220101326bffb0c93031ee" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "indexmap" +version = "1.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" + +[[package]] +name = "js-sys" +version = "0.3.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" + +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + +[[package]] +name = "kvdb" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8891bd853eff90e33024195d79d578dc984c82f9e0715fcd2b525a0c19d52811" +dependencies = [ + "parity-util-mem", + "smallvec", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e" + +[[package]] +name = "libp2p" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5133112ce42be9482f6a87be92a605dd6bbc9e93c297aee77d172ff06908f3a" +dependencies = [ + "atomic", + "bytes 1.0.1", + "futures 0.3.15", + "lazy_static", + "libp2p-core", + "libp2p-core-derive", + "libp2p-swarm", + "parity-multiaddr", + "parking_lot", + "pin-project 1.0.7", + "smallvec", + "wasm-timer", +] + +[[package]] +name = "libp2p-core" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2d56aadc2c2bf22cd7797f86e56a65b5b3994a0136b65be3106938acae7a26" +dependencies = [ + "asn1_der", + "bs58", + "ed25519-dalek", + "either", + "fnv", + "futures 0.3.15", + "futures-timer", + "lazy_static", + "libsecp256k1", + "log", + "multihash", + "multistream-select", + "parity-multiaddr", + "parking_lot", + "pin-project 1.0.7", + "prost", + "prost-build", + "rand 0.7.3", + "ring", + "rw-stream-sink", + "sha2 0.9.5", + "smallvec", + "thiserror", + "unsigned-varint 0.7.0", + "void", + "zeroize", +] + +[[package]] +name = "libp2p-core-derive" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4bc40943156e42138d22ed3c57ff0e1a147237742715937622a99b10fbe0156" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "libp2p-swarm" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7955b973e1fd2bd61ffd43ce261c1223f61f4aacd5bae362a924993f9a25fd98" +dependencies = [ + "either", + "futures 0.3.15", + "libp2p-core", + "log", + "rand 0.7.3", + "smallvec", + "void", + "wasm-timer", +] + +[[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.2", + "subtle 2.4.0", + "typenum", +] + +[[package]] +name = "lock_api" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if 1.0.0", + "value-bag", +] + +[[package]] +name = "lru" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f374d42cdfc1d7dbf3d3dec28afab2eb97ffbf43a3234d795b5986dbf4b90ba" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "matchers" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" + +[[package]] +name = "memchr" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" + +[[package]] +name = "memory-db" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "814bbecfc0451fc314eeea34f05bbcd5b98a7ad7af37faee088b86a1e633f1d4" +dependencies = [ + "hash-db", + "hashbrown", + "parity-util-mem", +] + +[[package]] +name = "memory_units" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" + +[[package]] +name = "merlin" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "miniz_oxide" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +dependencies = [ + "adler", + "autocfg", +] + +[[package]] +name = "multihash" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dac63698b887d2d929306ea48b63760431ff8a24fac40ddb22f9c7f49fb7cab" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.4", + "multihash-derive", + "sha2 0.9.5", + "unsigned-varint 0.5.1", +] + +[[package]] +name = "multihash-derive" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85ee3c48cb9d9b275ad967a0e96715badc13c6029adb92f34fa17b9ff28fd81f" +dependencies = [ + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "multistream-select" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d91ec0a2440aaff5f78ec35631a7027d50386c6163aa975f7caa0d5da4b6ff8" +dependencies = [ + "bytes 1.0.1", + "futures 0.3.15", + "log", + "pin-project 1.0.7", + "smallvec", + "unsigned-varint 0.7.0", +] + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5b3dd1c072ee7963717671d1ca129f1048fda25edea6b752bfc71ac8854170" + +[[package]] +name = "once_cell" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +dependencies = [ + "parking_lot", +] + +[[package]] +name = "opaque-debug" +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 = "parity-multiaddr" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58341485071825827b7f03cf7efd1cb21e6a709bea778fb50227fd45d2f361b4" +dependencies = [ + "arrayref", + "bs58", + "byteorder", + "data-encoding", + "multihash", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint 0.7.0", + "url", +] + +[[package]] +name = "parity-scale-codec" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0f518afaa5a47d0d6386229b0a6e01e86427291d643aa4cabb4992219f504f8" +dependencies = [ + "arrayvec 0.7.0", + "bitvec", + "byte-slice-cast", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f44c5f94427bd0b5076e8f7e15ca3f60a4d8ac0077e4793884e6fdfd8915344e" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "parity-util-mem" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "664a8c6b8e62d8f9f2f937e391982eb433ab285b4cd9545b342441e04a906e42" +dependencies = [ + "cfg-if 1.0.0", + "hashbrown", + "impl-trait-for-tuples", + "parity-util-mem-derive", + "parking_lot", + "primitive-types", + "winapi", +] + +[[package]] +name = "parity-util-mem-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" +dependencies = [ + "proc-macro2", + "syn", + "synstructure", +] + +[[package]] +name = "parity-wasm" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" + +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + +[[package]] +name = "parking_lot" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "paste" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" + +[[package]] +name = "pbkdf2" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "006c038a43a45995a9670da19e67600114740e8511d4333bf97a56e66a7542d9" +dependencies = [ + "byteorder", + "crypto-mac 0.7.0", +] + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac 0.8.0", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "petgraph" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pin-project" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f" +dependencies = [ + "pin-project-internal 0.4.28", +] + +[[package]] +name = "pin-project" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4" +dependencies = [ + "pin-project-internal 1.0.7", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c950132583b500556b1efd71d45b319029f2b71518d979fcc208e16b42426f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" + +[[package]] +name = "pin-project-lite" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "polling" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc12d774e799ee9ebae13f4076ca003b40d18a11ac0f3641e6f899618580b7b" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "log", + "wepoll-sys", + "winapi", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "primitive-types" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2415937401cb030a2a0a4d922483f945fa068f52a7dbb22ce0fe5f2b6f6adace" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-serde", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" + +[[package]] +name = "proc-macro-nested" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" + +[[package]] +name = "proc-macro2" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "prometheus" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8425533e7122f0c3cc7a37e6244b16ad3a2cc32ae7ac6276e2a75da0d9c200d" +dependencies = [ + "cfg-if 1.0.0", + "fnv", + "lazy_static", + "parking_lot", + "regex", + "thiserror", +] + +[[package]] +name = "prost" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" +dependencies = [ + "bytes 1.0.1", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" +dependencies = [ + "bytes 1.0.1", + "heck", + "itertools", + "log", + "multimap", + "petgraph", + "prost", + "prost-types", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" +dependencies = [ + "bytes 1.0.1", + "prost", +] + +[[package]] +name = "quote" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +dependencies = [ + "libc", + "rand_chacha 0.3.0", + "rand_core 0.6.2", + "rand_hc 0.3.0", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.2", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom 0.2.3", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_hc" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +dependencies = [ + "rand_core 0.6.2", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "redox_syscall" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "742739e41cd49414de871ea5e549afb7e2a3ac77b589bcbebe8c82fab37147fc" +dependencies = [ + "bitflags", +] + +[[package]] +name = "ref-cast" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +dependencies = [ + "byteorder", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "410f7acf3cb3a44527c5d9546bad4bf4e6c460915d5f9f2fc524498bfe8f70ce" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rw-stream-sink" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" +dependencies = [ + "futures 0.3.15", + "pin-project 0.4.28", + "static_assertions", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "sc-client-api" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d8b2c8dc0cee9ac56e87ad50c980edbdeb35bdd5b5d9da4ae90567423363be" +dependencies = [ + "derive_more", + "fnv", + "futures 0.3.15", + "hash-db", + "kvdb", + "lazy_static", + "log", + "parity-scale-codec", + "parking_lot", + "sc-executor", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-database", + "sp-externalities", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-storage", + "sp-transaction-pool", + "sp-trie", + "sp-utils", + "sp-version", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-consensus-pow" +version = "0.9.0" +dependencies = [ + "derive_more", + "futures 0.3.15", + "futures-timer", + "log", + "parity-scale-codec", + "parking_lot", + "sc-client-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-pow", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-timestamp", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-executor" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bace6a35999d2da7311d8fb98a29c1e89dbf0d14e50ac14140f2c38089819f46" +dependencies = [ + "derive_more", + "lazy_static", + "libsecp256k1", + "log", + "parity-scale-codec", + "parity-wasm", + "parking_lot", + "sc-executor-common", + "sc-executor-wasmi", + "sp-api", + "sp-core", + "sp-externalities", + "sp-io", + "sp-panic-handler", + "sp-runtime-interface", + "sp-serializer", + "sp-tasks", + "sp-trie", + "sp-version", + "sp-wasm-interface", + "wasmi", +] + +[[package]] +name = "sc-executor-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87004102a8e95f432f1c624c7fa7fb0edc5995db2e0fcbabbb697f1955e7c1d2" +dependencies = [ + "derive_more", + "parity-scale-codec", + "parity-wasm", + "sp-allocator", + "sp-core", + "sp-serializer", + "sp-wasm-interface", + "thiserror", + "wasmi", +] + +[[package]] +name = "sc-executor-wasmi" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3d7b6db2df5f2c24848883a855a8276363f00cef5b49744974f7e1203bf274" +dependencies = [ + "log", + "parity-scale-codec", + "sc-executor-common", + "sp-allocator", + "sp-core", + "sp-runtime-interface", + "sp-wasm-interface", + "wasmi", +] + +[[package]] +name = "schnorrkel" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "curve25519-dalek 2.1.2", + "getrandom 0.1.16", + "merlin", + "rand 0.7.3", + "rand_core 0.5.1", + "serde", + "sha2 0.8.2", + "subtle 2.4.0", + "zeroize", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "secrecy" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0673d6a6449f5e7d12a1caf424fd9363e2af3a4953023ed455e3c4beef4597c0" +dependencies = [ + "zeroize", +] + +[[package]] +name = "serde" +version = "1.0.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sharded-slab" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79c719719ee05df97490f80a45acfc99e5a30ce98a1e4fb67aee422745ae14e3" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef33d6d0cd06e0840fba9985aab098c147e67e05cee14d412d3345ed14ff30ac" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-registry" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68" + +[[package]] +name = "slab" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" + +[[package]] +name = "smallvec" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" + +[[package]] +name = "socket2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "sp-allocator" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec5f988ad0cabdb646318cb515a91e9d89062debc9728f9b634d73acab3f3f39" +dependencies = [ + "log", + "sp-core", + "sp-std", + "sp-wasm-interface", + "thiserror", +] + +[[package]] +name = "sp-api" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e63c3460d5daecf67df542c34c2bbd636214a5a200d4bddcfa2ffb9e72c346af" +dependencies = [ + "hash-db", + "parity-scale-codec", + "sp-api-proc-macro", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-version", + "thiserror", +] + +[[package]] +name = "sp-api-proc-macro" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "289624f4fe0f61e63a5019ed26c3bc732b5145eb52796ac6053cd72656d947a1" +dependencies = [ + "blake2-rfc", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-application-crypto" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c52e2e6d43036b97c4fce1ed87c5262c1ffdc78c655ada4d3024a3f8094bdd2c" +dependencies = [ + "parity-scale-codec", + "serde", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sp-arithmetic" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f1c69966c192d1dee8521f0b29ece2b14db07b9b44d801a94e295234761645" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "serde", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "sp-block-builder" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0adc979dbe619f56d664ebd1293dce13fcad6b8a47bcdd620ed53a454d330d12" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-inherents", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-blockchain" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8007c1ad8e9fb6cd8eed4e0fc91504a9ca4b228e1315302a2fbb0ac7f509f1b" +dependencies = [ + "futures 0.3.15", + "log", + "lru", + "parity-scale-codec", + "parking_lot", + "sp-api", + "sp-consensus", + "sp-database", + "sp-runtime", + "sp-state-machine", + "thiserror", +] + +[[package]] +name = "sp-consensus" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884db6c4b03f0f2fb2993127a2db95fc740fcd3496746dcaa6829c9868e7dc75" +dependencies = [ + "futures 0.3.15", + "futures-timer", + "libp2p", + "log", + "parity-scale-codec", + "parking_lot", + "serde", + "sp-api", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "sp-utils", + "sp-version", + "substrate-prometheus-endpoint", + "thiserror", + "wasm-timer", +] + +[[package]] +name = "sp-consensus-pow" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2aa1ffa45f7ad66c613fa3906823a0cc0d33ce2d0e7495f2037c5c4c3211481" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-core" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abbc8d4e9b8a7d5819ed26f1374017bb32833ef4890e4ff065e1da30669876bc" +dependencies = [ + "base58", + "blake2-rfc", + "byteorder", + "dyn-clonable", + "ed25519-dalek", + "futures 0.3.15", + "hash-db", + "hash256-std-hasher", + "hex", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin", + "num-traits", + "parity-scale-codec", + "parity-util-mem", + "parking_lot", + "primitive-types", + "rand 0.7.3", + "regex", + "schnorrkel", + "secrecy", + "serde", + "sha2 0.9.5", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "tiny-keccak", + "twox-hash", + "wasmi", + "zeroize", +] + +[[package]] +name = "sp-database" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8c3f018913eef191d95c824657c5759c459d28670e654fa34f5d9bd5e6f0492" +dependencies = [ + "kvdb", + "parking_lot", +] + +[[package]] +name = "sp-debug-derive" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e80275f23b4e7ba8f54dec5f90f016530e7307d2ee9445f617ab986cbe97f31e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-externalities" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fdc625f8c7b13b9a136d334888b21b5743d2081cb666cb03efca1dc9b8f74d1" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std", + "sp-storage", +] + +[[package]] +name = "sp-inherents" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2542380b535c6941502a0a3069a657eb5abb70fd67b11afa164d4a4b038ba73a" +dependencies = [ + "parity-scale-codec", + "parking_lot", + "sp-core", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-io" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33fd69f0a6e91bedc2fb1c5cc3689c212474b6c918274cb4cb14dbbe3c428c14" +dependencies = [ + "futures 0.3.15", + "hash-db", + "libsecp256k1", + "log", + "parity-scale-codec", + "parking_lot", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", + "sp-wasm-interface", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keystore" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6ccd2baf189112355338e8b224dc513cd239b974dbd717f12b3dc7a7248c3b" +dependencies = [ + "async-trait", + "derive_more", + "futures 0.3.15", + "merlin", + "parity-scale-codec", + "parking_lot", + "schnorrkel", + "sp-core", + "sp-externalities", +] + +[[package]] +name = "sp-panic-handler" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54702e109f1c8a870dd4065a497d2612d42cec5817126e96cc0658c5ea975784" +dependencies = [ + "backtrace", +] + +[[package]] +name = "sp-runtime" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa4b353b76f04616dbdb8d269d58dcac47acb31c006d3b70e7b64233e68695e" +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-io", + "sp-std", +] + +[[package]] +name = "sp-runtime-interface" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e5c88b4bc8d607e4e2ff767a85db58cf7101f3dd6064f06929342ea67fe8fb" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19a6c7c2251512c9e533d15db8a863b06ece1cbee778130dd9adbe44b6b39aa9" +dependencies = [ + "Inflector", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-serializer" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "982d793f01eb9eea9f30ffc63b821170068b9f0d9edf715d8ba77dc4de9c300f" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "sp-state-machine" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46fa4143e58e9130f726d4e8a9b86f3530a8bd19a2eedcdcf4af205f4b5a6d4f" +dependencies = [ + "hash-db", + "log", + "num-traits", + "parity-scale-codec", + "parking_lot", + "rand 0.7.3", + "smallvec", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-std", + "sp-trie", + "thiserror", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-std" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35391ea974fa5ee869cb094d5b437688fbf3d8127d64d1b9fed5822a1ed39b12" + +[[package]] +name = "sp-storage" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86af458d4a0251c490cdde9dcaaccb88d398f3b97ac6694cdd49ed9337e6b961" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "sp-tasks" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c585340cbee96c53a9b43fd07d81edf6cebeb80e4ca7c0ee79b856c0b1883a0e" +dependencies = [ + "log", + "sp-core", + "sp-externalities", + "sp-io", + "sp-runtime-interface", + "sp-std", +] + +[[package]] +name = "sp-timestamp" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27387c541197b9f47f3d9ddcab5649a3ecdca582d2f2ea2b511af24a3d3cbf83" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "sp-api", + "sp-inherents", + "sp-runtime", + "sp-std", + "wasm-timer", +] + +[[package]] +name = "sp-tracing" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567382d8d4e14fb572752863b5cd57a78f9e9a6583332b590b726f061f3ea957" +dependencies = [ + "log", + "parity-scale-codec", + "sp-std", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-transaction-pool" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3264d3b7ea31483eddffa2cc7f28c4d9c022598e456a985fd1cb5879a4609853" +dependencies = [ + "derive_more", + "futures 0.3.15", + "log", + "parity-scale-codec", + "serde", + "sp-api", + "sp-blockchain", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sp-trie" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b85b7f745da41ef825c6f7b93f1fdc897b03df94a4884adfbb70fbcd0aed1298" +dependencies = [ + "hash-db", + "memory-db", + "parity-scale-codec", + "sp-core", + "sp-std", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-utils" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ec2a5f924f7affd1e959f8f3c02bd87cdfa0e11c71a4cbc075f955ead8c1a1" +dependencies = [ + "futures 0.3.15", + "futures-core", + "futures-timer", + "lazy_static", + "prometheus", +] + +[[package]] +name = "sp-version" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbeffa538a13d715d30e01d57a2636ba32845b737a29a3ea32403576588222e7" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "serde", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-wasm-interface" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b214e125666a6416cf30a70cc6a5dacd34a4e5197f8a3d479f714af7e1dc7a47" +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 = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "substrate-bip39" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bed6646a0159b9935b5d045611560eeef842b78d7adc3ba36f5ca325a13a0236" +dependencies = [ + "hmac 0.7.1", + "pbkdf2 0.3.0", + "schnorrkel", + "sha2 0.8.2", + "zeroize", +] + +[[package]] +name = "substrate-prometheus-endpoint" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb561c19a121e1c89daa79dbfa67a55080f813caa47fd231833a0669696d508" +dependencies = [ + "async-std", + "derive_more", + "futures-util", + "hyper", + "log", + "prometheus", + "tokio", +] + +[[package]] +name = "subtle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" + +[[package]] +name = "subtle" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" + +[[package]] +name = "syn" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "synstructure" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "rand 0.8.3", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "thiserror" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tiny-bip39" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9e44c4759bae7f1032e286a7ef990bd9ed23fe831b7eeba0beb97484c2e59b8" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2 0.4.0", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.5", + "thiserror", + "unicode-normalization", + "zeroize", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures-core", + "memchr", + "pin-project-lite 0.1.12", +] + +[[package]] +name = "tokio-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +dependencies = [ + "bytes 0.5.6", + "futures-core", + "futures-sink", + "log", + "pin-project-lite 0.1.12", + "tokio", +] + +[[package]] +name = "toml" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +dependencies = [ + "serde", +] + +[[package]] +name = "tower-service" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" + +[[package]] +name = "tracing" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" +dependencies = [ + "cfg-if 1.0.0", + "log", + "pin-project-lite 0.2.6", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project 1.0.7", + "tracing", +] + +[[package]] +name = "tracing-log" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa5553bf0883ba7c9cbe493b085c29926bd41b66afc31ff72cf17ff4fb60dcd5" +dependencies = [ + "ansi_term", + "chrono", + "lazy_static", + "matchers", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + +[[package]] +name = "trie-db" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec051edf7f0fc9499a2cb0947652cab2148b9d7f61cee7605e312e9f970dacaf" +dependencies = [ + "hash-db", + "hashbrown", + "log", + "rustc-hex", + "smallvec", +] + +[[package]] +name = "trie-root" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "652931506d2c1244d7217a70b99f56718a7b4161b37f04e7cd868072a99f68cd" +dependencies = [ + "hash-db", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "twox-hash" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" +dependencies = [ + "cfg-if 0.1.10", + "rand 0.7.3", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" + +[[package]] +name = "uint" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e11fe9a9348741cf134085ad57c249508345fe16411b3d7fb4ff2da2f1d6382e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" +dependencies = [ + "matches", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" + +[[package]] +name = "unicode-xid" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "unsigned-varint" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35" + +[[package]] +name = "unsigned-varint" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f8d425fafb8cd76bc3f22aace4af471d3156301d7508f2107e98fbeae10bc7f" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "value-bag" +version = "1.0.0-alpha.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd320e1520f94261153e96f7534476ad869c14022aee1e59af7c778075d840ae" +dependencies = [ + "ctor", + "version_check", +] + +[[package]] +name = "version_check" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasm-bindgen" +version = "0.2.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" + +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures 0.3.15", + "js-sys", + "parking_lot", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmi" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf617d864d25af3587aa745529f7aaa541066c876d57e050c0d0c85c61c92aff" +dependencies = [ + "libc", + "memory_units", + "num-rational", + "num-traits", + "parity-wasm", + "wasmi-validation", +] + +[[package]] +name = "wasmi-validation" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea78c597064ba73596099281e2f4cfc019075122a65cdda3205af94f0b264d93" +dependencies = [ + "parity-wasm", +] + +[[package]] +name = "web-sys" +version = "0.3.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wepoll-sys" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcb14dea929042224824779fbc82d9fab8d2e6d3cbc0ac404de8edf489e77ff" +dependencies = [ + "cc", +] + +[[package]] +name = "which" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" +dependencies = [ + "either", + "libc", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[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 = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c1e130bebaeab2f23886bf9acbaca14b092408c452543c857f66399cd6dab1" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] diff --git a/client/consensus/consensus-pow/Cargo.toml b/client/consensus/consensus-pow/Cargo.toml new file mode 100644 index 00000000..345b8bf4 --- /dev/null +++ b/client/consensus/consensus-pow/Cargo.toml @@ -0,0 +1,78 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + +[package] +edition = "2018" +name = "sc-consensus-pow" +version = "0.9.0" +authors = ["Parity Technologies "] +description = "PoW consensus algorithm for substrate" +homepage = "https://substrate.dev" +readme = "README.md" +license = "GPL-3.0-or-later WITH Classpath-exception-2.0" +repository = "https://github.com/paritytech/substrate/" +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] +[dependencies.codec] +version = "2.0.0" +features = ["derive"] +package = "parity-scale-codec" + +[dependencies.derive_more] +version = "0.99.2" + +[dependencies.futures] +version = "0.3.1" +features = ["compat"] + +[dependencies.futures-timer] +version = "3.0.1" + +[dependencies.log] +version = "0.4.8" + +[dependencies.parking_lot] +version = "0.11.1" + +[dependencies.prometheus-endpoint] +version = "0.9.0" +package = "substrate-prometheus-endpoint" + +[dependencies.sc-client-api] +version = "3.0.0" + +[dependencies.sp-api] +version = "3.0.0" + +[dependencies.sp-block-builder] +version = "3.0.0" + +[dependencies.sp-blockchain] +version = "3.0.0" + +[dependencies.sp-consensus] +version = "0.9.0" + +[dependencies.sp-consensus-pow] +version = "0.9.0" + +[dependencies.sp-core] +version = "3.0.0" + +[dependencies.sp-inherents] +version = "3.0.0" + +[dependencies.sp-runtime] +version = "3.0.0" + +[dependencies.sp-timestamp] +version = "3.0.0" diff --git a/client/consensus/consensus-pow/README.md b/client/consensus/consensus-pow/README.md new file mode 100644 index 00000000..a335ec36 --- /dev/null +++ b/client/consensus/consensus-pow/README.md @@ -0,0 +1,16 @@ +Proof of work consensus for Substrate. + +To use this engine, you can need to have a struct that implements +`PowAlgorithm`. After that, pass an instance of the struct, along +with other necessary client references to `import_queue` to setup +the queue. Use the `start_mine` function for basic CPU mining. + +The auxiliary storage for PoW engine only stores the total difficulty. +For other storage requirements for particular PoW algorithm (such as +the actual difficulty for each particular blocks), you can take a client +reference in your `PowAlgorithm` implementation, and use a separate prefix +for the auxiliary storage. It is also possible to just use the runtime +as the storage, but it is not recommended as it won't work well with light +clients. + +License: GPL-3.0-or-later WITH Classpath-exception-2.0 \ No newline at end of file diff --git a/client/consensus/consensus-pow/src/lib.rs b/client/consensus/consensus-pow/src/lib.rs new file mode 100644 index 00000000..493676fd --- /dev/null +++ b/client/consensus/consensus-pow/src/lib.rs @@ -0,0 +1,742 @@ +// This file is part of Substrate. + +// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +//! Proof of work consensus for Substrate. +//! +//! To use this engine, you can need to have a struct that implements +//! `PowAlgorithm`. After that, pass an instance of the struct, along +//! with other necessary client references to `import_queue` to setup +//! the queue. Use the `start_mine` function for basic CPU mining. +//! +//! The auxiliary storage for PoW engine only stores the total difficulty. +//! For other storage requirements for particular PoW algorithm (such as +//! the actual difficulty for each particular blocks), you can take a client +//! reference in your `PowAlgorithm` implementation, and use a separate prefix +//! for the auxiliary storage. It is also possible to just use the runtime +//! as the storage, but it is not recommended as it won't work well with light +//! clients. + +mod worker; + +pub use crate::worker::{MiningWorker, MiningMetadata, MiningBuild}; + +use std::{ + sync::Arc, any::Any, borrow::Cow, collections::HashMap, marker::PhantomData, + cmp::Ordering, time::{Duration, SystemTime, UNIX_EPOCH}, +}; +use futures::{prelude::*, future::Either}; +use parking_lot::Mutex; +use sc_client_api::{BlockOf, backend::AuxStore, BlockchainEvents}; +use sp_blockchain::{HeaderBackend, ProvideCache, well_known_cache_keys::Id as CacheKeyId}; +use sp_block_builder::BlockBuilder as BlockBuilderApi; +use sp_runtime::{Justification, RuntimeString}; +use sp_runtime::generic::{BlockId, Digest, DigestItem}; +use sp_runtime::traits::{Block as BlockT, Header as HeaderT}; +use sp_api::ProvideRuntimeApi; +use sp_consensus_pow::{Seal, TotalDifficulty, POW_ENGINE_ID}; +use sp_inherents::{InherentDataProviders, InherentData}; +use sp_consensus::{ + BlockImportParams, BlockOrigin, ForkChoiceStrategy, SyncOracle, Environment, Proposer, + SelectChain, Error as ConsensusError, CanAuthorWith, RecordProof, BlockImport, + BlockCheckParams, ImportResult, +}; +use sp_consensus::import_queue::{ + BoxBlockImport, BasicQueue, Verifier, BoxJustificationImport, +}; +use codec::{Encode, Decode}; +use prometheus_endpoint::Registry; +use sc_client_api; +use log::*; +use sp_timestamp::{InherentError as TIError, TimestampInherentData}; + +use crate::worker::UntilImportedOrTimeout; +// use sp_std::{ +// convert::TryFrom, +// }; + +#[derive(derive_more::Display, Debug)] +pub enum Error { + #[display(fmt = "Header uses the wrong engine {:?}", _0)] + WrongEngine([u8; 4]), + #[display(fmt = "Header {:?} is unsealed", _0)] + HeaderUnsealed(B::Hash), + #[display(fmt = "PoW validation error: invalid seal")] + InvalidSeal, + #[display(fmt = "PoW validation error: preliminary verification failed")] + FailedPreliminaryVerify, + #[display(fmt = "Rejecting block too far in future")] + TooFarInFuture, + #[display(fmt = "Fetching best header failed using select chain: {:?}", _0)] + BestHeaderSelectChain(ConsensusError), + #[display(fmt = "Fetching best header failed: {:?}", _0)] + BestHeader(sp_blockchain::Error), + #[display(fmt = "Best header does not exist")] + NoBestHeader, + #[display(fmt = "Block proposing error: {:?}", _0)] + BlockProposingError(String), + #[display(fmt = "Fetch best hash failed via select chain: {:?}", _0)] + BestHashSelectChain(ConsensusError), + #[display(fmt = "Error with block built on {:?}: {:?}", _0, _1)] + BlockBuiltError(B::Hash, ConsensusError), + #[display(fmt = "Creating inherents failed: {}", _0)] + CreateInherents(sp_inherents::Error), + #[display(fmt = "Checking inherents failed: {}", _0)] + CheckInherents(String), + #[display(fmt = "Multiple pre-runtime digests")] + MultiplePreRuntimeDigests, + Client(sp_blockchain::Error), + Codec(codec::Error), + Environment(String), + Runtime(RuntimeString), + Other(String), +} + +impl std::convert::From> for String { + fn from(error: Error) -> String { + error.to_string() + } +} + +impl std::convert::From> for ConsensusError { + fn from(error: Error) -> ConsensusError { + ConsensusError::ClientImport(error.to_string()) + } +} + +/// Auxiliary storage prefix for PoW engine. +pub const POW_AUX_PREFIX: [u8; 4] = *b"PoW:"; + +/// Get the auxiliary storage key used by engine to store total difficulty. +fn aux_key>(hash: &T) -> Vec { + POW_AUX_PREFIX.iter().chain(hash.as_ref()).copied().collect() +} + +/// Intermediate value passed to block importer. +#[derive(Encode, Decode, Clone, Debug, Default)] +pub struct PowIntermediate { + /// Difficulty of the block, if known. + pub difficulty: Option, +} + +/// Intermediate key for PoW engine. +pub static INTERMEDIATE_KEY: &[u8] = b"pow1"; + +/// Auxiliary storage data for PoW. +#[derive(Encode, Decode, Clone, Debug, Default)] +pub struct PowAux { + /// Difficulty of the current block. + pub difficulty: Difficulty, + /// Total difficulty up to current block. + pub total_difficulty: Difficulty, +} + +impl PowAux where + Difficulty: Decode + Default, +{ + /// Read the auxiliary from client. + pub fn read(client: &C, hash: &B::Hash) -> Result> { + let key = aux_key(&hash); + + match client.get_aux(&key).map_err(Error::Client)? { + Some(bytes) => Self::decode(&mut &bytes[..]).map_err(Error::Codec), + None => Ok(Self::default()), + } + } +} + +/// Algorithm used for proof of work. +pub trait PowAlgorithm { + /// Difficulty for the algorithm. + type Difficulty: TotalDifficulty + Default + Encode + Decode + Ord + Clone + Copy + 'static ; + + /// Get the parent block's difficulty. + /// + /// This function will be called twice during the import process, so the implementation + /// should be properly cached. + fn difficulty(&self, parent: B::Hash) -> Result>; + + /// Get the next block's difficulty. + fn calc_difficulty(&self, parent: B::Hash, cur: B::Hash) -> Result>; + + /// Verify that the seal is valid against given pre hash when parent block is not yet imported. + /// + /// None means that preliminary verify is not available for this algorithm. + fn preliminary_verify( + &self, + _pre_hash: &B::Hash, + _seal: &Seal, + ) -> Result, Error> { + Ok(None) + } + /// Break a fork choice tie. + /// + /// By default this chooses the earliest block seen. Using uniform tie + /// breaking algorithms will help to protect against selfish mining. + /// + /// Returns if the new seal should be considered best block. + fn break_tie( + &self, + _own_seal: &Seal, + _new_seal: &Seal, + ) -> bool { + false + } + /// Verify that the difficulty is valid against given seal. + fn verify( + &self, + parent: &BlockId, + pre_hash: &B::Hash, + pre_digest: Option<&[u8]>, + seal: &Seal, + difficulty: Self::Difficulty, + ) -> Result>; +} + +/// A block importer for PoW. +pub struct PowBlockImport { + pub algorithm: Algorithm, + inner: I, + select_chain: S, + client: Arc, + inherent_data_providers: sp_inherents::InherentDataProviders, + check_inherents_after: <::Header as HeaderT>::Number, + can_author_with: CAW, +} + +impl Clone + for PowBlockImport +{ + fn clone(&self) -> Self { + Self { + algorithm: self.algorithm.clone(), + inner: self.inner.clone(), + select_chain: self.select_chain.clone(), + client: self.client.clone(), + inherent_data_providers: self.inherent_data_providers.clone(), + check_inherents_after: self.check_inherents_after.clone(), + can_author_with: self.can_author_with.clone(), + } + } +} + +impl PowBlockImport where + B: BlockT, + I: BlockImport> + Send + Sync, + I::Error: Into, + C: ProvideRuntimeApi + Send + Sync + HeaderBackend + AuxStore + ProvideCache + BlockOf, + C::Api: BlockBuilderApi, + Algorithm: PowAlgorithm, + CAW: CanAuthorWith, +{ + /// Create a new block import suitable to be used in PoW + pub fn new( + inner: I, + client: Arc, + algorithm: Algorithm, + check_inherents_after: <::Header as HeaderT>::Number, + select_chain: S, + inherent_data_providers: sp_inherents::InherentDataProviders, + can_author_with: CAW, + ) -> Self { + Self { + inner, + client, + algorithm, + check_inherents_after, + select_chain, + inherent_data_providers, + can_author_with, + } + } + + fn check_inherents( + &self, + block: B, + block_id: BlockId, + inherent_data: InherentData, + timestamp_now: u64, + ) -> Result<(), Error> { + const MAX_TIMESTAMP_DRIFT_SECS: u64 = 60; + + if *block.header().number() < self.check_inherents_after { + return Ok(()) + } + + if let Err(e) = self.can_author_with.can_author_with(&block_id) { + debug!( + target: "pow", + "Skipping `check_inherents` as authoring version is not compatible: {}", + e, + ); + + return Ok(()) + } + + let inherent_res = self.client.runtime_api().check_inherents( + &block_id, + block, + inherent_data, + ).map_err(Error::Client)?; + + if !inherent_res.ok() { + inherent_res + .into_errors() + .try_for_each(|(i, e)| match TIError::try_from(&i, &e) { + Some(TIError::ValidAtTimestamp(timestamp)) => { + if timestamp > timestamp_now + MAX_TIMESTAMP_DRIFT_SECS { + return Err(Error::TooFarInFuture); + } + + Ok(()) + }, + Some(TIError::Other(e)) => Err(Error::Runtime(e)), + None => Err(Error::CheckInherents( + self.inherent_data_providers.error_to_string(&i, &e) + )), + }) + } else { + Ok(()) + } + } +} + +impl BlockImport for PowBlockImport where + B: BlockT, + I: BlockImport> + Send + Sync, + I::Error: Into, + S: SelectChain, + C: ProvideRuntimeApi + Send + Sync + HeaderBackend + AuxStore + ProvideCache + BlockOf, + C::Api: BlockBuilderApi, + Algorithm: PowAlgorithm, + Algorithm::Difficulty: 'static, + CAW: CanAuthorWith, +{ + type Error = ConsensusError; + type Transaction = sp_api::TransactionFor; + + fn check_block( + &mut self, + block: BlockCheckParams, + ) -> Result { + self.inner.check_block(block).map_err(Into::into) + } + + fn import_block( + &mut self, + mut block: BlockImportParams, + new_cache: HashMap>, + ) -> Result { + let best_header = self.select_chain.best_chain() + .map_err(|e| format!("Fetch best chain failed via select chain: {:?}", e))?; + let best_hash = best_header.hash(); + + let parent_hash = *block.header.parent_hash(); + let best_aux = PowAux::read::<_, B>(self.client.as_ref(), &best_hash)?; + let mut aux = PowAux::read::<_, B>(self.client.as_ref(), &parent_hash)?; + + if let Some(inner_body) = block.body.take() { + let inherent_data = self.inherent_data_providers + .create_inherent_data().map_err(|e| e.into_string())?; + // :TODO: fix timestamp + //let timestamp_now = inherent_data.timestamp_inherent_data().map_err(|e| e.into_string())?; + //let timestamp_now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs(); + + let check_block = B::new(block.header.clone(), inner_body); + + // :TODO: may check later, now we don't check the timestamp inherent data + // self.check_inherents( + // check_block.clone(), + // BlockId::Hash(parent_hash), + // inherent_data, + // timestamp_now + // )?; + + block.body = Some(check_block.deconstruct().1); + } + + let inner_seal = fetch_seal::(block.post_digests.last(), block.header.hash())?; + + let intermediate = block.take_intermediate::>( + INTERMEDIATE_KEY + )?; + + let difficulty = match intermediate.difficulty { + Some(difficulty) => difficulty, + None => self.algorithm.difficulty(parent_hash)?, + }; + + let pre_hash = block.header.hash(); + let pre_digest = find_pre_digest::(&block.header)?; + if !self.algorithm.verify( + &BlockId::hash(parent_hash), + &pre_hash, + pre_digest.as_ref().map(|v| &v[..]), + &inner_seal, + difficulty, + )? { + return Err(Error::::InvalidSeal.into()) + } + + aux.difficulty = difficulty; + aux.total_difficulty.increment(difficulty); + + let key = aux_key(&block.post_hash()); + block.auxiliary.push((key, Some(aux.encode()))); + if block.fork_choice.is_none() { + block.fork_choice = Some(ForkChoiceStrategy::Custom( + match aux.total_difficulty.cmp(&best_aux.total_difficulty) { + Ordering::Less => false, + Ordering::Greater => true, + Ordering::Equal => { + let best_inner_seal = fetch_seal::( + best_header.digest().logs.last(), + best_hash, + )?; + + self.algorithm.break_tie(&best_inner_seal, &inner_seal) + }, + } + )); + } + + self.inner.import_block(block, new_cache).map_err(Into::into) + } +} + +/// A verifier for PoW blocks. +pub struct PowVerifier { + algorithm: Algorithm, + _marker: PhantomData, +} + +impl PowVerifier { + pub fn new( + algorithm: Algorithm, + ) -> Self { + Self { algorithm, _marker: PhantomData } + } + + fn check_header( + &self, + mut header: B::Header, + ) -> Result<(B::Header, DigestItem), Error> where + Algorithm: PowAlgorithm, + { + let hash = header.hash(); + + let (seal, inner_seal) = match header.digest_mut().pop() { + Some(DigestItem::Seal(id, seal)) => { + if id == POW_ENGINE_ID { + (DigestItem::Seal(id, seal.clone()), seal) + } else { + return Err(Error::WrongEngine(id)) + } + }, + _ => return Err(Error::HeaderUnsealed(hash)), + }; + + let pre_hash = header.hash(); + + if !self.algorithm.preliminary_verify(&pre_hash, &inner_seal)?.unwrap_or(true) { + return Err(Error::FailedPreliminaryVerify); + } + + Ok((header, seal)) + } +} + +impl Verifier for PowVerifier where + Algorithm: PowAlgorithm + Send + Sync, + Algorithm::Difficulty: 'static, +{ + fn verify( + &mut self, + origin: BlockOrigin, + header: B::Header, + justification: Option, + body: Option>, + ) -> Result<(BlockImportParams, Option)>>), String> { + let hash = header.hash(); + let (checked_header, seal) = self.check_header(header)?; + + let intermediate = PowIntermediate:: { + difficulty: None, + }; + + let mut import_block = BlockImportParams::new(origin, checked_header); + import_block.post_digests.push(seal); + import_block.body = body; + import_block.justification = justification; + import_block.intermediates.insert( + Cow::from(INTERMEDIATE_KEY), + Box::new(intermediate) as Box + ); + import_block.post_hash = Some(hash); + + Ok((import_block, None)) + } +} + +/// Register the PoW inherent data provider, if not registered already. +pub fn register_pow_inherent_data_provider( + inherent_data_providers: &InherentDataProviders, +) -> Result<(), sp_consensus::Error> { + if !inherent_data_providers.has_provider(&sp_timestamp::INHERENT_IDENTIFIER) { + inherent_data_providers + .register_provider(sp_timestamp::InherentDataProvider) + .map_err(Into::into) + .map_err(sp_consensus::Error::InherentData) + } else { + Ok(()) + } +} + +/// The PoW import queue type. +pub type PowImportQueue = BasicQueue; + +/// Import queue for PoW engine. +pub fn import_queue( + block_import: BoxBlockImport, + justification_import: Option>, + algorithm: Algorithm, + inherent_data_providers: InherentDataProviders, + spawner: &impl sp_core::traits::SpawnNamed, + registry: Option<&Registry>, +) -> Result< + PowImportQueue, + sp_consensus::Error +> where + B: BlockT, + Transaction: Send + Sync + 'static, + Algorithm: PowAlgorithm + Clone + Send + Sync + 'static, +{ + register_pow_inherent_data_provider(&inherent_data_providers)?; + + let verifier = PowVerifier::new(algorithm); + + Ok(BasicQueue::new( + verifier, + block_import, + justification_import, + spawner, + registry, + )) +} + +/// Start the mining worker for PoW. This function provides the necessary helper functions that can +/// be used to implement a miner. However, it does not do the CPU-intensive mining itself. +/// +/// Two values are returned -- a worker, which contains functions that allows querying the current +/// mining metadata and submitting mined blocks, and a future, which must be polled to fill in +/// information in the worker. +/// +/// `pre_runtime` is a parameter that allows a custom additional pre-runtime digest to be inserted +/// for blocks being built. This can encode authorship information, or just be a graffiti. +pub fn start_mining_worker( + block_import: BoxBlockImport>, + client: Arc, + select_chain: S, + algorithm: Algorithm, + mut env: E, + mut sync_oracle: SO, + pre_runtime: Option>, + inherent_data_providers: sp_inherents::InherentDataProviders, + timeout: Duration, + build_time: Duration, + can_author_with: CAW, +) -> (Arc>>, impl Future) where + Block: BlockT, + C: ProvideRuntimeApi + BlockchainEvents + 'static, + S: SelectChain + 'static, + Algorithm: PowAlgorithm + Clone, + Algorithm::Difficulty: 'static, + E: Environment + Send + Sync + 'static, + E::Error: std::fmt::Debug, + E::Proposer: Proposer>, + SO: SyncOracle + Clone + Send + Sync + 'static, + CAW: CanAuthorWith + Clone + Send + 'static, +{ + if let Err(_) = register_pow_inherent_data_provider(&inherent_data_providers) { + warn!("Registering inherent data provider for timestamp failed"); + } + + let timer = UntilImportedOrTimeout::new(client.import_notification_stream(), timeout); + let worker = Arc::new(Mutex::new(MiningWorker:: { + build: None, + algorithm: algorithm.clone(), + block_import, + })); + let worker_ret = worker.clone(); + + let task = timer.for_each(move |()| { + let worker = worker.clone(); + + if sync_oracle.is_major_syncing() { + debug!(target: "pow", "Skipping proposal due to sync."); + worker.lock().on_major_syncing(); + return Either::Left(future::ready(())) + } + + let best_header = match select_chain.best_chain() { + Ok(x) => x, + Err(err) => { + warn!( + target: "pow", + "Unable to pull new block for authoring. \ + Select best chain error: {:?}", + err + ); + return Either::Left(future::ready(())) + }, + }; + let best_hash = best_header.hash(); + + if let Err(err) = can_author_with.can_author_with(&BlockId::Hash(best_hash)) { + warn!( + target: "pow", + "Skipping proposal `can_author_with` returned: {} \ + Probably a node update is required!", + err, + ); + return Either::Left(future::ready(())) + } + + if worker.lock().best_hash() == Some(best_hash) { + return Either::Left(future::ready(())) + } + + // The worker is locked for the duration of the whole proposing period. Within this period, + // the mining target is outdated and useless anyway. + let difficulty = match algorithm.calc_difficulty(*best_header.parent_hash(), best_hash) { + Ok(x) => x, + Err(err) => { + warn!( + target: "pow", + "Unable to propose new block for authoring. \ + Calculate difficulty failed: {:?}", + err, + ); + return Either::Left(future::ready(())) + }, + }; + + let awaiting_proposer = env.init(&best_header); + let inherent_data = match inherent_data_providers.create_inherent_data() { + Ok(x) => x, + Err(err) => { + warn!( + target: "pow", + "Unable to propose new block for authoring. \ + Creating inherent data failed: {:?}", + err, + ); + return Either::Left(future::ready(())) + }, + }; + let mut inherent_digest = Digest::::default(); + if let Some(pre_runtime) = &pre_runtime { + inherent_digest.push(DigestItem::PreRuntime(POW_ENGINE_ID, pre_runtime.to_vec())); + } + + let pre_runtime = pre_runtime.clone(); + + Either::Right(async move { + let proposer = match awaiting_proposer.await { + Ok(x) => x, + Err(err) => { + warn!( + target: "pow", + "Unable to propose new block for authoring. \ + Creating proposer failed: {:?}", + err, + ); + return + }, + }; + + let proposal = match proposer.propose( + inherent_data.clone(), + inherent_digest, + build_time.clone(), + RecordProof::No, + ).await { + Ok(x) => x, + Err(err) => { + warn!( + target: "pow", + "Unable to propose new block for authoring. \ + Creating proposal failed: {:?}", + err, + ); + return + }, + }; + + let build = MiningBuild:: { + metadata: MiningMetadata { + best_hash, + pre_hash: proposal.block.header().hash(), + pre_runtime: pre_runtime.clone(), + difficulty, + number: (*proposal.block.header().number()), + }, + proposal, + }; + + worker.lock().on_build(build); + }) + }); + + (worker_ret, task) +} + +/// Find PoW pre-runtime. +fn find_pre_digest(header: &B::Header) -> Result>, Error> { + let mut pre_digest: Option<_> = None; + for log in header.digest().logs() { + trace!(target: "pow", "Checking log {:?}, looking for pre runtime digest", log); + match (log, pre_digest.is_some()) { + (DigestItem::PreRuntime(POW_ENGINE_ID, _), true) => { + return Err(Error::MultiplePreRuntimeDigests) + }, + (DigestItem::PreRuntime(POW_ENGINE_ID, v), false) => { + pre_digest = Some(v.clone()); + }, + (_, _) => trace!(target: "pow", "Ignoring digest not meant for us"), + } + } + + Ok(pre_digest) +} + +/// Fetch PoW seal. +pub fn fetch_seal( + digest: Option<&DigestItem>, + hash: B::Hash, +) -> Result, Error> { + match digest { + Some(DigestItem::Seal(id, seal)) => { + if id == &POW_ENGINE_ID { + Ok(seal.clone()) + } else { + return Err(Error::::WrongEngine(*id).into()) + } + }, + _ => return Err(Error::::HeaderUnsealed(hash).into()), + } +} diff --git a/client/consensus/consensus-pow/src/worker.rs b/client/consensus/consensus-pow/src/worker.rs new file mode 100644 index 00000000..e543b9e9 --- /dev/null +++ b/client/consensus/consensus-pow/src/worker.rs @@ -0,0 +1,215 @@ +// This file is part of Substrate. + +// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +use std::{pin::Pin, time::Duration, collections::HashMap, any::Any, borrow::Cow}; +use sc_client_api::ImportNotifications; +use sp_runtime::{DigestItem, traits::Block as BlockT, generic::BlockId, traits::NumberFor}; +use sp_consensus::{Proposal, BlockOrigin, BlockImportParams, import_queue::BoxBlockImport}; +use futures::{prelude::*, task::{Context, Poll}}; +use futures_timer::Delay; +use log::*; + +use crate::{INTERMEDIATE_KEY, POW_ENGINE_ID, Seal, PowAlgorithm, PowIntermediate}; + +/// Mining metadata. This is the information needed to start an actual mining loop. +#[derive(Clone, Eq, PartialEq)] +pub struct MiningMetadata { + /// Currently known best hash which the pre-hash is built on. + pub best_hash: H, + /// Mining pre-hash. + pub pre_hash: H, + /// Pre-runtime digest item. + pub pre_runtime: Option>, + /// Mining target difficulty. + pub difficulty: D, + /// block number + pub number: NumberFor, +} + +/// A build of mining, containing the metadata and the block proposal. +pub struct MiningBuild, C: sp_api::ProvideRuntimeApi> { + /// Mining metadata. + pub metadata: MiningMetadata, + /// Mining proposal. + pub proposal: Proposal>, +} + +/// Mining worker that exposes structs to query the current mining build and submit mined blocks. +pub struct MiningWorker, C: sp_api::ProvideRuntimeApi> { + pub(crate) build: Option>, + pub(crate) algorithm: Algorithm, + pub(crate) block_import: BoxBlockImport>, +} + +impl MiningWorker where + Block: BlockT, + C: sp_api::ProvideRuntimeApi, + Algorithm: PowAlgorithm, + Algorithm::Difficulty: 'static, +{ + /// Get the current best hash. `None` if the worker has just started or the client is doing + /// major syncing. + pub fn best_hash(&self) -> Option { + self.build.as_ref().map(|b| b.metadata.best_hash) + } + + pub(crate) fn on_major_syncing(&mut self) { + self.build = None; + } + + pub(crate) fn on_build( + &mut self, + build: MiningBuild, + ) { + self.build = Some(build); + } + + /// Get a copy of the current mining metadata, if available. + pub fn metadata(&self) -> Option> { + self.build.as_ref().map(|b| b.metadata.clone()) + } + + /// Submit a mined seal. The seal will be validated again. Returns true if the submission is + /// successful. + pub fn submit(&mut self, seal: Seal) -> bool { + if let Some(build) = self.build.take() { + match self.algorithm.verify( + &BlockId::Hash(build.metadata.best_hash), + &build.metadata.pre_hash, + build.metadata.pre_runtime.as_ref().map(|v| &v[..]), + &seal, + build.metadata.difficulty, + ) { + Ok(true) => (), + Ok(false) => { + warn!( + target: "pow", + "Unable to import mined block: seal is invalid", + ); + return false + }, + Err(err) => { + warn!( + target: "pow", + "Unable to import mined block: {:?}", + err, + ); + return false + }, + } + + let seal = DigestItem::Seal(POW_ENGINE_ID, seal); + let (header, body) = build.proposal.block.deconstruct(); + + let mut import_block = BlockImportParams::new(BlockOrigin::Own, header); + import_block.post_digests.push(seal); + import_block.body = Some(body); + import_block.storage_changes = Some(build.proposal.storage_changes); + + let intermediate = PowIntermediate:: { + difficulty: Some(build.metadata.difficulty), + }; + + import_block.intermediates.insert( + Cow::from(INTERMEDIATE_KEY), + Box::new(intermediate) as Box + ); + + match self.block_import.import_block(import_block, HashMap::default()) { + Ok(_) => { + info!( + target: "pow", + "✅ Successfully mined block on top of: {}", + build.metadata.best_hash + ); + true + }, + Err(err) => { + warn!( + target: "pow", + "Unable to import mined block: {:?}", + err, + ); + false + }, + } + } else { + warn!( + target: "pow", + "Unable to import mined block: build does not exist", + ); + false + } + } +} + +/// A stream that waits for a block import or timeout. +pub struct UntilImportedOrTimeout { + import_notifications: ImportNotifications, + timeout: Duration, + inner_delay: Option, +} + +impl UntilImportedOrTimeout { + /// Create a new stream using the given import notification and timeout duration. + pub fn new( + import_notifications: ImportNotifications, + timeout: Duration, + ) -> Self { + Self { + import_notifications, + timeout, + inner_delay: None, + } + } +} + +impl Stream for UntilImportedOrTimeout { + type Item = (); + + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll> { + let mut fire = false; + + loop { + match Stream::poll_next(Pin::new(&mut self.import_notifications), cx) { + Poll::Pending => break, + Poll::Ready(Some(_)) => { + fire = true; + }, + Poll::Ready(None) => return Poll::Ready(None), + } + } + + let timeout = self.timeout.clone(); + let inner_delay = self.inner_delay.get_or_insert_with(|| Delay::new(timeout)); + + match Future::poll(Pin::new(inner_delay), cx) { + Poll::Pending => (), + Poll::Ready(()) => { + fire = true; + }, + } + + if fire { + self.inner_delay = None; + Poll::Ready(Some(())) + } else { + Poll::Pending + } + } +} diff --git a/client/consensus/ethash/Cargo.toml b/client/consensus/ethash/Cargo.toml new file mode 100644 index 00000000..1628bd58 --- /dev/null +++ b/client/consensus/ethash/Cargo.toml @@ -0,0 +1,36 @@ +[package] +description = "Parity Ethereum Ethash & ProgPoW Implementations" +name = "ethash" +version = "1.12.0" +authors = ["Parity Technologies "] + +[dependencies] +crunchy = "0.1.0" +either = "1.0.0" +ethereum-types = "0.9.2" +keccak-hash = "0.5.0" +tiny-keccak = "2.0.2" +log = "0.4" +memmap = "0.6" +parking_lot = "0.11.1" +primal = "0.2.3" + +[dev-dependencies] +#criterion = "0.2" +rustc-hex = "1.0" +serde_json = "1.0" +tempdir = "0.3" + +[features] +default = [] +bench = [] + +[[bench]] +name = "basic" +harness = false +required-features = ['bench'] + +[[bench]] +name = "progpow" +harness = false +required-features = ['bench'] diff --git a/client/consensus/ethash/benches/basic.rs b/client/consensus/ethash/benches/basic.rs new file mode 100644 index 00000000..8e60a698 --- /dev/null +++ b/client/consensus/ethash/benches/basic.rs @@ -0,0 +1,126 @@ +// Copyright 2015-2020 Parity Technologies (UK) Ltd. +// This file is part of OpenEthereum. + +// OpenEthereum 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. + +// OpenEthereum 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 OpenEthereum. If not, see . + +#[macro_use] +extern crate criterion; +extern crate ethash; + +use criterion::Criterion; +use ethash::{NodeCacheBuilder, OptimizeFor}; + +const HASH: [u8; 32] = [ + 0xf5, 0x7e, 0x6f, 0x3a, 0xcf, 0xc0, 0xdd, 0x4b, 0x5b, 0xf2, 0xbe, 0xe4, 0x0a, 0xb3, 0x35, 0x8a, + 0xa6, 0x87, 0x73, 0xa8, 0xd0, 0x9f, 0x5e, 0x59, 0x5e, 0xab, 0x55, 0x94, 0x05, 0x52, 0x7d, 0x72, +]; +const NONCE: u64 = 0xd7b3ac70a301a249; + +criterion_group!( + basic, + bench_light_compute_memmap, + bench_light_compute_memory, + bench_light_new_round_trip_memmap, + bench_light_new_round_trip_memory, + bench_light_from_file_round_trip_memory, + bench_light_from_file_round_trip_memmap +); +criterion_main!(basic); + +fn bench_light_compute_memmap(b: &mut Criterion) { + use std::env; + + let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value()); + let light = builder.light(&env::temp_dir(), 486382); + + b.bench_function("bench_light_compute_memmap", move |b| { + b.iter(|| light.compute(&HASH, NONCE, u64::max_value())) + }); +} + +fn bench_light_compute_memory(b: &mut Criterion) { + use std::env; + + let builder = NodeCacheBuilder::new(OptimizeFor::Cpu, u64::max_value()); + let light = builder.light(&env::temp_dir(), 486382); + + b.bench_function("bench_light_compute_memmap", move |b| { + b.iter(|| light.compute(&HASH, NONCE, u64::max_value())) + }); +} + +fn bench_light_new_round_trip_memmap(b: &mut Criterion) { + use std::env; + + b.bench_function("bench_light_compute_memmap", move |b| { + b.iter(|| { + let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value()); + let light = builder.light(&env::temp_dir(), 486382); + light.compute(&HASH, NONCE, u64::max_value()); + }) + }); +} + +fn bench_light_new_round_trip_memory(b: &mut Criterion) { + use std::env; + + b.bench_function("bench_light_compute_memmap", move |b| { + b.iter(|| { + let builder = NodeCacheBuilder::new(OptimizeFor::Cpu, u64::max_value()); + let light = builder.light(&env::temp_dir(), 486382); + light.compute(&HASH, NONCE, u64::max_value()); + }) + }); +} + +fn bench_light_from_file_round_trip_memory(b: &mut Criterion) { + use std::env; + + let dir = env::temp_dir(); + let height = 486382; + { + let builder = NodeCacheBuilder::new(OptimizeFor::Cpu, u64::max_value()); + let mut dummy = builder.light(&dir, height); + dummy.to_file().unwrap(); + } + + b.bench_function("bench_light_compute_memmap", move |b| { + b.iter(|| { + let builder = NodeCacheBuilder::new(OptimizeFor::Cpu, u64::max_value()); + let light = builder.light_from_file(&dir, 486382).unwrap(); + light.compute(&HASH, NONCE, u64::max_value()); + }) + }); +} + +fn bench_light_from_file_round_trip_memmap(b: &mut Criterion) { + use std::env; + + let dir = env::temp_dir(); + let height = 486382; + + { + let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value()); + let mut dummy = builder.light(&dir, height); + dummy.to_file().unwrap(); + } + + b.bench_function("bench_light_compute_memmap", move |b| { + b.iter(|| { + let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value()); + let light = builder.light_from_file(&dir, 486382).unwrap(); + light.compute(&HASH, NONCE, u64::max_value()); + }) + }); +} diff --git a/client/consensus/ethash/benches/progpow.rs b/client/consensus/ethash/benches/progpow.rs new file mode 100644 index 00000000..939818e7 --- /dev/null +++ b/client/consensus/ethash/benches/progpow.rs @@ -0,0 +1,77 @@ +#[macro_use] +extern crate criterion; +extern crate ethash; +extern crate rustc_hex; +extern crate tempdir; + +use criterion::Criterion; +use ethash::progpow; + +use ethash::{compute::light_compute, NodeCacheBuilder, OptimizeFor}; +use rustc_hex::FromHex; +use tempdir::TempDir; + +fn bench_hashimoto_light(c: &mut Criterion) { + let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value()); + let tempdir = TempDir::new("").unwrap(); + let light = builder.light(&tempdir.path(), 1); + let h = FromHex::from_hex("c9149cc0386e689d789a1c2f3d5d169a61a6218ed30e74414dc736e442ef3d1f") + .unwrap(); + let mut hash = [0; 32]; + hash.copy_from_slice(&h); + + c.bench_function("hashimoto_light", move |b| { + b.iter(|| light_compute(&light, &hash, 0)) + }); +} + +fn bench_progpow_light(c: &mut Criterion) { + let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value()); + let tempdir = TempDir::new("").unwrap(); + let cache = builder.new_cache(tempdir.into_path(), 0); + + let h = FromHex::from_hex("c9149cc0386e689d789a1c2f3d5d169a61a6218ed30e74414dc736e442ef3d1f") + .unwrap(); + let mut hash = [0; 32]; + hash.copy_from_slice(&h); + + c.bench_function("progpow_light", move |b| { + b.iter(|| { + let c_dag = progpow::generate_cdag(cache.as_ref()); + progpow::progpow(hash, 0, 0, cache.as_ref(), &c_dag); + }) + }); +} + +fn bench_progpow_optimal_light(c: &mut Criterion) { + let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value()); + let tempdir = TempDir::new("").unwrap(); + let cache = builder.new_cache(tempdir.into_path(), 0); + let c_dag = progpow::generate_cdag(cache.as_ref()); + + let h = FromHex::from_hex("c9149cc0386e689d789a1c2f3d5d169a61a6218ed30e74414dc736e442ef3d1f") + .unwrap(); + let mut hash = [0; 32]; + hash.copy_from_slice(&h); + + c.bench_function("progpow_optimal_light", move |b| { + b.iter(|| { + progpow::progpow(hash, 0, 0, cache.as_ref(), &c_dag); + }) + }); +} + +fn bench_keccak_f800_long(c: &mut Criterion) { + c.bench_function("keccak_f800_long(0, 0, 0)", |b| { + b.iter(|| progpow::keccak_f800_long([0; 32], 0, [0; 8])) + }); +} + +criterion_group!( + benches, + bench_hashimoto_light, + bench_progpow_light, + bench_progpow_optimal_light, + bench_keccak_f800_long, +); +criterion_main!(benches); diff --git a/client/consensus/ethash/res/progpow_testvectors.json b/client/consensus/ethash/res/progpow_testvectors.json new file mode 100644 index 00000000..2939f710 --- /dev/null +++ b/client/consensus/ethash/res/progpow_testvectors.json @@ -0,0 +1,86 @@ +[ + [ + 0, + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000", + "faeb1be51075b03a4ff44b335067951ead07a3b078539ace76fd56fc410557a3", + "63155f732f2bf556967f906155b510c917e48e99685ead76ea83f4eca03ab12b" + ], + [ + 49, + "63155f732f2bf556967f906155b510c917e48e99685ead76ea83f4eca03ab12b", + "0000000006ff2c47", + "c789c1180f890ec555ff42042913465481e8e6bc512cb981e1c1108dc3f2227d", + "9e7248f20914913a73d80a70174c331b1d34f260535ac3631d770e656b5dd922" + ], + [ + 50, + "9e7248f20914913a73d80a70174c331b1d34f260535ac3631d770e656b5dd922", + "00000000076e482e", + "c7340542c2a06b3a7dc7222635f7cd402abf8b528ae971ddac6bbe2b0c7cb518", + "de37e1824c86d35d154cf65a88de6d9286aec4f7f10c3fc9f0fa1bcc2687188d" + ], + [ + 99, + "de37e1824c86d35d154cf65a88de6d9286aec4f7f10c3fc9f0fa1bcc2687188d", + "000000003917afab", + "f5e60b2c5bfddd136167a30cbc3c8dbdbd15a512257dee7964e0bc6daa9f8ba7", + "ac7b55e801511b77e11d52e9599206101550144525b5679f2dab19386f23dcce" + ], + [ + 29950, + "ac7b55e801511b77e11d52e9599206101550144525b5679f2dab19386f23dcce", + "005d409dbc23a62a", + "07393d15805eb08ee6fc6cb3ad4ad1010533bd0ff92d6006850246829f18fd6e", + "e43d7e0bdc8a4a3f6e291a5ed790b9fa1a0948a2b9e33c844888690847de19f5" + ], + [ + 29999, + "e43d7e0bdc8a4a3f6e291a5ed790b9fa1a0948a2b9e33c844888690847de19f5", + "005db5fa4c2a3d03", + "7551bddf977491da2f6cfc1679299544b23483e8f8ee0931c4c16a796558a0b8", + "d34519f72c97cae8892c277776259db3320820cb5279a299d0ef1e155e5c6454" + ], + [ + 30000, + "d34519f72c97cae8892c277776259db3320820cb5279a299d0ef1e155e5c6454", + "005db8607994ff30", + "f1c2c7c32266af9635462e6ce1c98ebe4e7e3ecab7a38aaabfbf2e731e0fbff4", + "8b6ce5da0b06d18db7bd8492d9e5717f8b53e7e098d9fef7886d58a6e913ef64" + ], + [ + 30049, + "8b6ce5da0b06d18db7bd8492d9e5717f8b53e7e098d9fef7886d58a6e913ef64", + "005e2e215a8ca2e7", + "57fe6a9fbf920b4e91deeb66cb0efa971e08229d1a160330e08da54af0689add", + "c2c46173481b9ced61123d2e293b42ede5a1b323210eb2a684df0874ffe09047" + ], + [ + 30050, + "c2c46173481b9ced61123d2e293b42ede5a1b323210eb2a684df0874ffe09047", + "005e30899481055e", + "ba30c61cc5a2c74a5ecaf505965140a08f24a296d687e78720f0b48baf712f2d", + "ea42197eb2ba79c63cb5e655b8b1f612c5f08aae1a49ff236795a3516d87bc71" + ], + [ + 30099, + "ea42197eb2ba79c63cb5e655b8b1f612c5f08aae1a49ff236795a3516d87bc71", + "005ea6aef136f88b", + "cfd5e46048cd133d40f261fe8704e51d3f497fc14203ac6a9ef6a0841780b1cd", + "49e15ba4bf501ce8fe8876101c808e24c69a859be15de554bf85dbc095491bd6" + ], + [ + 59950, + "49e15ba4bf501ce8fe8876101c808e24c69a859be15de554bf85dbc095491bd6", + "02ebe0503bd7b1da", + "21511fbaa31fb9f5fc4998a754e97b3083a866f4de86fa7500a633346f56d773", + "f5c50ba5c0d6210ddb16250ec3efda178de857b2b1703d8d5403bd0f848e19cf" + ], + [ + 59999, + "f5c50ba5c0d6210ddb16250ec3efda178de857b2b1703d8d5403bd0f848e19cf", + "02edb6275bd221e3", + "653eda37d337e39d311d22be9bbd3458d3abee4e643bee4a7280a6d08106ef98", + "341562d10d4afb706ec2c8d5537cb0c810de02b4ebb0a0eea5ae335af6fb2e88" + ] +] diff --git a/client/consensus/ethash/src/cache.rs b/client/consensus/ethash/src/cache.rs new file mode 100644 index 00000000..38b2b2de --- /dev/null +++ b/client/consensus/ethash/src/cache.rs @@ -0,0 +1,356 @@ +// Copyright 2015-2020 Parity Technologies (UK) Ltd. +// This file is part of OpenEthereum. + +// OpenEthereum 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. + +// OpenEthereum 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 OpenEthereum. If not, see . + +use compute::Light; +use either::Either; +use keccak::{keccak_512, H256}; +use memmap::MmapMut; +use parking_lot::Mutex; +use seed_compute::SeedHashCompute; + +use shared::{epoch, get_cache_size, to_hex, Node, ETHASH_CACHE_ROUNDS, NODE_BYTES}; + +use std::{ + borrow::Cow, + fs, + io::{self, Read, Write}, + path::{Path, PathBuf}, + slice, + sync::Arc, +}; + +type Cache = Either, MmapMut>; + +#[derive(PartialEq, Eq, Debug, Clone, Copy)] +pub enum OptimizeFor { + Cpu, + Memory, +} + +impl Default for OptimizeFor { + fn default() -> Self { + OptimizeFor::Cpu + } +} + +fn byte_size(cache: &Cache) -> usize { + use self::Either::{Left, Right}; + + match *cache { + Left(ref vec) => vec.len() * NODE_BYTES, + Right(ref mmap) => mmap.len(), + } +} + +fn new_buffer(path: &Path, num_nodes: usize, ident: &H256, optimize_for: OptimizeFor) -> Cache { + let memmap = match optimize_for { + OptimizeFor::Cpu => None, + OptimizeFor::Memory => make_memmapped_cache(path, num_nodes, ident).ok(), + }; + + memmap + .map(Either::Right) + .unwrap_or_else(|| Either::Left(make_memory_cache(num_nodes, ident))) +} + +#[derive(Clone)] +pub struct NodeCacheBuilder { + // TODO: Remove this locking and just use an `Rc`? + seedhash: Arc>, + optimize_for: OptimizeFor, + progpow_transition: u64, +} + +// TODO: Abstract the "optimize for" logic +pub struct NodeCache { + builder: NodeCacheBuilder, + cache_dir: Cow<'static, Path>, + cache_path: PathBuf, + epoch: u64, + cache: Cache, +} + +impl NodeCacheBuilder { + pub fn light(&self, cache_dir: &Path, block_number: u64) -> Light { + Light::new_with_builder(self, cache_dir, block_number, self.progpow_transition) + } + + pub fn light_from_file(&self, cache_dir: &Path, block_number: u64) -> io::Result { + Light::from_file_with_builder(self, cache_dir, block_number, self.progpow_transition) + } + + pub fn new>>(optimize_for: T, progpow_transition: u64) -> Self { + NodeCacheBuilder { + seedhash: Arc::new(Mutex::new(SeedHashCompute::default())), + optimize_for: optimize_for.into().unwrap_or_default(), + progpow_transition, + } + } + + fn block_number_to_ident(&self, block_number: u64) -> H256 { + self.seedhash.lock().hash_block_number(block_number) + } + + fn epoch_to_ident(&self, epoch: u64) -> H256 { + self.seedhash.lock().hash_epoch(epoch) + } + + pub fn from_file>>( + &self, + cache_dir: P, + block_number: u64, + ) -> io::Result { + let cache_dir = cache_dir.into(); + let ident = self.block_number_to_ident(block_number); + + let path = cache_path(cache_dir.as_ref(), &ident); + + let cache = cache_from_path(&path, self.optimize_for)?; + let expected_cache_size = get_cache_size(block_number); + + if byte_size(&cache) == expected_cache_size { + Ok(NodeCache { + builder: self.clone(), + epoch: epoch(block_number), + cache_dir: cache_dir, + cache_path: path, + cache: cache, + }) + } else { + Err(io::Error::new( + io::ErrorKind::InvalidData, + "Node cache is of incorrect size", + )) + } + } + + pub fn new_cache>>( + &self, + cache_dir: P, + block_number: u64, + ) -> NodeCache { + let cache_dir = cache_dir.into(); + let ident = self.block_number_to_ident(block_number); + + let cache_size = get_cache_size(block_number); + + // We use `debug_assert` since it is impossible for `get_cache_size` to return an unaligned + // value with the current implementation. If the implementation changes, CI will catch it. + debug_assert!(cache_size % NODE_BYTES == 0, "Unaligned cache size"); + let num_nodes = cache_size / NODE_BYTES; + + let path = cache_path(cache_dir.as_ref(), &ident); + let nodes = new_buffer(&path, num_nodes, &ident, self.optimize_for); + + NodeCache { + builder: self.clone(), + epoch: epoch(block_number), + cache_dir: cache_dir.into(), + cache_path: path, + cache: nodes, + } + } +} + +impl NodeCache { + pub fn cache_path(&self) -> &Path { + &self.cache_path + } + + pub fn flush(&mut self) -> io::Result<()> { + if let Some(last) = self + .epoch + .checked_sub(2) + .map(|ep| cache_path(self.cache_dir.as_ref(), &self.builder.epoch_to_ident(ep))) + { + fs::remove_file(last).unwrap_or_else(|error| match error.kind() { + io::ErrorKind::NotFound => (), + _ => warn!("Error removing stale DAG cache: {:?}", error), + }); + } + + consume_cache(&mut self.cache, &self.cache_path) + } +} + +fn make_memmapped_cache(path: &Path, num_nodes: usize, ident: &H256) -> io::Result { + use std::fs::OpenOptions; + + let file = OpenOptions::new() + .read(true) + .write(true) + .create(true) + .open(&path)?; + file.set_len((num_nodes * NODE_BYTES) as _)?; + + let mut memmap = unsafe { MmapMut::map_mut(&file)? }; + + unsafe { initialize_memory(memmap.as_mut_ptr() as *mut Node, num_nodes, ident) }; + + Ok(memmap) +} + +fn make_memory_cache(num_nodes: usize, ident: &H256) -> Vec { + let mut nodes: Vec = Vec::with_capacity(num_nodes); + // Use uninit instead of unnecessarily writing `size_of::() * num_nodes` 0s + unsafe { + initialize_memory(nodes.as_mut_ptr(), num_nodes, ident); + nodes.set_len(num_nodes); + } + + nodes +} + +fn cache_path<'a, P: Into>>(path: P, ident: &H256) -> PathBuf { + let mut buf = path.into().into_owned(); + buf.push(to_hex(ident)); + buf +} + +fn consume_cache(cache: &mut Cache, path: &Path) -> io::Result<()> { + use std::fs::OpenOptions; + + match *cache { + Either::Left(ref mut vec) => { + let mut file = OpenOptions::new() + .read(true) + .write(true) + .create(true) + .open(&path)?; + + let buf = unsafe { + slice::from_raw_parts_mut(vec.as_mut_ptr() as *mut u8, vec.len() * NODE_BYTES) + }; + + file.write_all(buf).map(|_| ()) + } + Either::Right(ref mmap) => mmap.flush(), + } +} + +fn cache_from_path(path: &Path, optimize_for: OptimizeFor) -> io::Result { + let memmap = match optimize_for { + OptimizeFor::Cpu => None, + OptimizeFor::Memory => { + let file = fs::OpenOptions::new() + .read(true) + .write(true) + .create(true) + .open(path)?; + unsafe { MmapMut::map_mut(&file).ok() } + } + }; + + memmap + .map(Either::Right) + .ok_or(()) + .or_else(|_| read_from_path(path).map(Either::Left)) +} + +fn read_from_path(path: &Path) -> io::Result> { + use std::{fs::File, mem}; + + let mut file = File::open(path)?; + + let mut nodes: Vec = Vec::with_capacity( + file.metadata() + .map(|m| m.len() as _) + .unwrap_or(NODE_BYTES * 1_000_000), + ); + file.read_to_end(&mut nodes)?; + + nodes.shrink_to_fit(); + + if nodes.len() % NODE_BYTES != 0 || nodes.capacity() % NODE_BYTES != 0 { + return Err(io::Error::new( + io::ErrorKind::Other, + "Node cache is not a multiple of node size", + )); + } + + let out: Vec = unsafe { + Vec::from_raw_parts( + nodes.as_mut_ptr() as *mut _, + nodes.len() / NODE_BYTES, + nodes.capacity() / NODE_BYTES, + ) + }; + + mem::forget(nodes); + + Ok(out) +} + +impl AsRef<[Node]> for NodeCache { + fn as_ref(&self) -> &[Node] { + match self.cache { + Either::Left(ref vec) => vec, + Either::Right(ref mmap) => unsafe { + let bytes = mmap.as_ptr(); + // This isn't a safety issue, so we can keep this a debug lint. We don't care about + // people manually messing with the files unless it can cause unsafety, but if we're + // generating incorrect files then we want to catch that in CI. + debug_assert_eq!(mmap.len() % NODE_BYTES, 0); + slice::from_raw_parts(bytes as _, mmap.len() / NODE_BYTES) + }, + } + } +} + +// This takes a raw pointer and a counter because `memory` may be uninitialized. `memory` _must_ be +// a pointer to the beginning of an allocated but possibly-uninitialized block of +// `num_nodes * NODE_BYTES` bytes +// +// We have to use raw pointers to read/write uninit, using "normal" indexing causes LLVM to freak +// out. It counts as a read and causes all writes afterwards to be elided. Yes, really. I know, I +// want to refactor this to use less `unsafe` as much as the next rustacean. +unsafe fn initialize_memory(memory: *mut Node, num_nodes: usize, ident: &H256) { + // We use raw pointers here, see above + let dst = slice::from_raw_parts_mut(memory as *mut u8, NODE_BYTES); + + debug_assert_eq!(ident.len(), 32); + keccak_512::write(&ident[..], dst); + + for i in 1..num_nodes { + // We use raw pointers here, see above + let dst = slice::from_raw_parts_mut(memory.offset(i as _) as *mut u8, NODE_BYTES); + let src = slice::from_raw_parts(memory.offset(i as isize - 1) as *mut u8, NODE_BYTES); + keccak_512::write(src, dst); + } + + // Now this is initialized, we can treat it as a slice. + let nodes: &mut [Node] = slice::from_raw_parts_mut(memory, num_nodes); + + for _ in 0..ETHASH_CACHE_ROUNDS { + for i in 0..num_nodes { + let data_idx = (num_nodes - 1 + i) % num_nodes; + let idx = nodes.get_unchecked_mut(i).as_words()[0] as usize % num_nodes; + + let data = { + let mut data: Node = nodes.get_unchecked(data_idx).clone(); + let rhs: &Node = nodes.get_unchecked(idx); + + for (a, b) in data.as_dwords_mut().iter_mut().zip(rhs.as_dwords()) { + *a ^= *b; + } + + data + }; + + keccak_512::write(&data.bytes, &mut nodes.get_unchecked_mut(i).bytes); + } + } +} diff --git a/client/consensus/ethash/src/compute.rs b/client/consensus/ethash/src/compute.rs new file mode 100644 index 00000000..00bbcd96 --- /dev/null +++ b/client/consensus/ethash/src/compute.rs @@ -0,0 +1,452 @@ +// Copyright 2015-2020 Parity Technologies (UK) Ltd. +// This file is part of OpenEthereum. + +// OpenEthereum 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. + +// OpenEthereum 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 OpenEthereum. If not, see . + +//! Ethash implementation +//! See https://github.com/ethereum/wiki/wiki/Ethash + +// TODO: fix endianess for big endian + +use cache::{NodeCache, NodeCacheBuilder}; +use keccak::{keccak_256, keccak_512, H256}; +use progpow::{generate_cdag, keccak_f800_long, keccak_f800_short, progpow, CDag}; +use seed_compute::SeedHashCompute; +use shared::*; +use std::io; + +use std::{mem, path::Path}; + +const MIX_WORDS: usize = ETHASH_MIX_BYTES / 4; +const MIX_NODES: usize = MIX_WORDS / NODE_WORDS; +pub const FNV_PRIME: u32 = 0x01000193; + +/// Computation result +pub struct ProofOfWork { + /// Difficulty boundary + pub value: H256, + /// Mix + pub mix_hash: H256, +} + +enum Algorithm { + Hashimoto, + Progpow(Box), +} + +pub struct Light { + block_number: u64, + cache: NodeCache, + algorithm: Algorithm, +} + +/// Light cache structure +impl Light { + pub fn new_with_builder( + builder: &NodeCacheBuilder, + cache_dir: &Path, + block_number: u64, + progpow_transition: u64, + ) -> Self { + let cache = builder.new_cache(cache_dir.to_path_buf(), block_number); + + let algorithm = if block_number >= progpow_transition { + Algorithm::Progpow(Box::new(generate_cdag(cache.as_ref()))) + } else { + Algorithm::Hashimoto + }; + + Light { + block_number, + cache, + algorithm, + } + } + + /// Calculate the light boundary data + /// `header_hash` - The header hash to pack into the mix + /// `nonce` - The nonce to pack into the mix + pub fn compute(&self, header_hash: &H256, nonce: u64, block_number: u64) -> ProofOfWork { + match self.algorithm { + Algorithm::Progpow(ref c_dag) => { + let (value, mix_hash) = progpow( + *header_hash, + nonce, + block_number, + self.cache.as_ref(), + c_dag, + ); + + ProofOfWork { value, mix_hash } + } + Algorithm::Hashimoto => light_compute(self, header_hash, nonce), + } + } + + pub fn from_file_with_builder( + builder: &NodeCacheBuilder, + cache_dir: &Path, + block_number: u64, + progpow_transition: u64, + ) -> io::Result { + let cache = builder.from_file(cache_dir.to_path_buf(), block_number)?; + + let algorithm = if block_number >= progpow_transition { + Algorithm::Progpow(Box::new(generate_cdag(cache.as_ref()))) + } else { + Algorithm::Hashimoto + }; + + Ok(Light { + block_number, + cache, + algorithm, + }) + } + + pub fn to_file(&mut self) -> io::Result<&Path> { + self.cache.flush()?; + Ok(self.cache.cache_path()) + } +} + +pub fn slow_hash_block_number(block_number: u64) -> H256 { + SeedHashCompute::resume_compute_seedhash([0u8; 32], 0, block_number / ETHASH_EPOCH_LENGTH) +} + +fn fnv_hash(x: u32, y: u32) -> u32 { + return x.wrapping_mul(FNV_PRIME) ^ y; +} + +/// Difficulty quick check for POW preverification +/// +/// `header_hash` The hash of the header +/// `nonce` The block's nonce +/// `mix_hash` The mix digest hash +/// Boundary recovered from mix hash +pub fn quick_get_difficulty( + header_hash: &H256, + nonce: u64, + mix_hash: &H256, + progpow: bool, +) -> H256 { + if progpow { + let seed = keccak_f800_short(*header_hash, nonce, [0u32; 8]); + keccak_f800_long(*header_hash, seed, unsafe { mem::transmute(*mix_hash) }) + } else { + let mut buf = [0u8; 64 + 32]; + + let hash_len = header_hash.len(); + buf[..hash_len].copy_from_slice(header_hash); + let end = hash_len + mem::size_of::(); + buf[hash_len..end].copy_from_slice(&nonce.to_ne_bytes()); + + keccak_512::inplace_range(&mut buf, 0..end); + buf[64..].copy_from_slice(mix_hash); + + let mut hash = [0u8; 32]; + keccak_256::write(&buf, &mut hash); + + hash + } +} + +/// Calculate the light client data +/// `light` - The light client handler +/// `header_hash` - The header hash to pack into the mix +/// `nonce` - The nonce to pack into the mix +pub fn light_compute(light: &Light, header_hash: &H256, nonce: u64) -> ProofOfWork { + let full_size = get_data_size(light.block_number); + hash_compute(light, full_size, header_hash, nonce) +} + +fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64) -> ProofOfWork { + macro_rules! make_const_array { + ($n:expr, $value:expr) => {{ + // We use explicit lifetimes to ensure that val's borrow is invalidated until the + // transmuted val dies. + unsafe fn make_const_array(val: &mut [T]) -> &mut [U; $n] { + use std::mem; + + debug_assert_eq!(val.len() * mem::size_of::(), $n * mem::size_of::()); + &mut *(val.as_mut_ptr() as *mut [U; $n]) + } + + make_const_array($value) + }}; + } + + #[repr(C)] + struct MixBuf { + half_mix: Node, + compress_bytes: [u8; MIX_WORDS], + } + + if full_size % MIX_WORDS != 0 { + panic!("Unaligned full size"); + } + + // You may be asking yourself: what in the name of Crypto Jesus is going on here? So: we need + // `half_mix` and `compress_bytes` in a single array later down in the code (we hash them + // together to create `value`) so that we can hash the full array. However, we do a bunch of + // reading and writing to these variables first. We originally allocated two arrays and then + // stuck them together with `ptr::copy_nonoverlapping` at the end, but this method is + // _significantly_ faster - by my benchmarks, a consistent 3-5%. This is the most ridiculous + // optimization I have ever done and I am so sorry. I can only chalk it up to cache locality + // improvements, since I can't imagine that 3-5% of our runtime is taken up by catting two + // arrays together. + let mut buf: MixBuf = MixBuf { + half_mix: { + // Pack `header_hash` and `nonce` together + let mut out = [0u8; NODE_BYTES]; + + let hash_len = header_hash.len(); + out[..hash_len].copy_from_slice(header_hash); + let end = hash_len + mem::size_of::(); + out[hash_len..end].copy_from_slice(&nonce.to_ne_bytes()); + + // compute keccak-512 hash and replicate across mix + keccak_512::inplace_range(&mut out, 0..end); + + Node { bytes: out } + }, + compress_bytes: [0u8; MIX_WORDS], + }; + + let mut mix: [_; MIX_NODES] = [buf.half_mix.clone(), buf.half_mix.clone()]; + + let page_size = 4 * MIX_WORDS; + let num_full_pages = (full_size / page_size) as u32; + // deref once for better performance + let cache: &[Node] = light.cache.as_ref(); + let first_val = buf.half_mix.as_words()[0]; + + debug_assert_eq!(MIX_NODES, 2); + debug_assert_eq!(NODE_WORDS, 16); + + for i in 0..ETHASH_ACCESSES as u32 { + let index = { + // This is trivially safe, but does not work on big-endian. The safety of this is + // asserted in debug builds (see the definition of `make_const_array!`). + let mix_words: &mut [u32; MIX_WORDS] = + unsafe { make_const_array!(MIX_WORDS, &mut mix) }; + + fnv_hash(first_val ^ i, mix_words[i as usize % MIX_WORDS]) % num_full_pages + }; + + // MIX_NODES + for n in 0..2 { + let tmp_node = calculate_dag_item(index * MIX_NODES as u32 + n as u32, cache); + + // NODE_WORDS + for (a, b) in mix[n].as_words_mut().iter_mut().zip(tmp_node.as_words()) { + *a = fnv_hash(*a, *b); + } + } + } + + let mix_words: [u32; MIX_WORDS] = unsafe { mem::transmute(mix) }; + + { + // We iterate precisely `compress.len()` times and set each index, + // leaving the array fully initialized. THIS ONLY WORKS ON LITTLE-ENDIAN MACHINES. + // See a future PR to make this and the rest of the code work correctly on + // big-endian arches like mips. + let compress: &mut [u32; MIX_WORDS / 4] = + unsafe { make_const_array!(MIX_WORDS / 4, &mut buf.compress_bytes) }; + #[cfg(target_endian = "big")] + { + compile_error!("OpenEthereum currently only supports little-endian targets"); + } + + // Compress mix + debug_assert_eq!(MIX_WORDS / 4, 8); + for i in 0..8 { + let w = i * 4; + + let mut reduction = mix_words[w + 0]; + reduction = reduction.wrapping_mul(FNV_PRIME) ^ mix_words[w + 1]; + reduction = reduction.wrapping_mul(FNV_PRIME) ^ mix_words[w + 2]; + reduction = reduction.wrapping_mul(FNV_PRIME) ^ mix_words[w + 3]; + compress[i] = reduction; + } + } + + let mix_hash = buf.compress_bytes; + + let value: H256 = { + // We can interpret the buffer as an array of `u8`s, since it's `repr(C)`. + let read_ptr: *const u8 = &buf as *const MixBuf as *const u8; + let buffer = unsafe { + core::slice::from_raw_parts( + read_ptr, + buf.half_mix.bytes.len() + buf.compress_bytes.len(), + ) + }; + // We overwrite the buf.compress_bytes since `keccak_256` has an internal buffer and so allows + // overlapping arrays as input. + keccak_256::write(buffer, &mut buf.compress_bytes); + + buf.compress_bytes + }; + + ProofOfWork { mix_hash, value } +} + +// TODO: Use the `simd` crate +pub fn calculate_dag_item(node_index: u32, cache: &[Node]) -> Node { + let num_parent_nodes = cache.len(); + let mut ret = cache[node_index as usize % num_parent_nodes].clone(); + ret.as_words_mut()[0] ^= node_index; + + keccak_512::inplace(ret.as_bytes_mut()); + + debug_assert_eq!(NODE_WORDS, 16); + for i in 0..ETHASH_DATASET_PARENTS as u32 { + let parent_index = fnv_hash(node_index ^ i, ret.as_words()[i as usize % NODE_WORDS]) + % num_parent_nodes as u32; + let parent = &cache[parent_index as usize]; + + unroll! { + for w in 0..16 { + ret.as_words_mut()[w] = fnv_hash(ret.as_words()[w], parent.as_words()[w]); + } + } + } + + keccak_512::inplace(ret.as_bytes_mut()); + + ret +} + +#[cfg(test)] +mod test { + use super::*; + use std::fs; + use tempdir::TempDir; + + #[test] + fn test_get_cache_size() { + // https://github.com/ethereum/wiki/wiki/Ethash/ef6b93f9596746a088ea95d01ca2778be43ae68f#data-sizes + assert_eq!(16776896usize, get_cache_size(0)); + assert_eq!(16776896usize, get_cache_size(1)); + assert_eq!(16776896usize, get_cache_size(ETHASH_EPOCH_LENGTH - 1)); + assert_eq!(16907456usize, get_cache_size(ETHASH_EPOCH_LENGTH)); + assert_eq!(16907456usize, get_cache_size(ETHASH_EPOCH_LENGTH + 1)); + assert_eq!(284950208usize, get_cache_size(2046 * ETHASH_EPOCH_LENGTH)); + assert_eq!(285081536usize, get_cache_size(2047 * ETHASH_EPOCH_LENGTH)); + assert_eq!( + 285081536usize, + get_cache_size(2048 * ETHASH_EPOCH_LENGTH - 1) + ); + } + + #[test] + fn test_get_data_size() { + // https://github.com/ethereum/wiki/wiki/Ethash/ef6b93f9596746a088ea95d01ca2778be43ae68f#data-sizes + assert_eq!(1073739904usize, get_data_size(0)); + assert_eq!(1073739904usize, get_data_size(1)); + assert_eq!(1073739904usize, get_data_size(ETHASH_EPOCH_LENGTH - 1)); + assert_eq!(1082130304usize, get_data_size(ETHASH_EPOCH_LENGTH)); + assert_eq!(1082130304usize, get_data_size(ETHASH_EPOCH_LENGTH + 1)); + assert_eq!(18236833408usize, get_data_size(2046 * ETHASH_EPOCH_LENGTH)); + assert_eq!(18245220736usize, get_data_size(2047 * ETHASH_EPOCH_LENGTH)); + } + + #[test] + fn test_difficulty_test() { + let hash = [ + 0xf5, 0x7e, 0x6f, 0x3a, 0xcf, 0xc0, 0xdd, 0x4b, 0x5b, 0xf2, 0xbe, 0xe4, 0x0a, 0xb3, + 0x35, 0x8a, 0xa6, 0x87, 0x73, 0xa8, 0xd0, 0x9f, 0x5e, 0x59, 0x5e, 0xab, 0x55, 0x94, + 0x05, 0x52, 0x7d, 0x72, + ]; + let mix_hash = [ + 0x1f, 0xff, 0x04, 0xce, 0xc9, 0x41, 0x73, 0xfd, 0x59, 0x1e, 0x3d, 0x89, 0x60, 0xce, + 0x6b, 0xdf, 0x8b, 0x19, 0x71, 0x04, 0x8c, 0x71, 0xff, 0x93, 0x7b, 0xb2, 0xd3, 0x2a, + 0x64, 0x31, 0xab, 0x6d, + ]; + let nonce = 0xd7b3ac70a301a249; + let boundary_good = [ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3e, 0x9b, 0x6c, 0x69, 0xbc, 0x2c, 0xe2, 0xa2, + 0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a, + 0xe9, 0x7e, 0x53, 0x84, + ]; + assert_eq!( + quick_get_difficulty(&hash, nonce, &mix_hash, false)[..], + boundary_good[..] + ); + let boundary_bad = [ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3a, 0x9b, 0x6c, 0x69, 0xbc, 0x2c, 0xe2, 0xa2, + 0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a, + 0xe9, 0x7e, 0x53, 0x84, + ]; + assert!(quick_get_difficulty(&hash, nonce, &mix_hash, false)[..] != boundary_bad[..]); + } + + #[test] + fn test_light_compute() { + let hash = [ + 0xf5, 0x7e, 0x6f, 0x3a, 0xcf, 0xc0, 0xdd, 0x4b, 0x5b, 0xf2, 0xbe, 0xe4, 0x0a, 0xb3, + 0x35, 0x8a, 0xa6, 0x87, 0x73, 0xa8, 0xd0, 0x9f, 0x5e, 0x59, 0x5e, 0xab, 0x55, 0x94, + 0x05, 0x52, 0x7d, 0x72, + ]; + let mix_hash = [ + 0x1f, 0xff, 0x04, 0xce, 0xc9, 0x41, 0x73, 0xfd, 0x59, 0x1e, 0x3d, 0x89, 0x60, 0xce, + 0x6b, 0xdf, 0x8b, 0x19, 0x71, 0x04, 0x8c, 0x71, 0xff, 0x93, 0x7b, 0xb2, 0xd3, 0x2a, + 0x64, 0x31, 0xab, 0x6d, + ]; + let boundary = [ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3e, 0x9b, 0x6c, 0x69, 0xbc, 0x2c, 0xe2, 0xa2, + 0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a, + 0xe9, 0x7e, 0x53, 0x84, + ]; + let nonce = 0xd7b3ac70a301a249; + + let tempdir = TempDir::new("").unwrap(); + // difficulty = 0x085657254bd9u64; + let light = NodeCacheBuilder::new(None, u64::max_value()).light(tempdir.path(), 486382); + let result = light_compute(&light, &hash, nonce); + assert_eq!(result.mix_hash[..], mix_hash[..]); + assert_eq!(result.value[..], boundary[..]); + } + + #[test] + fn test_drop_old_data() { + let tempdir = TempDir::new("").unwrap(); + let builder = NodeCacheBuilder::new(None, u64::max_value()); + let first = builder + .light(tempdir.path(), 0) + .to_file() + .unwrap() + .to_owned(); + + let second = builder + .light(tempdir.path(), ETHASH_EPOCH_LENGTH) + .to_file() + .unwrap() + .to_owned(); + assert!(fs::metadata(&first).is_ok()); + + let _ = builder + .light(tempdir.path(), ETHASH_EPOCH_LENGTH * 2) + .to_file(); + assert!(fs::metadata(&first).is_err()); + assert!(fs::metadata(&second).is_ok()); + + let _ = builder + .light(tempdir.path(), ETHASH_EPOCH_LENGTH * 3) + .to_file(); + assert!(fs::metadata(&second).is_err()); + } +} diff --git a/client/consensus/ethash/src/keccak.rs b/client/consensus/ethash/src/keccak.rs new file mode 100644 index 00000000..134a11fb --- /dev/null +++ b/client/consensus/ethash/src/keccak.rs @@ -0,0 +1,35 @@ +// Copyright 2015-2020 Parity Technologies (UK) Ltd. +// This file is part of OpenEthereum. + +// OpenEthereum 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. + +// OpenEthereum 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 OpenEthereum. If not, see . + +extern crate keccak_hash as hash; + +pub type H256 = [u8; 32]; + +pub mod keccak_512 { + use super::hash; + + pub use self::hash::{ + keccak512 as inplace, keccak512_range as inplace_range, keccak_512 as write, + }; +} + +pub mod keccak_256 { + use super::hash; + + pub use self::hash::{ + keccak256 as inplace, keccak256_range as inplace_range, keccak_256 as write, + }; +} diff --git a/client/consensus/ethash/src/lib.rs b/client/consensus/ethash/src/lib.rs new file mode 100644 index 00000000..2232d243 --- /dev/null +++ b/client/consensus/ethash/src/lib.rs @@ -0,0 +1,274 @@ +// Copyright 2015-2020 Parity Technologies (UK) Ltd. +// This file is part of OpenEthereum. + +// OpenEthereum 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. + +// OpenEthereum 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 OpenEthereum. If not, see . + +extern crate either; +extern crate ethereum_types; +extern crate memmap; +extern crate parking_lot; +extern crate primal; +extern crate tiny_keccak; + +#[macro_use] +extern crate crunchy; +#[macro_use] +extern crate log; + +#[cfg(test)] +extern crate rustc_hex; + +#[cfg(test)] +extern crate serde_json; + +#[cfg(test)] +extern crate tempdir; + +#[cfg(feature = "bench")] +pub mod compute; +#[cfg(not(feature = "bench"))] +mod compute; + +mod cache; +mod keccak; +mod seed_compute; +mod shared; + +#[cfg(feature = "bench")] +pub mod progpow; +#[cfg(not(feature = "bench"))] +mod progpow; + +pub use cache::{NodeCacheBuilder, OptimizeFor}; +use compute::Light; +pub use compute::{quick_get_difficulty, slow_hash_block_number, ProofOfWork}; +use ethereum_types::{BigEndianHash, U256, U512}; +use keccak::H256; +use parking_lot::Mutex; +pub use seed_compute::SeedHashCompute; +pub use shared::ETHASH_EPOCH_LENGTH; +use std::{ + convert::TryFrom, + mem, + path::{Path, PathBuf}, +}; + +use std::sync::Arc; + +struct LightCache { + recent_epoch: Option, + recent: Option>, + prev_epoch: Option, + prev: Option>, +} + +/// Light/Full cache manager. +pub struct EthashManager { + nodecache_builder: NodeCacheBuilder, + cache: Mutex, + cache_dir: PathBuf, + progpow_transition: u64, +} + +impl EthashManager { + /// Create a new new instance of ethash manager + pub fn new>>( + cache_dir: &Path, + optimize_for: T, + progpow_transition: u64, + ) -> EthashManager { + EthashManager { + cache_dir: cache_dir.to_path_buf(), + nodecache_builder: NodeCacheBuilder::new( + optimize_for.into().unwrap_or_default(), + progpow_transition, + ), + progpow_transition: progpow_transition, + cache: Mutex::new(LightCache { + recent_epoch: None, + recent: None, + prev_epoch: None, + prev: None, + }), + } + } + + /// Calculate the light client data + /// `block_number` - Block number to check + /// `light` - The light client handler + /// `header_hash` - The header hash to pack into the mix + /// `nonce` - The nonce to pack into the mix + pub fn compute_light(&self, block_number: u64, header_hash: &H256, nonce: u64) -> ProofOfWork { + let epoch = block_number / ETHASH_EPOCH_LENGTH; + let light = { + let mut lights = self.cache.lock(); + let light = if block_number == self.progpow_transition { + // we need to regenerate the cache to trigger algorithm change to progpow inside `Light` + None + } else { + match lights.recent_epoch.clone() { + Some(ref e) if *e == epoch => lights.recent.clone(), + _ => match lights.prev_epoch.clone() { + Some(e) if e == epoch => { + // don't swap if recent is newer. + if lights.recent_epoch > lights.prev_epoch { + None + } else { + // swap + let t = lights.prev_epoch; + lights.prev_epoch = lights.recent_epoch; + lights.recent_epoch = t; + let t = lights.prev.clone(); + lights.prev = lights.recent.clone(); + lights.recent = t; + lights.recent.clone() + } + } + _ => None, + }, + } + }; + + match light { + None => { + let light = match self + .nodecache_builder + .light_from_file(&self.cache_dir, block_number) + { + Ok(light) => Arc::new(light), + Err(e) => { + debug!("Light cache file not found for {}:{}", block_number, e); + let mut light = + self.nodecache_builder.light(&self.cache_dir, block_number); + if let Err(e) = light.to_file() { + warn!("Light cache file write error: {}", e); + } + Arc::new(light) + } + }; + lights.prev_epoch = mem::replace(&mut lights.recent_epoch, Some(epoch)); + lights.prev = mem::replace(&mut lights.recent, Some(light.clone())); + light + } + Some(light) => light, + } + }; + light.compute(header_hash, nonce, block_number) + } +} + +/// Convert an Ethash boundary to its original difficulty. Basically just `f(x) = 2^256 / x`. +pub fn boundary_to_difficulty(boundary: ðereum_types::H256) -> U256 { + difficulty_to_boundary_aux(&boundary.into_uint()) +} + +/// Convert an Ethash difficulty to the target boundary. Basically just `f(x) = 2^256 / x`. +pub fn difficulty_to_boundary(difficulty: &U256) -> ethereum_types::H256 { + BigEndianHash::from_uint(&difficulty_to_boundary_aux(difficulty)) +} + +fn difficulty_to_boundary_aux>(difficulty: T) -> ethereum_types::U256 { + let difficulty = difficulty.into(); + + assert!(!difficulty.is_zero()); + + if difficulty == U512::one() { + U256::max_value() + } else { + const PROOF: &str = "difficulty > 1, so result never overflows 256 bits; qed"; + U256::try_from((U512::one() << 256) / difficulty).expect(PROOF) + } +} + +#[test] +fn test_lru() { + use tempdir::TempDir; + + let tempdir = TempDir::new("").unwrap(); + let ethash = EthashManager::new(tempdir.path(), None, u64::max_value()); + let hash = [0u8; 32]; + ethash.compute_light(1, &hash, 1); + ethash.compute_light(50000, &hash, 1); + assert_eq!(ethash.cache.lock().recent_epoch.unwrap(), 1); + assert_eq!(ethash.cache.lock().prev_epoch.unwrap(), 0); + ethash.compute_light(1, &hash, 1); + assert_eq!(ethash.cache.lock().recent_epoch.unwrap(), 0); + assert_eq!(ethash.cache.lock().prev_epoch.unwrap(), 1); + ethash.compute_light(70000, &hash, 1); + assert_eq!(ethash.cache.lock().recent_epoch.unwrap(), 2); + assert_eq!(ethash.cache.lock().prev_epoch.unwrap(), 0); +} + +#[test] +fn test_difficulty_to_boundary() { + use ethereum_types::{BigEndianHash, H256}; + use std::str::FromStr; + + assert_eq!( + difficulty_to_boundary(&U256::from(1)), + BigEndianHash::from_uint(&U256::max_value()) + ); + assert_eq!( + difficulty_to_boundary(&U256::from(2)), + H256::from_str("8000000000000000000000000000000000000000000000000000000000000000").unwrap() + ); + assert_eq!( + difficulty_to_boundary(&U256::from(4)), + H256::from_str("4000000000000000000000000000000000000000000000000000000000000000").unwrap() + ); + assert_eq!( + difficulty_to_boundary(&U256::from(32)), + H256::from_str("0800000000000000000000000000000000000000000000000000000000000000").unwrap() + ); +} + +#[test] +fn test_difficulty_to_boundary_regression() { + use ethereum_types::H256; + + // the last bit was originally being truncated when performing the conversion + // https://github.com/openethereum/openethereum/issues/8397 + for difficulty in 1..9 { + assert_eq!( + U256::from(difficulty), + boundary_to_difficulty(&difficulty_to_boundary(&difficulty.into())) + ); + assert_eq!( + H256::from_low_u64_be(difficulty), + difficulty_to_boundary(&boundary_to_difficulty(&H256::from_low_u64_be(difficulty))) + ); + assert_eq!( + U256::from(difficulty), + boundary_to_difficulty(&BigEndianHash::from_uint(&boundary_to_difficulty( + &H256::from_low_u64_be(difficulty) + ))), + ); + assert_eq!( + H256::from_low_u64_be(difficulty), + difficulty_to_boundary(&difficulty_to_boundary(&difficulty.into()).into_uint()) + ); + } +} + +#[test] +#[should_panic] +fn test_difficulty_to_boundary_panics_on_zero() { + difficulty_to_boundary(&U256::from(0)); +} + +#[test] +#[should_panic] +fn test_boundary_to_difficulty_panics_on_zero() { + boundary_to_difficulty(ðereum_types::H256::zero()); +} diff --git a/client/consensus/ethash/src/progpow.rs b/client/consensus/ethash/src/progpow.rs new file mode 100644 index 00000000..131f90c2 --- /dev/null +++ b/client/consensus/ethash/src/progpow.rs @@ -0,0 +1,582 @@ +// Copyright 2015-2020 Parity Technologies (UK) Ltd. +// This file is part of OpenEthereum. + +// OpenEthereum 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. + +// OpenEthereum 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 OpenEthereum. If not, see . + +use compute::{calculate_dag_item, FNV_PRIME}; +use keccak::H256; +use shared::{get_data_size, Node, ETHASH_ACCESSES, ETHASH_MIX_BYTES}; + +const PROGPOW_CACHE_BYTES: usize = 16 * 1024; +const PROGPOW_CACHE_WORDS: usize = PROGPOW_CACHE_BYTES / 4; +const PROGPOW_CNT_CACHE: usize = 12; +const PROGPOW_CNT_MATH: usize = 20; +const PROGPOW_CNT_DAG: usize = ETHASH_ACCESSES; +const PROGPOW_DAG_LOADS: usize = 4; +const PROGPOW_MIX_BYTES: usize = 2 * ETHASH_MIX_BYTES; +const PROGPOW_PERIOD_LENGTH: usize = 50; // blocks per progpow epoch (N) +const PROGPOW_LANES: usize = 16; +const PROGPOW_REGS: usize = 32; + +const FNV_HASH: u32 = 0x811c9dc5; + +const KECCAKF_RNDC: [u32; 24] = [ + 0x00000001, 0x00008082, 0x0000808a, 0x80008000, 0x0000808b, 0x80000001, 0x80008081, 0x00008009, + 0x0000008a, 0x00000088, 0x80008009, 0x8000000a, 0x8000808b, 0x0000008b, 0x00008089, 0x00008003, + 0x00008002, 0x00000080, 0x0000800a, 0x8000000a, 0x80008081, 0x00008080, 0x80000001, 0x80008008, +]; + +const KECCAKF_ROTC: [u32; 24] = [ + 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 2, 14, 27, 41, 56, 8, 25, 43, 62, 18, 39, 61, 20, 44, +]; + +const KECCAKF_PILN: [usize; 24] = [ + 10, 7, 11, 17, 18, 3, 5, 16, 8, 21, 24, 4, 15, 23, 19, 13, 12, 2, 20, 14, 22, 9, 6, 1, +]; + +fn keccak_f800_round(st: &mut [u32; 25], r: usize) { + // Theta + let mut bc = [0u32; 5]; + for i in 0..bc.len() { + bc[i] = st[i] ^ st[i + 5] ^ st[i + 10] ^ st[i + 15] ^ st[i + 20]; + } + + for i in 0..bc.len() { + let t = bc[(i + 4) % 5] ^ bc[(i + 1) % 5].rotate_left(1); + for j in (0..st.len()).step_by(5) { + st[j + i] ^= t; + } + } + + // Rho Pi + let mut t = st[1]; + + debug_assert_eq!(KECCAKF_ROTC.len(), 24); + for i in 0..24 { + let j = KECCAKF_PILN[i]; + bc[0] = st[j]; + st[j] = t.rotate_left(KECCAKF_ROTC[i]); + t = bc[0]; + } + + // Chi + for j in (0..st.len()).step_by(5) { + for i in 0..bc.len() { + bc[i] = st[j + i]; + } + for i in 0..bc.len() { + st[j + i] ^= (!bc[(i + 1) % 5]) & bc[(i + 2) % 5]; + } + } + + // Iota + debug_assert!(r < KECCAKF_RNDC.len()); + st[0] ^= KECCAKF_RNDC[r]; +} + +fn keccak_f800(header_hash: H256, nonce: u64, result: [u32; 8], st: &mut [u32; 25]) { + for i in 0..8 { + st[i] = (header_hash[4 * i] as u32) + + ((header_hash[4 * i + 1] as u32) << 8) + + ((header_hash[4 * i + 2] as u32) << 16) + + ((header_hash[4 * i + 3] as u32) << 24); + } + + st[8] = nonce as u32; + st[9] = (nonce >> 32) as u32; + + for i in 0..8 { + st[10 + i] = result[i]; + } + + for r in 0..22 { + keccak_f800_round(st, r); + } +} + +pub fn keccak_f800_short(header_hash: H256, nonce: u64, result: [u32; 8]) -> u64 { + let mut st = [0u32; 25]; + keccak_f800(header_hash, nonce, result, &mut st); + (st[0].swap_bytes() as u64) << 32 | st[1].swap_bytes() as u64 +} + +pub fn keccak_f800_long(header_hash: H256, nonce: u64, result: [u32; 8]) -> H256 { + let mut st = [0u32; 25]; + keccak_f800(header_hash, nonce, result, &mut st); + + // NOTE: transmute from `[u32; 8]` to `[u8; 32]` + unsafe { std::mem::transmute([st[0], st[1], st[2], st[3], st[4], st[5], st[6], st[7]]) } +} + +#[inline] +fn fnv1a_hash(h: u32, d: u32) -> u32 { + (h ^ d).wrapping_mul(FNV_PRIME) +} + +#[derive(Clone)] +struct Kiss99 { + z: u32, + w: u32, + jsr: u32, + jcong: u32, +} + +impl Kiss99 { + fn new(z: u32, w: u32, jsr: u32, jcong: u32) -> Kiss99 { + Kiss99 { z, w, jsr, jcong } + } + + #[inline] + fn next_u32(&mut self) -> u32 { + self.z = 36969u32 + .wrapping_mul(self.z & 65535) + .wrapping_add(self.z >> 16); + self.w = 18000u32 + .wrapping_mul(self.w & 65535) + .wrapping_add(self.w >> 16); + let mwc = (self.z << 16).wrapping_add(self.w); + self.jsr ^= self.jsr << 17; + self.jsr ^= self.jsr >> 13; + self.jsr ^= self.jsr << 5; + self.jcong = 69069u32.wrapping_mul(self.jcong).wrapping_add(1234567); + + (mwc ^ self.jcong).wrapping_add(self.jsr) + } +} + +fn fill_mix(seed: u64, lane_id: u32) -> [u32; PROGPOW_REGS] { + // Use FNV to expand the per-warp seed to per-lane + // Use KISS to expand the per-lane seed to fill mix + let z = fnv1a_hash(FNV_HASH, seed as u32); + let w = fnv1a_hash(z, (seed >> 32) as u32); + let jsr = fnv1a_hash(w, lane_id); + let jcong = fnv1a_hash(jsr, lane_id); + + let mut rnd = Kiss99::new(z, w, jsr, jcong); + + let mut mix = [0; PROGPOW_REGS]; + + debug_assert_eq!(PROGPOW_REGS, 32); + for i in 0..32 { + mix[i] = rnd.next_u32(); + } + + mix +} + +// Merge new data from b into the value in a. Assuming A has high entropy only +// do ops that retain entropy even if B is low entropy (IE don't do A&B) +fn merge(a: u32, b: u32, r: u32) -> u32 { + match r % 4 { + 0 => a.wrapping_mul(33).wrapping_add(b), + 1 => (a ^ b).wrapping_mul(33), + 2 => a.rotate_left(((r >> 16) % 31) + 1) ^ b, + _ => a.rotate_right(((r >> 16) % 31) + 1) ^ b, + } +} + +fn math(a: u32, b: u32, r: u32) -> u32 { + match r % 11 { + 0 => a.wrapping_add(b), + 1 => a.wrapping_mul(b), + 2 => ((a as u64).wrapping_mul(b as u64) >> 32) as u32, + 3 => a.min(b), + 4 => a.rotate_left(b), + 5 => a.rotate_right(b), + 6 => a & b, + 7 => a | b, + 8 => a ^ b, + 9 => a.leading_zeros() + b.leading_zeros(), + _ => a.count_ones() + b.count_ones(), + } +} + +fn progpow_init(seed: u64) -> (Kiss99, [u32; PROGPOW_REGS], [u32; PROGPOW_REGS]) { + let z = fnv1a_hash(FNV_HASH, seed as u32); + let w = fnv1a_hash(z, (seed >> 32) as u32); + let jsr = fnv1a_hash(w, seed as u32); + let jcong = fnv1a_hash(jsr, (seed >> 32) as u32); + + let mut rnd = Kiss99::new(z, w, jsr, jcong); + + // Create a random sequence of mix destinations for merge() and mix sources + // for cache reads guarantees every destination merged once and guarantees + // no duplicate cache reads, which could be optimized away. Uses + // Fisher-Yates shuffle. + let mut mix_seq_dst = [0u32; PROGPOW_REGS]; + let mut mix_seq_cache = [0u32; PROGPOW_REGS]; + for i in 0..mix_seq_dst.len() { + mix_seq_dst[i] = i as u32; + mix_seq_cache[i] = i as u32; + } + + for i in (1..mix_seq_dst.len()).rev() { + let j = rnd.next_u32() as usize % (i + 1); + mix_seq_dst.swap(i, j); + + let j = rnd.next_u32() as usize % (i + 1); + mix_seq_cache.swap(i, j); + } + + (rnd, mix_seq_dst, mix_seq_cache) +} + +pub type CDag = [u32; PROGPOW_CACHE_WORDS]; + +fn progpow_loop( + seed: u64, + loop_: usize, + mix: &mut [[u32; PROGPOW_REGS]; PROGPOW_LANES], + cache: &[Node], + c_dag: &CDag, + data_size: usize, +) { + // All lanes share a base address for the global load. Global offset uses + // mix[0] to guarantee it depends on the load result. + let g_offset = mix[loop_ % PROGPOW_LANES][0] as usize + % (64 * data_size / (PROGPOW_LANES * PROGPOW_DAG_LOADS)); + + // 256 bytes of dag data + let mut dag_item = [0u32; 64]; + + // Fetch DAG nodes (64 bytes each) + for l in 0..PROGPOW_DAG_LOADS { + let index = g_offset * PROGPOW_LANES * PROGPOW_DAG_LOADS + l * 16; + let node = calculate_dag_item(index as u32 / 16, cache); + dag_item[l * 16..(l + 1) * 16].clone_from_slice(node.as_words()); + } + + let (rnd, mix_seq_dst, mix_seq_cache) = progpow_init(seed); + + // Lanes can execute in parallel and will be convergent + for l in 0..mix.len() { + let mut rnd = rnd.clone(); + + // Initialize the seed and mix destination sequence + let mut mix_seq_dst_cnt = 0; + let mut mix_seq_cache_cnt = 0; + + let mut mix_dst = || { + let res = mix_seq_dst[mix_seq_dst_cnt % PROGPOW_REGS] as usize; + mix_seq_dst_cnt += 1; + res + }; + let mut mix_cache = || { + let res = mix_seq_cache[mix_seq_cache_cnt % PROGPOW_REGS] as usize; + mix_seq_cache_cnt += 1; + res + }; + + for i in 0..PROGPOW_CNT_CACHE.max(PROGPOW_CNT_MATH) { + if i < PROGPOW_CNT_CACHE { + // Cached memory access, lanes access random 32-bit locations + // within the first portion of the DAG + let offset = mix[l][mix_cache()] as usize % PROGPOW_CACHE_WORDS; + let data = c_dag[offset]; + let dst = mix_dst(); + + mix[l][dst] = merge(mix[l][dst], data, rnd.next_u32()); + } + + if i < PROGPOW_CNT_MATH { + // Random math + // Generate 2 unique sources + let src_rnd = rnd.next_u32() % (PROGPOW_REGS * (PROGPOW_REGS - 1)) as u32; + let src1 = src_rnd % PROGPOW_REGS as u32; // 0 <= src1 < PROGPOW_REGS + let mut src2 = src_rnd / PROGPOW_REGS as u32; // 0 <= src2 < PROGPOW_REGS - 1 + if src2 >= src1 { + src2 += 1; // src2 is now any reg other than src1 + } + + let data = math(mix[l][src1 as usize], mix[l][src2 as usize], rnd.next_u32()); + let dst = mix_dst(); + + mix[l][dst] = merge(mix[l][dst], data, rnd.next_u32()); + } + } + + // Global load to sequential locations + let mut data_g = [0u32; PROGPOW_DAG_LOADS]; + let index = ((l ^ loop_) % PROGPOW_LANES) * PROGPOW_DAG_LOADS; + for i in 0..PROGPOW_DAG_LOADS { + data_g[i] = dag_item[index + i]; + } + + // Consume the global load data at the very end of the loop to allow + // full latency hiding. Always merge into `mix[0]` to feed the offset + // calculation. + mix[l][0] = merge(mix[l][0], data_g[0], rnd.next_u32()); + for i in 1..PROGPOW_DAG_LOADS { + let dst = mix_dst(); + mix[l][dst] = merge(mix[l][dst], data_g[i], rnd.next_u32()); + } + } +} + +pub fn progpow( + header_hash: H256, + nonce: u64, + block_number: u64, + cache: &[Node], + c_dag: &CDag, +) -> (H256, H256) { + let mut mix = [[0u32; PROGPOW_REGS]; PROGPOW_LANES]; + let mut lane_results = [0u32; PROGPOW_LANES]; + let mut result = [0u32; 8]; + + let data_size = get_data_size(block_number) / PROGPOW_MIX_BYTES; + + // NOTE: This assert is required to aid the optimizer elide the non-zero + // remainder check in `progpow_loop`. + assert!(data_size > 0); + + // Initialize mix for all lanes + let seed = keccak_f800_short(header_hash, nonce, result); + + for l in 0..mix.len() { + mix[l] = fill_mix(seed, l as u32); + } + + // Execute the randomly generated inner loop + let period = block_number / PROGPOW_PERIOD_LENGTH as u64; + for i in 0..PROGPOW_CNT_DAG { + progpow_loop(period, i, &mut mix, cache, c_dag, data_size); + } + + // Reduce mix data to a single per-lane result + for l in 0..lane_results.len() { + lane_results[l] = FNV_HASH; + for i in 0..PROGPOW_REGS { + lane_results[l] = fnv1a_hash(lane_results[l], mix[l][i]); + } + } + + // Reduce all lanes to a single 128-bit result + result = [FNV_HASH; 8]; + for l in 0..PROGPOW_LANES { + result[l % 8] = fnv1a_hash(result[l % 8], lane_results[l]); + } + + let digest = keccak_f800_long(header_hash, seed, result); + + // NOTE: transmute from `[u32; 8]` to `[u8; 32]` + let result = unsafe { ::std::mem::transmute(result) }; + + (digest, result) +} + +pub fn generate_cdag(cache: &[Node]) -> CDag { + let mut c_dag = [0u32; PROGPOW_CACHE_WORDS]; + + for i in 0..PROGPOW_CACHE_WORDS / 16 { + let node = calculate_dag_item(i as u32, cache); + for j in 0..16 { + c_dag[i * 16 + j] = node.as_words()[j]; + } + } + + c_dag +} + +#[cfg(test)] +mod test { + use tempdir::TempDir; + + use super::*; + use cache::{NodeCacheBuilder, OptimizeFor}; + use keccak::H256; + use rustc_hex::FromHex; + use serde_json::{self, Value}; + use std::collections::VecDeque; + + fn h256(hex: &str) -> H256 { + let bytes = FromHex::from_hex(hex).unwrap(); + let mut res = [0; 32]; + res.copy_from_slice(&bytes); + res + } + + #[test] + fn test_cdag() { + let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value()); + let tempdir = TempDir::new("").unwrap(); + let cache = builder.new_cache(tempdir.into_path(), 0); + + let c_dag = generate_cdag(cache.as_ref()); + + let expected = vec![ + 690150178u32, + 1181503948, + 2248155602, + 2118233073, + 2193871115, + 1791778428, + 1067701239, + 724807309, + 530799275, + 3480325829, + 3899029234, + 1998124059, + 2541974622, + 1100859971, + 1297211151, + 3268320000, + 2217813733, + 2690422980, + 3172863319, + 2651064309, + ]; + + assert_eq!(c_dag.iter().take(20).cloned().collect::>(), expected,); + } + + #[test] + fn test_random_merge() { + let tests = [ + (1000000u32, 101u32, 33000101u32), + (2000000, 102, 66003366), + (3000000, 103, 6000103), + (4000000, 104, 2000104), + (1000000, 0, 33000000), + (2000000, 0, 66000000), + (3000000, 0, 6000000), + (4000000, 0, 2000000), + ]; + + for (i, &(a, b, expected)) in tests.iter().enumerate() { + assert_eq!(merge(a, b, i as u32), expected,); + } + } + + #[test] + fn test_random_math() { + let tests = [ + (20u32, 22u32, 42u32), + (70000, 80000, 1305032704), + (70000, 80000, 1), + (1, 2, 1), + (3, 10000, 196608), + (3, 0, 3), + (3, 6, 2), + (3, 6, 7), + (3, 6, 5), + (0, 0xffffffff, 32), + (3 << 13, 1 << 5, 3), + (22, 20, 42), + (80000, 70000, 1305032704), + (80000, 70000, 1), + (2, 1, 1), + (10000, 3, 80000), + (0, 3, 0), + (6, 3, 2), + (6, 3, 7), + (6, 3, 5), + (0, 0xffffffff, 32), + (3 << 13, 1 << 5, 3), + ]; + + for (i, &(a, b, expected)) in tests.iter().enumerate() { + assert_eq!(math(a, b, i as u32), expected,); + } + } + + #[test] + fn test_keccak_256() { + let expected = "5dd431e5fbc604f499bfa0232f45f8f142d0ff5178f539e5a7800bf0643697af"; + assert_eq!(keccak_f800_long([0; 32], 0, [0; 8]), h256(expected),); + } + + #[test] + fn test_keccak_64() { + let expected: u64 = 0x5dd431e5fbc604f4; + assert_eq!(keccak_f800_short([0; 32], 0, [0; 8]), expected,); + } + + #[test] + fn test_progpow_hash() { + let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value()); + let tempdir = TempDir::new("").unwrap(); + let cache = builder.new_cache(tempdir.into_path(), 0); + let c_dag = generate_cdag(cache.as_ref()); + + let header_hash = [0; 32]; + + let (digest, result) = progpow(header_hash, 0, 0, cache.as_ref(), &c_dag); + + let expected_digest = + FromHex::from_hex("63155f732f2bf556967f906155b510c917e48e99685ead76ea83f4eca03ab12b") + .unwrap(); + let expected_result = + FromHex::from_hex("faeb1be51075b03a4ff44b335067951ead07a3b078539ace76fd56fc410557a3") + .unwrap(); + + assert_eq!(digest.to_vec(), expected_digest,); + + assert_eq!(result.to_vec(), expected_result,); + } + + #[test] + fn test_progpow_testvectors() { + struct ProgpowTest { + block_number: u64, + header_hash: H256, + nonce: u64, + mix_hash: H256, + final_hash: H256, + } + + let tests: Vec> = + serde_json::from_slice(include_bytes!("../res/progpow_testvectors.json")).unwrap(); + + let tests: Vec = tests + .into_iter() + .map(|mut test: VecDeque| { + assert!(test.len() == 5); + + let block_number: u64 = serde_json::from_value(test.pop_front().unwrap()).unwrap(); + let header_hash: String = + serde_json::from_value(test.pop_front().unwrap()).unwrap(); + let nonce: String = serde_json::from_value(test.pop_front().unwrap()).unwrap(); + let mix_hash: String = serde_json::from_value(test.pop_front().unwrap()).unwrap(); + let final_hash: String = serde_json::from_value(test.pop_front().unwrap()).unwrap(); + + ProgpowTest { + block_number, + header_hash: h256(&header_hash), + nonce: u64::from_str_radix(&nonce, 16).unwrap(), + mix_hash: h256(&mix_hash), + final_hash: h256(&final_hash), + } + }) + .collect(); + + for test in tests { + let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value()); + let tempdir = TempDir::new("").unwrap(); + let cache = builder.new_cache(tempdir.path().to_owned(), test.block_number); + let c_dag = generate_cdag(cache.as_ref()); + + let (digest, result) = progpow( + test.header_hash, + test.nonce, + test.block_number, + cache.as_ref(), + &c_dag, + ); + + assert_eq!(digest, test.final_hash); + assert_eq!(result, test.mix_hash); + } + } +} diff --git a/client/consensus/ethash/src/seed_compute.rs b/client/consensus/ethash/src/seed_compute.rs new file mode 100644 index 00000000..6ca9aba7 --- /dev/null +++ b/client/consensus/ethash/src/seed_compute.rs @@ -0,0 +1,110 @@ +// Copyright 2015-2020 Parity Technologies (UK) Ltd. +// This file is part of OpenEthereum. + +// OpenEthereum 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. + +// OpenEthereum 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 OpenEthereum. If not, see . + +use keccak::{keccak_256, H256}; +use shared; + +use std::cell::Cell; + +#[derive(Default)] +pub struct SeedHashCompute { + prev_epoch: Cell, + prev_seedhash: Cell, +} + +impl SeedHashCompute { + #[inline] + fn reset_cache(&self) { + self.prev_epoch.set(0); + self.prev_seedhash.set([0u8; 32]); + } + + #[inline] + pub fn hash_block_number(&self, block_number: u64) -> H256 { + self.hash_epoch(shared::epoch(block_number)) + } + + #[inline] + pub fn hash_epoch(&self, epoch: u64) -> H256 { + if epoch < self.prev_epoch.get() { + // can't build on previous hash if requesting an older block + self.reset_cache(); + } + if epoch > self.prev_epoch.get() { + let seed_hash = SeedHashCompute::resume_compute_seedhash( + self.prev_seedhash.get(), + self.prev_epoch.get(), + epoch, + ); + self.prev_seedhash.set(seed_hash); + self.prev_epoch.set(epoch); + } + self.prev_seedhash.get() + } + + #[inline] + pub fn resume_compute_seedhash(mut hash: H256, start_epoch: u64, end_epoch: u64) -> H256 { + for _ in start_epoch..end_epoch { + keccak_256::inplace(&mut hash); + } + hash + } +} + +#[cfg(test)] +mod tests { + use super::SeedHashCompute; + + #[test] + fn test_seed_compute_once() { + let seed_compute = SeedHashCompute::default(); + let hash = [ + 241, 175, 44, 134, 39, 121, 245, 239, 228, 236, 43, 160, 195, 152, 46, 7, 199, 5, 253, + 147, 241, 206, 98, 43, 3, 104, 17, 40, 192, 79, 106, 162, + ]; + assert_eq!(seed_compute.hash_block_number(486382), hash); + } + + #[test] + fn test_seed_compute_zero() { + let seed_compute = SeedHashCompute::default(); + assert_eq!(seed_compute.hash_block_number(0), [0u8; 32]); + } + + #[test] + fn test_seed_compute_after_older() { + let seed_compute = SeedHashCompute::default(); + // calculating an older value first shouldn't affect the result + let _ = seed_compute.hash_block_number(50000); + let hash = [ + 241, 175, 44, 134, 39, 121, 245, 239, 228, 236, 43, 160, 195, 152, 46, 7, 199, 5, 253, + 147, 241, 206, 98, 43, 3, 104, 17, 40, 192, 79, 106, 162, + ]; + assert_eq!(seed_compute.hash_block_number(486382), hash); + } + + #[test] + fn test_seed_compute_after_newer() { + let seed_compute = SeedHashCompute::default(); + // calculating an newer value first shouldn't affect the result + let _ = seed_compute.hash_block_number(972764); + let hash = [ + 241, 175, 44, 134, 39, 121, 245, 239, 228, 236, 43, 160, 195, 152, 46, 7, 199, 5, 253, + 147, 241, 206, 98, 43, 3, 104, 17, 40, 192, 79, 106, 162, + ]; + assert_eq!(seed_compute.hash_block_number(486382), hash); + } +} diff --git a/client/consensus/ethash/src/shared.rs b/client/consensus/ethash/src/shared.rs new file mode 100644 index 00000000..4f72b61a --- /dev/null +++ b/client/consensus/ethash/src/shared.rs @@ -0,0 +1,154 @@ +// Copyright 2015-2020 Parity Technologies (UK) Ltd. +// This file is part of OpenEthereum. + +// OpenEthereum 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. + +// OpenEthereum 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 OpenEthereum. If not, see . + +use primal::is_prime; + +pub const DATASET_BYTES_INIT: u64 = 1 << 30; +pub const DATASET_BYTES_GROWTH: u64 = 1 << 23; +pub const CACHE_BYTES_INIT: u64 = 1 << 24; +pub const CACHE_BYTES_GROWTH: u64 = 1 << 17; + +pub const ETHASH_EPOCH_LENGTH: u64 = 30000; +pub const ETHASH_CACHE_ROUNDS: usize = 3; +pub const ETHASH_MIX_BYTES: usize = 128; +pub const ETHASH_ACCESSES: usize = 64; +pub const ETHASH_DATASET_PARENTS: u32 = 256; +pub const NODE_DWORDS: usize = NODE_WORDS / 2; +pub const NODE_WORDS: usize = NODE_BYTES / 4; +pub const NODE_BYTES: usize = 64; + +pub fn epoch(block_number: u64) -> u64 { + block_number / ETHASH_EPOCH_LENGTH +} + +static CHARS: &'static [u8] = b"0123456789abcdef"; +pub fn to_hex(bytes: &[u8]) -> String { + let mut v = Vec::with_capacity(bytes.len() * 2); + for &byte in bytes.iter() { + v.push(CHARS[(byte >> 4) as usize]); + v.push(CHARS[(byte & 0xf) as usize]); + } + + unsafe { String::from_utf8_unchecked(v) } +} + +pub fn get_cache_size(block_number: u64) -> usize { + // TODO: Memoise + let mut sz: u64 = CACHE_BYTES_INIT + CACHE_BYTES_GROWTH * (block_number / ETHASH_EPOCH_LENGTH); + sz = sz - NODE_BYTES as u64; + while !is_prime(sz / NODE_BYTES as u64) { + sz = sz - 2 * NODE_BYTES as u64; + } + sz as usize +} + +pub fn get_data_size(block_number: u64) -> usize { + // TODO: Memoise + let mut sz: u64 = + DATASET_BYTES_INIT + DATASET_BYTES_GROWTH * (block_number / ETHASH_EPOCH_LENGTH); + sz = sz - ETHASH_MIX_BYTES as u64; + while !is_prime(sz / ETHASH_MIX_BYTES as u64) { + sz = sz - 2 * ETHASH_MIX_BYTES as u64; + } + sz as usize +} + +pub type NodeBytes = [u8; NODE_BYTES]; +pub type NodeWords = [u32; NODE_WORDS]; +pub type NodeDwords = [u64; NODE_DWORDS]; + +macro_rules! static_assert_size_eq { + (@inner $a:ty, $b:ty, $($rest:ty),*) => { + fn first() { + static_assert_size_eq!($a, $b); + } + + fn second() { + static_assert_size_eq!($b, $($rest),*); + } + }; + (@inner $a:ty, $b:ty) => { + unsafe { + let val: $b = ::mem::MaybeUninit::uninit().assume_init(); + let _: $a = ::std::mem::transmute(val); + } + }; + ($($rest:ty),*) => { + static_assert_size_eq!(size_eq: $($rest),*); + }; + ($name:ident : $($rest:ty),*) => { + #[allow(dead_code)] + fn $name() { + static_assert_size_eq!(@inner $($rest),*); + } + }; +} + +static_assert_size_eq!(Node, NodeBytes, NodeWords, NodeDwords); + +#[repr(C)] +pub union Node { + pub dwords: NodeDwords, + pub words: NodeWords, + pub bytes: NodeBytes, +} + +impl Clone for Node { + fn clone(&self) -> Self { + unsafe { + Node { + bytes: *&self.bytes, + } + } + } +} + +// We use `inline(always)` because I was experiencing an 100% slowdown and `perf` showed that these +// calls were taking up ~30% of the runtime. Adding these annotations fixes the issue. Remove at +// your peril, if and only if you have benchmarks to prove that this doesn't reintroduce the +// performance regression. It's not caused by the `debug_assert_eq!` either, your guess is as good +// as mine. +impl Node { + #[inline(always)] + pub fn as_bytes(&self) -> &NodeBytes { + unsafe { &self.bytes } + } + + #[inline(always)] + pub fn as_bytes_mut(&mut self) -> &mut NodeBytes { + unsafe { &mut self.bytes } + } + + #[inline(always)] + pub fn as_words(&self) -> &NodeWords { + unsafe { &self.words } + } + + #[inline(always)] + pub fn as_words_mut(&mut self) -> &mut NodeWords { + unsafe { &mut self.words } + } + + #[inline(always)] + pub fn as_dwords(&self) -> &NodeDwords { + unsafe { &self.dwords } + } + + #[inline(always)] + pub fn as_dwords_mut(&mut self) -> &mut NodeDwords { + unsafe { &mut self.dwords } + } +} diff --git a/client/consensus/ethpow/Cargo.toml b/client/consensus/ethpow/Cargo.toml new file mode 100644 index 00000000..fcd200e6 --- /dev/null +++ b/client/consensus/ethpow/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = 'ethpow' +version = "1.0.0" +edition = '2018' +authors = ['MVS DevHub '] +repository = 'https://github.com/mvs-org/new-frontiers' +description = 'Ethash-based Proof of Work algorithms for Substrate' +license = "GPL-3.0-or-later" + +[dependencies] +# Substrate packages +sp-api = '3.0' +sp-consensus-pow = '0.9' +sp-core = '3.0' +sp-runtime = '3.0' +sp-blockchain = '3.0' +log = '0.4.8' + +# Ethereum +sc-consensus-pow = { path = "../../consensus/consensus-pow" } +ethash = { path = "../../consensus/ethash" } +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" +ethereum-types = "0.9.2" +derive_more = "0.99.2" +parity-scale-codec = '2.0' +tempdir = "0.3" \ No newline at end of file diff --git a/client/consensus/ethpow/src/error.rs b/client/consensus/ethpow/src/error.rs new file mode 100644 index 00000000..e5d77f62 --- /dev/null +++ b/client/consensus/ethpow/src/error.rs @@ -0,0 +1,69 @@ +// This file is part of Substrate. + +// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +//! A manual sealing engine: the engine listens for rpc calls to seal blocks and create forks. +//! This is suitable for a testing environment. + + +/// Error code for rpc +mod codes { + pub const MISMATCHED_H256_SEAL: i64 = 10_000; + pub const INVALID_SEAL: i64 = 11_000; + pub const EMPTY_TRANSACTION_POOL: i64 = 12_000; + pub const BLOCK_NOT_FOUND: i64 = 13_000; + pub const INVALID_POW: i64 = 14_000; + pub const INHERENTS_ERROR: i64 = 15_000; + pub const BLOCKCHAIN_ERROR: i64 = 16_000; + pub const UNKNOWN_ERROR: i64 = 20_000; +} + +/// errors encountered by background block authorship task +#[derive(Debug, derive_more::Display, derive_more::From)] +pub enum Error { + /// Transaction pool is empty, cannot create a block + #[display(fmt = "Transaction pool is empty, set create_empty to true,\ + if you want to create empty blocks")] + EmptyTransactionPool, + #[display(fmt = "Mismatched H256 Seal Element")] + MismatchedH256SealElement, + #[display(fmt = "Invalid WorkSeal")] + InvalidWorkSeal, + //#[display(fmt = "Invalid ProofOfWork: expected: {}, found: {}", _0, _1)] + #[display(fmt = "Invalid ProofOfWork, Invalid Difficulty")] + InvalidProofOfWork, + /// Some other error. + Other(String), +} + +impl Error { + fn to_code(&self) -> i64 { + use Error::*; + match self { + MismatchedH256SealElement => codes::MISMATCHED_H256_SEAL, + InvalidWorkSeal => codes::INVALID_SEAL, + InvalidProofOfWork => codes::INVALID_POW, + EmptyTransactionPool => codes::EMPTY_TRANSACTION_POOL, + // ConsensusError(_) => codes::CONSENSUS_ERROR, + // InherentError(_) => codes::INHERENTS_ERROR, + // BlockchainError(_) => codes::BLOCKCHAIN_ERROR, + // SendError(_) | Canceled(_) => codes::SERVER_SHUTTING_DOWN, + _ => codes::UNKNOWN_ERROR + } + } +} + diff --git a/client/consensus/ethpow/src/lib.rs b/client/consensus/ethpow/src/lib.rs new file mode 100644 index 00000000..9dc41976 --- /dev/null +++ b/client/consensus/ethpow/src/lib.rs @@ -0,0 +1,341 @@ +use parity_scale_codec::{Decode, Encode}; +use sc_consensus_pow::{Error, PowAlgorithm}; + +use sp_api::ProvideRuntimeApi; +use sp_consensus_pow::{DifficultyApi, Seal as RawSeal}; +use sp_blockchain::HeaderBackend; +use ethereum_types::{self, U256 as EU256, H256 as EH256}; +use sp_core::{U256, H256}; +use sp_runtime::generic::BlockId; +use sp_runtime::traits::{Block as BlockT, Header as HeaderT, UniqueSaturatedInto}; +use std::{cmp, sync::Arc, time::{SystemTime, UNIX_EPOCH}}; +use ethash::{self, quick_get_difficulty, slow_hash_block_number, EthashManager}; +use log::{error, info, debug, trace, warn}; + +mod error; +use error::{Error as EthError}; + + +#[derive(Clone, PartialEq, Eq, Encode, Decode, Debug)] +pub struct WorkSeal { + /// The found nonce + pub nonce : u64, + /// The proof-of-work hash of header. + pub pow_hash: H256, + /// The seed hash. + pub mix_digest: H256, + /// The difficulty + pub difficulty: U256, + /// The block number + pub header_nr: u64, + /// The timestamp + pub timestamp: u64, +} + +/// A minimal PoW algorithm that uses Sha3 hashing. +/// Difficulty is fixed at 1_000_000 +#[derive(Clone)] +pub struct MinimalEthashAlgorithm { + pow: Arc, +} + +impl MinimalEthashAlgorithm { + pub fn new() -> Self { + use tempdir::TempDir; + + let tempdir = TempDir::new("").unwrap(); + Self { pow: Arc::new(EthashManager::new(tempdir.path(), None, u64::max_value())), } + } + + fn verify_seal(&self, seal: &WorkSeal) -> Result<(), EthError> { + let mut tmp:[u8; 32] = seal.pow_hash.into(); + let pre_hash = EH256::from(tmp); + tmp = seal.mix_digest.into(); + let mix_digest = EH256::from(tmp); + + let result = self.pow.compute_light( + seal.header_nr, + &pre_hash.0, + seal.nonce, + ); + let mix = EH256(result.mix_hash); + tmp = ethash::boundary_to_difficulty(&EH256(result.value)).into(); + let difficulty = U256::from(tmp); + trace!(target:"pow", "num: {num}, seed: {seed}, h: {h}, non: {non}, mix: {mix}, res: {res}", + num = seal.header_nr, + seed = EH256(slow_hash_block_number(seal.header_nr)), + h = pre_hash, + non = seal.nonce, + mix = EH256(result.mix_hash), + res = EH256(result.value)); + + if mix != mix_digest { + return Err(EthError::MismatchedH256SealElement); + } + if difficulty < seal.difficulty { + return Err(EthError::InvalidProofOfWork); + } + + trace!(target:"pow", "miner verified ok"); + Ok(()) + } +} + +// Here we implement the general PowAlgorithm trait for our concrete EthashAlgorithm +impl> PowAlgorithm for MinimalEthashAlgorithm { + type Difficulty = U256; + + fn difficulty(&self, _parent: B::Hash) -> Result> { + // Fixed difficulty hardcoded here + Ok(U256::from(1_000_000)) + } + + fn calc_difficulty(&self, _parent: B::Hash, _cur: B::Hash) -> Result> { + // Fixed difficulty hardcoded here + Ok(U256::from(1_000_000)) + } + + fn verify( + &self, + _parent: &BlockId, + pre_hash: &H256, + _pre_digest: Option<&[u8]>, + seal: &RawSeal, + difficulty: Self::Difficulty, + ) -> Result> { + // Try to construct a seal object by decoding the raw seal given + let seal = match WorkSeal::decode(&mut &seal[..]) { + Ok(seal) => seal, + Err(_) => return Ok(false), + }; + + match self.verify_seal(&seal) { + Ok(_) => {}, + Err(_) => return Ok(false), + }; + + Ok(true) + } +} + +/// A complete PoW Algorithm that uses Sha3 hashing. +/// Needs a reference to the client so it can grab the difficulty from the runtime. +pub struct EthashAlgorithm { + client: Arc, + pow: Arc, + minimum_difficulty: U256, + difficulty_bound_divisor: U256, + difficulty_increment_divisor: u64, + duration_limit: u64, + progpow: bool, +} + +impl EthashAlgorithm { + pub fn new(client: Arc) -> Self { + use tempdir::TempDir; + + let tempdir = TempDir::new("").unwrap(); + Self { + client, + pow: Arc::new(EthashManager::new(tempdir.path(), None, u64::max_value())), + minimum_difficulty: U256::from(1_000_000), + difficulty_bound_divisor: U256::from(2048), + difficulty_increment_divisor: 10, + duration_limit: 13, + progpow: false, + } + } + + fn verify_seal(&self, seal: &WorkSeal) -> Result<(), EthError> { + let mut tmp:[u8; 32] = seal.pow_hash.into(); + let pre_hash = EH256::from(tmp); + tmp = seal.mix_digest.into(); + let mix_digest = EH256::from(tmp); + + let result = self.pow.compute_light( + seal.header_nr, + &pre_hash.0, + seal.nonce, + ); + let mix = EH256(result.mix_hash); + tmp = ethash::boundary_to_difficulty(&EH256(result.value)).into(); + let difficulty = U256::from(tmp); + trace!(target:"pow", "num: {num}, seed: {seed}, h: {h}, non: {non}, mix: {mix}, res: {res}", + num = seal.header_nr, + seed = EH256(slow_hash_block_number(seal.header_nr)), + h = pre_hash, + non = seal.nonce, + mix = EH256(result.mix_hash), + res = EH256(result.value)); + + if mix != mix_digest { + debug!(target:"pow", "verify_seal EthError::MismatchedH256SealElement"); + return Err(EthError::MismatchedH256SealElement); + } + if difficulty < seal.difficulty { + debug!(target:"pow", "verify_seal EthError::InvalidProofOfWork"); + return Err(EthError::InvalidProofOfWork); + } + + trace!(target:"pow", "miner verified ok"); + Ok(()) + } +} + +// Manually implement clone. Deriving doesn't work because +// it'll derive impl Clone for EthashAlgorithm. But C in practice isn't Clone. +impl Clone for EthashAlgorithm { + fn clone(&self) -> Self { + Self::new(self.client.clone()) + } +} + +// Here we implement the general PowAlgorithm trait for our concrete EthashAlgorithm +impl, C> PowAlgorithm for EthashAlgorithm +where + C: HeaderBackend + ProvideRuntimeApi, +{ + type Difficulty = U256; + + fn difficulty(&self, hash: B::Hash) -> Result> { + let header = self.client.header(BlockId::::hash(hash)).map_err(|err| { + sc_consensus_pow::Error::Other(format!("{:?}", err)) + })?.ok_or_else(|| { + sc_consensus_pow::Error::Other(format!("there should be header")) + })?; + let raw_seal = match sc_consensus_pow::fetch_seal::( + header.digest().logs.last(), + hash, + ) { + Ok(seal) => seal, + Err(err) => { + let nr :u64 = UniqueSaturatedInto::::unique_saturated_into(*header.number()); + if nr == 0 { //:NOTICE: This should be the genesis header, use minimum_difficulty + return Ok(self.minimum_difficulty); + } else { + return Err(sc_consensus_pow::Error::Other(format!("{:?}", err))); + } + }, + }; + let seal = WorkSeal::decode(&mut &raw_seal[..]).map_err(|err| { + sc_consensus_pow::Error::Other(format!("{:?}", err)) + })?; + + // header difficulty + Ok(seal.difficulty) + } + + fn calc_difficulty(&self, parent: B::Hash, cur: B::Hash) -> Result> { + let parent_header = match self.client.header(BlockId::::hash(parent)).map_err(|err| { + sc_consensus_pow::Error::Other(format!("{:?}", err)) + })? { + Some(header) => header, + None => { + //:NOTICE: This should be the genesis header, use minimum_difficulty + return Ok(self.minimum_difficulty); + }, + }; + let raw_seal = match sc_consensus_pow::fetch_seal::( + parent_header.digest().logs.last(), + parent, + ) { + Ok(seal) => seal, + Err(err) => { + let nr :u64 = UniqueSaturatedInto::::unique_saturated_into(*parent_header.number()); + if nr == 0 { //:NOTICE: This should be the genesis header, use minimum_difficulty + return Ok(self.minimum_difficulty); + } else { + return Err(sc_consensus_pow::Error::Other(format!("{:?}", err))); + } + }, + }; + let parent_seal = WorkSeal::decode(&mut &raw_seal[..]).map_err(|err| { + sc_consensus_pow::Error::Other(format!("{:?}", err)) + })?; + + let header = self.client.header(BlockId::::hash(cur)).map_err(|err| { + sc_consensus_pow::Error::Other(format!("{:?}", err)) + })?.ok_or_else(|| { + sc_consensus_pow::Error::Other(format!("there should be header")) + })?; + let raw_seal = sc_consensus_pow::fetch_seal::( + header.digest().logs.last(), + cur, + ).map_err(|err| { + sc_consensus_pow::Error::Other(format!("{:?}", err)) + })?; + let seal = WorkSeal::decode(&mut &raw_seal[..]).map_err(|err| { + sc_consensus_pow::Error::Other(format!("{:?}", err)) + })?; + + let min_difficulty = self.minimum_difficulty; + let difficulty_bound_divisor = self.difficulty_bound_divisor; + let duration_limit = self.duration_limit; + + let mut target = if seal.timestamp >= parent_seal.timestamp + duration_limit { + seal.difficulty - (seal.difficulty / difficulty_bound_divisor) + } else { + seal.difficulty + (seal.difficulty / difficulty_bound_divisor) + }; + target = cmp::max(min_difficulty, target); + debug!(target:"pow", "duration: {}, pTime: {}, cTime: {}, old_dif: {}, new_dif: {}", + seal.timestamp-parent_seal.timestamp, parent_seal.timestamp, seal.timestamp, seal.difficulty, target); + + // parent header difficulty + Ok(target) + } + + fn verify( + &self, + parent: &BlockId, + pre_hash: &H256, + _pre_digest: Option<&[u8]>, + seal: &RawSeal, + difficulty: Self::Difficulty, + ) -> Result> { + // Try to construct a seal object by decoding the raw seal given + let seal = match WorkSeal::decode(&mut &seal[..]) { + Ok(seal) => seal, + Err(_) => return Ok(false), + }; + + let parent_header = self.client.header(*parent).map_err(|err| { + sc_consensus_pow::Error::Other(format!("{:?}", err)) + })?.ok_or_else(|| { + sc_consensus_pow::Error::Other(format!("there should be header")) + })?; + let nr :u64 = UniqueSaturatedInto::::unique_saturated_into(*parent_header.number()); + // Basic seal check + if nr != 0 { //:NOTICE: genesis header doesn't contain seal + let raw_seal = sc_consensus_pow::fetch_seal::( + parent_header.digest().logs.last(), + parent_header.hash(), + ).map_err(|err| { + sc_consensus_pow::Error::Other(format!("{:?}", err)) + })?; + let parent_seal = WorkSeal::decode(&mut &raw_seal[..]).map_err(|err| { + sc_consensus_pow::Error::Other(format!("{:?}", err)) + })?; + + if seal.timestamp < parent_seal.timestamp { + return Err(sc_consensus_pow::Error::InvalidSeal); + } + + if seal.header_nr != parent_seal.header_nr + 1 { + return Err(sc_consensus_pow::Error::InvalidSeal); + } + + const ACCEPTABLE_DRIFT: u64 = 15; + let timestamp_now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs(); + if seal.timestamp > timestamp_now + ACCEPTABLE_DRIFT { + return Err(sc_consensus_pow::Error::TooFarInFuture); + } + } + + self.verify_seal(&seal).map_err(|err| { + sc_consensus_pow::Error::Other(format!("{:?}", err)) + })?; + + Ok(true) + } +} diff --git a/client/consensus/Cargo.toml b/client/consensus/fc-consensus/Cargo.toml similarity index 100% rename from client/consensus/Cargo.toml rename to client/consensus/fc-consensus/Cargo.toml diff --git a/client/consensus/src/lib.rs b/client/consensus/fc-consensus/src/lib.rs similarity index 100% rename from client/consensus/src/lib.rs rename to client/consensus/fc-consensus/src/lib.rs diff --git a/client/ethash-rpc/Cargo.toml b/client/ethash-rpc/Cargo.toml new file mode 100644 index 00000000..1704fa3d --- /dev/null +++ b/client/ethash-rpc/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = 'ethash-rpc' +version = "1.0.0" +edition = '2018' +authors = ['MVS DevHub '] +repository = 'https://github.com/mvs-org/new-frontiers' +description = 'Ethash Algorithm RPC for external miner' +license = "GPL-3.0-or-later" + +[dependencies] +# Substrate packages +# sp-api = '3.0' +sp-core = '3.0' +futures = '0.3.4' +jsonrpc-core = "15.0" +jsonrpc-derive = "15.0" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" +derive_more = "0.99.2" +parity-scale-codec = '2.0' +log = '0.4.8' + +# Ethereum +# ethereum-types = "0.9.2" +ethash = { path = "../consensus/ethash" } + + diff --git a/client/ethash-rpc/src/error.rs b/client/ethash-rpc/src/error.rs new file mode 100644 index 00000000..65759074 --- /dev/null +++ b/client/ethash-rpc/src/error.rs @@ -0,0 +1,109 @@ +// This file is part of Substrate. + +// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +//! A manual sealing engine: the engine listens for rpc calls to seal blocks and create forks. +//! This is suitable for a testing environment. + +use futures::channel::{oneshot, mpsc::SendError}; + +/// Error code for rpc +mod codes { + pub const SERVER_SHUTTING_DOWN: i64 = 10_000; + pub const BLOCK_IMPORT_FAILED: i64 = 11_000; + pub const EMPTY_TRANSACTION_POOL: i64 = 12_000; + pub const BLOCK_NOT_FOUND: i64 = 13_000; + pub const CONSENSUS_ERROR: i64 = 14_000; + pub const INHERENTS_ERROR: i64 = 15_000; + pub const BLOCKCHAIN_ERROR: i64 = 16_000; + pub const UNKNOWN_ERROR: i64 = 20_000; +} + +/// errors encountered by background block authorship task +#[derive(Debug, derive_more::Display, derive_more::From)] +pub enum Error { + // /// An error occurred while importing the block + // #[display(fmt = "Block import failed: {:?}", _0)] + // BlockImportError(ImportResult), + /// Transaction pool is empty, cannot create a block + #[display(fmt = "Transaction pool is empty, set create_empty to true,\ + if you want to create empty blocks")] + EmptyTransactionPool, + // /// encountered during creation of Proposer. + // #[display(fmt = "Consensus Error: {}", _0)] + // ConsensusError(ConsensusError), + // /// Failed to create Inherents data + // #[display(fmt = "Inherents Error: {}", _0)] + // InherentError(InherentsError), + // /// error encountered during finalization + // #[display(fmt = "Finalization Error: {}", _0)] + // BlockchainError(BlockchainError), + /// Supplied parent_hash doesn't exist in chain + #[display(fmt = "Supplied parent_hash: {} doesn't exist in chain", _0)] + #[from(ignore)] + BlockNotFound(String), + /// Some string error + #[display(fmt = "{}", _0)] + #[from(ignore)] + StringError(String), + ///send error + #[display(fmt = "Consensus process is terminating")] + Canceled(oneshot::Canceled), + ///send error + #[display(fmt = "Consensus process is terminating")] + SendError(SendError), + /// no work + #[display(fmt = "No work now")] + NoWork, + #[display(fmt = "Metadata not available")] + NoMetaData, + #[display(fmt = "Mismatched H256 Seal Element")] + MismatchedH256SealElement, + //#[display(fmt = "Invalid ProofOfWork: expected: {}, found: {}", _0, _1)] + #[display(fmt = "Invalid ProofOfWork, Invalid Difficulty")] + InvalidProofOfWork, + #[display(fmt = "Unimplemented")] + Unimplemented, + /// Some other error. + Other(String), +} + +impl Error { + fn to_code(&self) -> i64 { + use Error::*; + match self { + // BlockImportError(_) => codes::BLOCK_IMPORT_FAILED, + BlockNotFound(_) => codes::BLOCK_NOT_FOUND, + EmptyTransactionPool => codes::EMPTY_TRANSACTION_POOL, + // ConsensusError(_) => codes::CONSENSUS_ERROR, + // InherentError(_) => codes::INHERENTS_ERROR, + // BlockchainError(_) => codes::BLOCKCHAIN_ERROR, + SendError(_) | Canceled(_) => codes::SERVER_SHUTTING_DOWN, + _ => codes::UNKNOWN_ERROR + } + } +} + +impl std::convert::From for jsonrpc_core::Error { + fn from(error: Error) -> Self { + jsonrpc_core::Error { + code: jsonrpc_core::ErrorCode::ServerError(error.to_code()), + message: format!("{}", error), + data: None + } + } +} diff --git a/client/ethash-rpc/src/lib.rs b/client/ethash-rpc/src/lib.rs new file mode 100644 index 00000000..8dd2859e --- /dev/null +++ b/client/ethash-rpc/src/lib.rs @@ -0,0 +1,141 @@ + +use jsonrpc_core::Result; +use jsonrpc_core::Error; +use jsonrpc_derive::rpc; +use futures::{ + channel::{mpsc, oneshot}, + TryFutureExt, + FutureExt, + SinkExt +}; +use std::sync::Arc; +use sp_core::{H256, U256}; +use log; + +mod work; +mod error; +pub use work::{Work}; +pub use error::{Error as RpcError}; + +/// Future's type for jsonrpc +type FutureResult = Box + Send>; +/// sender passed to the authorship task to report errors or successes. +pub type Sender = Option>>; + +/// Message sent to the background authorship task, usually by RPC. +pub enum EtheminerCmd { + GetWork { + /// sender to report errors/success to the rpc. + sender: Sender, + }, + /// Tells the engine to finalize the block with the supplied hash + SubmitWork { + /// The found nonce + nonce : U256, + /// The proof-of-work hash of header. + pow_hash: H256, + /// The seed hash. + mix_digest: H256, + /// sender to report errors/success to the rpc. + sender: Sender, + }, + SubmitHashrate { + /// hash of the block + hash: Hash, + /// sender to report errors/success to the rpc. + sender: Sender, + }, +} + +#[rpc(server)] +pub trait EthashRpc { + #[rpc(name = "eth_getWork")] + fn eth_getWork(&self, _: Option) -> FutureResult; + + #[rpc(name = "eth_submitWork")] + fn eth_submitWork(&self, nonce: U256, pow_hash: H256, mix_digest: H256) -> FutureResult; + + #[rpc(name = "eth_hashrate")] + fn eth_hashrate(&self) -> Result; + + #[rpc(name = "eth_submitHashrate")] + fn eth_submitHashrate(&self, _: U256, _: H256) -> Result; +} + +/// A struct that implements the `EthashRpc` +pub struct EthashData { + client: Arc, + command_sink: mpsc::Sender>, +} + +impl EthashData { + /// Create new `EthashData` instance with the given reference to the client. + pub fn new(client: Arc, command_sink: mpsc::Sender>) -> Self { + Self { + client, + command_sink, + } + } +} + +impl EthashRpc for EthashData { + fn eth_getWork(&self, no_new_work_timeout: Option) -> FutureResult { + let mut sink = self.command_sink.clone(); + let future = async move { + let (sender, receiver) = oneshot::channel(); + let command = EtheminerCmd::GetWork { + sender: Some(sender), + }; + sink.send(command).await?; + receiver.await? + }.boxed(); + + Box::new(future.map_err(Error::from).compat()) + } + + fn eth_submitWork(&self, nonce: U256, pow_hash: H256, mix_digest: H256) -> FutureResult { + let mut sink = self.command_sink.clone(); + let future = async move { + let (sender, receiver) = oneshot::channel(); + let command = EtheminerCmd::SubmitWork { + nonce, + pow_hash, + mix_digest, + sender: Some(sender), + }; + sink.send(command).await?; + receiver.await? + }.boxed(); + + Box::new(future.map_err(Error::from).compat()) + } + + fn eth_hashrate(&self) -> Result { + //Ok(default()) + //Err(errors::unimplemented(None)) + Err(Error::from(RpcError::Unimplemented)) + } + + fn eth_submitHashrate(&self, _: U256, _: H256) -> Result { + Ok(true) + } +} + +/// report any errors or successes encountered by the authorship task back +/// to the rpc +pub fn send_result( + sender: &mut Sender, + result: std::result::Result +) { + if let Some(sender) = sender.take() { + if let Err(err) = sender.send(result) { + log::warn!("Server is shutting down: {:?}", err) + } + } else { + // instant seal doesn't report errors over rpc, simply log them. + match result { + Ok(r) => log::info!("Instant Seal success: {:?}", r), + Err(e) => log::error!("Instant Seal encountered an error: {}", e) + } + } +} diff --git a/client/ethash-rpc/src/work.rs b/client/ethash-rpc/src/work.rs new file mode 100644 index 00000000..3c8b78b1 --- /dev/null +++ b/client/ethash-rpc/src/work.rs @@ -0,0 +1,51 @@ +// Copyright 2015-2020 Parity Technologies (UK) Ltd. +// This file is part of OpenEthereum. + +// OpenEthereum 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. + +// OpenEthereum 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 OpenEthereum. If not, see . + +use sp_core::{U256, H256}; +use serde::{Serialize, Serializer}; +use parity_scale_codec::{Decode, Encode}; + +/// The result of an `eth_getWork` call: it differs based on an option +/// whether to send the block number. +#[derive(Debug, PartialEq, Eq, Clone)] +pub struct Work { + /// The proof-of-work hash. + pub pow_hash: H256, + /// The seed hash. + pub seed_hash: H256, + /// The target. + pub target: H256, + /// The block number: this isn't always stored. + pub number: Option, +} + +impl Serialize for Work { + fn serialize(&self, s: S) -> Result + where + S: Serializer, + { + match self.number.as_ref() { + Some(num) => ( + &self.pow_hash, + &self.seed_hash, + &self.target, + U256::from(*num), + ) + .serialize(s), + None => (&self.pow_hash, &self.seed_hash, &self.target).serialize(s), + } + } +} diff --git a/docker-compose.yml b/docker-compose.yml index cfc4437b..3e8fd562 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,52 @@ -version: "3.2" - +version: "3.3" services: - dev: - container_name: node-template - image: paritytech/ci-linux:974ba3ac-20201006 - working_dir: /var/www/node-template + bootnode: + build: . + container_name: bootnode + image: metaverse-pow:ver1 + user: root + volumes: + - "/tmp:/tmp" + ports: + - "9333:9933" + networks: + pow-net: + ipv4_address: 172.100.0.10 + command: "--name bootnode --validator --rpc-cors all --base-path /tmp/bootnode --node-key 0000000000000000000000000000000000000000000000000000000000000111" + node-01: + build: . + container_name: node01 + image: metaverse-pow:ver1 + user: root + volumes: + - "/tmp:/tmp" ports: - - "9944:9944" - environment: - - CARGO_HOME=/var/www/node-template/.cargo + - "9334:9933" + networks: + pow-net: + ipv4_address: 172.100.0.20 + command: "--name node01 --validator --rpc-cors all --base-path /tmp/node01 --bootnodes /ip4/172.100.0.10/tcp/30333/p2p/12D3KooWRBaMZHnFYtT1B143sSLHkx8G6ysPSg8PMzqXkymm38Ld" + depends_on: + - bootnode + node-02: + build: . + container_name: node02 + image: metaverse-pow:ver1 + user: root volumes: - - .:/var/www/node-template - - type: bind - source: ./.local - target: /root/.local - command: bash -c "cargo build --release && ./target/release/node-template --dev --ws-external" + - "/tmp:/tmp" + ports: + - "9335:9933" + networks: + pow-net: + ipv4_address: 172.100.0.30 + depends_on: + - bootnode + command: "--name node02 --validator --rpc-cors all --base-path /tmp/node02 --bootnodes /ip4/172.100.0.10/tcp/30333/p2p/12D3KooWRBaMZHnFYtT1B143sSLHkx8G6ysPSg8PMzqXkymm38Ld" + +networks: + pow-net: + driver: bridge + ipam: + config: + - subnet: 172.100.0.0/16 diff --git a/node/Cargo.toml b/node/Cargo.toml index 08079d39..72b56f11 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -54,6 +54,7 @@ sp-inherents = '3.0.0' sp-runtime = '3.0.0' sp-transaction-pool = '3.0.0' substrate-frame-rpc-system = '3.0.0' +sp-timestamp = '3.0' pallet-evm = '3.0.0' pallet-ethereum = '1.0.0' @@ -65,10 +66,21 @@ fc-rpc-core = '1.0.0' fc-mapping-sync = '1.0.0' - # local dependencies metaverse-vm-runtime = { path = '../runtime', version = '0.2.1' } +# Ethereum +# serde = "1.0" +# serde_derive = "1.0" +# serde_json = "1.0" +parking_lot = "0.11.1" +ethereum-types = "0.9.2" +parity-scale-codec = '2.0' +sc-consensus-pow = { path = "../client/consensus/consensus-pow" } +ethash = { path = "../client/consensus/ethash" } +ethpow = { path = "../client/consensus/ethpow" } +ethash-rpc = { path = "../client/ethash-rpc" } + [features] default = [] runtime-benchmarks = ['metaverse-vm-runtime/runtime-benchmarks'] diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 4d963082..41935da5 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -1,6 +1,6 @@ use sp_core::{Pair, Public, sr25519}; use metaverse_vm_runtime::{ - AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig, + AccountId, BalancesConfig, GenesisConfig, GrandpaConfig, SudoConfig, SystemConfig, EVMConfig, EthereumConfig, WASM_BINARY, Signature }; use sp_consensus_aura::sr25519::AuthorityId as AuraId; @@ -194,9 +194,9 @@ fn testnet_genesis( // Configure endowed accounts with initial balance of 1 << 60. balances: endowed_accounts.iter().cloned().map(|k|(k, 1 << 60)).collect(), }), - pallet_aura: Some(AuraConfig { - authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(), - }), + // pallet_aura: Some(AuraConfig { + // authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(), + // }), pallet_grandpa: Some(GrandpaConfig { authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(), }), diff --git a/node/src/rpc.rs b/node/src/rpc.rs index f99ec1d8..dc9f43b5 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -18,6 +18,8 @@ use sc_network::NetworkService; use jsonrpc_pubsub::manager::SubscriptionManager; use pallet_ethereum::EthereumStorageSchema; use fc_rpc::{StorageOverride, SchemaV1Override, }; +use futures::channel::mpsc::Sender; +use ethash_rpc::EtheminerCmd; /// Full client dependencies. pub struct FullDeps { @@ -41,6 +43,8 @@ pub struct FullDeps { pub backend: Arc>, /// Maximum number of logs in a query. pub max_past_logs: u32, + /// A command stream to send commands to ethash consensus engine + pub command_sink: Sender>, } /// Instantiate all Full RPC extensions. @@ -81,6 +85,7 @@ pub fn create_full( backend, enable_dev_signer, max_past_logs, + command_sink, } = deps; io.extend_with( @@ -149,6 +154,11 @@ pub fn create_full( )) ); + // Add Ethash RPC + io.extend_with(ethash_rpc::EthashRpc::to_delegate( + ethash_rpc::EthashData::new(client, command_sink), + )); + io } diff --git a/node/src/service.rs b/node/src/service.rs index b6c48061..6ee0bb6a 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -1,6 +1,6 @@ //! Service and ServiceFactory implementation. Specialized wrapper over substrate service. -use std::{sync::{Arc, Mutex}, time::Duration, collections::{HashMap, BTreeMap}}; +use std::{sync::{Arc, Mutex}, time::{Duration, SystemTime, UNIX_EPOCH}, collections::{HashMap, BTreeMap}}; use fc_rpc_core::types::{FilterPool, PendingTransactions}; use sc_client_api::{ExecutorProvider, RemoteBackend}; use metaverse_vm_runtime::{self, opaque::Block, RuntimeApi}; @@ -8,12 +8,25 @@ use sc_service::{error::Error as ServiceError, Configuration, TaskManager, BaseP use sp_inherents::InherentDataProviders; use sc_executor::native_executor_instance; pub use sc_executor::NativeExecutor; -use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; -use sc_finality_grandpa::SharedVoterState; +use sc_finality_grandpa::{SharedVoterState, GrandpaBlockImport}; use sc_keystore::LocalKeystore; - use crate::cli::Cli; +use futures::prelude::*; +use parking_lot::{Mutex as PMutex}; +use sp_consensus::import_queue::BasicQueue; +use sp_api::{ProvideRuntimeApi, TransactionFor}; +use sp_runtime::traits::{Block as BlockT, Header as HeaderT, UniqueSaturatedInto}; +use ethash::{self, SeedHashCompute}; +use ethpow::{MinimalEthashAlgorithm, EthashAlgorithm, WorkSeal}; +use ethash_rpc::{self, EtheminerCmd, Work, RpcError}; +use sc_consensus_pow::{PowAlgorithm, MiningWorker, MiningMetadata, MiningBuild}; +use sp_core::{U256, H256}; +use ethereum_types::{self, U256 as EU256, H256 as EH256}; +use parity_scale_codec::{Decode, Encode}; +use log::{error, info, debug, trace, warn}; + + // Our native executor instance. native_executor_instance!( pub Executor, @@ -26,6 +39,18 @@ type FullClient = sc_service::TFullClient; type FullBackend = sc_service::TFullBackend; type FullSelectChain = sc_consensus::LongestChain; +// :TODO: fix timestamp +pub fn build_inherent_data_providers() -> Result { + let providers = InherentDataProviders::new(); + + providers + .register_provider(sp_timestamp::InherentDataProvider) + .map_err(Into::into) + .map_err(sp_consensus::error::Error::InherentData)?; + + Ok(providers) +} + pub fn open_frontier_backend(config: &Configuration) -> Result>, String> { let config_dir = config.base_path.as_ref() .map(|base_path| base_path.config_dir(config.chain_spec.id())) @@ -45,24 +70,27 @@ pub fn open_frontier_backend(config: &Configuration) -> Result Result, + BasicQueue>, sc_transaction_pool::FullPool, ( - sc_consensus_aura::AuraBlockImport< + sc_consensus_pow::PowBlockImport< Block, + GrandpaBlockImport, FullClient, - sc_finality_grandpa::GrandpaBlockImport, - AuraPair + FullSelectChain, + EthashAlgorithm, + impl sp_consensus::CanAuthorWith, >, sc_finality_grandpa::LinkHalf, PendingTransactions, Option, Arc>, + EthashAlgorithm, ) >, ServiceError> { if config.keystore_remote.is_some() { return Err(ServiceError::Other( format!("Remote Keystores are not supported."))) } - let inherent_data_providers = InherentDataProviders::new(); + let inherent_data_providers = build_inherent_data_providers()?; let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( @@ -94,19 +122,26 @@ pub fn new_partial(config: &Configuration, _cli: &Cli) -> Result::new( - grandpa_block_import.clone(), client.clone(), - ); + let can_author_with = sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()); + let ethash_alg = EthashAlgorithm::new(client.clone()); - let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>( - sc_consensus_aura::slot_duration(&*client)?, - aura_block_import.clone(), - Some(Box::new(grandpa_block_import.clone())), + let pow_block_import = sc_consensus_pow::PowBlockImport::new( + grandpa_block_import, client.clone(), + ethash_alg.clone(), + 0, // check inherents starting at block 0 + select_chain.clone(), + inherent_data_providers.clone(), + can_author_with, + ); + + let import_queue = sc_consensus_pow::import_queue( + Box::new(pow_block_import.clone()), + None, + ethash_alg.clone(), inherent_data_providers.clone(), &task_manager.spawn_handle(), config.prometheus_registry(), - sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), )?; Ok(sc_service::PartialComponents { @@ -118,9 +153,11 @@ pub fn new_partial(config: &Configuration, _cli: &Cli) -> Result Result Result Result Result( - sc_consensus_aura::slot_duration(&*client)?, + let (worker, worker_task) = sc_consensus_pow::start_mining_worker( + Box::new(pow_block_import), client.clone(), select_chain, - block_import, - proposer_factory, + ethash_alg, + proposer, network.clone(), - inherent_data_providers.clone(), - force_authoring, - backoff_authoring_blocks, - keystore_container.sync_keystore(), + None, + inherent_data_providers, + // time to wait for a new block before starting to mine a new one + Duration::from_secs(10), + // how long to take to actually build the block (i.e. executing extrinsics) + Duration::from_secs(10), can_author_with, - )?; + ); - // the AURA authoring task is considered essential, i.e. if it - // fails we take down the service with it. - task_manager.spawn_essential_handle().spawn_blocking("aura", aura); + task_manager + .spawn_essential_handle() + .spawn_blocking("pow", worker_task); + + // Start Mining + task_manager + .spawn_essential_handle() + .spawn_blocking("mining", run_mining_svc(worker.clone(), commands_stream)); } // if the node isn't actively participating in consensus then it doesn't @@ -334,20 +379,27 @@ pub fn new_light(mut config: Configuration) -> Result select_chain.clone(), )?; - let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new( - grandpa_block_import.clone(), + let inherent_data_providers = build_inherent_data_providers()?; + let ethash_alg = EthashAlgorithm::new(client.clone()); + + let pow_block_import = sc_consensus_pow::PowBlockImport::new( + grandpa_block_import, client.clone(), + ethash_alg.clone(), + 0, // check inherents starting at block 0 + select_chain, + inherent_data_providers.clone(), + // FixMe #375 + sp_consensus::AlwaysCanAuthor, ); - let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>( - sc_consensus_aura::slot_duration(&*client)?, - aura_block_import, - Some(Box::new(grandpa_block_import)), - client.clone(), - InherentDataProviders::new(), + let import_queue = sc_consensus_pow::import_queue( + Box::new(pow_block_import), + None, + ethash_alg.clone(), + inherent_data_providers, &task_manager.spawn_handle(), config.prometheus_registry(), - sp_consensus::NeverCanAuthor, )?; let (network, network_status_sinks, system_rpc_tx, network_starter) = @@ -386,3 +438,66 @@ pub fn new_light(mut config: Configuration) -> Result Ok(task_manager) } + + +pub async fn run_mining_svc( + worker : Arc>>, + mut commands_stream: CS, +) + where + B: BlockT, + Algorithm: PowAlgorithm, + C: sp_api::ProvideRuntimeApi, + CS: Stream::Hash>> + Unpin + 'static, +{ + let seed_compute = SeedHashCompute::default(); + + while let Some(command) = commands_stream.next().await { + match command { + EtheminerCmd::GetWork { mut sender } => { + let metadata = worker.lock().metadata(); + if let Some(metadata) = metadata { + let nr :u64 = UniqueSaturatedInto::::unique_saturated_into(metadata.number); + let pow_hash:H256 = metadata.pre_hash; + let seed_hash:H256 = seed_compute.hash_block_number(nr).into(); + let tmp:[u8; 32] = metadata.difficulty.into(); + let tmp:[u8; 32] = ethash::difficulty_to_boundary(&EU256::from(tmp)).into(); + let target:H256 = H256::from(tmp); + + let ret = Ok(Work { + pow_hash, + seed_hash, + target, + number: Some(nr), + }); + + ethash_rpc::send_result(&mut sender, ret) + // ethash_rpc::send_result(&mut sender, future.await) + } else { + ethash_rpc::send_result(&mut sender, Err(RpcError::NoWork)) + } + } + EtheminerCmd::SubmitWork { nonce, pow_hash, mix_digest, mut sender } => { + let mut worker = worker.lock(); + let metadata = worker.metadata(); + if let Some(metadata) = metadata { + let non_nr :u64 = UniqueSaturatedInto::::unique_saturated_into(nonce); + let header_nr :u64 = UniqueSaturatedInto::::unique_saturated_into(metadata.number); + let timestamp :u64 = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs(); + let seal = WorkSeal{nonce:non_nr, pow_hash, mix_digest, difficulty:metadata.difficulty, header_nr, timestamp}; + debug!(target:"pow", "worker.submit pow_hash: {}", pow_hash); + worker.submit(seal.encode()); + ethash_rpc::send_result(&mut sender, Ok(true)) + } else { + ethash_rpc::send_result(&mut sender, Err(RpcError::NoMetaData)) + } + + + } + EtheminerCmd::SubmitHashrate { hash, mut sender } => { + + } + } + } +} + diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index a17fc9f6..d61dd634 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -17,7 +17,7 @@ use sp_runtime::traits::{ BlakeTwo256, Block as BlockT, AccountIdLookup, Verify, IdentifyAccount, NumberFor, }; use sp_api::impl_runtime_apis; -use sp_consensus_aura::sr25519::AuthorityId as AuraId; +//use sp_consensus_aura::sr25519::AuthorityId as AuraId; use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList}; use pallet_grandpa::fg_primitives; use sp_version::RuntimeVersion; @@ -95,7 +95,7 @@ pub mod opaque { impl_opaque_keys! { pub struct SessionKeys { - pub aura: Aura, + //pub aura: Aura, pub grandpa: Grandpa, } } @@ -124,7 +124,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { /// up by `pallet_aura` to implement `fn slot_duration()`. /// /// Change this to adjust the block time. -pub const MILLISECS_PER_BLOCK: u64 = 6000; +// :TODO: may need discussion on the minimum time value between blocks +pub const MILLISECS_PER_BLOCK: u64 = 100; //6000; pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; @@ -207,9 +208,9 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; } -impl pallet_aura::Config for Runtime { - type AuthorityId = AuraId; -} +// impl pallet_aura::Config for Runtime { +// type AuthorityId = AuraId; +// } impl pallet_grandpa::Config for Runtime { type Event = Event; @@ -237,7 +238,7 @@ parameter_types! { impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; - type OnTimestampSet = Aura; + type OnTimestampSet = (); type MinimumPeriod = MinimumPeriod; type WeightInfo = (); } @@ -321,23 +322,24 @@ impl pallet_evm::Config for Runtime { type OnChargeTransaction = (); } -pub struct EthereumFindAuthor(PhantomData); -impl> FindAuthor for EthereumFindAuthor -{ - fn find_author<'a, I>(digests: I) -> Option where - I: 'a + IntoIterator - { - if let Some(author_index) = F::find_author(digests) { - let authority_id = Aura::authorities()[author_index as usize].clone(); - return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); - } - None - } -} +// pub struct EthereumFindAuthor(PhantomData); +// impl> FindAuthor for EthereumFindAuthor +// { +// fn find_author<'a, I>(digests: I) -> Option where +// I: 'a + IntoIterator +// { +// if let Some(author_index) = F::find_author(digests) { +// let authority_id = Aura::authorities()[author_index as usize].clone(); +// return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); +// } +// None +// } +// } impl pallet_ethereum::Config for Runtime { type Event = Event; - type FindAuthor = EthereumFindAuthor; + // () means we will never record a block author in the Ethereum-formatted blocks + type FindAuthor = (); //EthereumFindAuthor; type StateRoot = pallet_ethereum::IntermediateStateRoot; } @@ -351,7 +353,7 @@ construct_runtime!( System: frame_system::{Module, Call, Config, Storage, Event}, RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage}, Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, - Aura: pallet_aura::{Module, Config}, + //Aura: pallet_aura::{Module, Config}, Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event}, Balances: pallet_balances::{Module, Call, Storage, Config, Event}, TransactionPayment: pallet_transaction_payment::{Module, Storage}, @@ -473,15 +475,15 @@ impl_runtime_apis! { } } - impl sp_consensus_aura::AuraApi for Runtime { - fn slot_duration() -> u64 { - Aura::slot_duration() - } + // impl sp_consensus_aura::AuraApi for Runtime { + // fn slot_duration() -> u64 { + // Aura::slot_duration() + // } - fn authorities() -> Vec { - Aura::authorities() - } - } + // fn authorities() -> Vec { + // Aura::authorities() + // } + // } impl sp_session::SessionKeys for Runtime { fn generate_session_keys(seed: Option>) -> Vec {