diff --git a/substrate/.gitattributes b/substrate/.gitattributes new file mode 100644 index 0000000000..9a0309f9e5 --- /dev/null +++ b/substrate/.gitattributes @@ -0,0 +1 @@ +Cargo.lock linguist-generated=true -diff diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index f3ddb34c4f..32eb742442 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -31,23 +31,23 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "aio-limited" version = "0.1.0" -source = "git+https://github.com/paritytech/aio-limited.git#1f42497dcd2a6f85b83af97cd80314b26a1e4a9e" +source = "git+https://github.com/paritytech/aio-limited.git#a7c0bd6944902b1c9fb2bcf4f8fe1412c824b5b9" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -117,7 +117,7 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -132,6 +132,11 @@ dependencies = [ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "base-x" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "base58" version = "0.1.0" @@ -139,20 +144,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "base64" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "base64" -version = "0.7.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -160,7 +165,7 @@ name = "bigint" version = "4.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -174,6 +179,16 @@ name = "bitflags" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "blake2" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crypto-mac 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "blake2-rfc" version = "0.2.18" @@ -217,7 +232,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "byteorder" -version = "1.2.6" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -225,7 +240,7 @@ name = "bytes" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -241,16 +256,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cfg-if" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "chashmap" -version = "2.2.1" -source = "git+https://github.com/redox-os/tfs#3e7dcdb0c586d0d8bb3f25bfd948d2f418a4ab10" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "owning_ref 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -278,6 +293,14 @@ dependencies = [ "yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "clear_on_drop" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cloudabi" version = "0.0.3" @@ -301,16 +324,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "core-foundation" -version = "0.2.3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "core-foundation-sys" -version = "0.2.3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", @@ -324,8 +347,8 @@ dependencies = [ "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "criterion-plot 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "criterion-stats 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "isatty 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -340,7 +363,7 @@ name = "criterion-plot" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "cast 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -386,7 +409,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -400,7 +423,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -412,7 +435,7 @@ name = "crossbeam-utils" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -425,6 +448,29 @@ name = "crunchy" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "crunchy" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "crypto-mac" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crypto-mac" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ctr" version = "0.1.1" @@ -443,13 +489,31 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "curve25519-dalek" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "data-encoding" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "datastore" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "base64 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "chashmap 2.2.1 (git+https://github.com/redox-os/tfs)", + "chashmap 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", @@ -474,6 +538,24 @@ dependencies = [ "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "discard" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ed25519-dalek" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "curve25519-dalek 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "either" version = "1.5.0" @@ -503,7 +585,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -524,10 +606,11 @@ dependencies = [ [[package]] name = "eth-secp256k1" version = "0.5.7" -source = "git+https://github.com/paritytech/rust-secp256k1#db81cfea59014b4d176f10f86ed52e1a130b6822" +source = "git+https://github.com/paritytech/rust-secp256k1#ccc06e7480148b723eb44ac56cf4d20eec380b6f" dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -547,22 +630,22 @@ dependencies = [ [[package]] name = "failure" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "failure_derive" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.16 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -584,7 +667,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -593,13 +676,15 @@ dependencies = [ [[package]] name = "fixed-hash" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -695,10 +780,10 @@ name = "globset" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -707,16 +792,16 @@ name = "h2" version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -762,6 +847,15 @@ dependencies = [ "proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hmac" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crypto-mac 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "http" version = "0.1.13" @@ -787,10 +881,10 @@ dependencies = [ [[package]] name = "hyper" -version = "0.10.13" +version = "0.10.15" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -805,7 +899,7 @@ dependencies = [ [[package]] name = "hyper" -version = "0.12.12" +version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -816,14 +910,15 @@ dependencies = [ "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -840,7 +935,7 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -867,7 +962,7 @@ name = "isatty" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -894,10 +989,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "jsonrpc-core" version = "9.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git#207a277b098943864ecaf22dbab7a5e309866d6b" +source = "git+https://github.com/paritytech/jsonrpc.git#a39139f92e7c92bddbd67372c556aad110f02e89" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", @@ -906,12 +1001,12 @@ dependencies = [ [[package]] name = "jsonrpc-http-server" version = "9.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git#207a277b098943864ecaf22dbab7a5e309866d6b" +source = "git+https://github.com/paritytech/jsonrpc.git#a39139f92e7c92bddbd67372c556aad110f02e89" dependencies = [ - "hyper 0.12.12 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.13 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "jsonrpc-server-utils 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -919,7 +1014,7 @@ dependencies = [ [[package]] name = "jsonrpc-macros" version = "9.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git#207a277b098943864ecaf22dbab7a5e309866d6b" +source = "git+https://github.com/paritytech/jsonrpc.git#a39139f92e7c92bddbd67372c556aad110f02e89" dependencies = [ "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "jsonrpc-pubsub 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", @@ -929,23 +1024,23 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" version = "9.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git#207a277b098943864ecaf22dbab7a5e309866d6b" +source = "git+https://github.com/paritytech/jsonrpc.git#a39139f92e7c92bddbd67372c556aad110f02e89" dependencies = [ "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-server-utils" version = "9.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git#207a277b098943864ecaf22dbab7a5e309866d6b" +source = "git+https://github.com/paritytech/jsonrpc.git#a39139f92e7c92bddbd67372c556aad110f02e89" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -955,12 +1050,12 @@ dependencies = [ [[package]] name = "jsonrpc-ws-server" version = "9.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git#207a277b098943864ecaf22dbab7a5e309866d6b" +source = "git+https://github.com/paritytech/jsonrpc.git#a39139f92e7c92bddbd67372c556aad110f02e89" dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "jsonrpc-server-utils 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "ws 0.7.5 (git+https://github.com/tomusdrw/ws-rs)", @@ -1059,132 +1154,137 @@ dependencies = [ [[package]] name = "libp2p" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-dns 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-floodsub 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-identify 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-kad 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-mplex 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-ping 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-ratelimit 0.1.1 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-relay 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-secio 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-tcp-transport 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-transport-timeout 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-uds 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-websocket 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-yamux 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-dns 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-floodsub 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-identify 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-kad 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-mplex 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-peerstore 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-ping 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-ratelimit 0.1.1 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-relay 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-secio 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-tcp-transport 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-transport-timeout 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-uds 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-websocket 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-yamux 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "multiaddr 0.3.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "multihash 0.8.1-pre (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", "stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libp2p-core" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "multihash 0.8.1-pre (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "multistream-select 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "multihash 0.8.1-pre (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "multistream-select 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "smallvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rw-stream-sink 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libp2p-dns" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", "tokio-dns-unofficial 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libp2p-floodsub" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libp2p-identify" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-peerstore 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libp2p-kad" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "bigint 4.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "datastore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "datastore 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-identify 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-ping 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-identify 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-ping 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "multihash 0.8.1-pre (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1192,29 +1292,29 @@ dependencies = [ [[package]] name = "libp2p-mplex" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libp2p-peerstore" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "datastore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "datastore 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "multiaddr 0.3.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1223,69 +1323,76 @@ dependencies = [ [[package]] name = "libp2p-ping" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "multistream-select 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "multistream-select 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libp2p-ratelimit" version = "0.1.1" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "aio-limited 0.1.0 (git+https://github.com/paritytech/aio-limited.git)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libp2p-relay" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "protobuf 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "libp2p-peerstore 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "protobuf 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libp2p-secio" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "aes-ctr 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "asn1_der 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "ctr 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ed25519-dalek 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "hmac 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "rw-stream-sink 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "stdweb 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "twofish 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1293,66 +1400,66 @@ dependencies = [ [[package]] name = "libp2p-tcp-transport" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", "tk-listen 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libp2p-transport-timeout" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libp2p-uds" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "tokio-uds 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "tokio-uds 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libp2p-websocket" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "rw-stream-sink 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", "stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "websocket 0.20.3 (git+https://github.com/tomaka/rust-websocket?branch=send)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "websocket 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libp2p-yamux" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "yamux 0.1.0 (git+https://github.com/paritytech/yamux)", ] @@ -1385,15 +1492,15 @@ name = "log" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "log" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1421,10 +1528,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memchr" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1467,7 +1574,7 @@ dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1480,7 +1587,7 @@ version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1509,11 +1616,13 @@ dependencies = [ [[package]] name = "multiaddr" version = "0.3.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ + "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "multihash 0.8.1-pre (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "data-encoding 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "multihash 0.8.1-pre (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1521,23 +1630,26 @@ dependencies = [ [[package]] name = "multihash" version = "0.8.1-pre" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ + "blake2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "sha1 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "multistream-select" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1556,16 +1668,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "native-tls" -version = "0.1.5" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)", "schannel 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1573,7 +1688,7 @@ name = "net2" version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1585,7 +1700,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1596,7 +1711,7 @@ version = "0.1.0" dependencies = [ "exit-future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "node-executor 0.1.0", "node-primitives 0.1.0", "node-runtime 0.1.0", @@ -1608,6 +1723,7 @@ dependencies = [ "substrate-cli 0.3.0", "substrate-client 0.1.0", "substrate-consensus-aura 0.1.0", + "substrate-keystore 0.1.0", "substrate-network 0.1.0", "substrate-primitives 0.1.0", "substrate-service 0.3.0", @@ -1671,8 +1787,6 @@ dependencies = [ "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "sr-api 0.1.0", - "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", "sr-version 0.1.0", @@ -1689,6 +1803,7 @@ dependencies = [ "srml-timestamp 0.1.0", "srml-treasury 0.1.0", "srml-upgrade-key 0.1.0", + "substrate-client 0.1.0", "substrate-keyring 0.1.0", "substrate-primitives 0.1.0", ] @@ -1756,10 +1871,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "openssl" -version = "0.9.24" +version = "0.10.15" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1767,17 +1883,9 @@ dependencies = [ ] [[package]] -name = "openssl" -version = "0.10.14" +name = "openssl-probe" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "openssl-sys" @@ -1790,6 +1898,11 @@ dependencies = [ "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "owning_ref" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "owning_ref" version = "0.3.3" @@ -1818,7 +1931,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1868,7 +1981,17 @@ name = "parity-wasm" version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "owning_ref 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1980,7 +2103,7 @@ dependencies = [ [[package]] name = "protobuf" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1996,8 +2119,8 @@ name = "pwasm-utils" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2021,7 +2144,7 @@ dependencies = [ [[package]] name = "quote" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2119,11 +2242,11 @@ name = "regex" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2131,11 +2254,11 @@ name = "regex" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2143,7 +2266,7 @@ name = "regex-syntax" version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ucd-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2151,7 +2274,7 @@ name = "regex-syntax" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ucd-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2229,11 +2352,11 @@ dependencies = [ [[package]] name = "rw-stream-sink" version = "0.1.0" -source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +source = "git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5#d961e656a74d1bab5366d371a06f9e10d5f4a6c5" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2254,6 +2377,11 @@ name = "safemem" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "safemem" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "schannel" version = "0.1.14" @@ -2275,21 +2403,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "security-framework" -version = "0.1.16" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "security-framework-sys" -version = "0.1.16" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2317,8 +2445,8 @@ version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.12 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2431,11 +2559,6 @@ dependencies = [ "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "smallvec" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "smallvec" version = "0.6.5" @@ -2444,16 +2567,6 @@ dependencies = [ "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "sr-api" -version = "0.1.0" -dependencies = [ - "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "sr-primitives 0.1.0", - "sr-std 0.1.0", - "sr-version 0.1.0", -] - [[package]] name = "sr-io" version = "0.1.0" @@ -2473,7 +2586,7 @@ name = "sr-primitives" version = "0.1.0" dependencies = [ "integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2525,7 +2638,6 @@ dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -2543,7 +2655,6 @@ dependencies = [ "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -2561,7 +2672,6 @@ dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -2580,7 +2690,6 @@ dependencies = [ "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", "pwasm-utils 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-sandbox 0.1.0", @@ -2601,7 +2710,6 @@ dependencies = [ "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -2621,7 +2729,6 @@ dependencies = [ "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -2639,7 +2746,6 @@ dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -2657,7 +2763,6 @@ dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -2667,6 +2772,18 @@ dependencies = [ "substrate-primitives 0.1.0", ] +[[package]] +name = "srml-metadata" +version = "0.1.0" +dependencies = [ + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", +] + [[package]] name = "srml-session" version = "0.1.0" @@ -2676,7 +2793,6 @@ dependencies = [ "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -2696,7 +2812,6 @@ dependencies = [ "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -2724,7 +2839,7 @@ dependencies = [ "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", - "substrate-metadata 0.1.0", + "srml-metadata 0.1.0", ] [[package]] @@ -2736,7 +2851,6 @@ dependencies = [ "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -2752,7 +2866,6 @@ dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -2770,7 +2883,6 @@ dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -2788,7 +2900,6 @@ dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -2803,11 +2914,60 @@ name = "stable_deref_trait" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "static_assertions" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "stdweb" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "stdweb" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "discard 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "stdweb-derive 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "stdweb-internal-macros 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "stdweb-internal-runtime 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "stdweb-derive" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "stdweb-internal-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base-x 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "stdweb-internal-runtime" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "stream-cipher" version = "0.1.1" @@ -2861,14 +3021,13 @@ dependencies = [ "fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "substrate-client 0.1.0", "substrate-network 0.1.0", - "substrate-network-libp2p 0.1.0", "substrate-primitives 0.1.0", "substrate-service 0.3.0", "substrate-telemetry 0.3.0", @@ -2889,12 +3048,13 @@ dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sr-api 0.1.0", "sr-primitives 0.1.0", + "sr-std 0.1.0", + "sr-version 0.1.0", "substrate-consensus-common 0.1.0", "substrate-executor 0.1.0", "substrate-keyring 0.1.0", @@ -2913,7 +3073,7 @@ dependencies = [ "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2975,7 +3135,7 @@ dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "exit-future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3000,11 +3160,11 @@ name = "substrate-executor" version = "0.1.0" dependencies = [ "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3025,8 +3185,8 @@ version = "0.1.0" dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sr-api 0.1.0", "sr-primitives 0.1.0", + "substrate-client 0.1.0", "substrate-primitives 0.1.0", ] @@ -3037,7 +3197,7 @@ dependencies = [ "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "finality-grandpa 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3077,16 +3237,6 @@ dependencies = [ "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "substrate-metadata" -version = "0.1.0" -dependencies = [ - "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "substrate-network" version = "0.1.0" @@ -3096,7 +3246,7 @@ dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3122,8 +3272,8 @@ dependencies = [ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "libp2p 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3131,7 +3281,7 @@ dependencies = [ "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3142,9 +3292,9 @@ version = "0.1.0" dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", "hash256-std-hasher 0.9.0 (git+https://github.com/paritytech/trie)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3159,7 +3309,7 @@ dependencies = [ "sr-std 0.1.0", "substrate-serializer 0.1.0", "twox-hash 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3174,10 +3324,11 @@ dependencies = [ "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "jsonrpc-macros 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "jsonrpc-pubsub 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "sr-version 0.1.0", "substrate-client 0.1.0", @@ -3196,7 +3347,7 @@ dependencies = [ "jsonrpc-http-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "jsonrpc-pubsub 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "jsonrpc-ws-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "substrate-rpc 0.1.0", @@ -3218,7 +3369,7 @@ dependencies = [ "exit-future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3265,7 +3416,7 @@ name = "substrate-state-db" version = "0.1.0" dependencies = [ "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3279,7 +3430,7 @@ dependencies = [ "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-primitives 0.1.0", @@ -3293,7 +3444,7 @@ name = "substrate-telemetry" version = "0.3.0" dependencies = [ "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3313,6 +3464,7 @@ dependencies = [ "substrate-executor 0.1.0", "substrate-keyring 0.1.0", "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", "substrate-test-runtime 0.1.0", ] @@ -3321,17 +3473,17 @@ name = "substrate-test-runtime" version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "sr-api 0.1.0", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", "sr-version 0.1.0", "srml-support 0.1.0", + "substrate-client 0.1.0", "substrate-keyring 0.1.0", "substrate-primitives 0.1.0", ] @@ -3343,7 +3495,7 @@ dependencies = [ "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3357,7 +3509,7 @@ version = "0.1.0" dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", @@ -3390,6 +3542,11 @@ name = "subtle" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "subtle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "syn" version = "0.13.11" @@ -3406,28 +3563,28 @@ version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "syn" -version = "0.15.12" +version = "0.15.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "synstructure" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.16 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3436,7 +3593,7 @@ name = "sysinfo" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3466,7 +3623,7 @@ name = "tempfile" version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3509,6 +3666,16 @@ dependencies = [ "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "thread-id" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "thread-scoped" version = "1.0.2" @@ -3546,9 +3713,9 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3562,14 +3729,14 @@ dependencies = [ "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-fs 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-fs 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-uds 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-uds 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3579,7 +3746,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3590,12 +3757,12 @@ dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3630,22 +3797,22 @@ dependencies = [ [[package]] name = "tokio-fs" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-io" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3656,13 +3823,13 @@ dependencies = [ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3674,19 +3841,19 @@ dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-threadpool" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3705,13 +3872,12 @@ dependencies = [ [[package]] name = "tokio-tls" -version = "0.1.4" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3721,26 +3887,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-uds" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3828,16 +3994,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ucd-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "uint" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3922,7 +4088,7 @@ dependencies = [ [[package]] name = "utf8-ranges" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -3982,7 +4148,7 @@ version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3991,7 +4157,7 @@ name = "wasmi" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3999,21 +4165,21 @@ dependencies = [ [[package]] name = "websocket" -version = "0.20.3" -source = "git+https://github.com/tomaka/rust-websocket?branch=send#28ea5eb82b573bf3ace2fc75c36d791bcedf08b1" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)", - "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tls 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4069,7 +4235,7 @@ name = "ws" version = "0.7.5" source = "git+https://github.com/tomusdrw/ws-rs#f12d19c4c19422fc79af28a3181f598bc07ecd1e" dependencies = [ - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4085,13 +4251,13 @@ name = "ws" version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.10.14 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4120,23 +4286,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "yamux" version = "0.1.0" -source = "git+https://github.com/paritytech/yamux#5c0d19af3bc59a12c2e45d18798350dd00746481" +source = "git+https://github.com/paritytech/yamux#966f2730f7a32150f282eef29fd2aecb14d7b9fa" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "nohash-hasher 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [metadata] "checksum aes-ctr 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f65958ff3692041c36fc009261ccd63f24cd8e0dc1164266f068c2387e8b4e4f" "checksum aes-soft 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67cc03b0a090a05cb01e96998a01905d7ceedce1bc23b756c0bb7faa0682ccb1" "checksum aesni 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6810b7fb9f2bb4f76f05ac1c170b8dde285b6308955dc3afd89710268c958d9e" -"checksum aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "68f56c7353e5a9547cbd76ed90f7bb5ffc3ba09d4ea9bd1d8c06c8b1142eeb5a" +"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e" "checksum aio-limited 0.1.0 (git+https://github.com/paritytech/aio-limited.git)" = "" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" @@ -4148,31 +4314,34 @@ dependencies = [ "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" "checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" "checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0" +"checksum base-x 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5cda5d0f5584d129112ad8bf4775b9fd2b9f1e30738c7b1a25314ba2244d6a51" "checksum base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" -"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" "checksum base64 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5032d51da2741729bfdaeb2664d9b8c6d9fd1e2b90715c660b6def36628499c2" +"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" "checksum bigint 4.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ebecac13b3c745150d7b6c3ea7572d372f09d627c2077e893bf26c5c7f70d282" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" +"checksum blake2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73b77e29dbd0115e43938be2d5128ecf81c0353e00acaa65339a1242586951d9" "checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" "checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" "checksum block-cipher-trait 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "370424437b9459f3dfd68428ed9376ddfe03d8b70ede29cc533b3557df186ab4" "checksum bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0de79cfb98e7aa9988188784d8664b4b5dad6eaaa0863b91d9a4ed871d4f7a42" "checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" "checksum byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96c8b41881888cc08af32d47ac4edd52bc7fa27fef774be47a92443756451304" -"checksum byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "90492c5858dd7d2e78691cfb89f90d273a2800fc11d98f60786e5d87e2f83781" +"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d" "checksum bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0ce55bd354b095246fc34caf4e9e242f5297a7fd938b090cadfea6eee614aa62" "checksum cast 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "011941fb53da1a8ac3e4132a1becc367c44fe13f630769f3143d8c66c91c6cb6" "checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16" -"checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3" -"checksum chashmap 2.2.1 (git+https://github.com/redox-os/tfs)" = "" +"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" +"checksum chashmap 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "47e651a8c1eb0cbbaa730f705e2531e75276c6f2bbe2eb12662cfd305213dff8" "checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" "checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" +"checksum clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "97276801e127ffb46b66ce23f35cc96bd454fa311294bced4bbace7baa8b1d17" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "6ec65ee4f9c9d16f335091d23693457ed4928657ba4982289d7fafee03bc614a" "checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" -"checksum core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25bfd746d203017f7d5cbd31ee5d8e17f94b6521c7af77ece6c9e4b2d4b16c67" -"checksum core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "065a5d7ffdcbc8fa145d6f0746f3555025b9097a9e9cda59f7467abae670c78d" +"checksum core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "286e0b41c3a20da26536c6000a280585d519fd07b3956b43aed8a79e9edce980" +"checksum core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "716c271e8613ace48344f723b60b900a93150271e5be206212d052bbc0883efa" "checksum criterion 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f58b0200bf321214bdda8c797cf0071bcc638171c40ec198c3f652a4edaacde3" "checksum criterion-plot 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "885431f7865f9d4956b466126674e5ea40a0f193d42157e56630c356c5501957" "checksum criterion-stats 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c71521cb4c7b7eac76b540e75447fb0172c4234d6333729001b886aaa21d6da4" @@ -4184,12 +4353,19 @@ dependencies = [ "checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" "checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015" "checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" +"checksum crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c240f247c278fa08a6d4820a6a222bfc6e0d999e51ba67be94f44c905b2161f2" +"checksum crypto-mac 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0999b4ff4d3446d4ddb19a63e9e00c1876e75cd7000d20e57a693b4b3f08d958" +"checksum crypto-mac 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7afa06d05a046c7a47c3a849907ec303504608c927f4e85f7bfff22b7180d971" "checksum ctr 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4b669fcb8e20124db86dbd9b01e74ec0e9e420e65381311ce5249864fc7ff0c0" "checksum ctrlc 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "630391922b1b893692c6334369ff528dcc3a9d8061ccf4c803aa8f83cb13db5e" -"checksum datastore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum curve25519-dalek 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3eacf6ff1b911e3170a8c400b402e10c86dc3cb166bd69034ebbc2b785fea4c2" +"checksum data-encoding 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "67df0571a74bf0d97fb8b2ed22abdd9a48475c96bd327db968b7d9cace99655e" +"checksum datastore 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" "checksum difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3304d19798a8e067e48d8e69b2c37f0b5e9b4e462504ad9e27e9f3fce02bba8" "checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" "checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90" +"checksum discard 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" +"checksum ed25519-dalek 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cd66d8a16ef71c23cf5eeb2140d8d3cd293457c6c7fd6804b593397a933fcf1e" "checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" "checksum elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88d4851b005ef16de812ea9acdb7bece2f0a40dd86c07b85631d7dafa54537bb" "checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" @@ -4199,12 +4375,12 @@ dependencies = [ "checksum eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)" = "" "checksum etrace 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f17311e68ea07046ee809b8513f6c259518bc10173681d98c21f8c3926f56f40" "checksum exit-future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9aa7b56cef68c4182db7212dece19cc9f6e2916cf9412e57e6cea53ec02f316d" -"checksum failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7efb22686e4a466b1ec1a15c2898f91fa9cb340452496dca654032de20ff95b9" -"checksum failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "946d0e98a50d9831f5d589038d2ca7f8f455b1c21028c0db0e84116a12696426" +"checksum failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6dd377bcc1b1b7ce911967e3ec24fa19c3224394ec05b54aa7b083d498341ac7" +"checksum failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "64c2d913fe8ed3b6c6518eedf4538255b989945c14c2a7d5cbff62a5e2120596" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" "checksum finality-grandpa 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "be6d2735e8f570474c7925a60ebe04ec0bdd9eea7cc4fddab78a0ecfdefec20e" -"checksum fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d5ec8112f00ea8a483e04748a85522184418fd1cf02890b626d8fc28683f7de" +"checksum fixed-hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a557e80084b05c32b455963ff565a9de6f2866da023d6671705c6aff6f65e01c" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" @@ -4225,13 +4401,14 @@ dependencies = [ "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4da5f0e01bd8a71a224a4eedecaacfcabda388dbb7a80faf04d3514287572d95" "checksum hex-literal-impl 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1d340b6514f232f6db1bd16db65302a5278a04fef9ce867cb932e7e5fa21130a" +"checksum hmac 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "733e1b3ac906631ca01ebb577e9bb0f5e37a454032b9036b5eaea4013ed6f99a" "checksum http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "24f58e8c2d8e886055c3ead7b28793e1455270b5fb39650984c224bc538ba581" "checksum httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83" "checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e" -"checksum hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)" = "368cb56b2740ebf4230520e2b90ebb0461e69034d85d1945febd9b3971426db2" -"checksum hyper 0.12.12 (registry+https://github.com/rust-lang/crates.io-index)" = "4aca412c241a2dd53af261efc7adf7736fdebd67dc0d1cc1ffdbcb9407e0e810" +"checksum hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)" = "df0caae6b71d266b91b4a83111a61d2b94ed2e2bea024c532b933dcff867e58c" +"checksum hyper 0.12.13 (registry+https://github.com/rust-lang/crates.io-index)" = "95ffee0d1d30de4313fdaaa485891ce924991d45bbc18adfc8ac5b1639e62fbb" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -"checksum indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08173ba1e906efb6538785a8844dd496f5d34f0a2d88038e95195172fc667220" +"checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" "checksum integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ea155abb3ba6f382a75f1418988c05fe82959ed9ce727de427f9cfd425b0c903" "checksum interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "141340095b15ed7491bd3d4ced9d20cebfb826174b6bb03386381f62b01e3d77" "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" @@ -4256,32 +4433,32 @@ dependencies = [ "checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0" "checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" "checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2" -"checksum libp2p 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-dns 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-floodsub 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-identify 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-kad 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-mplex 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-ping 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-ratelimit 0.1.1 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-relay 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-secio 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-tcp-transport 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-transport-timeout 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-uds 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-websocket 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum libp2p-yamux 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-core 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-dns 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-floodsub 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-identify 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-kad 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-mplex 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-peerstore 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-ping 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-ratelimit 0.1.1 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-relay 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-secio 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-tcp-transport 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-transport-timeout 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-uds 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-websocket 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum libp2p-yamux 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" "checksum linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e" "checksum local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1ceb20f39ff7ae42f3ff9795f3986b1daad821caaa1e1732a0944103a5a1a66" "checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -"checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f" +"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" "checksum mashup 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f2d82b34c7fb11bb41719465c060589e291d505ca4735ea30016a91f6fc79c3b" "checksum mashup-impl 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "aa607bfb674b4efb310512527d64266b065de3f894fc52f84efcbf7eaa5965fb" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -"checksum memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b3629fe9fdbff6daa6c33b90f7c08355c1aca05a3d01fa8063b822fcf185f3b" +"checksum memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0a3eb002f0535929f1199681417029ebea04aadc0c7a4224b46be99c7f5d6a16" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" "checksum memory-db 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" @@ -4290,12 +4467,12 @@ dependencies = [ "checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" "checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -"checksum multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum multihash 0.8.1-pre (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" -"checksum multistream-select 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum multiaddr 0.3.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum multihash 0.8.1-pre (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" +"checksum multistream-select 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" "checksum names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef320dab323286b50fb5cdda23f61c796a72a89998ab565ca32525c5c556f2da" "checksum nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34d4f00fcc2f4c9efa8cc971db0da9e28290e28e97af47585e48691ef10ff31f" -"checksum native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f74dbadc8b43df7864539cedb7bc91345e532fdd913cfdc23ad94f4d2d40fbc0" +"checksum native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ff8e08de0070bbf4c31f452ea2a70db092f36f6f2e4d897adf5674477d488fb2" "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" @@ -4307,9 +4484,10 @@ dependencies = [ "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" "checksum ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2c49021782e5233cd243168edfa8037574afed4eba4bbaf538b3d8d1789d8c" "checksum opaque-debug 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d620c9c26834b34f039489ac0dfdb12c7ac15ccaf818350a64c9b5334a452ad7" -"checksum openssl 0.10.14 (registry+https://github.com/rust-lang/crates.io-index)" = "6285ab297861546af7a2753593b3160bfc09f0ab9d1f5bb009e39d81a169b499" -"checksum openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "a3605c298474a3aa69de92d21139fb5e2a81688d308262359d85cdd0d12a7985" +"checksum openssl 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)" = "5e1309181cdcbdb51bc3b6bedb33dfac2a83b3d585033d3f6d9e22e8c1928613" +"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" "checksum openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)" = "278c1ad40a89aa1e741a1eed089a2f60b18fab8089c3139b542140fc7d674106" +"checksum owning_ref 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9d52571ddcb42e9c900c901a18d8d67e393df723fcd51dd59c5b1a85d0acb6cc" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5168b4cf41f3835e4bc6ffb32f51bc9365dc50cb351904595b3931d917fd0c" "checksum parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dca389ea5e1632c89b2ce54f7e2b4a8a8c9d278042222a91e0bf95451218cb4c" @@ -4319,6 +4497,7 @@ dependencies = [ "checksum parity-rocksdb-sys 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0e59eda423021494a6cf1be74f6989add403f53157409993f794e17b123cab51" "checksum parity-snappy-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c2086caac40c79289cb70d7e1c64f5888e1c53f5d38399d3e95101493739f423" "checksum parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)" = "511379a8194230c2395d2f5fa627a5a7e108a9f976656ce723ae68fca4097bfc" +"checksum parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "fa12d706797d42551663426a45e2db2e0364bd1dbf6aeada87e89c5f981f43e9" "checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" "checksum parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4d05f1349491390b1730afba60bb20d55761bef489a954546b58b4b34e1e2ac" "checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" @@ -4332,13 +4511,13 @@ dependencies = [ "checksum proc-macro-hack-impl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2b753ad9ed99dd8efeaa7d2fb8453c8f6bc3e54b97966d35f1bc77ca6865254a" "checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7" "checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" -"checksum protobuf 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56c363dfc36e450457f4fa05a91d8c3f0fed00fc21142b4ce2cb7b525675eaeb" +"checksum protobuf 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8e95ac45a1e122e1b62c3f23bbe51574c39d06d1c8c5a2a5676de497d0a84a34" "checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07" "checksum pwasm-utils 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "efd695333cfae6e9dbe2703a6d040e252b57a6fc3b9a65c712615ac042b2e0c5" "checksum quick-error 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5fb6ccf8db7bbcb9c2eae558db5ab4f3da1c2a87e4e597ed394726bc8ea6ca1d" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" -"checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5" +"checksum quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "63b5829244f52738cfee93b3a165c1911388675be000c888d2fae620dee8fa5b" "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" "checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd" "checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" @@ -4362,15 +4541,16 @@ dependencies = [ "checksum rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "403bb3a286107a04825a5f82e1270acc1e14028d3d554d7a1e08914549575ab8" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum rw-stream-sink 0.1.0 (git+https://github.com/libp2p/rust-libp2p?rev=d961e656a74d1bab5366d371a06f9e10d5f4a6c5)" = "" "checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" "checksum safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f7bf422d23a88c16d5090d455f182bc99c60af4df6a345c63428acf5129e347" "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" +"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" "checksum schannel 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "0e1a231dc10abf6749cfa5d7767f25888d484201accbd919b66ab5413c502d56" "checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" -"checksum security-framework 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "dfa44ee9c54ce5eecc9de7d5acbad112ee58755239381f687e564004ba4a2332" -"checksum security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "5421621e836278a0b139268f36eee0dc7e389b784dc3f79d8f11aabadf41bead" +"checksum security-framework 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "697d3f3c23a618272ead9e1fb259c1411102b31c6af8b93f1d64cca9c3b0e8e0" +"checksum security-framework-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab01dfbe5756785b5b4d46e0289e5a18071dfa9a7c2b24213ea00b9ef9b665bf" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "15c141fc7027dd265a47c090bf864cf62b42c4d228bbcf4e51a0c9e2b0d3f7ef" @@ -4389,18 +4569,23 @@ dependencies = [ "checksum slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e544d16c6b230d84c866662fe55e31aacfca6ae71e6fc49ae9a311cb379bfc2f" "checksum slog-json 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddd14b8df2df39378b3e933c79784350bf715b11444d99f903df0253bbe524e5" "checksum slog-scope 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "053344c94c0e2b22da6305efddb698d7c485809427cf40555dc936085f67a9df" -"checksum smallvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1347484b6f8bc4b32a9323d9800b6d934376391002ad9c528cc659fe8afc08ee" "checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +"checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" +"checksum stdweb 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "22203527a18dc1c5c83bbd247fb005f5877d040783b6626571d6b7ed7a6f5e75" +"checksum stdweb-derive 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e21ebd9179de08f2300a65454268a17ea3de204627458588c84319c4def3930" +"checksum stdweb-internal-macros 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bcbc9155af9606d44c740197d7d6672b49c4ee93a176c7cecde8b49322677604" +"checksum stdweb-internal-runtime 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b74fe9de4c0d07e91987f4d798b95f27f3cb7769fbc222fa951fa386908297b5" "checksum stream-cipher 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "30dc6118470d69ce0fdcf7e6f95e95853f7f4f72f80d835d4519577c323814ab" "checksum string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00caf261d6f90f588f8450b8e1230fa0d5be49ee6140fdfbcb55335aff350970" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum subtle 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc7f6353c2ee5407358d063a14cccc1630804527090a6fb5a9489ce4924280fb" +"checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" "checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b" "checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" -"checksum syn 0.15.12 (registry+https://github.com/rust-lang/crates.io-index)" = "34ab9797e47d24cb76b8dc4d24ff36807018c7cc549c4cba050b068be0c586b0" -"checksum synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85bb9b7550d063ea184027c9b8c20ac167cd36d3e06b3a40bceb9d746dc1a7b7" +"checksum syn 0.15.16 (registry+https://github.com/rust-lang/crates.io-index)" = "0b78d53b5e1b6e63129140b1336877c3bddbae398c7956150396bdad0e28676c" +"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" "checksum sysinfo 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "11c5f6e8a7a7146f26ffed9a5ff8bab2706f1ac8a413a415e1d211b819d5c24d" "checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" "checksum target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c63f48baada5c52e65a29eef93ab4f8982681b67f9e8d29c7b05abcfec2b9ffe" @@ -4410,6 +4595,7 @@ dependencies = [ "checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" +"checksum thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" "checksum thread-scoped 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bcbb6aa301e5d3b0b5ef639c9a9c7e2f1c944f177b460c04dc24c69b1fa2bd99" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" @@ -4421,15 +4607,15 @@ dependencies = [ "checksum tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f90fcd90952f0a496d438a976afba8e5c205fb12123f813d8ab3aa1c8436638c" "checksum tokio-dns-unofficial 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bb9bf62ca2c53bf2f2faec3e48a98b6d8c9577c27011cb0203a4beacdc8ab328" "checksum tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c117b6cf86bb730aab4834f10df96e4dd586eff2c3c27d3781348da49e255bde" -"checksum tokio-fs 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b5cbe4ca6e71cb0b62a66e4e6f53a8c06a6eefe46cc5f665ad6f274c9906f135" -"checksum tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "8b8a85fffbec3c5ab1ab62324570230dcd37ee5996a7859da5caf7b9d45e3e8c" +"checksum tokio-fs 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "60ae25f6b17d25116d2cba342083abe5255d3c2c79cb21ea11aa049c53bf7c75" +"checksum tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "7392fe0a70d5ce0c882c4778116c519bd5dbaa8a7c3ae3d04578b3afafdcda21" "checksum tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4b26fd37f1125738b2170c80b551f69ff6fecb277e6e5ca885e53eec2b005018" "checksum tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ad235e9dadd126b2d47f6736f65aa1fdcd6420e66ca63f44177bc78df89f912" -"checksum tokio-threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bbd8a8b911301c60cbfaa2a6588fb210e5c1038375b8bdecc47aa09a94c3c05f" +"checksum tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3929aee321c9220ed838ed6c3928be7f9b69986b0e3c22c972a66dbf8a298c68" "checksum tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "3a52f00c97fedb6d535d27f65cccb7181c8dd4c6edc3eda9ea93f6d45d05168e" -"checksum tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "772f4b04e560117fe3b0a53e490c16ddc8ba6ec437015d91fa385564996ed913" +"checksum tokio-tls 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e53fdbf3156f588be1676022fe794232b24922d426e8c14f4e46891c1e31c440" "checksum tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "da941144b816d0dcda4db3a1ba87596e4df5e860a72b70783fe435891f80601c" -"checksum tokio-uds 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "22e3aa6d1fcc19e635418dc0a30ab5bd65d347973d6f43f1a37bf8d9d1335fc9" +"checksum tokio-uds 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "df195376b43508f01570bacc73e13a1de0854dc59e79d1ec09913e8db6dd2a70" "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" "checksum trie-bench 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum trie-db 0.9.0 (git+https://github.com/paritytech/trie)" = "" @@ -4440,8 +4626,8 @@ dependencies = [ "checksum twox-hash 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4f85be565a110ed72ed7048cf56570db04ce0a592c98aa59b7dacde3e5718750" "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" -"checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" -"checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" +"checksum ucd-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d0f8bfa9ff0cadcd210129ad9d2c5f145c13e9ced3d3e5d948a6213487d52444" +"checksum uint 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "082df6964410f6aa929a61ddfafc997e4f32c62c22490e439ac351cec827f436" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d3218ea14b4edcaccfa0df0a64a3792a2c32cc706f1b336e48867f9d3147f90" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" @@ -4453,7 +4639,7 @@ dependencies = [ "checksum unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5fb8abc4b7d8158bdfbbaaccc35331ed3c30c2673e99000d7ae665a2eb6576f4" "checksum untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f392d7819dbe58833e26872f5f6f0d68b7bbbe90fc3667e98731c4a15ad9a7ae" "checksum url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2a321979c09843d272956e73700d12c4e7d3d92b2ee112b31548aef0d4efc5a6" -"checksum utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd70f467df6810094968e2fce0ee1bd0e87157aceb026a8c083bcf5e25b9efe4" +"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737" "checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum vergen 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "93fb2d57fbc535fcd45548c99b141d2d960995daaf04b864c4d9fe1ea011c819" @@ -4463,7 +4649,7 @@ dependencies = [ "checksum wabt-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ca77c6b934a2b32618941b2f565aac43b8cb7141378c3b4fba4d8fcdcd57da3" "checksum want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "797464475f30ddb8830cc529aaaae648d581f99e2036a928877dfde027ddf6b3" "checksum wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d184c4b7081f30316f74f8d73c197314dcb56ea7af9323522b42a2fa9cb19453" -"checksum websocket 0.20.3 (git+https://github.com/tomaka/rust-websocket?branch=send)" = "" +"checksum websocket 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c9faed2bff8af2ea6b9f8b917d3d00b467583f6781fe3def174a9e33c879703" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" diff --git a/substrate/Cargo.toml b/substrate/Cargo.toml index 899c9cedfb..7be891ec59 100644 --- a/substrate/Cargo.toml +++ b/substrate/Cargo.toml @@ -33,7 +33,6 @@ members = [ "core/primitives", "core/rpc", "core/rpc-servers", - "core/sr-api", "core/sr-io", "core/sr-sandbox", "core/sr-std", @@ -77,6 +76,7 @@ exclude = [ "core/executor/wasm", "pwasm-alloc", "core/test-runtime/wasm", + "test-utils/chain-spec-builder" ] [badges] diff --git a/substrate/Dockerfile b/substrate/Dockerfile index 4e365fe43e..f7a36f2a5b 100644 --- a/substrate/Dockerfile +++ b/substrate/Dockerfile @@ -1,12 +1,12 @@ -FROM frolvlad/alpine-glibc AS builder +FROM alpine:edge AS builder LABEL maintainer="chevdor@gmail.com" LABEL description="This is the build stage for Substrate. Here we create the binary." RUN apk add build-base \ cmake \ linux-headers \ - openssl-dev && \ - apk add --repository http://nl.alpinelinux.org/alpine/edge/community cargo + openssl-dev \ + cargo ARG PROFILE=release WORKDIR /substrate @@ -17,7 +17,7 @@ RUN cargo build --$PROFILE # ===== SECOND STAGE ====== -FROM alpine:3.8 +FROM alpine:edge LABEL maintainer="chevdor@gmail.com" LABEL description="This is the 2nd stage: a very small image where we copy the Substrate binary." ARG PROFILE=release diff --git a/substrate/README.adoc b/substrate/README.adoc index 8ca0512976..d832b58313 100644 --- a/substrate/README.adoc +++ b/substrate/README.adoc @@ -227,7 +227,36 @@ Or you can join the BBQ Birch Testnet with: [source, shell] cargo run -include::doc/packages/packages.adoc[] +Detailed logs may be shown by running the node with the following environment variables set: `RUST_LOG=debug RUST_BACKTRACE=1 cargo run -- --dev`. + +If you want to see the multi-node consensus algorithm in action locally, then you can create a local testnet with two validator nodes for Alice and Bob, who are the initial authorities of the genesis chain specification that have been endowed with a testnet DOTs. We'll give each node a name and expose them so they are listed on [Telemetry](https://telemetry.polkadot.io/#/Local%20Testnet). You'll need two terminals windows open. + +We'll start Alice's substrate node first on default TCP port 30333 with her chain database stored locally at `/tmp/alice`. The Bootnode ID of her node is `QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN`, which is generated from the `--node-key` value that we specify below: + +[source, shell] +cargo run -- \ + --base-path /tmp/alice \ + --chain=local \ + --key Alice \ + --name "ALICE" \ + --node-key 0000000000000000000000000000000000000000000000000000000000000001 \ + --telemetry-url ws://telemetry.polkadot.io:1024 \ + --validator + +In the second terminal, we'll run the following to start Bob's substrate node on a different TCP port of 30334, and with his chain database stored locally at `/tmp/bob`. We'll specify a value for the `--bootnodes` option that will connect his node to Alice's Bootnode ID on TCP port 30333: + +[source, shell] +cargo run -- \ + --base-path /tmp/bob \ + --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN \ + --chain=local \ + --key Bob \ + --name "BOB" \ + --port 30334 \ + --telemetry-url ws://telemetry.polkadot.io:1024 \ + --validator + +Additional Substate CLI usage options are available and may be shown by running `cargo run -- --help`. == Documentation @@ -240,13 +269,16 @@ You can generate documentation for a Substrate Rust package and have it automati cargo doc --package --open ``` -Replacing `` with one of the following (i.e. `cargo doc --package node-cli --open`): +Replacing `` with one of the following (i.e. `cargo doc --package substrate --open`): +* All Substrate Packages +[source, shell] +substrate * Substrate Core [source, shell] -substrate, substrate-bft, substrate-cli, substrate-client, substrate-client-db, -substrate-executor, substrate-finality-grandpa, substrate-keyring, substrate-keystore, -substrate-metadata, substrate-misbehavior-check, substrate-network, +substrate, substrate-cli, substrate-client, substrate-client-db, +substrate-consensus-common, substrate-consensus-rhd, +substrate-executor, substrate-finality-grandpa, substrate-keyring, substrate-keystore, substrate-network, substrate-network-libp2p, substrate-primitives, substrate-rpc, substrate-rpc-servers, substrate-serializer, substrate-service, substrate-service-test, substrate-state-db, substrate-state-machine, substrate-telemetry, substrate-test-client, @@ -257,17 +289,16 @@ substrate-trie sr-api, sr-io, sr-primitives, sr-sandbox, sr-std, sr-version * Substrate Runtime Module Library (SRML) [source, shell] -srml-balances, srml-consensus, srml-contract, srml-council, srml-democracy, srml-example, -srml-executive, srml-session, srml-staking, srml-support, srml-system, srml-timestamp, +srml-assets, srml-balances, srml-consensus, srml-contract, srml-council, srml-democracy, srml-example, +srml-executive, srml-metadata, srml-session, srml-staking, srml-support, srml-system, srml-timestamp, srml-treasury * Node [source, shell] -node-cli, node-consensus, node-executor, node-network, node-primitives, node-runtime, node-service +node-cli, node-consensus, node-executor, node-network, node-primitives, node-runtime * Subkey [source, shell] subkey - === Contributing to documentation for Substrate packages https://doc.rust-lang.org/1.9.0/book/documentation.html[Document source code] for Substrate packages by annotating the source code with documentation comments. diff --git a/substrate/core/cli/Cargo.toml b/substrate/core/cli/Cargo.toml index 4fc17e34cb..1552791b26 100644 --- a/substrate/core/cli/Cargo.toml +++ b/substrate/core/cli/Cargo.toml @@ -25,7 +25,6 @@ exit-future = "0.1" sysinfo = "0.6.2" substrate-client = { path = "../../core/client" } substrate-network = { path = "../../core/network" } -substrate-network-libp2p = { path = "../../core/network-libp2p" } sr-primitives = { path = "../../core/sr-primitives" } substrate-primitives = { path = "../../core/primitives" } substrate-service = { path = "../../core/service" } diff --git a/substrate/core/cli/README.adoc b/substrate/core/cli/README.adoc index f847930dab..fc58908fdf 100644 --- a/substrate/core/cli/README.adoc +++ b/substrate/core/cli/README.adoc @@ -1,13 +1,6 @@ = Substrate CLI -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description Substrate CLI library include::doc/shell-completion.adoc[] diff --git a/substrate/core/cli/src/informant.rs b/substrate/core/cli/src/informant.rs index 85d82132b4..5912da8126 100644 --- a/substrate/core/cli/src/informant.rs +++ b/substrate/core/cli/src/informant.rs @@ -30,9 +30,8 @@ use runtime_primitives::traits::{Header, As}; const TIMER_INTERVAL_MS: u64 = 5000; /// Spawn informant on the event loop -pub fn start(service: &Service, exit: ::exit_future::Exit, handle: TaskExecutor) - where - C: Components, +pub fn start(service: &Service, exit: ::exit_future::Exit, handle: TaskExecutor) where + C: Components, { let interval = Interval::new(Instant::now(), Duration::from_millis(TIMER_INTERVAL_MS)); @@ -121,4 +120,3 @@ fn speed(best_number: u64, last_number: Option) -> String { format!(" {:4.1} bps", speed / 10.0) } } - diff --git a/substrate/core/cli/src/lib.rs b/substrate/core/cli/src/lib.rs index 59d653bfed..8aec489457 100644 --- a/substrate/core/cli/src/lib.rs +++ b/substrate/core/cli/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Substrate CLI library. -// end::description[] #![warn(missing_docs)] #![warn(unused_extern_crates)] @@ -36,7 +34,6 @@ extern crate sysinfo; extern crate substrate_client as client; extern crate substrate_network as network; -extern crate substrate_network_libp2p as network_libp2p; extern crate sr_primitives as runtime_primitives; extern crate substrate_service as service; extern crate substrate_primitives as primitives; @@ -58,13 +55,12 @@ pub mod error; pub mod informant; mod panic_hook; -use network_libp2p::Protocol; use runtime_primitives::traits::As; use service::{ ServiceFactory, FactoryFullConfiguration, RuntimeGenesis, FactoryGenesis, PruningMode, ChainSpec, }; -use network::NonReservedPeerMode; +use network::{Protocol, config::NonReservedPeerMode}; use primitives::H256; use std::io::{Write, Read, stdin, stdout}; diff --git a/substrate/core/client/Cargo.toml b/substrate/core/client/Cargo.toml index 5eeb75940d..1ecf284dc1 100644 --- a/substrate/core/client/Cargo.toml +++ b/substrate/core/client/Cargo.toml @@ -4,27 +4,55 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -error-chain = "0.12" -fnv = "1.0" -log = "0.4" -parking_lot = "0.4" -hex-literal = "0.1" -futures = "0.1.17" -slog = "^2" -heapsize = "0.4" -substrate-consensus-common = { path = "../consensus/common" } -parity-codec = "2.1" -substrate-executor = { path = "../executor" } -substrate-primitives = { path = "../primitives" } -sr-primitives = { path = "../sr-primitives" } -sr-api = { path = "../sr-api" } -substrate-state-machine = { path = "../state-machine" } -substrate-keyring = { path = "../keyring" } -substrate-trie = { path = "../trie" } -substrate-telemetry = { path = "../telemetry" } -hash-db = { git = "https://github.com/paritytech/trie" } -kvdb = "0.1" +error-chain = { version = "0.12", optional = true } +fnv = { version = "1.0", optional = true } +log = { version = "0.4", optional = true } +parking_lot = { version = "0.4", optional = true } +hex-literal = { version = "0.1", optional = true } +futures = { version = "0.1.17", optional = true } +slog = { version = "^2", optional = true } +heapsize = { version = "0.4", optional = true } +substrate-consensus-common = { path = "../consensus/common", optional = true } +substrate-executor = { path = "../executor", optional = true } +substrate-state-machine = { path = "../state-machine", optional = true } +substrate-keyring = { path = "../keyring", optional = true } +substrate-trie = { path = "../trie", optional = true } +substrate-telemetry = { path = "../telemetry", optional = true } +hash-db = { git = "https://github.com/paritytech/trie", optional = true } +kvdb = { version = "0.1", optional = true } + +parity-codec = { version = "2.1", default-features = false } +substrate-primitives = { path = "../primitives", default-features = false } +sr-primitives = { path = "../sr-primitives", default-features = false } +sr-version = { path = "../sr-version", default-features = false } +sr-std = { path = "../sr-std", default-features = false } [dev-dependencies] substrate-test-client = { path = "../test-client" } kvdb-memorydb = "0.1" + +[features] +default = ["std"] +std = [ + "parity-codec/std", + "substrate-consensus-common", + "substrate-primitives/std", + "parking_lot", + "error-chain", + "fnv", + "log", + "hex-literal", + "futures", + "slog", + "heapsize", + "substrate-executor", + "sr-primitives/std", + "sr-version/std", + "sr-std/std", + "substrate-state-machine", + "substrate-keyring", + "substrate-trie", + "substrate-telemetry", + "hash-db", + "kvdb" +] diff --git a/substrate/core/client/README.adoc b/substrate/core/client/README.adoc deleted file mode 100644 index d644b1d039..0000000000 --- a/substrate/core/client/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Client - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/client/db/README.adoc b/substrate/core/client/db/README.adoc deleted file mode 100644 index c0b123392c..0000000000 --- a/substrate/core/client/db/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Client DB - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/client/db/src/lib.rs b/substrate/core/client/db/src/lib.rs index 95f1104910..c047c93989 100644 --- a/substrate/core/client/db/src/lib.rs +++ b/substrate/core/client/db/src/lib.rs @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Client backend that uses RocksDB database as storage. //! //! # Canonicality vs. Finality @@ -24,8 +23,6 @@ //! having discarded heavy state that will allow a chain reorganization. //! //! Finality implies canonicality but not vice-versa. -//! -// end::description[] extern crate substrate_client as client; extern crate kvdb_rocksdb; @@ -67,7 +64,7 @@ use hash_db::Hasher; use kvdb::{KeyValueDB, DBTransaction}; use trie::MemoryDB; use parking_lot::RwLock; -use primitives::{H256, AuthorityId, Blake2Hasher, ChangesTrieConfiguration}; +use primitives::{H256, AuthorityId, Blake2Hasher, ChangesTrieConfiguration, convert_hash}; use primitives::storage::well_known_keys; use runtime_primitives::{generic::BlockId, Justification, StorageMap, ChildrenStorageMap}; use runtime_primitives::traits::{Block as BlockT, Header as HeaderT, As, NumberFor, Zero, Digest, DigestItem}; @@ -97,17 +94,17 @@ pub struct DatabaseSettings { } /// Create an instance of db-backed client. -pub fn new_client( +pub fn new_client( settings: DatabaseSettings, executor: E, genesis_storage: S, block_execution_strategy: ExecutionStrategy, api_execution_strategy: ExecutionStrategy, -) -> Result, client::LocalCallExecutor, E>, Block>, client::error::Error> -where - Block: BlockT, - E: CodeExecutor + RuntimeInfo, - S: BuildStorage, +) -> Result, client::LocalCallExecutor, E>, Block, RA>, client::error::Error> + where + Block: BlockT, + E: CodeExecutor + RuntimeInfo, + S: BuildStorage, { let backend = Arc::new(Backend::new(settings, CANONICALIZATION_DELAY)?); let executor = client::LocalCallExecutor::new(backend.clone(), executor); @@ -148,7 +145,7 @@ impl<'a> state_db::MetaDb for StateMetaDb<'a> { /// Block database pub struct BlockchainDb { db: Arc, - meta: RwLock, Block::Hash>>, + meta: Arc, Block::Hash>>>, leaves: RwLock>>, } @@ -159,7 +156,7 @@ impl BlockchainDb { Ok(BlockchainDb { db, leaves: RwLock::new(leaves), - meta: RwLock::new(meta), + meta: Arc::new(RwLock::new(meta)), }) } @@ -376,7 +373,7 @@ struct StorageDb { impl state_machine::Storage for StorageDb { fn get(&self, key: &H256) -> Result, String> { - self.state_db.get(&key.0.into(), self).map(|r| r.map(|v| DBValue::from_slice(&v))) + self.state_db.get(key, self).map(|r| r.map(|v| DBValue::from_slice(&v))) .map_err(|e| format!("Database backend error: {:?}", e)) } } @@ -386,7 +383,7 @@ impl state_db::HashDb for StorageDb { type Hash = H256; fn get(&self, key: &H256) -> Result>, Self::Error> { - self.db.get(columns::STATE, &key[..]).map(|r| r.map(|v| v.to_vec())) + self.db.get(columns::STATE, key.as_bytes()).map(|r| r.map(|v| v.to_vec())) } } @@ -409,6 +406,7 @@ impl state_machine::Storage for DbGenesisStorage { pub struct DbChangesTrieStorage { db: Arc, + meta: Arc, Block::Hash>>>, min_blocks_to_keep: Option, _phantom: ::std::marker::PhantomData, } @@ -422,7 +420,7 @@ impl DbChangesTrieStorage { } /// Prune obsolete changes tries. - pub fn prune(&self, config: Option, tx: &mut DBTransaction, block: NumberFor) { + pub fn prune(&self, config: Option, tx: &mut DBTransaction, block_hash: Block::Hash, block_num: NumberFor) { // never prune on archive nodes let min_blocks_to_keep = match self.min_blocks_to_keep { Some(min_blocks_to_keep) => min_blocks_to_keep, @@ -440,23 +438,54 @@ impl DbChangesTrieStorage { &config, &*self, min_blocks_to_keep, - block.as_(), + &state_machine::ChangesTrieAnchorBlockId { + hash: convert_hash(&block_hash), + number: block_num.as_(), + }, |node| tx.delete(columns::CHANGES_TRIE, node.as_ref())); } } impl state_machine::ChangesTrieRootsStorage for DbChangesTrieStorage { - fn root(&self, block: u64) -> Result, String> { - Ok(read_db::(&*self.db, columns::HASH_LOOKUP, columns::HEADER, BlockId::Number(As::sa(block))) - .map_err(|err| format!("{}", err)) - .and_then(|header| match header { - Some(header) => Block::Header::decode(&mut &header[..]) - .ok_or_else(|| format!("Failed to parse header of block {}", block)) - .map(Some), - None => Ok(None) - })? - .and_then(|header| header.digest().log(DigestItem::as_changes_trie_root) - .map(|root| H256::from_slice(root.as_ref())))) + fn root(&self, anchor: &state_machine::ChangesTrieAnchorBlockId, block: u64) -> Result, String> { + // check API requirement + assert!(block <= anchor.number, "API requirement"); + + // we need to get hash of the block to resolve changes trie root + let block_id = if block <= self.meta.read().finalized_number.as_() { + // if block is finalized, we could just read canonical hash + BlockId::Number(As::sa(block)) + } else { + // the block is not finalized + let mut current_num = anchor.number; + let mut current_hash: Block::Hash = convert_hash(&anchor.hash); + let maybe_anchor_header: Block::Header = ::utils::require_header::( + &*self.db, columns::HASH_LOOKUP, columns::HEADER, BlockId::Number(As::sa(current_num)) + ).map_err(|e| e.to_string())?; + if maybe_anchor_header.hash() == current_hash { + // if anchor is canonicalized, then the block is also canonicalized + BlockId::Number(As::sa(block)) + } else { + // else (block is not finalized + anchor is not canonicalized): + // => we should find the required block hash by traversing + // back from the anchor to the block with given number + while current_num != block { + let current_header: Block::Header = ::utils::require_header::( + &*self.db, columns::HASH_LOOKUP, columns::HEADER, BlockId::Hash(current_hash) + ).map_err(|e| e.to_string())?; + + current_hash = *current_header.parent_hash(); + current_num = current_num - 1; + } + + BlockId::Hash(current_hash) + } + }; + + Ok(::utils::require_header::(&*self.db, columns::HASH_LOOKUP, columns::HEADER, block_id) + .map_err(|e| e.to_string())? + .digest().log(DigestItem::as_changes_trie_root) + .map(|root| H256::from_slice(root.as_ref()))) } } @@ -502,6 +531,7 @@ impl Backend { fn from_kvdb(db: Arc, pruning: PruningMode, canonicalization_delay: u64) -> Result { let is_archive_pruning = pruning.is_archive(); let blockchain = BlockchainDb::new(db.clone())?; + let meta = blockchain.meta.clone(); let map_e = |e: state_db::Error| ::client::error::Error::from(format!("State database error: {:?}", e)); let state_db: StateDb = StateDb::new(pruning, &StateMetaDb(&*db)).map_err(map_e)?; let storage_db = StorageDb { @@ -510,6 +540,7 @@ impl Backend { }; let changes_tries_storage = DbChangesTrieStorage { db, + meta, min_blocks_to_keep: if is_archive_pruning { None } else { Some(MIN_BLOCKS_TO_KEEP_CHANGES_TRIES_FOR) }, _phantom: Default::default(), }; @@ -589,7 +620,7 @@ impl Backend { let changes_trie_config: Option = self.state_at(BlockId::Hash(parent_hash))? .storage(well_known_keys::CHANGES_TRIE_CONFIG)? .and_then(|v| Decode::decode(&mut &*v)); - self.changes_tries_storage.prune(changes_trie_config, transaction, f_num); + self.changes_tries_storage.prune(changes_trie_config, transaction, f_hash, f_num); } Ok(()) @@ -755,9 +786,9 @@ impl client::backend::Backend for Backend whe let mut changeset: state_db::ChangeSet = state_db::ChangeSet::default(); for (key, (val, rc)) in operation.updates.drain() { if rc > 0 { - changeset.inserted.push((key.0.into(), val.to_vec())); + changeset.inserted.push((key, val.to_vec())); } else if rc < 0 { - changeset.deleted.push(key.0.into()); + changeset.deleted.push(key); } } let number_u64 = number.as_(); @@ -1138,7 +1169,7 @@ mod tests { backend.commit_operation(op).unwrap(); - assert_eq!(backend.storage.db.get(::columns::STATE, &key.0[..]).unwrap().unwrap(), &b"hello"[..]); + assert_eq!(backend.storage.db.get(::columns::STATE, key.as_bytes()).unwrap().unwrap(), &b"hello"[..]); hash }; @@ -1172,7 +1203,7 @@ mod tests { backend.commit_operation(op).unwrap(); - assert_eq!(backend.storage.db.get(::columns::STATE, &key.0[..]).unwrap().unwrap(), &b"hello"[..]); + assert_eq!(backend.storage.db.get(::columns::STATE, key.as_bytes()).unwrap().unwrap(), &b"hello"[..]); hash }; @@ -1204,21 +1235,24 @@ mod tests { backend.commit_operation(op).unwrap(); - assert!(backend.storage.db.get(::columns::STATE, &key.0[..]).unwrap().is_none()); + assert!(backend.storage.db.get(::columns::STATE, key.as_bytes()).unwrap().is_none()); } backend.finalize_block(BlockId::Number(1)).unwrap(); backend.finalize_block(BlockId::Number(2)).unwrap(); - assert!(backend.storage.db.get(::columns::STATE, &key.0[..]).unwrap().is_none()); + assert!(backend.storage.db.get(::columns::STATE, key.as_bytes()).unwrap().is_none()); } #[test] fn changes_trie_storage_works() { let backend = Backend::::new_test(1000, 100); + backend.changes_tries_storage.meta.write().finalized_number = 1000; + let check_changes = |backend: &Backend, block: u64, changes: Vec<(Vec, Vec)>| { let (changes_root, mut changes_trie_update) = prepare_changes(changes); - assert_eq!(backend.changes_tries_storage.root(block), Ok(Some(changes_root))); + let anchor = state_machine::ChangesTrieAnchorBlockId { hash: Default::default(), number: block }; + assert_eq!(backend.changes_tries_storage.root(&anchor, block), Ok(Some(changes_root))); for (key, (val, _)) in changes_trie_update.drain() { assert_eq!(backend.changes_trie_storage().unwrap().get(&key), Ok(Some(val))); @@ -1242,9 +1276,66 @@ mod tests { check_changes(&backend, 2, changes2); } + #[test] + fn changes_trie_storage_works_with_forks() { + let backend = Backend::::new_test(1000, 100); + + let changes0 = vec![(b"k0".to_vec(), b"v0".to_vec())]; + let changes1 = vec![(b"k1".to_vec(), b"v1".to_vec())]; + let changes2 = vec![(b"k2".to_vec(), b"v2".to_vec())]; + let block0 = insert_header(&backend, 0, Default::default(), changes0.clone(), Default::default()); + let block1 = insert_header(&backend, 1, block0, changes1.clone(), Default::default()); + let block2 = insert_header(&backend, 2, block1, changes2.clone(), Default::default()); + + let changes2_1_0 = vec![(b"k3".to_vec(), b"v3".to_vec())]; + let changes2_1_1 = vec![(b"k4".to_vec(), b"v4".to_vec())]; + let block2_1_0 = insert_header(&backend, 3, block2, changes2_1_0.clone(), Default::default()); + let block2_1_1 = insert_header(&backend, 4, block2_1_0, changes2_1_1.clone(), Default::default()); + + let changes2_2_0 = vec![(b"k5".to_vec(), b"v5".to_vec())]; + let changes2_2_1 = vec![(b"k6".to_vec(), b"v6".to_vec())]; + let block2_2_0 = insert_header(&backend, 3, block2, changes2_2_0.clone(), Default::default()); + let block2_2_1 = insert_header(&backend, 4, block2_2_0, changes2_2_1.clone(), Default::default()); + + // finalize block1 + backend.changes_tries_storage.meta.write().finalized_number = 1; + + // branch1: when asking for finalized block hash + let (changes1_root, _) = prepare_changes(changes1); + let anchor = state_machine::ChangesTrieAnchorBlockId { hash: block2_1_1, number: 4 }; + assert_eq!(backend.changes_tries_storage.root(&anchor, 1), Ok(Some(changes1_root))); + + // branch2: when asking for finalized block hash + let anchor = state_machine::ChangesTrieAnchorBlockId { hash: block2_2_1, number: 4 }; + assert_eq!(backend.changes_tries_storage.root(&anchor, 1), Ok(Some(changes1_root))); + + // branch1: when asking for non-finalized block hash (search by traversal) + let (changes2_1_0_root, _) = prepare_changes(changes2_1_0); + let anchor = state_machine::ChangesTrieAnchorBlockId { hash: block2_1_1, number: 4 }; + assert_eq!(backend.changes_tries_storage.root(&anchor, 3), Ok(Some(changes2_1_0_root))); + + // branch2: when asking for non-finalized block hash (search using canonicalized hint) + let (changes2_2_0_root, _) = prepare_changes(changes2_2_0); + let anchor = state_machine::ChangesTrieAnchorBlockId { hash: block2_2_1, number: 4 }; + assert_eq!(backend.changes_tries_storage.root(&anchor, 3), Ok(Some(changes2_2_0_root))); + + // finalize first block of branch2 (block2_2_0) + backend.changes_tries_storage.meta.write().finalized_number = 3; + + // branch2: when asking for finalized block of this branch + assert_eq!(backend.changes_tries_storage.root(&anchor, 3), Ok(Some(changes2_2_0_root))); + + // branch1: when asking for finalized block of other branch + // => result is incorrect (returned for the block of branch1), but this is expected, + // because the other fork is abandoned (forked before finalized header) + let anchor = state_machine::ChangesTrieAnchorBlockId { hash: block2_1_1, number: 4 }; + assert_eq!(backend.changes_tries_storage.root(&anchor, 3), Ok(Some(changes2_2_0_root))); + } + #[test] fn changes_tries_are_pruned_on_finalization() { let mut backend = Backend::::new_test(1000, 100); + backend.changes_tries_storage.meta.write().finalized_number = 1000; backend.changes_tries_storage.min_blocks_to_keep = Some(8); let config = ChangesTrieConfiguration { digest_interval: 2, @@ -1267,26 +1358,27 @@ mod tests { let _ = insert_header(&backend, 12, block11, vec![(b"key_at_12".to_vec(), b"val_at_12".to_vec())], Default::default()); // check that roots of all tries are in the columns::CHANGES_TRIE + let anchor = state_machine::ChangesTrieAnchorBlockId { hash: Default::default(), number: 100 }; fn read_changes_trie_root(backend: &Backend, num: u64) -> H256 { backend.blockchain().header(BlockId::Number(num)).unwrap().unwrap().digest().logs().iter() .find(|i| i.as_changes_trie_root().is_some()).unwrap().as_changes_trie_root().unwrap().clone() } - let root1 = read_changes_trie_root(&backend, 1); assert_eq!(backend.changes_tries_storage.root(1).unwrap(), Some(root1)); - let root2 = read_changes_trie_root(&backend, 2); assert_eq!(backend.changes_tries_storage.root(2).unwrap(), Some(root2)); - let root3 = read_changes_trie_root(&backend, 3); assert_eq!(backend.changes_tries_storage.root(3).unwrap(), Some(root3)); - let root4 = read_changes_trie_root(&backend, 4); assert_eq!(backend.changes_tries_storage.root(4).unwrap(), Some(root4)); - let root5 = read_changes_trie_root(&backend, 5); assert_eq!(backend.changes_tries_storage.root(5).unwrap(), Some(root5)); - let root6 = read_changes_trie_root(&backend, 6); assert_eq!(backend.changes_tries_storage.root(6).unwrap(), Some(root6)); - let root7 = read_changes_trie_root(&backend, 7); assert_eq!(backend.changes_tries_storage.root(7).unwrap(), Some(root7)); - let root8 = read_changes_trie_root(&backend, 8); assert_eq!(backend.changes_tries_storage.root(8).unwrap(), Some(root8)); - let root9 = read_changes_trie_root(&backend, 9); assert_eq!(backend.changes_tries_storage.root(9).unwrap(), Some(root9)); - let root10 = read_changes_trie_root(&backend, 10); assert_eq!(backend.changes_tries_storage.root(10).unwrap(), Some(root10)); - let root11 = read_changes_trie_root(&backend, 11); assert_eq!(backend.changes_tries_storage.root(11).unwrap(), Some(root11)); - let root12 = read_changes_trie_root(&backend, 12); assert_eq!(backend.changes_tries_storage.root(12).unwrap(), Some(root12)); + let root1 = read_changes_trie_root(&backend, 1); assert_eq!(backend.changes_tries_storage.root(&anchor, 1).unwrap(), Some(root1)); + let root2 = read_changes_trie_root(&backend, 2); assert_eq!(backend.changes_tries_storage.root(&anchor, 2).unwrap(), Some(root2)); + let root3 = read_changes_trie_root(&backend, 3); assert_eq!(backend.changes_tries_storage.root(&anchor, 3).unwrap(), Some(root3)); + let root4 = read_changes_trie_root(&backend, 4); assert_eq!(backend.changes_tries_storage.root(&anchor, 4).unwrap(), Some(root4)); + let root5 = read_changes_trie_root(&backend, 5); assert_eq!(backend.changes_tries_storage.root(&anchor, 5).unwrap(), Some(root5)); + let root6 = read_changes_trie_root(&backend, 6); assert_eq!(backend.changes_tries_storage.root(&anchor, 6).unwrap(), Some(root6)); + let root7 = read_changes_trie_root(&backend, 7); assert_eq!(backend.changes_tries_storage.root(&anchor, 7).unwrap(), Some(root7)); + let root8 = read_changes_trie_root(&backend, 8); assert_eq!(backend.changes_tries_storage.root(&anchor, 8).unwrap(), Some(root8)); + let root9 = read_changes_trie_root(&backend, 9); assert_eq!(backend.changes_tries_storage.root(&anchor, 9).unwrap(), Some(root9)); + let root10 = read_changes_trie_root(&backend, 10); assert_eq!(backend.changes_tries_storage.root(&anchor, 10).unwrap(), Some(root10)); + let root11 = read_changes_trie_root(&backend, 11); assert_eq!(backend.changes_tries_storage.root(&anchor, 11).unwrap(), Some(root11)); + let root12 = read_changes_trie_root(&backend, 12); assert_eq!(backend.changes_tries_storage.root(&anchor, 12).unwrap(), Some(root12)); // now simulate finalization of block#12, causing prune of tries at #1..#4 let mut tx = DBTransaction::new(); - backend.changes_tries_storage.prune(Some(config.clone()), &mut tx, 12); + backend.changes_tries_storage.prune(Some(config.clone()), &mut tx, Default::default(), 12); backend.storage.db.write(tx).unwrap(); assert!(backend.changes_tries_storage.get(&root1).unwrap().is_none()); assert!(backend.changes_tries_storage.get(&root2).unwrap().is_none()); @@ -1299,7 +1391,7 @@ mod tests { // now simulate finalization of block#16, causing prune of tries at #5..#8 let mut tx = DBTransaction::new(); - backend.changes_tries_storage.prune(Some(config.clone()), &mut tx, 16); + backend.changes_tries_storage.prune(Some(config.clone()), &mut tx, Default::default(), 16); backend.storage.db.write(tx).unwrap(); assert!(backend.changes_tries_storage.get(&root5).unwrap().is_none()); assert!(backend.changes_tries_storage.get(&root6).unwrap().is_none()); @@ -1310,7 +1402,7 @@ mod tests { // => no changes tries are pruned, because we never prune in archive mode backend.changes_tries_storage.min_blocks_to_keep = None; let mut tx = DBTransaction::new(); - backend.changes_tries_storage.prune(Some(config), &mut tx, 20); + backend.changes_tries_storage.prune(Some(config), &mut tx, Default::default(), 20); backend.storage.db.write(tx).unwrap(); assert!(backend.changes_tries_storage.get(&root9).unwrap().is_some()); assert!(backend.changes_tries_storage.get(&root10).unwrap().is_some()); diff --git a/substrate/core/client/db/src/utils.rs b/substrate/core/client/db/src/utils.rs index f7b81845e8..5caebd7e72 100644 --- a/substrate/core/client/db/src/utils.rs +++ b/substrate/core/client/db/src/utils.rs @@ -187,6 +187,17 @@ pub fn read_header( } } +/// Required header from the database. +pub fn require_header( + db: &KeyValueDB, + col_index: Option, + col: Option, + id: BlockId, +) -> client::error::Result { + read_header(db, col_index, col, id) + .and_then(|header| header.ok_or_else(|| client::error::ErrorKind::UnknownBlock(format!("{}", id)).into())) +} + /// Read meta from the database. pub fn read_meta(db: &KeyValueDB, col_meta: Option, col_header: Option) -> Result< Meta<<::Header as HeaderT>::Number, Block::Hash>, diff --git a/substrate/core/client/src/backend.rs b/substrate/core/client/src/backend.rs index 972a2ef6cf..a4e6852560 100644 --- a/substrate/core/client/src/backend.rs +++ b/substrate/core/client/src/backend.rs @@ -47,8 +47,7 @@ impl NewBlockState { } /// Block insertion operation. Keeps hold if the inserted block state and data. -pub trait BlockImportOperation -where +pub trait BlockImportOperation where Block: BlockT, H: Hasher, { @@ -88,11 +87,9 @@ where /// /// The same applies for live `BlockImportOperation`s: while an import operation building on a parent `P` /// is alive, the state for `P` should not be pruned. -pub trait Backend: Send + Sync -where +pub trait Backend: Send + Sync where Block: BlockT, H: Hasher, - { /// Associated block insertion operation type. type BlockImportOperation: BlockImportOperation; diff --git a/substrate/core/client/src/block_builder/api.rs b/substrate/core/client/src/block_builder/api.rs new file mode 100644 index 0000000000..a5cbe7e554 --- /dev/null +++ b/substrate/core/client/src/block_builder/api.rs @@ -0,0 +1,40 @@ +// Copyright 2018 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate 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. + +// Substrate 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 Substrate. If not, see . + +//! The runtime api for building blocks. + +use runtime_primitives::{traits::Block as BlockT, ApplyResult}; +use rstd::vec::Vec; + +decl_runtime_apis! { + /// The `BlockBuilder` api trait that provides required functions for building a block for a runtime. + pub trait BlockBuilder { + /// The runtime api for building blocks./// Apply the given extrinsics. + fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyResult; + /// Finish the current block. + fn finalise_block() -> ::Header; + /// Generate inherent extrinsics. + fn inherent_extrinsics( + inherent: InherentExtrinsic + ) -> Vec; + /// Check that the inherents are valid. + fn check_inherents( + block: Block, data: InherentData + ) -> Result<(), Error>; + /// Generate a random seed. + fn random_seed() -> ::Hash; + } +} diff --git a/substrate/core/client/src/block_builder.rs b/substrate/core/client/src/block_builder/block_builder.rs similarity index 58% rename from substrate/core/client/src/block_builder.rs rename to substrate/core/client/src/block_builder/block_builder.rs index b918ca4956..7d5b867e3a 100644 --- a/substrate/core/client/src/block_builder.rs +++ b/substrate/core/client/src/block_builder/block_builder.rs @@ -14,60 +14,48 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -//! Utility struct to build a block. - +use super::api::BlockBuilder as BlockBuilderApi; use std::vec::Vec; -use std::marker::PhantomData; use codec::Encode; -use state_machine; -use runtime_primitives::traits::{Header as HeaderT, Hash, Block as BlockT, One, HashFor}; +use blockchain::HeaderBackend; +use runtime_primitives::traits::{ + Header as HeaderT, Hash, Block as BlockT, One, HashFor, ProvideRuntimeApi, ApiRef +}; +use primitives::H256; use runtime_primitives::generic::BlockId; -use runtime_api::BlockBuilder as BlockBuilderAPI; -use {backend, error, Client, CallExecutor}; +use runtime_api::Core; +use error; use runtime_primitives::ApplyOutcome; -use primitives::{Blake2Hasher, H256}; -use hash_db::Hasher; /// Utility for building new (valid) blocks from a stream of extrinsics. -pub struct BlockBuilder<'a, B, E, Block, H> -where - B: backend::Backend + 'a, - E: CallExecutor + Clone + 'a, - Block: BlockT, - H: Hasher, - H::Out: Ord, - -{ +pub struct BlockBuilder<'a, Block, A: ProvideRuntimeApi> where Block: BlockT { header: ::Header, extrinsics: Vec<::Extrinsic>, - client: &'a Client, + api: ApiRef<'a, A::Api>, block_id: BlockId, - changes: state_machine::OverlayedChanges, - _marker: PhantomData, } -impl<'a, B, E, Block> BlockBuilder<'a, B, E, Block, Blake2Hasher> +impl<'a, Block, A> BlockBuilder<'a, Block, A> where - B: backend::Backend + 'a, - E: CallExecutor + Clone + 'a, Block: BlockT, + A: ProvideRuntimeApi + HeaderBackend + 'a, + A::Api: BlockBuilderApi, { /// Create a new instance of builder from the given client, building on the latest block. - pub fn new(client: &'a Client) -> error::Result { - client.info().and_then(|i| Self::at_block(&BlockId::Hash(i.chain.best_hash), client)) + pub fn new(api: &'a A) -> error::Result { + api.info().and_then(|i| Self::at_block(&BlockId::Hash(i.best_hash), api)) } /// Create a new instance of builder from the given client using a particular block's ID to /// build upon. - pub fn at_block(block_id: &BlockId, client: &'a Client) -> error::Result { - let number = client.block_number_from_id(block_id)? + pub fn at_block(block_id: &BlockId, api: &'a A) -> error::Result { + let number = api.block_number_from_id(block_id)? .ok_or_else(|| error::ErrorKind::UnknownBlock(format!("{}", block_id)))? + One::one(); - let parent_hash = client.block_hash_from_id(block_id)? + let parent_hash = api.block_hash_from_id(block_id)? .ok_or_else(|| error::ErrorKind::UnknownBlock(format!("{}", block_id)))?; - let mut changes = Default::default(); let header = <::Header as HeaderT>::new( number, Default::default(), @@ -76,16 +64,14 @@ where Default::default() ); - client.initialise_block(block_id, &mut changes, &header)?; - changes.commit_prospective(); + let api = api.runtime_api(); + api.initialise_block(block_id, &header)?; Ok(BlockBuilder { header, extrinsics: Vec::new(), - client, + api, block_id: *block_id, - changes, - _marker: Default::default(), }) } @@ -93,30 +79,32 @@ where /// can be validly executed (by executing it); if it is invalid, it'll be returned along with /// the error. Otherwise, it will return a mutable reference to self (in order to chain). pub fn push(&mut self, xt: ::Extrinsic) -> error::Result<()> { - match self.client.apply_extrinsic(&self.block_id, &mut self.changes, &xt) { - Ok(result) => { - match result { + fn impl_push<'a, T, Block: BlockT>( + api: &mut ApiRef<'a, T>, + block_id: &BlockId, + xt: Block::Extrinsic, + extrinsics: &mut Vec + ) -> error::Result<()> where T: BlockBuilderApi { + api.map_api_result(|api| { + match api.apply_extrinsic(block_id, &xt)? { Ok(ApplyOutcome::Success) | Ok(ApplyOutcome::Fail) => { - self.extrinsics.push(xt); - self.changes.commit_prospective(); + extrinsics.push(xt); Ok(()) } Err(e) => { - self.changes.discard_prospective(); - Err(error::ErrorKind::ApplyExtinsicFailed(e).into()) + Err(error::ErrorKind::ApplyExtrinsicFailed(e).into()) } } - } - Err(e) => { - self.changes.discard_prospective(); - Err(e) - } + }) } + + //FIXME: Please NLL, help me! + impl_push(&mut self.api, &self.block_id, xt, &mut self.extrinsics) } /// Consume the builder to return a valid `Block` containing all pushed extrinsics. pub fn bake(mut self) -> error::Result { - self.header = self.client.finalise_block(&self.block_id, &mut self.changes)?; + self.header = self.api.finalise_block(&self.block_id)?; debug_assert_eq!( self.header.extrinsics_root().clone(), diff --git a/substrate/core/client/src/block_builder/mod.rs b/substrate/core/client/src/block_builder/mod.rs new file mode 100644 index 0000000000..f22f599ffd --- /dev/null +++ b/substrate/core/client/src/block_builder/mod.rs @@ -0,0 +1,23 @@ +// Copyright 2018 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate 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. + +// Substrate 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 Substrate. If not, see . + +//! Utility struct to build a block. + +#[cfg(feature = "std")] +mod block_builder; +#[cfg(feature = "std")] +pub use self::block_builder::*; +pub mod api; diff --git a/substrate/core/client/src/blockchain.rs b/substrate/core/client/src/blockchain.rs index a2896ab7f3..8c46e5ebe2 100644 --- a/substrate/core/client/src/blockchain.rs +++ b/substrate/core/client/src/blockchain.rs @@ -40,6 +40,22 @@ pub trait HeaderBackend: Send + Sync { fn expect_header(&self, id: BlockId) -> Result { self.header(id)?.ok_or_else(|| ErrorKind::UnknownBlock(format!("{}", id)).into()) } + + /// Convert an arbitrary block ID into a block hash. + fn block_hash_from_id(&self, id: &BlockId) -> Result> { + match *id { + BlockId::Hash(h) => Ok(Some(h)), + BlockId::Number(n) => self.hash(n), + } + } + + /// Convert an arbitrary block ID into a block hash. + fn block_number_from_id(&self, id: &BlockId) -> Result>> { + match *id { + BlockId::Hash(_) => Ok(self.header(*id)?.map(|h| h.number().clone())), + BlockId::Number(n) => Ok(Some(n)), + } + } } /// Blockchain database backend. Does not perform any validation. diff --git a/substrate/core/client/src/cht.rs b/substrate/core/client/src/cht.rs index fd8e07c3dd..39e1aaa95b 100644 --- a/substrate/core/client/src/cht.rs +++ b/substrate/core/client/src/cht.rs @@ -27,7 +27,7 @@ use hash_db; use heapsize::HeapSizeOf; use trie; -use primitives::H256; +use primitives::{H256, convert_hash}; use runtime_primitives::traits::{As, Header as HeaderT, SimpleArithmetic, One}; use state_machine::backend::InMemory as InMemoryState; use state_machine::{prove_read, read_proof_check}; @@ -113,8 +113,7 @@ pub fn check_proof( Hasher: hash_db::Hasher, Hasher::Out: Ord + HeapSizeOf, { - let mut root: Hasher::Out = Default::default(); - root.as_mut().copy_from_slice(local_root.as_ref()); + let root: Hasher::Out = convert_hash(&local_root); let local_cht_key = encode_cht_key(local_number); let local_cht_value = read_proof_check::(root, remote_proof, &local_cht_key).map_err(|e| ClientError::from(e))?; diff --git a/substrate/core/client/src/client.rs b/substrate/core/client/src/client.rs index 688ca6e7d3..4d4a438a08 100644 --- a/substrate/core/client/src/client.rs +++ b/substrate/core/client/src/client.rs @@ -16,36 +16,40 @@ //! Substrate Client -use std::sync::Arc; -use error::{Error, ErrorKind}; +use std::{marker::PhantomData, sync::Arc}; +use error::Error; use futures::sync::mpsc; use parking_lot::{Mutex, RwLock}; use primitives::AuthorityId; use runtime_primitives::{ Justification, - generic::{BlockId, SignedBlock, Block as RuntimeBlock}, + generic::{BlockId, SignedBlock}, transaction_validity::{TransactionValidity, TransactionTag}, }; use consensus::{ImportBlock, ImportResult, BlockOrigin}; -use runtime_primitives::traits::{Block as BlockT, Header as HeaderT, Zero, As, NumberFor, CurrentHeight, BlockNumberToHash}; -use runtime_primitives::{ApplyResult, BuildStorage}; -use runtime_api as api; -use primitives::{Blake2Hasher, H256, ChangesTrieConfiguration}; +use runtime_primitives::traits::{ + Block as BlockT, Header as HeaderT, Zero, As, NumberFor, CurrentHeight, BlockNumberToHash, + ApiRef, ProvideRuntimeApi +}; +use runtime_primitives::BuildStorage; +use runtime_api::{Core as CoreAPI, CallApiAt, TaggedTransactionQueue, ConstructRuntimeApi}; +use primitives::{Blake2Hasher, H256, ChangesTrieConfiguration, convert_hash}; use primitives::storage::{StorageKey, StorageData}; use primitives::storage::well_known_keys; -use codec::{Encode, Decode}; +use codec::Decode; use state_machine::{ - Backend as StateBackend, CodeExecutor, + Backend as StateBackend, CodeExecutor, ChangesTrieAnchorBlockId, ExecutionStrategy, ExecutionManager, prove_read, key_changes, key_changes_proof, OverlayedChanges }; +use codec::Encode; use backend::{self, BlockImportOperation}; use blockchain::{self, Info as ChainInfo, Backend as ChainBackend, HeaderBackend as ChainHeaderBackend}; use call_executor::{CallExecutor, LocalCallExecutor}; use executor::{RuntimeVersion, RuntimeInfo}; use notifications::{StorageNotifications, StorageEventStream}; -use {cht, error, in_mem, block_builder, genesis, consensus}; +use {cht, error, in_mem, block_builder::{self, api::BlockBuilder as BlockBuilderAPI}, genesis, consensus}; /// Type that implements `futures::Stream` of block import events. pub type ImportNotifications = mpsc::UnboundedReceiver>; @@ -54,7 +58,7 @@ pub type ImportNotifications = mpsc::UnboundedReceiver = mpsc::UnboundedReceiver>; /// Substrate Client -pub struct Client where Block: BlockT { +pub struct Client where Block: BlockT { backend: Arc, executor: E, storage_notifications: Mutex>, @@ -65,6 +69,7 @@ pub struct Client where Block: BlockT { block_execution_strategy: ExecutionStrategy, api_execution_strategy: ExecutionStrategy, changes_trie_config: Option, + _phantom: PhantomData, } /// A source of blockchain events. @@ -180,36 +185,36 @@ impl PrePostHeader { } /// Create an instance of in-memory client. -pub fn new_in_mem( +pub fn new_in_mem( executor: E, genesis_storage: S, -) -> error::Result, LocalCallExecutor, E>, Block>> -where - E: CodeExecutor + RuntimeInfo, - S: BuildStorage, - Block: BlockT, +) -> error::Result, LocalCallExecutor, E>, Block, RA>> + where + E: CodeExecutor + RuntimeInfo, + S: BuildStorage, + Block: BlockT, { new_with_backend(Arc::new(in_mem::Backend::new()), executor, genesis_storage) } /// Create a client with the explicitely provided backend. /// This is useful for testing backend implementations. -pub fn new_with_backend( +pub fn new_with_backend( backend: Arc, executor: E, build_genesis_storage: S, -) -> error::Result, Block>> -where - E: CodeExecutor + RuntimeInfo, - S: BuildStorage, - Block: BlockT, - B: backend::LocalBackend +) -> error::Result, Block, RA>> + where + E: CodeExecutor + RuntimeInfo, + S: BuildStorage, + Block: BlockT, + B: backend::LocalBackend { let call_executor = LocalCallExecutor::new(backend.clone(), executor); Client::new(backend, call_executor, build_genesis_storage, ExecutionStrategy::NativeWhenPossible, ExecutionStrategy::NativeWhenPossible) } -impl Client where +impl Client where B: backend::Backend, E: CallExecutor, Block: BlockT, @@ -255,6 +260,7 @@ impl Client where block_execution_strategy, api_execution_strategy, changes_trie_config, + _phantom: Default::default(), }) } @@ -323,6 +329,36 @@ impl Client where self.header_proof_with_cht_size(id, cht::SIZE) } + pub(crate) fn call_at_state( + &self, + at: &BlockId, + function: &'static str, + args: Vec, + changes: &mut OverlayedChanges + ) -> error::Result> { + let state = self.state_at(at)?; + + let execution_manager = || match self.api_execution_strategy { + ExecutionStrategy::NativeWhenPossible => ExecutionManager::NativeWhenPossible, + ExecutionStrategy::AlwaysWasm => ExecutionManager::AlwaysWasm, + ExecutionStrategy::Both => ExecutionManager::Both(|wasm_result, native_result| { + warn!("Consensus error between wasm and native runtime execution at block {:?}", at); + warn!(" Function {:?}", function); + warn!(" Native result {:?}", native_result); + warn!(" Wasm result {:?}", wasm_result); + wasm_result + }), + }; + + self.executor.call_at_state(&state, changes, function, &args, execution_manager()) + .map(|res| res.0) + } + + /// Get block hash by number. + pub fn block_hash(&self, block_number: <::Header as HeaderT>::Number) -> error::Result> { + self.backend.blockchain().hash(block_number) + } + /// Reads given header and generates CHT-based header proof for CHT of given size. pub fn header_proof_with_cht_size(&self, id: &BlockId, cht_size: u64) -> error::Result<(Block::Header, Vec>)> { let proof_error = || error::ErrorKind::Backend(format!("Failed to generate header proof for {:?}", id)); @@ -355,7 +391,10 @@ impl Client where config, storage, self.require_block_number_from_id(&BlockId::Hash(first))?.as_(), - self.require_block_number_from_id(&BlockId::Hash(last))?.as_(), + &ChangesTrieAnchorBlockId { + hash: convert_hash(&last), + number: self.require_block_number_from_id(&BlockId::Hash(last))?.as_(), + }, self.backend.blockchain().info()?.best_number.as_(), key) .map_err(|err| error::ErrorKind::ChangesTrieAccessFailed(err).into()) @@ -388,7 +427,10 @@ impl Client where config, storage, self.require_block_number_from_id(&BlockId::Hash(first))?.as_(), - self.require_block_number_from_id(&BlockId::Hash(last))?.as_(), + &ChangesTrieAnchorBlockId { + hash: convert_hash(&last), + number: self.require_block_number_from_id(&BlockId::Hash(last))?.as_(), + }, max_number.as_(), key) .map_err(|err| error::ErrorKind::ChangesTrieAccessFailed(err).into()) @@ -396,88 +438,41 @@ impl Client where } /// Create a new block, built on the head of the chain. - pub fn new_block(&self) -> error::Result> - where E: Clone + pub fn new_block( + &self + ) -> error::Result> where + E: Clone + Send + Sync, + RA: BlockBuilderAPI { block_builder::BlockBuilder::new(self) } /// Create a new block, built on top of `parent`. - pub fn new_block_at(&self, parent: &BlockId) -> error::Result> - where E: Clone + pub fn new_block_at( + &self, parent: &BlockId + ) -> error::Result> where + E: Clone + Send + Sync, + RA: BlockBuilderAPI { block_builder::BlockBuilder::at_block(parent, &self) } - /// Set up the native execution environment to call into a native runtime code. - pub fn call_api(&self, function: &'static str, args: &A) -> error::Result - where A: Encode, R: Decode - { - self.call_api_at(&BlockId::Number(self.info()?.chain.best_number), function, args) - } - - /// Call a runtime function at given block. - pub fn call_api_at(&self, at: &BlockId, function: &'static str, args: &A) -> error::Result - where A: Encode, R: Decode - { - let parent = at; - let header = <::Header as HeaderT>::new( - self.block_number_from_id(&parent)? - .ok_or_else(|| error::ErrorKind::UnknownBlock(format!("{:?}", parent)))? + As::sa(1), - Default::default(), - Default::default(), - self.block_hash_from_id(&parent)? - .ok_or_else(|| error::ErrorKind::UnknownBlock(format!("{:?}", parent)))?, - Default::default() - ); - let mut overlay = Default::default(); - - self.call_at_state(at, "initialise_block", &header, &mut overlay)?; - self.call_at_state(at, function, args, &mut overlay) - } - - fn call_at_state( - &self, - at: &BlockId, - function: &'static str, - args: &A, - changes: &mut OverlayedChanges - ) -> error::Result { - let state = self.state_at(at)?; - - let execution_manager = || match self.api_execution_strategy { - ExecutionStrategy::NativeWhenPossible => ExecutionManager::NativeWhenPossible, - ExecutionStrategy::AlwaysWasm => ExecutionManager::AlwaysWasm, - ExecutionStrategy::Both => ExecutionManager::Both(|wasm_result, native_result| { - warn!("Consensus error between wasm and native runtime execution at block {:?}", at); - warn!(" Function {:?}", function); - warn!(" Native result {:?}", native_result); - warn!(" Wasm result {:?}", wasm_result); - wasm_result - }), - }; - - self.executor.call_at_state( - &state, - changes, - function, - &args.encode(), - execution_manager() - ).and_then(|res| - R::decode(&mut &res.0[..]) - .ok_or_else(|| Error::from(ErrorKind::CallResultDecode(function))) - ) - } - // TODO [ToDr] Optimize and re-use tags from the pool. - fn transaction_tags(&self, at: Block::Hash, body: &Option>) -> error::Result> { + fn transaction_tags( + &self, + at: Block::Hash, + body: &Option> + ) -> error::Result> where + RA: TaggedTransactionQueue, + E: CallExecutor + Send + Sync + Clone, + { let id = BlockId::Hash(at); Ok(match body { None => vec![], Some(ref extrinsics) => { let mut tags = vec![]; for tx in extrinsics { - let tx = api::TaggedTransactionQueue::validate_transaction(self, &id, &tx)?; + let tx = self.runtime_api().validate_transaction(&id, &tx)?; match tx { TransactionValidity::Valid { mut provides, .. } => { tags.append(&mut provides); @@ -503,7 +498,10 @@ impl Client where authorities: Option>, finalized: bool, aux: Vec<(Vec, Option>)>, - ) -> error::Result { + ) -> error::Result where + RA: TaggedTransactionQueue, + E: CallExecutor + Send + Sync + Clone, + { let parent_hash = import_headers.post().parent_hash().clone(); match self.backend.blockchain().status(BlockId::Hash(hash))? { blockchain::BlockStatus::InChain => return Ok(ImportResult::AlreadyInChain), @@ -734,30 +732,9 @@ impl Client where } } - /// Get block hash by number. - pub fn block_hash(&self, block_number: <::Header as HeaderT>::Number) -> error::Result> { - self.backend.blockchain().hash(block_number) - } - - /// Convert an arbitrary block ID into a block hash. - pub fn block_hash_from_id(&self, id: &BlockId) -> error::Result> { - match *id { - BlockId::Hash(h) => Ok(Some(h)), - BlockId::Number(n) => self.block_hash(n), - } - } - - /// Convert an arbitrary block ID into a block hash. - pub fn block_number_from_id(&self, id: &BlockId) -> error::Result>> { - match *id { - BlockId::Hash(_) => Ok(self.header(id)?.map(|h| h.number().clone())), - BlockId::Number(n) => Ok(Some(n)), - } - } - /// Convert an arbitrary block ID into a block hash, returning error if the block is unknown. fn require_block_number_from_id(&self, id: &BlockId) -> error::Result> { - self.block_number_from_id(id) + self.backend.blockchain().block_number_from_id(id) .and_then(|n| n.ok_or_else(|| error::ErrorKind::UnknownBlock(format!("{}", id)).into())) } @@ -778,11 +755,11 @@ impl Client where /// Get full block by id. pub fn block(&self, id: &BlockId) - -> error::Result>> + -> error::Result>> { Ok(match (self.header(id)?, self.body(id)?, self.justification(id)?) { (Some(header), Some(extrinsics), Some(justification)) => - Some(SignedBlock { block: RuntimeBlock { header, extrinsics }, justification }), + Some(SignedBlock { block: Block::new(header, extrinsics), justification }), _ => None, }) } @@ -895,11 +872,87 @@ impl Client where } } - -impl consensus::BlockImport for Client where +impl ChainHeaderBackend for Client where B: backend::Backend, - E: CallExecutor + Clone, + E: CallExecutor + Send + Sync, Block: BlockT, + RA: Send + Sync +{ + fn header(&self, id: BlockId) -> error::Result> { + self.backend.blockchain().header(id) + } + + fn info(&self) -> error::Result> { + self.backend.blockchain().info() + } + + fn status(&self, id: BlockId) -> error::Result { + self.backend.blockchain().status(id) + } + + fn number(&self, hash: Block::Hash) -> error::Result::Header as HeaderT>::Number>> { + self.backend.blockchain().number(hash) + } + + fn hash(&self, number: NumberFor) -> error::Result> { + self.backend.blockchain().hash(number) + } +} + +impl ProvideRuntimeApi for Client where + B: backend::Backend, + E: CallExecutor + Clone + Send + Sync, + Block: BlockT, + RA: CoreAPI +{ + type Api = RA; + + fn runtime_api<'a>(&'a self) -> ApiRef<'a, Self::Api> { + Self::Api::construct_runtime_api(self) + } +} + +impl CallApiAt for Client where + B: backend::Backend, + E: CallExecutor + Clone + Send + Sync, + Block: BlockT, + RA: Send + Sync, +{ + fn call_api_at( + &self, + at: &BlockId, + function: &'static str, + args: Vec, + changes: &mut OverlayedChanges, + initialised_block: &mut Option>, + ) -> error::Result> { + //TODO: Find a better way to prevent double block initialization + if function != "initialise_block" && initialised_block.map(|id| id != *at).unwrap_or(true) { + let parent = at; + let header = <::Header as HeaderT>::new( + self.block_number_from_id(parent)? + .ok_or_else(|| error::ErrorKind::UnknownBlock(format!("{:?}", parent)))? + + As::sa(1), + Default::default(), + Default::default(), + self.block_hash_from_id(&parent)? + .ok_or_else(|| error::ErrorKind::UnknownBlock(format!("{:?}", parent)))?, + Default::default() + ); + self.call_at_state(at, "initialise_block", header.encode(), changes)?; + *initialised_block = Some(*at); + } + + self.call_at_state(at, function, args, changes) + } +} + + +impl consensus::BlockImport for Client where + B: backend::Backend, + E: CallExecutor + Clone + Send + Sync, + Block: BlockT, + RA: TaggedTransactionQueue { type Error = Error; @@ -914,8 +967,8 @@ impl consensus::BlockImport for Client where let ImportBlock { origin, header, - external_justification, - post_runtime_digests, + justification, + post_digests, body, finalized, auxiliary, @@ -927,11 +980,11 @@ impl consensus::BlockImport for Client where blockchain::BlockStatus::Unknown => return Ok(ImportResult::UnknownParent), } - let import_headers = if post_runtime_digests.is_empty() { + let import_headers = if post_digests.is_empty() { PrePostHeader::Same(header) } else { let mut post_header = header.clone(); - for item in post_runtime_digests { + for item in post_digests { post_header.digest_mut().push(item); } PrePostHeader::Different(header, post_header) @@ -946,7 +999,7 @@ impl consensus::BlockImport for Client where origin, hash, import_headers, - external_justification, + justification, body, new_authorities, finalized, @@ -963,7 +1016,7 @@ impl consensus::BlockImport for Client where } } -impl consensus::Authorities for Client where +impl consensus::Authorities for Client where B: backend::Backend, E: CallExecutor + Clone, Block: BlockT, @@ -974,7 +1027,7 @@ impl consensus::Authorities for Client where } } -impl CurrentHeight for Client where +impl CurrentHeight for Client where B: backend::Backend, E: CallExecutor + Clone, Block: BlockT, @@ -985,7 +1038,7 @@ impl CurrentHeight for Client where } } -impl BlockNumberToHash for Client where +impl BlockNumberToHash for Client where B: backend::Backend, E: CallExecutor + Clone, Block: BlockT, @@ -998,7 +1051,7 @@ impl BlockNumberToHash for Client where } -impl BlockchainEvents for Client +impl BlockchainEvents for Client where E: CallExecutor, Block: BlockT, @@ -1022,7 +1075,7 @@ where } } -impl ChainHead for Client +impl ChainHead for Client where B: backend::Backend, E: CallExecutor, @@ -1033,116 +1086,17 @@ where } } -impl BlockBody for Client where - B: backend::Backend, - E: CallExecutor, - Block: BlockT, +impl BlockBody for Client + where + B: backend::Backend, + E: CallExecutor, + Block: BlockT, { fn block_body(&self, id: &BlockId) -> error::Result::Extrinsic>>> { self.body(id) } } -impl api::Core for Client where - B: backend::Backend, - E: CallExecutor, - Block: BlockT, -{ - type Error = Error; - - fn version(&self, at: &BlockId) -> Result { - self.call_api_at(at, "version", &()) - } - - fn authorities(&self, at: &BlockId) -> Result, Self::Error> { - self.authorities_at(at) - } - - fn execute_block(&self, at: &BlockId, block: &Block) -> Result<(), Self::Error> { - self.call_api_at(at, "execute_block", &(block)) - } -} - -impl api::Metadata> for Client where - B: backend::Backend, - E: CallExecutor, - Block: BlockT, -{ - type Error = Error; - - fn metadata(&self, at: &BlockId) -> Result, Self::Error> { - self.executor.call(at, "metadata",&[]).map(|v| v.return_data) - } -} - -impl api::BlockBuilder for Client where - B: backend::Backend, - E: CallExecutor, - Block: BlockT, -{ - type Error = Error; - type OverlayedChanges = OverlayedChanges; - - fn initialise_block( - &self, - at: &BlockId, - changes: &mut OverlayedChanges, - header: &::Header - ) -> Result<(), Self::Error> { - self.call_at_state(at, "initialise_block", header, changes) - } - - fn apply_extrinsic( - &self, - at: &BlockId, - changes: &mut OverlayedChanges, - extrinsic: &::Extrinsic - ) -> Result { - self.call_at_state(at, "apply_extrinsic", extrinsic, changes) - } - - fn finalise_block( - &self, - at: &BlockId, - changes: &mut OverlayedChanges - ) -> Result<::Header, Self::Error> { - self.call_at_state(at, "finalise_block", &(), changes) - } - - fn inherent_extrinsics( - &self, at: &BlockId, inherent: &InherentExtrinsic - ) -> Result, Self::Error> { - self.call_api_at(at, "inherent_extrinsics", &(inherent)) - } - - fn check_inherents( - &self, - at: &BlockId, - block: &Block, - data: &InherentData - ) -> Result, Self::Error> { - self.call_api_at(at, "check_inherents", &(block, data)) - } - - fn random_seed(&self, at: &BlockId) -> Result<::Hash, Self::Error> { - self.call_api_at(at, "random_seed", &()) - } -} - -impl api::TaggedTransactionQueue for Client where - B: backend::Backend, - E: CallExecutor, - Block: BlockT, -{ - type Error = Error; - - fn validate_transaction( - &self, at: &BlockId, tx: &::Extrinsic - ) -> Result { - self.call_api_at(at, "validate_transaction", &(tx)) - } -} - #[cfg(test)] pub(crate) mod tests { use std::collections::HashMap; @@ -1155,14 +1109,14 @@ pub(crate) mod tests { use consensus::BlockOrigin; use test_client::client::backend::Backend as TestBackend; use test_client::BlockBuilderExt; - use test_client::runtime::{self, Block, Transfer}; + use test_client::runtime::{self, Block, Transfer, ClientWithApi, test_api::TestAPI}; /// Returns tuple, consisting of: /// 1) test client pre-filled with blocks changing balances; /// 2) roots of changes tries for these blocks /// 3) test cases in form (begin, end, key, vec![(block, extrinsic)]) that are required to pass pub fn prepare_client_with_key_changes() -> ( - test_client::client::Client, + test_client::client::Client, Vec, Vec<(u64, u64, Vec, Vec<(u64, u32)>)>, ) { @@ -1234,8 +1188,20 @@ pub(crate) mod tests { fn client_initialises_from_genesis_ok() { let client = test_client::new(); - assert_eq!(client.call_api::<_, u64>("balance_of", &Keyring::Alice.to_raw_public()).unwrap(), 1000); - assert_eq!(client.call_api::<_, u64>("balance_of", &Keyring::Ferdie.to_raw_public()).unwrap(), 0); + assert_eq!( + client.runtime_api().balance_of( + &BlockId::Number(client.info().unwrap().chain.best_number), + &Keyring::Alice.to_raw_public() + ).unwrap(), + 1000 + ); + assert_eq!( + client.runtime_api().balance_of( + &BlockId::Number(client.info().unwrap().chain.best_number), + &Keyring::Ferdie.to_raw_public() + ).unwrap(), + 0 + ); } #[test] @@ -1278,8 +1244,20 @@ pub(crate) mod tests { assert_eq!(client.info().unwrap().chain.best_number, 1); assert!(client.state_at(&BlockId::Number(1)).unwrap() != client.state_at(&BlockId::Number(0)).unwrap()); - assert_eq!(client.call_api::<_, u64>("balance_of", &Keyring::Alice.to_raw_public()).unwrap(), 958); - assert_eq!(client.call_api::<_, u64>("balance_of", &Keyring::Ferdie.to_raw_public()).unwrap(), 42); + assert_eq!( + client.runtime_api().balance_of( + &BlockId::Number(client.info().unwrap().chain.best_number), + &Keyring::Alice.to_raw_public() + ).unwrap(), + 958 + ); + assert_eq!( + client.runtime_api().balance_of( + &BlockId::Number(client.info().unwrap().chain.best_number), + &Keyring::Ferdie.to_raw_public() + ).unwrap(), + 42 + ); } #[test] diff --git a/substrate/core/client/src/error.rs b/substrate/core/client/src/error.rs index 3971b6a821..aa09344c99 100644 --- a/substrate/core/client/src/error.rs +++ b/substrate/core/client/src/error.rs @@ -41,7 +41,7 @@ error_chain! { } /// Applying extrinsic error. - ApplyExtinsicFailed(e: ApplyError) { + ApplyExtrinsicFailed(e: ApplyError) { description("Extrinsic error"), display("Extrinsic error: {:?}", e), } diff --git a/substrate/core/client/src/genesis.rs b/substrate/core/client/src/genesis.rs index 16dc8f5e05..83c4338b8b 100644 --- a/substrate/core/client/src/genesis.rs +++ b/substrate/core/client/src/genesis.rs @@ -67,7 +67,7 @@ mod tests { use trie::ordered_trie_root; let transactions = txs.into_iter().map(|tx| { - let signature = Pair::from(Keyring::from_public(Public::from_raw(tx.from.0)).unwrap()) + let signature = Pair::from(Keyring::from_public(Public::from_raw(tx.from.to_fixed_bytes())).unwrap()) .sign(&tx.encode()).into(); Extrinsic { transfer: tx, signature } diff --git a/substrate/core/client/src/lib.rs b/substrate/core/client/src/lib.rs index a033277905..58fced9687 100644 --- a/substrate/core/client/src/lib.rs +++ b/substrate/core/client/src/lib.rs @@ -14,64 +14,103 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Substrate Client and associated logic. -// end::description[] +#![cfg_attr(not(feature = "std"), no_std)] #![warn(missing_docs)] #![recursion_limit="128"] +#[cfg(feature = "std")] extern crate substrate_trie as trie; extern crate parity_codec as codec; extern crate substrate_primitives as primitives; extern crate sr_primitives as runtime_primitives; +#[cfg(feature = "std")] extern crate substrate_state_machine as state_machine; +#[cfg(feature = "std")] extern crate substrate_consensus_common as consensus; -#[cfg(test)] extern crate substrate_keyring as keyring; -#[cfg(test)] extern crate substrate_test_client as test_client; -#[macro_use] extern crate substrate_telemetry; -#[macro_use] extern crate slog; // needed until we can reexport `slog_info` from `substrate_telemetry` +extern crate sr_version as runtime_version; +extern crate sr_std as rstd; +#[cfg(test)] +extern crate substrate_keyring as keyring; +#[cfg(test)] +extern crate substrate_test_client as test_client; +#[cfg(feature = "std")] +#[macro_use] +extern crate substrate_telemetry; +#[cfg(feature = "std")] +#[macro_use] +extern crate slog; // needed until we can reexport `slog_info` from `substrate_telemetry` +#[cfg(feature = "std")] extern crate fnv; +#[cfg(feature = "std")] extern crate futures; +#[cfg(feature = "std")] extern crate parking_lot; +#[cfg(feature = "std")] extern crate hash_db; +#[cfg(feature = "std")] extern crate heapsize; +#[cfg(feature = "std")] extern crate kvdb; -extern crate sr_api; -#[macro_use] extern crate error_chain; -#[macro_use] extern crate log; -#[cfg_attr(test, macro_use)] extern crate substrate_executor as executor; -#[cfg(test)] #[macro_use] extern crate hex_literal; -#[cfg(test)] extern crate kvdb_memorydb; +#[cfg(feature = "std")] +#[macro_use] +extern crate error_chain; +#[cfg(feature = "std")] +#[macro_use] +extern crate log; +#[cfg(feature = "std")] +#[cfg_attr(test, macro_use)] +extern crate substrate_executor as executor; +#[cfg(test)] +#[macro_use] +extern crate hex_literal; +#[cfg(feature = "std")] +#[cfg(test)] +extern crate kvdb_memorydb; +#[macro_use] +pub mod runtime_api; +#[cfg(feature = "std")] pub mod error; +#[cfg(feature = "std")] pub mod blockchain; +#[cfg(feature = "std")] pub mod backend; +#[cfg(feature = "std")] pub mod cht; +#[cfg(feature = "std")] pub mod in_mem; +#[cfg(feature = "std")] pub mod genesis; pub mod block_builder; +#[cfg(feature = "std")] pub mod light; +#[cfg(feature = "std")] mod leaves; +#[cfg(feature = "std")] mod call_executor; +#[cfg(feature = "std")] mod client; +#[cfg(feature = "std")] mod notifications; +#[cfg(feature = "std")] pub use blockchain::Info as ChainInfo; +#[cfg(feature = "std")] pub use call_executor::{CallResult, CallExecutor, LocalCallExecutor}; +#[cfg(feature = "std")] pub use client::{ new_with_backend, new_in_mem, BlockBody, BlockStatus, ImportNotifications, FinalityNotifications, BlockchainEvents, Client, ClientInfo, ChainHead, }; +#[cfg(feature = "std")] pub use notifications::{StorageEventStream, StorageChangeSet}; +#[cfg(feature = "std")] pub use state_machine::ExecutionStrategy; +#[cfg(feature = "std")] pub use leaves::LeafSet; - -/// Traits for interfacing with the runtime from the client. -pub mod runtime_api { - pub use sr_api::*; -} diff --git a/substrate/core/client/src/light/call_executor.rs b/substrate/core/client/src/light/call_executor.rs index d52883db64..732b783b73 100644 --- a/substrate/core/client/src/light/call_executor.rs +++ b/substrate/core/client/src/light/call_executor.rs @@ -21,6 +21,7 @@ use std::marker::PhantomData; use std::sync::Arc; use futures::{IntoFuture, Future}; +use primitives::convert_hash; use runtime_primitives::generic::BlockId; use runtime_primitives::traits::{Block as BlockT, Header as HeaderT}; use state_machine::{Backend as StateBackend, CodeExecutor, OverlayedChanges, @@ -136,8 +137,7 @@ pub fn check_execution_proof( { let local_state_root = request.header.state_root(); - let mut root: H::Out = Default::default(); - root.as_mut().copy_from_slice(local_state_root.as_ref()); + let root: H::Out = convert_hash(&local_state_root); let mut changes = OverlayedChanges::default(); let local_result = execution_proof_check::( diff --git a/substrate/core/client/src/light/fetcher.rs b/substrate/core/client/src/light/fetcher.rs index 38a46c7d68..b75b74a0a9 100644 --- a/substrate/core/client/src/light/fetcher.rs +++ b/substrate/core/client/src/light/fetcher.rs @@ -21,10 +21,10 @@ use futures::IntoFuture; use hash_db::Hasher; use heapsize::HeapSizeOf; -use primitives::ChangesTrieConfiguration; +use primitives::{ChangesTrieConfiguration, convert_hash}; use runtime_primitives::traits::{As, Block as BlockT, Header as HeaderT, NumberFor}; -use state_machine::{CodeExecutor, ChangesTrieRootsStorage, read_proof_check, - key_changes_proof_check}; +use state_machine::{CodeExecutor, ChangesTrieRootsStorage, ChangesTrieAnchorBlockId, + read_proof_check, key_changes_proof_check}; use call_executor::CallResult; use cht; @@ -192,9 +192,8 @@ impl FetchChecker for LightDataChecker request: &RemoteReadRequest, remote_proof: Vec> ) -> ClientResult>> { - let mut root: H::Out = Default::default(); - root.as_mut().copy_from_slice(request.header.state_root().as_ref()); - read_proof_check::(root, remote_proof, &request.key).map_err(Into::into) + read_proof_check::(convert_hash(request.header.state_root()), remote_proof, &request.key) + .map_err(Into::into) } fn check_execution_proof( @@ -229,7 +228,10 @@ impl FetchChecker for LightDataChecker }, remote_proof, first_number, - request.last_block.0.as_(), + &ChangesTrieAnchorBlockId { + hash: convert_hash(&request.last_block.1), + number: request.last_block.0.as_(), + }, remote_max.as_(), &request.key) .map(|pairs| pairs.into_iter().map(|(b, x)| (As::sa(b), x)).collect()) @@ -248,15 +250,12 @@ impl<'a, H, Hash> ChangesTrieRootsStorage for RootsStorage<'a, Hash> H: Hasher, Hash: 'a + Send + Sync + Clone + AsRef<[u8]>, { - fn root(&self, block: u64) -> Result, String> { + fn root(&self, _anchor: &ChangesTrieAnchorBlockId, block: u64) -> Result, String> { + // we can't ask for roots from parallel forks here => ignore anchor Ok(block.checked_sub(self.first) .and_then(|index| self.roots.get(index as usize)) .cloned() - .map(|root| { - let mut hasher_root: H::Out = Default::default(); - hasher_root.as_mut().copy_from_slice(root.as_ref()); - hasher_root - })) + .map(|root| convert_hash(&root))) } } @@ -478,7 +477,7 @@ pub mod tests { assert!(local_checker.check_changes_proof(&request, remote_max + 1, remote_proof.clone()).is_err()); // check proof on local client using broken proof - remote_proof = local_roots_range.into_iter().map(|v| v.to_vec()).collect(); + remote_proof = local_roots_range.into_iter().map(|v| v.as_bytes().to_vec()).collect(); assert!(local_checker.check_changes_proof(&request, remote_max, remote_proof).is_err()); } } diff --git a/substrate/core/client/src/light/mod.rs b/substrate/core/client/src/light/mod.rs index 8791e2930f..29db81a001 100644 --- a/substrate/core/client/src/light/mod.rs +++ b/substrate/core/client/src/light/mod.rs @@ -48,11 +48,11 @@ pub fn new_light_backend, F: Fetcher>(bloc } /// Create an instance of light client. -pub fn new_light( +pub fn new_light( backend: Arc>, fetcher: Arc, genesis_storage: GS, -) -> ClientResult, RemoteCallExecutor, F, Blake2Hasher>, B>> +) -> ClientResult, RemoteCallExecutor, F, Blake2Hasher>, B, RA>> where B: BlockT, S: BlockchainStorage, diff --git a/substrate/core/client/src/runtime_api/core.rs b/substrate/core/client/src/runtime_api/core.rs new file mode 100644 index 0000000000..20798422b7 --- /dev/null +++ b/substrate/core/client/src/runtime_api/core.rs @@ -0,0 +1,62 @@ +// Copyright 2018 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate 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. + +// Substrate 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 Substrate. If not, see . + +#[cfg(feature = "std")] +use super::{ConstructRuntimeApi, ApiExt}; +use runtime_version::RuntimeVersion; +use runtime_primitives::traits::Block as BlockT; +#[cfg(feature = "std")] +use runtime_primitives::generic::BlockId; +use primitives::AuthorityId; +#[cfg(feature = "std")] +use error::Result; +use rstd::vec::Vec; + +/// The `Core` api trait that is mandantory for each runtime. +/// This is the side that should be implemented for the `RuntimeApi` that is used by the `Client`. +/// Any modifications at one of these two traits, needs to be done on the other one as well. +#[cfg(feature = "std")] +pub trait Core: 'static + Send + Sync + ConstructRuntimeApi + ApiExt { + /// Returns the version of the runtime. + fn version(&self, at: &BlockId) -> Result; + /// Returns the authorities. + fn authorities(&self, at: &BlockId) -> Result>; + /// Execute the given block. + fn execute_block(&self, at: &BlockId, block: &Block) -> Result<()>; + /// Initialise a block with the given header. + fn initialise_block( + &self, + at: &BlockId, + header: &::Header + ) -> Result<()>; +} + +pub mod runtime { + use super::*; + + /// The `Core` api trait that is mandantory for each runtime. + /// This is the side that should be implemented for the `Runtime`. + pub trait Core { + /// Returns the version of the runtime. + fn version() -> RuntimeVersion; + /// Returns the authorities. + fn authorities() -> Vec; + /// Execute the given block. + fn execute_block(block: Block); + /// Initialise a block with the given header. + fn initialise_block(header: ::Header); + } +} diff --git a/substrate/core/sr-api/src/lib.rs b/substrate/core/client/src/runtime_api/macros.rs similarity index 78% rename from substrate/core/sr-api/src/lib.rs rename to substrate/core/client/src/runtime_api/macros.rs index ed148c0030..b58f2143c8 100644 --- a/substrate/core/sr-api/src/lib.rs +++ b/substrate/core/client/src/runtime_api/macros.rs @@ -14,25 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] -//! API's for interfacing with the runtime via native/wasm. -// end::description[] - -#![cfg_attr(not(feature = "std"), no_std)] - -extern crate sr_std as rstd; -extern crate sr_primitives as primitives; -#[doc(hidden)] -pub extern crate parity_codec as codec; -extern crate sr_version as runtime_version; -use rstd::vec::Vec; - -#[doc(hidden)] -pub use primitives::{traits::Block as BlockT, generic::BlockId, transaction_validity::TransactionValidity, ApplyResult}; -#[doc(hidden)] -pub use rstd::slice; -#[doc(hidden)] -pub use codec::{Encode, Decode}; +//! Macros for declaring and implementing the runtime APIs. // these are part of the public API, so need to be re-exported pub use runtime_version::{ApiId, RuntimeVersion}; @@ -42,7 +24,7 @@ pub use runtime_version::{ApiId, RuntimeVersion}; /// # Example: /// /// ```nocompile -/// decl_apis!{ +/// decl_runtime_apis!{ /// pub trait Test ExtraClientSide { /// fn test(event: Event) -> AccountId; /// @@ -70,11 +52,11 @@ pub use runtime_version::{ApiId, RuntimeVersion}; /// } /// ``` /// -/// The declarations generated in the `runtime` module will be used by `impl_apis!` for implementing +/// The declarations generated in the `runtime` module will be used by `impl_runtime_apis!` for implementing /// the traits for a runtime. The other declarations should be used for implementing the interface /// in the client. #[macro_export] -macro_rules! decl_apis { +macro_rules! decl_runtime_apis { ( $( $( #[$attr:meta] )* @@ -93,7 +75,7 @@ macro_rules! decl_apis { )* ) => { $( - decl_apis!( + decl_runtime_apis!( @ADD_BLOCK_GENERIC $( #[$attr] )* pub trait $name $(< $( $generic_param $( : $generic_bound )* ),* >)* { @@ -111,7 +93,7 @@ macro_rules! decl_apis { $( $( $generic_param $( : $generic_bound )* ),* )* ); )* - decl_apis! { + decl_runtime_apis! { @GENERATE_RUNTIME_TRAITS $( $( #[$attr] )* @@ -140,7 +122,7 @@ macro_rules! decl_apis { Block: BlockT $(, $generic_param_rest:ident $( : $generic_bound_rest:ident )* )* ) => { - decl_apis!( + decl_runtime_apis!( @ADD_BLOCK_GENERIC $( #[$attr] )* pub trait $name $(< $( $generic_param_orig $( : $generic_bound_orig )* ),* >)* { @@ -153,7 +135,7 @@ macro_rules! decl_apis { )* }; Found; - $( $generic_param_parsed $( : $generic_bound_parsed )* , )* Block: $crate::BlockT; + $( $generic_param_parsed $( : $generic_bound_parsed )* , )* Block: $crate::runtime_api::BlockT; $( $generic_param_rest $( : $generic_bound_rest )* ),* ); }; @@ -173,7 +155,7 @@ macro_rules! decl_apis { $generic_param:ident $( : $generic_bound:ident )* $(, $generic_param_rest:ident $( : $generic_bound_rest:ident )* )* ) => { - decl_apis!( + decl_runtime_apis!( @ADD_BLOCK_GENERIC $( #[$attr] )* pub trait $name $(< $( $generic_param_orig $( : $generic_bound_orig )* ),* >)* { @@ -204,7 +186,7 @@ macro_rules! decl_apis { Found; $( $generic_param_parsed:ident $( : $generic_bound_parsed:path )* ),*; ) => { - decl_apis!( + decl_runtime_apis!( @GENERATE_RETURN_TYPES $( #[$attr] )* pub trait $name $(< $( $generic_param_orig $( : $generic_bound_orig )* ),* >)* { @@ -235,7 +217,7 @@ macro_rules! decl_apis { ; $( $generic_param_parsed:ident $( : $generic_bound_parsed:ident )* ),*; ) => { - decl_apis!( + decl_runtime_apis!( @GENERATE_RETURN_TYPES $( #[$attr] )* pub trait $name $(< $( $generic_param_orig $( : $generic_bound_orig )* ),* >)* { @@ -248,7 +230,7 @@ macro_rules! decl_apis { )* }; // We need to add the required generic Block parameter - Block: $crate::BlockT $(, $generic_param_parsed $( : $generic_bound_parsed )* )*; + Block: $crate::runtime_api::BlockT $(, $generic_param_parsed $( : $generic_bound_parsed )* )*; {}; $( $( $return_ty )*; )* ); @@ -269,7 +251,7 @@ macro_rules! decl_apis { $return_ty_current:ty; $( $( $return_ty_rest:ty )*; )* ) => { - decl_apis!( + decl_runtime_apis!( @GENERATE_RETURN_TYPES $( #[$attr] )* pub trait $name $(< $( $generic_param_orig $( : $generic_bound_orig )* ),* >)* { @@ -282,7 +264,7 @@ macro_rules! decl_apis { )* }; $( $generic_param_parsed $( : $generic_bound_parsed )* ),*; - { $( $result_return_ty; )* Result<$return_ty_current, Self::Error>; }; + { $( $result_return_ty; )* $crate::error::Result<$return_ty_current>; }; $( $( $return_ty_rest )*; )* ); }; @@ -302,7 +284,7 @@ macro_rules! decl_apis { ; $( $( $return_ty_rest:ty )*; )* ) => { - decl_apis!( + decl_runtime_apis!( @GENERATE_RETURN_TYPES $( #[$attr] )* pub trait $name $(< $( $generic_param_orig $( : $generic_bound_orig )* ),* >)* { @@ -315,7 +297,7 @@ macro_rules! decl_apis { )* }; $( $generic_param_parsed $( : $generic_bound_parsed )* ),*; - { $( $result_return_ty; )* Result<(), Self::Error>; }; + { $( $result_return_ty; )* $crate::error::Result<()>; }; $( $( $return_ty_rest )*; )* ); }; @@ -333,7 +315,7 @@ macro_rules! decl_apis { $( $generic_param_parsed:ident $( : $generic_bound_parsed:path )* ),*; { $( $result_return_ty:ty; )* }; ) => { - decl_apis!( + decl_runtime_apis!( @GENERATE_CLIENT_TRAITS $( #[$attr] )* pub trait $name $(< $( $generic_param_orig $( : $generic_bound_orig )* ),* >)* { @@ -364,15 +346,14 @@ macro_rules! decl_apis { { $( $result_return_ty:ty; )* }; ) => { $( #[$attr] )* - pub trait $name < $( $generic_param_parsed $( : $generic_bound_parsed )* ),* > { - /// The Error type returned by this API. - type Error; + #[cfg(feature = "std")] + pub trait $name < $( $generic_param_parsed $( : $generic_bound_parsed )* ),* > : $crate::runtime_api::Core { $( type $client_generic_param $( : $client_generic_bound )*; )* $( $( #[$fn_attr] )* - fn $fn_name $( < $( $fn_generic: $crate::Encode + $crate::Decode ),* > )* ( - &self, at: &$crate::BlockId $(, $param_name: $param_type )* + fn $fn_name $( < $( $fn_generic: $crate::runtime_api::Encode + $crate::runtime_api::Decode ),* > )* ( + &self, at: &$crate::runtime_api::BlockId $(, $param_name: $param_type )* ) -> $result_return_ty; )* } @@ -390,7 +371,7 @@ macro_rules! decl_apis { }; )* ) => { - decl_apis! { + decl_runtime_apis! { @GENERATE_RUNTIME_TRAITS_WITH_JOINED_GENERICS $( $( #[$attr] )* @@ -431,63 +412,8 @@ macro_rules! decl_apis { }; } -/// The ApiIds for the various standard runtime APIs. -pub mod id { - use super::ApiId; - - /// ApiId for the BlockBuilder trait. - pub const BLOCK_BUILDER: ApiId = *b"blkbuild"; - - /// ApiId for the TaggedTransactionQueue trait. - pub const TAGGED_TRANSACTION_QUEUE: ApiId = *b"validatx"; - - /// ApiId for the Metadata trait. - pub const METADATA: ApiId = *b"metadata"; -} - -decl_apis! { - /// The `Core` api trait that is mandantory for each runtime. - pub trait Core { - fn version() -> RuntimeVersion; - fn authorities() -> Vec; - fn execute_block(block: Block); - } - - /// The `Metadata` api trait that returns metadata for the runtime. - pub trait Metadata { - fn metadata() -> Data; - } - - /// The `OldTxQueue` api trait for interfering with the old transaction queue. - pub trait OldTxQueue { - fn account_nonce(account: AccountId) -> Index; - fn lookup_address(address: Address) -> Option; - } - - /// The `TaggedTransactionQueue` api trait for interfering with the new transaction queue. - pub trait TaggedTransactionQueue { - fn validate_transaction(tx: ::Extrinsic) -> TransactionValidity; - } - - /// The `BlockBuilder` api trait that provides required functions for building a block for a runtime. - pub trait BlockBuilder ExtraClientSide { - /// Initialise a block with the given header. - fn initialise_block(header: ::Header) ExtraClientSide(changes: &mut Self::OverlayedChanges); - /// Apply the given extrinsics. - fn apply_extrinsic(extrinsic: ::Extrinsic) ExtraClientSide(changes: &mut Self::OverlayedChanges) -> ApplyResult; - /// Finish the current block. - fn finalise_block() ExtraClientSide(changes: &mut Self::OverlayedChanges) -> ::Header; - /// Generate inherent extrinsics. - fn inherent_extrinsics(inherent: InherentExtrinsic) -> Vec; - /// Check that the inherents are valid. - fn check_inherents(block: Block, data: InherentData) -> Result<(), Error>; - /// Generate a random seed. - fn random_seed() -> ::Hash; - } -} - /// Implement the given API's for the given runtime. -/// All desired API's need to be implemented in one `impl_apis!` call. +/// All desired API's need to be implemented in one `impl_runtime_apis!` call. /// Besides generating the implementation for the runtime, there will be also generated an /// auxiliary module named `api` that contains function for inferring with the API in native/wasm. /// It is important to use the traits from the `runtime` module with this macro. @@ -496,18 +422,17 @@ decl_apis! { /// /// ```nocompile /// #[macro_use] -/// extern crate sr_api as runtime_api; +/// extern crate substrate_client as client; /// -/// use runtime_api::runtime::{Core, TaggedTransactionQueue}; +/// use client::runtime_api::runtime::{Core, TaggedTransactionQueue}; /// -/// impl_apis! { -/// impl Core for Runtime { -/// fn version() -> RuntimeVersion { 1 } -/// fn authorities() -> Vec { vec![1] } +/// impl_runtime_apis! { +/// impl Core for Runtime { +/// fn version() -> RuntimeVersion { unimplemented!() } +/// fn authorities() -> Vec { unimplemented!() } /// fn execute_block(block: Block) { /// //comment -/// let block = call_arbitrary_code(block); -/// execute(block); +/// unimplemented!() /// } /// } /// @@ -521,7 +446,7 @@ decl_apis! { /// fn main() {} /// ``` #[macro_export] -macro_rules! impl_apis { +macro_rules! impl_runtime_apis { ( impl $trait_name:ident $( < $( $generic:ident ),* > )* for $runtime:ident { $( @@ -539,7 +464,7 @@ macro_rules! impl_apis { } )* } - impl_apis! { + impl_runtime_apis! { $runtime; $( $fn_name ( $( $arg_name: $arg_ty ),* ); )*; $( $rest )* @@ -564,7 +489,7 @@ macro_rules! impl_apis { } )* } - impl_apis! { + impl_runtime_apis! { $runtime; $( $fn_name_parsed ( $( $arg_name_parsed: $arg_ty_parsed ),* ); )* $( $fn_name ( $( $arg_name: $arg_ty ),* ); )*; @@ -583,7 +508,7 @@ macro_rules! impl_apis { match method { $( stringify!($fn_name) => { - Some({impl_apis! { + Some({impl_runtime_apis! { @GENERATE_IMPL_CALL $runtime; $fn_name; @@ -604,11 +529,11 @@ macro_rules! impl_apis { &[0u8; 0] } else { unsafe { - $crate::slice::from_raw_parts(input_data, input_len) + $crate::runtime_api::slice::from_raw_parts(input_data, input_len) } }; - let output = { impl_apis! { + let output = { impl_runtime_apis! { @GENERATE_IMPL_CALL $runtime; $fn_name; @@ -632,13 +557,13 @@ macro_rules! impl_apis { $arg_name:ident : $arg_ty:ty; $input:ident; ) => { - let $arg_name : $arg_ty = match $crate::codec::Decode::decode(&mut $input) { + let $arg_name : $arg_ty = match $crate::runtime_api::Decode::decode(&mut $input) { Some(input) => input, None => panic!("Bad input data provided to {}", stringify!($fn_name)), }; let output = $runtime::$fn_name($arg_name); - $crate::codec::Encode::encode(&output) + $crate::runtime_api::Encode::encode(&output) }; (@GENERATE_IMPL_CALL $runtime:ident; @@ -646,12 +571,12 @@ macro_rules! impl_apis { $( $arg_name:ident : $arg_ty:ty ),*; $input:ident; ) => { - let ( $( $arg_name ),* ) : ($( $arg_ty ),*) = match $crate::codec::Decode::decode(&mut $input) { + let ( $( $arg_name ),* ) : ($( $arg_ty ),*) = match $crate::runtime_api::Decode::decode(&mut $input) { Some(input) => input, None => panic!("Bad input data provided to {}", stringify!($fn_name)), }; let output = $runtime::$fn_name($( $arg_name ),*); - $crate::codec::Encode::encode(&output) + $crate::runtime_api::Encode::encode(&output) }; } diff --git a/substrate/core/client/src/runtime_api/mod.rs b/substrate/core/client/src/runtime_api/mod.rs new file mode 100644 index 0000000000..e151718360 --- /dev/null +++ b/substrate/core/client/src/runtime_api/mod.rs @@ -0,0 +1,122 @@ +// Copyright 2018 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate 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. + +// Substrate 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 Substrate. If not, see . + +//! All the functionality required for declaring and implementing runtime api's. +//! Core api's are also declared here. + +#[doc(hidden)] +#[cfg(feature = "std")] +pub use state_machine::OverlayedChanges; +#[doc(hidden)] +pub use runtime_primitives::{traits::Block as BlockT, generic::BlockId}; +#[cfg(feature = "std")] +use runtime_primitives::traits::ApiRef; +pub use runtime_version::ApiId; +#[doc(hidden)] +pub use rstd::slice; +#[cfg(feature = "std")] +use rstd::result; +pub use codec::{Encode, Decode}; +#[cfg(feature = "std")] +use error; + +mod core; +#[macro_use] +mod macros; +mod traits; + +/// Something that can be constructed to a runtime api. +#[cfg(feature = "std")] +pub trait ConstructRuntimeApi: Sized { + /// Construct an instance of the runtime api. + fn construct_runtime_api<'a, T: CallApiAt>(call: &'a T) -> ApiRef<'a, Self>; +} + +/// An extension for the `RuntimeApi`. +#[cfg(feature = "std")] +pub trait ApiExt { + /// The given closure will be called with api instance. Inside the closure any api call is + /// allowed. After doing the api call, the closure is allowed to map the `Result` to a + /// different `Result` type. This can be important, as the internal data structure that keeps + /// track of modifications to the storage, discards changes when the `Result` is an `Err`. + /// On `Ok`, the structure commits the changes to an internal buffer. + fn map_api_result result::Result, R, E>( + &self, + map_call: F + ) -> result::Result; +} + +/// Something that can call the runtime api at a given block. +#[cfg(feature = "std")] +pub trait CallApiAt { + /// Calls the given api function with the given encoded arguments at the given block + /// and returns the encoded result. + fn call_api_at( + &self, + at: &BlockId, + function: &'static str, + args: Vec, + changes: &mut OverlayedChanges, + initialised_block: &mut Option>, + ) -> error::Result>; + + /// Call the given api function with strong arguments at the given block + /// and returns the decoded result. + fn call_api_at_strong( + &self, + at: &BlockId, + function: &'static str, + args: &In, + changes: &mut OverlayedChanges, + initialised_block: &mut Option>, + ) -> error::Result where Self: Sized { + let raw = self.call_api_at( + at, + function, + args.encode(), + changes, + initialised_block, + )?; + + match Out::decode(&mut &raw[..]) { + Some(out) => Ok(out), + None => bail!(error::ErrorKind::CallResultDecode(function)), + } + } +} + +/// The ApiIds for the various standard runtime APIs. +pub mod id { + use super::ApiId; + + /// ApiId for the BlockBuilder trait. + pub const BLOCK_BUILDER: ApiId = *b"blkbuild"; + + /// ApiId for the TaggedTransactionQueue trait. + pub const TAGGED_TRANSACTION_QUEUE: ApiId = *b"validatx"; + + /// ApiId for the Metadata trait. + pub const METADATA: ApiId = *b"metadata"; +} + +pub use self::core::*; +pub use self::traits::*; + +/// The runtime apis that should be implemented for the `Runtime`. +pub mod runtime { + pub use super::core::runtime::Core; + pub use super::traits::runtime::*; +} diff --git a/substrate/core/client/src/runtime_api/traits.rs b/substrate/core/client/src/runtime_api/traits.rs new file mode 100644 index 0000000000..4d237a09ef --- /dev/null +++ b/substrate/core/client/src/runtime_api/traits.rs @@ -0,0 +1,35 @@ +// Copyright 2018 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate 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. + +// Substrate 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 Substrate. If not, see . + +use primitives::OpaqueMetadata; +use runtime_primitives::{ + traits::{Block as BlockT}, + transaction_validity::TransactionValidity +}; + +decl_runtime_apis! { + /// The `Metadata` api trait that returns metadata for the runtime. + pub trait Metadata { + /// Returns the metadata of a runtime. + fn metadata() -> OpaqueMetadata; + } + + /// The `TaggedTransactionQueue` api trait for interfering with the new transaction queue. + pub trait TaggedTransactionQueue { + /// Validate the given transaction. + fn validate_transaction(tx: ::Extrinsic) -> TransactionValidity; + } +} diff --git a/substrate/core/consensus/aura/src/lib.rs b/substrate/core/consensus/aura/src/lib.rs index c57161668d..babfef8dc1 100644 --- a/substrate/core/consensus/aura/src/lib.rs +++ b/substrate/core/consensus/aura/src/lib.rs @@ -130,22 +130,7 @@ pub trait CompatibleDigestItem: Sized { fn as_aura_seal(&self) -> Option<(u64, &ed25519::Signature)>; } -impl CompatibleDigestItem for generic::DigestItem { - /// Construct a digest item which is a slot number and a signature on the - /// hash. - fn aura_seal(slot_number: u64, signature: ed25519::Signature) -> Self { - generic::DigestItem::Seal(slot_number, signature) - } - /// If this item is an Aura seal, return the slot number and signature. - fn as_aura_seal(&self) -> Option<(u64, &ed25519::Signature)> { - match self { - generic::DigestItem::Seal(slot, ref sign) => Some((*slot, sign)), - _ => None - } - } -} - -impl CompatibleDigestItem for generic::DigestItem { +impl CompatibleDigestItem for generic::DigestItem { /// Construct a digest item which is a slot number and a signature on the /// hash. fn aura_seal(slot_number: u64, signature: ed25519::Signature) -> Self { @@ -255,8 +240,8 @@ pub fn start_aura( let import_block = ImportBlock { origin: BlockOrigin::Own, header, - external_justification: Vec::new(), - post_runtime_digests: vec![item], + justification: Vec::new(), + post_digests: vec![item], body: Some(body), finalized: false, auxiliary: Vec::new(), @@ -380,8 +365,8 @@ impl Verifier for AuraVerifier where let import_block = ImportBlock { origin, header: pre_header, - external_justification: Vec::new(), - post_runtime_digests: vec![item], + justification: Vec::new(), + post_digests: vec![item], body, finalized: false, auxiliary: Vec::new(), @@ -420,7 +405,7 @@ mod tests { use network::test::*; use network::test::{Block as TestBlock, PeersClient}; use runtime_primitives::traits::Block as BlockT; - use network::ProtocolConfig; + use network::config::ProtocolConfig; use parking_lot::Mutex; use tokio::runtime::current_thread; use keyring::Keyring; @@ -429,7 +414,7 @@ mod tests { type Error = client::error::Error; - type TestClient = client::Client; + type TestClient = client::Client; struct DummyFactory(Arc); struct DummyProposer(u64, Arc); diff --git a/substrate/core/consensus/common/README.adoc b/substrate/core/consensus/common/README.adoc deleted file mode 100644 index d8f9e1daf2..0000000000 --- a/substrate/core/consensus/common/README.adoc +++ /dev/null @@ -1,12 +0,0 @@ -= Consensus Common - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/consensus/common/src/block_import.rs b/substrate/core/consensus/common/src/block_import.rs index 582886d827..566e5bfb02 100644 --- a/substrate/core/consensus/common/src/block_import.rs +++ b/substrate/core/consensus/common/src/block_import.rs @@ -44,7 +44,7 @@ pub struct ImportBlock { /// /// Consensus engines which alter the header (by adding post-runtime digests) /// should strip those off in the initial verification process and pass them - /// via the `post_runtime_digests` field. During block authorship, they should + /// via the `post_digests` field. During block authorship, they should /// not be pushed to the header directly. /// /// The reason for this distinction is so the header can be directly @@ -52,10 +52,10 @@ pub struct ImportBlock { /// post-runtime digests are pushed back on after. pub header: Block::Header, /// Justification provided for this block from the outside:. - pub external_justification: Justification, + pub justification: Justification, /// Digest items that have been added after the runtime for external /// work, like a consensus signature. - pub post_runtime_digests: Vec>, + pub post_digests: Vec>, /// Block's body pub body: Option>, /// Is this block finalized already? @@ -82,8 +82,8 @@ impl ImportBlock { ( self.origin, self.header, - self.external_justification, - self.post_runtime_digests, + self.justification, + self.post_digests, self.body, self.finalized, self.auxiliary, diff --git a/substrate/core/consensus/common/src/lib.rs b/substrate/core/consensus/common/src/lib.rs index 12d5cfa70d..4758a4abfe 100644 --- a/substrate/core/consensus/common/src/lib.rs +++ b/substrate/core/consensus/common/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate Consensus Common. If not, see . -// tag::description[] -//! Consensus basics and common features -// end::description[] +//! Tracks offline validators. // This provides "unused" building blocks to other crates #![allow(dead_code)] diff --git a/substrate/core/consensus/rhd/README.adoc b/substrate/core/consensus/rhd/README.adoc deleted file mode 100644 index ff7bde1714..0000000000 --- a/substrate/core/consensus/rhd/README.adoc +++ /dev/null @@ -1,12 +0,0 @@ -= Consensus Rhododendron (RHD) - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/consensus/rhd/src/lib.rs b/substrate/core/consensus/rhd/src/lib.rs index b99ea4a24c..449f9c3ffa 100644 --- a/substrate/core/consensus/rhd/src/lib.rs +++ b/substrate/core/consensus/rhd/src/lib.rs @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! BFT Agreement based on a rotating proposer in different rounds. //! //! Where this crate refers to input stream, should never logically conclude. @@ -30,7 +29,6 @@ //! conclude without having witnessed the conclusion. //! In general, this future should be pre-empted by the import of a justification //! set for this block height. -// end::description[] #![cfg(feature="rhd")] // FIXME: doesn't compile - https://github.com/paritytech/substrate/issues/1020 @@ -419,10 +417,10 @@ impl Future for BftFuture. -// tag::description[] //! Temporary crate for contracts implementations. //! //! This will be replaced with WASM contracts stored on-chain. @@ -25,7 +24,6 @@ //! - init_block(PrevBlock?) -> InProgressBlock //! - add_transaction(InProgressBlock) -> InProgressBlock //! It is left as is for now as it might be removed before this is ever done. -// end::description[] #![warn(missing_docs)] #![recursion_limit="128"] diff --git a/substrate/core/executor/src/wasm_executor.rs b/substrate/core/executor/src/wasm_executor.rs index 56624060e7..7480b61950 100644 --- a/substrate/core/executor/src/wasm_executor.rs +++ b/substrate/core/executor/src/wasm_executor.rs @@ -29,7 +29,7 @@ use wasm_utils::UserError; use primitives::{blake2_256, twox_128, twox_256, ed25519}; use primitives::hexdisplay::HexDisplay; use primitives::sandbox as sandbox_primitives; -use primitives::Blake2Hasher; +use primitives::{H256, Blake2Hasher}; use trie::ordered_trie_root; use sandbox; @@ -412,8 +412,15 @@ impl_function_executor!(this: FunctionExecutor<'e, E>, Ok(0) } }, - ext_storage_changes_root(block: u64, result: *mut u8) -> u32 => { - let r = this.ext.storage_changes_root(block); + ext_storage_changes_root(parent_hash_data: *const u8, parent_hash_len: u32, parent_number: u64, result: *mut u8) -> u32 => { + let mut parent_hash = H256::default(); + if parent_hash_len != parent_hash.as_ref().len() as u32 { + return Err(UserError("Invalid parent_hash_len in ext_storage_changes_root").into()); + } + let raw_parent_hash = this.memory.get(parent_hash_data, parent_hash_len as usize) + .map_err(|_| UserError("Invalid attempt to get parent_hash in ext_storage_changes_root"))?; + parent_hash.as_mut().copy_from_slice(&raw_parent_hash[..]); + let r = this.ext.storage_changes_root(parent_hash, parent_number); if let Some(ref r) = r { this.memory.set(result, &r[..]).map_err(|_| UserError("Invalid attempt to set memory in ext_storage_changes_root"))?; } @@ -845,7 +852,7 @@ mod tests { let test_code = include_bytes!("../wasm/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm"); assert_eq!( WasmExecutor::new().call(&mut ext, 8, &test_code[..], "test_enumerated_trie_root", &[]).unwrap(), - ordered_trie_root::(vec![b"zero".to_vec(), b"one".to_vec(), b"two".to_vec()].iter()).0.encode() + ordered_trie_root::(vec![b"zero".to_vec(), b"one".to_vec(), b"two".to_vec()].iter()).as_fixed_bytes().encode() ); } diff --git a/substrate/core/executor/wasm/Cargo.lock b/substrate/core/executor/wasm/Cargo.lock index 691a9291a2..94dd14381d 100644 --- a/substrate/core/executor/wasm/Cargo.lock +++ b/substrate/core/executor/wasm/Cargo.lock @@ -17,10 +17,18 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "fixed-hash" -version = "0.2.2" +name = "crunchy" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "fixed-hash" +version = "0.3.0-beta.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hash-db" version = "0.9.0" @@ -141,13 +149,18 @@ dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "static_assertions" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "substrate-primitives" version = "0.1.0" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.3.0-beta.3 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", "hash256-std-hasher 0.9.0 (git+https://github.com/paritytech/trie)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -155,7 +168,7 @@ dependencies = [ "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-std 0.1.0", - "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.5.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -170,11 +183,11 @@ dependencies = [ [[package]] name = "uint" -version = "0.4.1" +version = "0.5.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -187,7 +200,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" "checksum byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "90492c5858dd7d2e78691cfb89f90d273a2800fc11d98f60786e5d87e2f83781" "checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" -"checksum fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d5ec8112f00ea8a483e04748a85522184418fd1cf02890b626d8fc28683f7de" +"checksum crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c240f247c278fa08a6d4820a6a222bfc6e0d999e51ba67be94f44c905b2161f2" +"checksum fixed-hash 0.3.0-beta.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4e71c99c903a9fe54baed1bc701b43daba8c6dc6d4aec89a32f667ab6b3094c4" "checksum hash-db 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum hash256-std-hasher 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" @@ -200,6 +214,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)" = "84257ccd054dc351472528c8587b4de2dbf0dc0fe2e634030c1a90bfdacebaa9" +"checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" -"checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" +"checksum uint 0.5.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4630460173a57c0af94b8306091e018025d988473f641a4af754b6cde980e1e3" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" diff --git a/substrate/core/finality-grandpa/README.adoc b/substrate/core/finality-grandpa/README.adoc deleted file mode 100644 index 5338cf9e8c..0000000000 --- a/substrate/core/finality-grandpa/README.adoc +++ /dev/null @@ -1,12 +0,0 @@ -= Finality GRANDPA (aka SHAFT) - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/finality-grandpa/primitives/Cargo.toml b/substrate/core/finality-grandpa/primitives/Cargo.toml index b568da0c06..2b2711fab8 100644 --- a/substrate/core/finality-grandpa/primitives/Cargo.toml +++ b/substrate/core/finality-grandpa/primitives/Cargo.toml @@ -4,18 +4,18 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] +substrate-client = { path = "../../client", default-features = false } substrate-primitives = { path = "../../primitives", default-features = false } parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } -sr-api = { path = "../../sr-api", default-features = false } sr-primitives = { path = "../../sr-primitives", default-features = false } [features] default = ["std"] std = [ "substrate-primitives/std", + "substrate-client/std", "parity-codec/std", "parity-codec-derive/std", - "sr-api/std", "sr-primitives/std", ] diff --git a/substrate/core/finality-grandpa/primitives/src/lib.rs b/substrate/core/finality-grandpa/primitives/src/lib.rs index 21fd9c6e3b..2f53523555 100644 --- a/substrate/core/finality-grandpa/primitives/src/lib.rs +++ b/substrate/core/finality-grandpa/primitives/src/lib.rs @@ -26,7 +26,7 @@ extern crate parity_codec; extern crate parity_codec_derive; #[macro_use] -extern crate sr_api; +extern crate substrate_client as client; use substrate_primitives::AuthorityId; use sr_primitives::traits::{Block as BlockT, DigestFor, NumberFor}; @@ -48,34 +48,33 @@ pub const AUTHORITIES_CALL: &str = "grandpa_authorities"; /// The ApiIds for GRANDPA API. pub mod id { - use sr_api::ApiId; + use client::runtime_api::ApiId; /// ApiId for the GrandpaApi trait. pub const GRANDPA_API: ApiId = *b"fgrandpa"; } -decl_apis! { - /// APIs for integrating the GRANDPA finality gadget into runtimes. +/// APIs for integrating the GRANDPA finality gadget into runtimes. +/// This should be implemented on the runtime side. +/// +/// This is primarily used for negotiating authority-set changes for the +/// gadget. GRANDPA uses a signalling model of changing authority sets: +/// changes should be signalled with a delay of N blocks, and then automatically +/// applied in the runtime after those N blocks have passed. +/// +/// The consensus protocol will coordinate the handoff externally. +pub trait GrandpaApi { + /// Check a digest for pending changes. + /// Return `None` if there are no pending changes. /// - /// This is primarily used for negotiating authority-set changes for the - /// gadget. GRANDPA uses a signalling model of changing authority sets: - /// changes should be signalled with a delay of N blocks, and then automatically - /// applied in the runtime after those N blocks have passed. + /// Precedence towards earlier or later digest items can be given + /// based on the rules of the chain. /// - /// The consensus protocol will coordinate the handoff externally. - pub trait GrandpaApi { - /// Check a digest for pending changes. - /// Return `None` if there are no pending changes. - /// - /// Precedence towards earlier or later digest items can be given - /// based on the rules of the chain. - /// - /// No change should be scheduled if one is already and the delay has not - /// passed completely. - fn grandpa_pending_change(digest: DigestFor) -> Option>>; + /// No change should be scheduled if one is already and the delay has not + /// passed completely. + fn grandpa_pending_change(digest: DigestFor) -> Option>>; - /// Get the current GRANDPA authorities and weights. This should not change except - /// for when changes are scheduled and the corresponding delay has passed. - fn grandpa_authorities() -> Vec<(AuthorityId, u64)>; - } + /// Get the current GRANDPA authorities and weights. This should not change except + /// for when changes are scheduled and the corresponding delay has passed. + fn grandpa_authorities() -> Vec<(AuthorityId, u64)>; } diff --git a/substrate/core/finality-grandpa/src/lib.rs b/substrate/core/finality-grandpa/src/lib.rs index 0ea5d782b0..63851b1e4b 100644 --- a/substrate/core/finality-grandpa/src/lib.rs +++ b/substrate/core/finality-grandpa/src/lib.rs @@ -83,6 +83,8 @@ use futures::prelude::*; use futures::stream::Fuse; use futures::sync::mpsc; use client::{Client, error::Error as ClientError, ImportNotifications, backend::Backend, CallExecutor}; +use client::blockchain::HeaderBackend; +use client::runtime_api::{CallApiAt, TaggedTransactionQueue}; use codec::{Encode, Decode}; use consensus_common::{BlockImport, ImportBlock, ImportResult}; use runtime_primitives::traits::{ @@ -193,9 +195,10 @@ pub trait BlockStatus { fn block_number(&self, hash: Block::Hash) -> Result>, Error>; } -impl> BlockStatus for Arc> where +impl, RA> BlockStatus for Arc> where B: Backend, - E: CallExecutor, + E: CallExecutor + Send + Sync, + RA: Send + Sync, NumberFor: BlockNumberOps, { fn block_number(&self, hash: Block::Hash) -> Result>, Error> { @@ -468,8 +471,8 @@ fn outgoing_messages( } /// The environment we run GRANDPA in. -struct Environment { - inner: Arc>, +struct Environment { + inner: Arc>, voters: Arc>, config: Config, authority_set: SharedAuthoritySet>, @@ -477,7 +480,7 @@ struct Environment { set_id: u64, } -impl, B, E, N> grandpa::Chain> for Environment where +impl, B, E, N, RA> grandpa::Chain> for Environment where Block: 'static, B: Backend + 'static, E: CallExecutor + 'static, @@ -573,12 +576,13 @@ impl From for ExitOrError { } } -impl, N> voter::Environment> for Environment where +impl, N, RA> voter::Environment> for Environment where Block: 'static, B: Backend + 'static, - E: CallExecutor + 'static, + E: CallExecutor + 'static + Send + Sync, N: Network + 'static, N::In: 'static, + RA: 'static + Send + Sync, NumberFor: BlockNumberOps, { type Timer = Box>; @@ -771,28 +775,33 @@ pub trait ApiClient> { -> Result>>, ClientError>; } -impl> ApiClient for Arc> where +impl, RA> ApiClient for Arc> where B: Backend + 'static, - E: CallExecutor + 'static + Clone, + E: CallExecutor + 'static + Clone + Send + Sync, DigestFor: Encode, + RA: Send + Sync, { fn genesis_authorities(&self) -> Result, ClientError> { use runtime_primitives::traits::Zero; - self.call_api_at( + self.call_api_at_strong( &BlockId::Number(NumberFor::::zero()), fg_primitives::AUTHORITIES_CALL, - &() + &(), + &mut Default::default(), + &mut None, ) } fn scheduled_change(&self, header: &Block::Header) -> Result>>, ClientError> { - self.call_api_at( + self.call_api_at_strong( &BlockId::hash(header.parent_hash().clone()), ::fg_primitives::PENDING_CHANGE_CALL, header.digest(), + &mut Default::default(), + &mut None, ) } } @@ -802,17 +811,18 @@ impl> ApiClient for Arc, Api> { - inner: Arc>, +pub struct GrandpaBlockImport, Api, RA> { + inner: Arc>, authority_set: SharedAuthoritySet>, api_client: Api, } -impl, Api> BlockImport for GrandpaBlockImport where +impl, Api, RA> BlockImport for GrandpaBlockImport where B: Backend + 'static, - E: CallExecutor + 'static + Clone, + E: CallExecutor + 'static + Clone + Send + Sync, DigestFor: Encode, Api: ApiClient, + RA: TaggedTransactionQueue + Send + Sync, // necessary for client to import `BlockImport`. { type Error = ClientError; @@ -857,19 +867,20 @@ impl, Api> BlockImport for GrandpaBlockImp /// Half of a link between a block-import worker and a the background voter. // This should remain non-clone. -pub struct LinkHalf> { - client: Arc>, +pub struct LinkHalf, RA> { + client: Arc>, authority_set: SharedAuthoritySet>, } /// Make block importer and link half necessary to tie the background voter /// to it. -pub fn block_import, Api>(client: Arc>, api_client: Api) - -> Result<(GrandpaBlockImport, LinkHalf), ClientError> +pub fn block_import, Api, RA>(client: Arc>, api_client: Api) + -> Result<(GrandpaBlockImport, LinkHalf), ClientError> where B: Backend + 'static, E: CallExecutor + 'static, Api: ApiClient, + RA: Send + Sync, { let authority_set = match client.backend().get_aux(AUTHORITY_SET_KEY)? { None => { @@ -902,18 +913,19 @@ pub fn block_import, Api>(client: Arc, N>( +pub fn run_grandpa, N, RA>( config: Config, - link: LinkHalf, + link: LinkHalf, network: N, ) -> ::client::error::Result> where Block::Hash: Ord, B: Backend + 'static, - E: CallExecutor + 'static, + E: CallExecutor + Send + Sync + 'static, N: Network + 'static, N::In: 'static, NumberFor: BlockNumberOps, DigestFor: Encode, + RA: Send + Sync + 'static, { use futures::future::{self, Loop as FutureLoop}; use runtime_primitives::traits::Zero; diff --git a/substrate/core/finality-grandpa/src/tests.rs b/substrate/core/finality-grandpa/src/tests.rs index 1a47a8fa8b..1d8c7db7c5 100644 --- a/substrate/core/finality-grandpa/src/tests.rs +++ b/substrate/core/finality-grandpa/src/tests.rs @@ -19,7 +19,7 @@ use super::*; use network::test::{Block, Hash, TestNetFactory, Peer, PeersClient}; use network::import_queue::{PassThroughVerifier}; -use network::ProtocolConfig; +use network::config::{ProtocolConfig, Roles}; use parking_lot::Mutex; use tokio::runtime::current_thread; use keyring::Keyring; @@ -31,7 +31,7 @@ use std::collections::HashSet; use authorities::AuthoritySet; -type PeerData = Mutex>>; +type PeerData = Mutex>>; type GrandpaPeer = Peer; struct GrandpaTestNet { @@ -73,7 +73,7 @@ impl TestNetFactory for GrandpaTestNet { fn default_config() -> ProtocolConfig { // the authority role ensures gossip hits all nodes here. ProtocolConfig { - roles: ::network::Roles::AUTHORITY, + roles: Roles::AUTHORITY, } } diff --git a/substrate/core/keyring/README.adoc b/substrate/core/keyring/README.adoc deleted file mode 100644 index 0118fe883d..0000000000 --- a/substrate/core/keyring/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Keyring - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/keyring/src/lib.rs b/substrate/core/keyring/src/lib.rs index 6ba79d146c..d2970c54c6 100644 --- a/substrate/core/keyring/src/lib.rs +++ b/substrate/core/keyring/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Support code for the runtime. A set of test accounts. -// end::description[] #[macro_use] extern crate hex_literal; #[macro_use] extern crate lazy_static; diff --git a/substrate/core/keystore/README.adoc b/substrate/core/keystore/README.adoc deleted file mode 100644 index 5a66a882ff..0000000000 --- a/substrate/core/keystore/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Keystore - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/keystore/src/lib.rs b/substrate/core/keystore/src/lib.rs index aeb9c50886..6d8e3b3ae9 100644 --- a/substrate/core/keystore/src/lib.rs +++ b/substrate/core/keystore/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Keystore (and session key management) for ed25519 based chains like Polkadot. -// end::description[] extern crate substrate_primitives; extern crate parity_crypto as crypto; @@ -131,6 +129,24 @@ pub struct Store { additional: HashMap, } +pub fn pad_seed(seed: &str) -> Seed { + let mut s: [u8; 32] = [' ' as u8; 32]; + + let was_hex = if seed.len() == 66 && &seed[0..2] == "0x" { + if let Ok(d) = hex::decode(&seed[2..]) { + s.copy_from_slice(&d); + true + } else { false } + } else { false }; + + if !was_hex { + let len = ::std::cmp::min(32, seed.len()); + &mut s[..len].copy_from_slice(&seed.as_bytes()[..len]); + } + + s +} + impl Store { /// Create a new store at the given path. pub fn open(path: PathBuf) -> Result { @@ -153,24 +169,11 @@ impl Store { /// Create a new key from seed. Do not place it into the store. /// Only the first 32 bytes of the sead are used. This is meant to be used for testing only. - // TODO: Remove this + // FIXME: remove this - https://github.com/paritytech/substrate/issues/1063 pub fn generate_from_seed(&mut self, seed: &str) -> Result { - let mut s: [u8; 32] = [' ' as u8; 32]; - - let was_hex = if seed.len() == 66 && &seed[0..2] == "0x" { - if let Ok(d) = hex::decode(&seed[2..]) { - s.copy_from_slice(&d); - true - } else { false } - } else { false }; - - if !was_hex { - let len = ::std::cmp::min(32, seed.len()); - &mut s[..len].copy_from_slice(&seed.as_bytes()[..len]); - } - - let pair = Pair::from_seed(&s); - self.additional.insert(pair.public(), s); + let padded_seed = pad_seed(seed); + let pair = Pair::from_seed(&padded_seed); + self.additional.insert(pair.public(), padded_seed); Ok(pair) } diff --git a/substrate/core/network-libp2p/Cargo.toml b/substrate/core/network-libp2p/Cargo.toml index e07338455b..6b0fb9af40 100644 --- a/substrate/core/network-libp2p/Cargo.toml +++ b/substrate/core/network-libp2p/Cargo.toml @@ -11,7 +11,7 @@ bytes = "0.4" error-chain = { version = "0.12", default-features = false } fnv = "1.0" futures = "0.1" -libp2p = { git = "https://github.com/tomaka/libp2p-rs", rev = "8111062f0177fd7423626f2db9560273644a4c4d", default-features = false, features = ["libp2p-secio", "libp2p-secio-secp256k1"] } +libp2p = { git = "https://github.com/libp2p/rust-libp2p", rev = "d961e656a74d1bab5366d371a06f9e10d5f4a6c5", default-features = false, features = ["secio-rsa", "secio-secp256k1"] } parking_lot = "0.5" libc = "0.2" log = "0.4" diff --git a/substrate/core/network-libp2p/README.adoc b/substrate/core/network-libp2p/README.adoc deleted file mode 100644 index 2f340aa397..0000000000 --- a/substrate/core/network-libp2p/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Network libp2p - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/network-libp2p/src/custom_proto.rs b/substrate/core/network-libp2p/src/custom_proto.rs index a2680b056e..fd76581d3e 100644 --- a/substrate/core/network-libp2p/src/custom_proto.rs +++ b/substrate/core/network-libp2p/src/custom_proto.rs @@ -15,7 +15,7 @@ // along with Substrate. If not, see . use bytes::Bytes; -use libp2p::core::{Multiaddr, ConnectionUpgrade, Endpoint}; +use libp2p::core::{ConnectionUpgrade, Endpoint}; use libp2p::tokio_codec::Framed; use std::{collections::VecDeque, io, vec::IntoIter as VecIntoIter}; use futures::{prelude::*, future, stream, task}; @@ -115,7 +115,6 @@ impl RegisteredProtocolSubstream { self.send_queue.push_back(data); // If the length of the queue goes over a certain arbitrary threshold, we print a warning. - // TODO: figure out a good threshold if self.send_queue.len() >= 2048 { warn!(target: "sub-libp2p", "Queue of packets to send over substream is pretty \ large: {}", self.send_queue.len()); @@ -203,8 +202,7 @@ where TSubstream: AsyncRead + AsyncWrite, self, socket: TSubstream, protocol_version: Self::UpgradeIdentifier, - _: Endpoint, - _: &Multiaddr + _: Endpoint ) -> Self::Future { let framed = Framed::new(socket, UviBytes::default()); @@ -273,13 +271,12 @@ where TSubstream: AsyncRead + AsyncWrite, self, socket: TSubstream, upgrade_identifier: Self::UpgradeIdentifier, - endpoint: Endpoint, - remote_addr: &Multiaddr + endpoint: Endpoint ) -> Self::Future { let (protocol_index, inner_proto_id) = upgrade_identifier; self.0.into_iter() .nth(protocol_index) .expect("invalid protocol index ; programmer logic error") - .upgrade(socket, inner_proto_id, endpoint, remote_addr) + .upgrade(socket, inner_proto_id, endpoint) } } diff --git a/substrate/core/network-libp2p/src/lib.rs b/substrate/core/network-libp2p/src/lib.rs index 9d53b01b01..2bf6a0d490 100644 --- a/substrate/core/network-libp2p/src/lib.rs +++ b/substrate/core/network-libp2p/src/lib.rs @@ -14,12 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] -//! TODO: Missing doc -// end::description[] +//! Substrate libp2p implementation of the ethcore network library -#![recursion_limit="128"] -#![type_length_limit = "268435456"] +#![recursion_limit = "128"] extern crate parking_lot; extern crate fnv; @@ -58,7 +55,8 @@ pub use custom_proto::RegisteredProtocol; pub use error::{Error, ErrorKind, DisconnectReason}; pub use libp2p::{Multiaddr, multiaddr::Protocol, PeerId}; pub use service_task::{start_service, Service, ServiceEvent}; -pub use traits::*; // TODO: expand to actual items +pub use traits::{NetworkConfiguration, NodeIndex, NodeId, NonReservedPeerMode}; +pub use traits::{ProtocolId, Secret, Severity}; /// Check if node url is valid pub fn validate_node_url(url: &str) -> Result<(), Error> { diff --git a/substrate/core/network-libp2p/src/node_handler.rs b/substrate/core/network-libp2p/src/node_handler.rs index f7a388ddcd..ad1f4b7504 100644 --- a/substrate/core/network-libp2p/src/node_handler.rs +++ b/substrate/core/network-libp2p/src/node_handler.rs @@ -19,7 +19,6 @@ use custom_proto::{RegisteredProtocols, RegisteredProtocolSubstream}; use futures::{prelude::*, task}; use libp2p::core::{ConnectionUpgrade, Endpoint, PeerId, PublicKey, upgrade}; use libp2p::core::nodes::handled_node::{NodeHandler, NodeHandlerEndpoint, NodeHandlerEvent}; -use libp2p::core::nodes::swarm::ConnectedPoint; use libp2p::kad::{KadConnecConfig, KadFindNodeRespond, KadIncomingRequest, KadConnecController}; use libp2p::{identify, ping}; use parking_lot::Mutex; @@ -54,20 +53,17 @@ pub struct SubstrateNodeHandler { /// Substreams open for "custom" protocols (eg. dot). custom_protocols_substreams: Vec>, - /// Address of the node. - address: Multiaddr, - /// Substream open for Kademlia, if any. kademlia_substream: Option<(KadConnecController, Box + Send>)>, /// If true, we need to send back a `KadOpen` event on the stream (if Kademlia is open). need_report_kad_open: bool, /// Substream open for sending pings, if any. - ping_out_substream: Option>, + ping_out_substream: Option>, /// Active pinging attempt with the moment it expires. active_ping_out: Option, /// Substreams open for receiving pings. - ping_in_substreams: Vec>, + ping_in_substreams: Vec>, /// Future that fires when we need to ping the node again. /// /// Every time we receive a pong, we reset the timer to the next time. @@ -249,7 +245,7 @@ macro_rules! listener_upgrade { upgrade::or(upgrade::or(upgrade::or( upgrade::map((*$self.registered_custom).clone(), move |c| FinalUpgrade::Custom(c)), upgrade::map(KadConnecConfig::new(), move |(c, s)| FinalUpgrade::Kad(c, s))), - upgrade::map(ping::Ping::default(), move |p| FinalUpgrade::from(p))), + upgrade::map(ping::protocol::Ping::default(), move |p| FinalUpgrade::from(p))), upgrade::map(identify::IdentifyProtocolConfig, move |i| FinalUpgrade::from(i))) // TODO: meh for cloning a Vec here ) @@ -260,20 +256,14 @@ where TSubstream: AsyncRead + AsyncWrite + Send + 'static, { /// Creates a new node handler. #[inline] - pub fn new(registered_custom: Arc, endpoint: ConnectedPoint) -> Self { + pub fn new(registered_custom: Arc) -> Self { let registered_custom_len = registered_custom.len(); let queued_dial_upgrades = registered_custom.0 .iter() .map(|proto| UpgradePurpose::Custom(proto.id())) .collect(); - let address = match endpoint { - ConnectedPoint::Dialer { address } => address.clone(), - ConnectedPoint::Listener { send_back_addr, .. } => send_back_addr.clone(), - }; - SubstrateNodeHandler { - address, custom_protocols_substreams: Vec::with_capacity(registered_custom_len), kademlia_substream: None, need_report_kad_open: false, @@ -294,18 +284,19 @@ where TSubstream: AsyncRead + AsyncWrite + Send + 'static, } } -impl NodeHandler for SubstrateNodeHandler +impl NodeHandler for SubstrateNodeHandler where TSubstream: AsyncRead + AsyncWrite + Send + 'static, { type InEvent = SubstrateInEvent; type OutEvent = SubstrateOutEvent; type OutboundOpenInfo = (); + type Substream = TSubstream; fn inject_substream(&mut self, substream: TSubstream, endpoint: NodeHandlerEndpoint) { // For listeners, propose all the possible upgrades. if endpoint == NodeHandlerEndpoint::Listener { let listener_upgrade = listener_upgrade!(self); - let upgrade = upgrade::apply(substream, listener_upgrade, Endpoint::Listener, &self.address); + let upgrade = upgrade::apply(substream, listener_upgrade, Endpoint::Listener); self.upgrades_in_progress_listen.push(Box::new(upgrade) as Box<_>); // Since we pushed to `upgrades_in_progress_listen`, we have to notify the task. if let Some(task) = self.to_notify.take() { @@ -338,26 +329,22 @@ where TSubstream: AsyncRead + AsyncWrite + Send + 'static, return; }; - // TODO: shouldn't be &self.address ; requires a change in libp2p - let upgrade = upgrade::apply(substream, wanted, Endpoint::Dialer, &self.address); + let upgrade = upgrade::apply(substream, wanted, Endpoint::Dialer); self.upgrades_in_progress_dial.push((purpose, Box::new(upgrade) as Box<_>)); } UpgradePurpose::Kad => { let wanted = upgrade::map(KadConnecConfig::new(), move |(c, s)| FinalUpgrade::Kad(c, s)); - // TODO: shouldn't be &self.address ; requires a change in libp2p - let upgrade = upgrade::apply(substream, wanted, Endpoint::Dialer, &self.address); + let upgrade = upgrade::apply(substream, wanted, Endpoint::Dialer); self.upgrades_in_progress_dial.push((purpose, Box::new(upgrade) as Box<_>)); } UpgradePurpose::Identify => { let wanted = upgrade::map(identify::IdentifyProtocolConfig, move |i| FinalUpgrade::from(i)); - // TODO: shouldn't be &self.address ; requires a change in libp2p - let upgrade = upgrade::apply(substream, wanted, Endpoint::Dialer, &self.address); + let upgrade = upgrade::apply(substream, wanted, Endpoint::Dialer); self.upgrades_in_progress_dial.push((purpose, Box::new(upgrade) as Box<_>)); } UpgradePurpose::Ping => { - let wanted = upgrade::map(ping::Ping::default(), move |p| FinalUpgrade::from(p)); - // TODO: shouldn't be &self.address ; requires a change in libp2p - let upgrade = upgrade::apply(substream, wanted, Endpoint::Dialer, &self.address); + let wanted = upgrade::map(ping::protocol::Ping::default(), move |p| FinalUpgrade::from(p)); + let upgrade = upgrade::apply(substream, wanted, Endpoint::Dialer); self.upgrades_in_progress_dial.push((purpose, Box::new(upgrade) as Box<_>)); } }; @@ -733,6 +720,9 @@ where TSubstream: AsyncRead + AsyncWrite + Send + 'static, }, // We don't care about Kademlia pings, they are unused. Ok(Async::Ready(Some(KadIncomingRequest::PingPong))) => {}, + // Other Kademlia messages are unimplemented. + Ok(Async::Ready(Some(KadIncomingRequest::GetProviders { .. }))) => {}, + Ok(Async::Ready(Some(KadIncomingRequest::AddProvider { .. }))) => {}, Ok(Async::NotReady) => { self.kademlia_substream = Some((controller, stream)); break; @@ -847,16 +837,16 @@ enum FinalUpgrade { Kad(KadConnecController, Box + Send>), IdentifyListener(identify::IdentifySender), IdentifyDialer(identify::IdentifyInfo, Multiaddr), - PingDialer(ping::PingDialer), - PingListener(ping::PingListener), + PingDialer(ping::protocol::PingDialer), + PingListener(ping::protocol::PingListener), Custom(RegisteredProtocolSubstream), } -impl From> for FinalUpgrade { - fn from(out: ping::PingOutput) -> Self { +impl From> for FinalUpgrade { + fn from(out: ping::protocol::PingOutput) -> Self { match out { - ping::PingOutput::Ponger(ponger) => FinalUpgrade::PingListener(ponger), - ping::PingOutput::Pinger(pinger) => FinalUpgrade::PingDialer(pinger), + ping::protocol::PingOutput::Ponger(ponger) => FinalUpgrade::PingListener(ponger), + ping::protocol::PingOutput::Pinger(pinger) => FinalUpgrade::PingDialer(pinger), } } } diff --git a/substrate/core/network-libp2p/src/service_task.rs b/substrate/core/network-libp2p/src/service_task.rs index 93be0e476c..f40170b00c 100644 --- a/substrate/core/network-libp2p/src/service_task.rs +++ b/substrate/core/network-libp2p/src/service_task.rs @@ -21,7 +21,7 @@ use futures::{prelude::*, task, Stream}; use futures::sync::{oneshot, mpsc}; use libp2p::{Multiaddr, PeerId}; use libp2p::core::{Endpoint, PublicKey}; -use libp2p::core::nodes::swarm::ConnectedPoint; +use libp2p::core::nodes::ConnectedPoint; use libp2p::kad::{KadSystem, KadSystemConfig, KadConnecController, KadPeer}; use libp2p::kad::{KadConnectionType, KadQueryEvent}; use parking_lot::Mutex; @@ -567,6 +567,8 @@ impl Service { /// Adds a list of peers to the network topology. fn add_discovered_peers(&mut self, list: impl IntoIterator) { + let mut topology_has_changed = false; + for peer in list { let connected = match peer.connection_ty { KadConnectionType::NotConnected => false, @@ -575,15 +577,20 @@ impl Service { KadConnectionType::CannotConnect => continue, }; - self.topology.add_kademlia_discovered_addrs( + let changed = self.topology.add_kademlia_discovered_addrs( &peer.node_id, peer.multiaddrs.iter().map(|a| (a.clone(), connected)) ); + + if changed { + topology_has_changed = true; + } } // Potentially connect to the newly-discovered nodes. - // TODO: only do so if the topology reports that something new has been added - self.connect_to_nodes(); + if topology_has_changed { + self.connect_to_nodes(); + } } /// Handles the swarm opening a connection to the given peer. diff --git a/substrate/core/network-libp2p/src/swarm.rs b/substrate/core/network-libp2p/src/swarm.rs index 497472d93f..0a6bfaa994 100644 --- a/substrate/core/network-libp2p/src/swarm.rs +++ b/substrate/core/network-libp2p/src/swarm.rs @@ -20,15 +20,12 @@ use fnv::FnvHashMap; use futures::{prelude::*, Stream}; use libp2p::{Multiaddr, multiaddr::Protocol, PeerId}; use libp2p::core::{muxing, Endpoint, PublicKey}; -use libp2p::core::nodes::node::Substream; -use libp2p::core::nodes::swarm::{ConnectedPoint, Swarm as Libp2pSwarm, HandlerFactory}; -use libp2p::core::nodes::swarm::{SwarmEvent as Libp2pSwarmEvent, Peer as SwarmPeer}; +use libp2p::core::nodes::{ConnectedPoint, RawSwarm, RawSwarmEvent, Peer as SwarmPeer, Substream}; use libp2p::core::transport::boxed::Boxed; use libp2p::kad::{KadConnecController, KadFindNodeRespond}; use libp2p::secio; use node_handler::{SubstrateOutEvent, SubstrateNodeHandler, SubstrateInEvent, IdentificationRequest}; -use std::io::{Error as IoError, ErrorKind as IoErrorKind}; -use std::{mem, sync::Arc}; +use std::{io, mem, sync::Arc}; use transport; use {Error, NodeIndex, ProtocolId}; @@ -47,10 +44,11 @@ pub fn start_swarm( let transport = transport::build_transport(local_private_key); // Build the underlying libp2p swarm. - let swarm = Libp2pSwarm::with_handler_builder(transport, HandlerBuilder(Arc::new(registered_custom))); + let swarm = RawSwarm::new(transport); Ok(Swarm { swarm, + registered_custom: Arc::new(registered_custom), local_public_key, local_peer_id, listening_addrs: Vec::new(), @@ -60,20 +58,6 @@ pub fn start_swarm( }) } -/// Dummy structure that exists because we need to be able to express the type. Otherwise we would -/// use a closure. -#[derive(Clone)] -struct HandlerBuilder(Arc); -impl HandlerFactory for HandlerBuilder -{ - type Handler = SubstrateNodeHandler>; - - #[inline] - fn new_handler(&self, addr: ConnectedPoint) -> Self::Handler { - SubstrateNodeHandler::new(self.0.clone(), addr) - } -} - /// Event produced by the swarm. pub enum SwarmEvent { /// We have successfully connected to a node. @@ -117,7 +101,7 @@ pub enum SwarmEvent { /// Address that failed. address: Multiaddr, /// Reason why we failed. - error: IoError, + error: io::Error, }, /// Report information about the node. @@ -197,20 +181,23 @@ pub enum SwarmEvent { /// Index of the node. node_index: NodeIndex, /// Reason why it has been closed. `Ok` means that it's been closed gracefully. - result: Result<(), IoError>, + result: Result<(), io::Error>, }, } /// Network swarm. Must be polled regularly in order for the networking to work. pub struct Swarm { /// Stream of events of the swarm. - swarm: Libp2pSwarm< + swarm: RawSwarm< Boxed<(PeerId, Muxer)>, SubstrateInEvent, SubstrateOutEvent>, - HandlerBuilder + SubstrateNodeHandler> >, + /// List of registered protocols. Used when we open or receive a new connection. + registered_custom: Arc, + /// Public key of the local node. local_public_key: PublicKey, @@ -340,7 +327,7 @@ impl Swarm { SwarmPeer::NotConnected(peer) => { trace!(target: "sub-libp2p", "Starting to connect to {:?} through {}", peer_id, addr); - match peer.connect(addr) { + match peer.connect(addr, SubstrateNodeHandler::new(self.registered_custom.clone())) { Ok(_) => Ok(false), Err(_) => Err(()), } @@ -351,7 +338,7 @@ impl Swarm { /// Start dialing an address, not knowing which peer ID to expect. #[inline] pub fn dial(&mut self, addr: Multiaddr) -> Result<(), Multiaddr> { - self.swarm.dial(addr) + self.swarm.dial(addr, SubstrateNodeHandler::new(self.registered_custom.clone())) } /// After receiving a `NodePending` event, you should call either `accept_node` or `drop_node` @@ -479,124 +466,6 @@ impl Swarm { ); } - /// Processes an event received by the swarm. - /// - /// Optionally returns an event to report back to the outside. - /// - /// > **Note**: Must be called from inside `poll()`, otherwise it will panic. This method - /// > shouldn't be made public because of this requirement. - fn process_network_event( - &mut self, - event: Libp2pSwarmEvent, SubstrateOutEvent>> - ) -> Option { - match event { - Libp2pSwarmEvent::Connected { peer_id, endpoint } => { - let node_index = self.next_node_index.clone(); - self.next_node_index += 1; - self.node_by_peer.insert(peer_id.clone(), node_index); - self.nodes_info.insert(node_index, NodeInfo { - peer_id: peer_id.clone(), - endpoint: match endpoint { - ConnectedPoint::Listener { .. } => Endpoint::Listener, - ConnectedPoint::Dialer { .. } => Endpoint::Dialer, - }, - open_protocols: Vec::new(), - }); - - return Some(SwarmEvent::NodePending { - node_index, - peer_id, - endpoint - }); - } - Libp2pSwarmEvent::Replaced { peer_id, endpoint, .. } => { - let node_index = *self.node_by_peer.get(&peer_id) - .expect("node_by_peer is always kept in sync with the inner swarm"); - let infos = self.nodes_info.get_mut(&node_index) - .expect("nodes_info is always kept in sync with the swarm"); - debug_assert_eq!(infos.peer_id, peer_id); - infos.endpoint = match endpoint { - ConnectedPoint::Listener { .. } => Endpoint::Listener, - ConnectedPoint::Dialer { .. } => Endpoint::Dialer, - }; - let closed_custom_protocols = mem::replace(&mut infos.open_protocols, Vec::new()); - - return Some(SwarmEvent::Reconnected { - node_index, - endpoint, - closed_custom_protocols, - }); - }, - Libp2pSwarmEvent::NodeClosed { peer_id, .. } => { - debug!(target: "sub-libp2p", "Connection to {:?} closed gracefully", peer_id); - let node_index = self.node_by_peer.remove(&peer_id) - .expect("node_by_peer is always kept in sync with the inner swarm"); - let infos = self.nodes_info.remove(&node_index) - .expect("nodes_info is always kept in sync with the inner swarm"); - debug_assert_eq!(infos.peer_id, peer_id); - return Some(SwarmEvent::NodeClosed { - node_index, - peer_id, - closed_custom_protocols: infos.open_protocols, - }); - }, - Libp2pSwarmEvent::NodeError { peer_id, error, .. } => { - debug!(target: "sub-libp2p", "Closing {:?} because of error: {:?}", peer_id, error); - let node_index = self.node_by_peer.remove(&peer_id) - .expect("node_by_peer is always kept in sync with the inner swarm"); - let infos = self.nodes_info.remove(&node_index) - .expect("nodes_info is always kept in sync with the inner swarm"); - debug_assert_eq!(infos.peer_id, peer_id); - return Some(SwarmEvent::NodeClosed { - node_index, - peer_id, - closed_custom_protocols: infos.open_protocols, - }); - }, - Libp2pSwarmEvent::DialError { multiaddr, error, .. } => - return Some(SwarmEvent::DialFail { - address: multiaddr, - error, - }), - Libp2pSwarmEvent::UnknownPeerDialError { multiaddr, error } => - return Some(SwarmEvent::DialFail { - address: multiaddr, - error, - }), - Libp2pSwarmEvent::PublicKeyMismatch { - actual_peer_id, - multiaddr, - expected_peer_id, - .. - } => { - debug!(target: "sub-libp2p", "When dialing {:?} through {}, public key mismatch, \ - actual = {:?}", expected_peer_id, multiaddr, actual_peer_id); - return Some(SwarmEvent::DialFail { - address: multiaddr, - error: IoError::new(IoErrorKind::Other, "Public key mismatch"), - }); - }, - Libp2pSwarmEvent::ListenerClosed { listen_addr, result, .. } => { - warn!(target: "sub-libp2p", "Listener closed for {}: {:?}", listen_addr, result); - if self.swarm.listeners().count() == 0 { - warn!(target: "sub-libp2p", "No listener left"); - } - }, - Libp2pSwarmEvent::NodeEvent { peer_id, event } => - if let Some(event) = self.handle_node_event(peer_id, event) { - return Some(event); - }, - Libp2pSwarmEvent::IncomingConnection { listen_addr, send_back_addr } => - trace!(target: "sub-libp2p", "Incoming connection with {} on listener {}", - send_back_addr, listen_addr), - Libp2pSwarmEvent::IncomingConnectionError { listen_addr, send_back_addr, error } => - trace!(target: "sub-libp2p", "Incoming connection with {} on listener {} \ - errored: {:?}", send_back_addr, listen_addr, error), - } - - None - } - /// Processes an event obtained by a node in the swarm. /// /// Optionally returns an event that the service must emit. @@ -698,17 +567,105 @@ impl Swarm { impl Stream for Swarm { type Item = SwarmEvent; - type Error = IoError; + type Error = io::Error; fn poll(&mut self) -> Poll, Self::Error> { loop { - match self.swarm.poll() { - Async::Ready(Some(event)) => - if let Some(event) = self.process_network_event(event) { - return Ok(Async::Ready(Some(event))); - } + let (peer_id, node_event) = match self.swarm.poll() { + Async::Ready(RawSwarmEvent::Connected { peer_id, endpoint }) => { + let node_index = self.next_node_index.clone(); + self.next_node_index += 1; + self.node_by_peer.insert(peer_id.clone(), node_index); + self.nodes_info.insert(node_index, NodeInfo { + peer_id: peer_id.clone(), + endpoint: match endpoint { + ConnectedPoint::Listener { .. } => Endpoint::Listener, + ConnectedPoint::Dialer { .. } => Endpoint::Dialer, + }, + open_protocols: Vec::new(), + }); + + return Ok(Async::Ready(Some(SwarmEvent::NodePending { + node_index, + peer_id, + endpoint + }))); + } + Async::Ready(RawSwarmEvent::Replaced { peer_id, endpoint, .. }) => { + let node_index = *self.node_by_peer.get(&peer_id) + .expect("node_by_peer is always kept in sync with the inner swarm"); + let infos = self.nodes_info.get_mut(&node_index) + .expect("nodes_info is always kept in sync with the swarm"); + debug_assert_eq!(infos.peer_id, peer_id); + infos.endpoint = match endpoint { + ConnectedPoint::Listener { .. } => Endpoint::Listener, + ConnectedPoint::Dialer { .. } => Endpoint::Dialer, + }; + let closed_custom_protocols = mem::replace(&mut infos.open_protocols, Vec::new()); + + return Ok(Async::Ready(Some(SwarmEvent::Reconnected { + node_index, + endpoint, + closed_custom_protocols, + }))); + }, + Async::Ready(RawSwarmEvent::NodeClosed { peer_id, .. }) => { + debug!(target: "sub-libp2p", "Connection to {:?} closed gracefully", peer_id); + let node_index = self.node_by_peer.remove(&peer_id) + .expect("node_by_peer is always kept in sync with the inner swarm"); + let infos = self.nodes_info.remove(&node_index) + .expect("nodes_info is always kept in sync with the inner swarm"); + debug_assert_eq!(infos.peer_id, peer_id); + return Ok(Async::Ready(Some(SwarmEvent::NodeClosed { + node_index, + peer_id, + closed_custom_protocols: infos.open_protocols, + }))); + }, + Async::Ready(RawSwarmEvent::NodeError { peer_id, error, .. }) => { + debug!(target: "sub-libp2p", "Closing {:?} because of error: {:?}", peer_id, error); + let node_index = self.node_by_peer.remove(&peer_id) + .expect("node_by_peer is always kept in sync with the inner swarm"); + let infos = self.nodes_info.remove(&node_index) + .expect("nodes_info is always kept in sync with the inner swarm"); + debug_assert_eq!(infos.peer_id, peer_id); + return Ok(Async::Ready(Some(SwarmEvent::NodeClosed { + node_index, + peer_id, + closed_custom_protocols: infos.open_protocols, + }))); + }, + Async::Ready(RawSwarmEvent::DialError { multiaddr, error, .. }) => + return Ok(Async::Ready(Some(SwarmEvent::DialFail { + address: multiaddr, + error, + }))), + Async::Ready(RawSwarmEvent::UnknownPeerDialError { multiaddr, error, .. }) => + return Ok(Async::Ready(Some(SwarmEvent::DialFail { + address: multiaddr, + error, + }))), + Async::Ready(RawSwarmEvent::ListenerClosed { listen_addr, result, .. }) => { + warn!(target: "sub-libp2p", "Listener closed for {}: {:?}", listen_addr, result); + continue; + }, + Async::Ready(RawSwarmEvent::NodeEvent { peer_id, event }) => (peer_id, event), + Async::Ready(RawSwarmEvent::IncomingConnection(incoming)) => { + trace!(target: "sub-libp2p", "Incoming connection with {} on listener {}", + incoming.send_back_addr(), incoming.listen_addr()); + incoming.accept(SubstrateNodeHandler::new(self.registered_custom.clone())); + continue; + }, + Async::Ready(RawSwarmEvent::IncomingConnectionError { listen_addr, send_back_addr, error }) => { + trace!(target: "sub-libp2p", "Incoming connection with {} on listener {} \ + errored: {:?}", send_back_addr, listen_addr, error); + continue; + }, Async::NotReady => return Ok(Async::NotReady), - Async::Ready(None) => unreachable!("The Swarm stream never ends"), + }; + + if let Some(event) = self.handle_node_event(peer_id, node_event) { + return Ok(Async::Ready(Some(event))); } } } diff --git a/substrate/core/network-libp2p/src/topology.rs b/substrate/core/network-libp2p/src/topology.rs index ad92448c6a..061a3d1795 100644 --- a/substrate/core/network-libp2p/src/topology.rs +++ b/substrate/core/network-libp2p/src/topology.rs @@ -245,12 +245,16 @@ impl NetTopology { /// Adds addresses that a node says it is listening on. /// /// The addresses are most likely to be valid. + /// + /// Returns `true` if the topology has changed in some way. Returns `false` if calling this + /// method was a no-op. #[inline] pub fn add_self_reported_listen_addrs( &mut self, peer_id: &PeerId, addrs: I, - ) where I: Iterator { + ) -> bool + where I: Iterator { self.add_discovered_addrs(peer_id, addrs.map(|a| (a, true))) } @@ -260,21 +264,28 @@ impl NetTopology { /// /// For each address, incorporates a boolean. If true, that means we have some sort of hint /// that this address can be reached. + /// + /// Returns `true` if the topology has changed in some way. Returns `false` if calling this + /// method was a no-op. #[inline] pub fn add_kademlia_discovered_addrs( &mut self, peer_id: &PeerId, addrs: I, - ) where I: Iterator { + ) -> bool + where I: Iterator { self.add_discovered_addrs(peer_id, addrs) } - /// Inner implementaiton of the `add_*_discovered_addrs`. + /// Inner implementaiton of the `add_*_discovered_addrs` methods. + /// Returns `true` if the topology has changed in some way. Returns `false` if calling this + /// method was a no-op. fn add_discovered_addrs( &mut self, peer_id: &PeerId, addrs: I, - ) where I: Iterator { + ) -> bool + where I: Iterator { let mut addrs: Vec<_> = addrs.collect(); let now_systime = SystemTime::now(); let now = Instant::now(); @@ -291,6 +302,8 @@ impl NetTopology { true }); + let mut anything_changed = false; + if !addrs.is_empty() { trace!( target: "sub-libp2p", @@ -317,6 +330,7 @@ impl NetTopology { } } + anything_changed = true; peer.addrs.push(Addr { addr, expires: now_systime + KADEMLIA_DISCOVERY_EXPIRATION, @@ -329,6 +343,8 @@ impl NetTopology { }), }); } + + anything_changed } /// Indicates the peer store that we're connected to this given address. diff --git a/substrate/core/network-libp2p/src/transport.rs b/substrate/core/network-libp2p/src/transport.rs index cb091540da..89c6757bbc 100644 --- a/substrate/core/network-libp2p/src/transport.rs +++ b/substrate/core/network-libp2p/src/transport.rs @@ -30,14 +30,14 @@ pub fn build_transport( let base = libp2p::CommonTransport::new() .with_upgrade(secio::SecioConfig::new(local_private_key)) - .and_then(move |out, endpoint, client_addr| { + .and_then(move |out, endpoint| { let upgrade = upgrade::or( upgrade::map(yamux::Config::default(), either::EitherOutput::First), upgrade::map(mplex_config, either::EitherOutput::Second), ); let peer_id = out.remote_key.into_peer_id(); let upgrade = upgrade::map(upgrade, move |muxer| (peer_id, muxer)); - upgrade::apply(out.stream, upgrade, endpoint, client_addr) + upgrade::apply(out.stream, upgrade, endpoint.into()) }) .map(|(id, muxer), _| (id, StreamMuxerBox::new(muxer))); diff --git a/substrate/core/network/README.adoc b/substrate/core/network/README.adoc deleted file mode 100644 index ac29b0cd0b..0000000000 --- a/substrate/core/network/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Network - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/network/src/chain.rs b/substrate/core/network/src/chain.rs index 6e4ec75cde..32cb18f276 100644 --- a/substrate/core/network/src/chain.rs +++ b/substrate/core/network/src/chain.rs @@ -68,52 +68,53 @@ pub trait Client: Send + Sync { ) -> Result<(NumberFor, Vec>), Error>; } -impl Client for SubstrateClient where +impl Client for SubstrateClient where B: client::backend::Backend + Send + Sync + 'static, E: CallExecutor + Send + Sync + 'static, Self: BlockImport, Block: BlockT, + RA: Send + Sync { fn import(&self, block: ImportBlock, new_authorities: Option>) -> Result { - (self as &SubstrateClient).import_block(block, new_authorities) + (self as &SubstrateClient).import_block(block, new_authorities) } fn info(&self) -> Result, Error> { - (self as &SubstrateClient).info() + (self as &SubstrateClient).info() } fn block_status(&self, id: &BlockId) -> Result { - (self as &SubstrateClient).block_status(id) + (self as &SubstrateClient).block_status(id) } fn block_hash(&self, block_number: ::Number) -> Result, Error> { - (self as &SubstrateClient).block_hash(block_number) + (self as &SubstrateClient).block_hash(block_number) } fn header(&self, id: &BlockId) -> Result, Error> { - (self as &SubstrateClient).header(id) + (self as &SubstrateClient).header(id) } fn body(&self, id: &BlockId) -> Result>, Error> { - (self as &SubstrateClient).body(id) + (self as &SubstrateClient).body(id) } fn justification(&self, id: &BlockId) -> Result, Error> { - (self as &SubstrateClient).justification(id) + (self as &SubstrateClient).justification(id) } fn header_proof(&self, block_number: ::Number) -> Result<(Block::Header, Vec>), Error> { - (self as &SubstrateClient).header_proof(&BlockId::Number(block_number)) + (self as &SubstrateClient).header_proof(&BlockId::Number(block_number)) } fn read_proof(&self, block: &Block::Hash, key: &[u8]) -> Result>, Error> { - (self as &SubstrateClient).read_proof(&BlockId::Hash(block.clone()), key) + (self as &SubstrateClient).read_proof(&BlockId::Hash(block.clone()), key) } fn execution_proof(&self, block: &Block::Hash, method: &str, data: &[u8]) -> Result<(Vec, Vec>), Error> { - (self as &SubstrateClient).execution_proof(&BlockId::Hash(block.clone()), method, data) + (self as &SubstrateClient).execution_proof(&BlockId::Hash(block.clone()), method, data) } fn key_changes_proof( @@ -123,6 +124,6 @@ impl Client for SubstrateClient where max: Block::Hash, key: &[u8] ) -> Result<(NumberFor, Vec>), Error> { - (self as &SubstrateClient).key_changes_proof(first, last, max, key) + (self as &SubstrateClient).key_changes_proof(first, last, max, key) } } diff --git a/substrate/core/network/src/config.rs b/substrate/core/network/src/config.rs index fc6a1e374b..a7936ce491 100644 --- a/substrate/core/network/src/config.rs +++ b/substrate/core/network/src/config.rs @@ -14,9 +14,34 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -pub use service::Roles; +//! Configuration for the networking layer of Substrate. -/// Protocol configuration +pub use network_libp2p::{NonReservedPeerMode, NetworkConfiguration}; + +use chain::Client; +use codec; +use on_demand::OnDemandService; +use runtime_primitives::traits::{Block as BlockT}; +use service::{ExHashT, TransactionPool}; +use std::sync::Arc; + +/// Service initialization parameters. +pub struct Params { + /// Configuration. + pub config: ProtocolConfig, + /// Network layer configuration. + pub network_config: NetworkConfiguration, + /// Substrate relay chain access point. + pub chain: Arc>, + /// On-demand service reference. + pub on_demand: Option>>, + /// Transaction pool. + pub transaction_pool: Arc>, + /// Protocol specialization. + pub specialization: S, +} + +/// Configuration for the Substrate-specific part of the networking layer. #[derive(Clone)] pub struct ProtocolConfig { /// Assigned roles. @@ -30,3 +55,29 @@ impl Default for ProtocolConfig { } } } + +bitflags! { + /// Bitmask of the roles that a node fulfills. + pub struct Roles: u8 { + /// No network. + const NONE = 0b00000000; + /// Full node, does not participate in consensus. + const FULL = 0b00000001; + /// Light client node. + const LIGHT = 0b00000010; + /// Act as an authority + const AUTHORITY = 0b00000100; + } +} + +impl codec::Encode for Roles { + fn encode_to(&self, dest: &mut T) { + dest.push_byte(self.bits()) + } +} + +impl codec::Decode for Roles { + fn decode(input: &mut I) -> Option { + Self::from_bits(input.read_byte()?) + } +} diff --git a/substrate/core/network/src/consensus_gossip.rs b/substrate/core/network/src/consensus_gossip.rs index 0ecb0e5e68..882d2f02fd 100644 --- a/substrate/core/network/src/consensus_gossip.rs +++ b/substrate/core/network/src/consensus_gossip.rs @@ -26,8 +26,8 @@ use runtime_primitives::traits::{Block as BlockT, Header as HeaderT, Hash, HashF use runtime_primitives::generic::BlockId; use message::generic::{Message, ConsensusMessage}; use protocol::Context; -use service::Roles; -use specialization::Specialization; +use config::Roles; +use specialization::NetworkSpecialization; use StatusMessage; use generic_message; @@ -262,7 +262,7 @@ where } } -impl Specialization for ConsensusGossip where +impl NetworkSpecialization for ConsensusGossip where Block::Header: HeaderT { fn status(&self) -> Vec { diff --git a/substrate/core/network/src/import_queue.rs b/substrate/core/network/src/import_queue.rs index 0d760e0d15..cb7bf86e69 100644 --- a/substrate/core/network/src/import_queue.rs +++ b/substrate/core/network/src/import_queue.rs @@ -164,8 +164,12 @@ impl> ImportQueue for BasicQueue { fn stop(&self) { self.clear(); if let Some(handle) = self.handle.lock().take() { - self.data.is_stopping.store(true, Ordering::SeqCst); - self.data.signal.notify_one(); + { + // Perform storing the stop flag and signalling under a single lock. + let _queue_lock = self.data.queue.lock(); + self.data.is_stopping.store(true, Ordering::SeqCst); + self.data.signal.notify_one(); + } let _ = handle.join(); } @@ -217,12 +221,15 @@ fn import_thread, V: Verifier>( ) { trace!(target: "sync", "Starting import thread"); loop { - if qdata.is_stopping.load(Ordering::SeqCst) { - break; - } - let new_blocks = { let mut queue_lock = qdata.queue.lock(); + + // We are holding the same lock that `stop` takes so here we either see that stop flag + // is active or wait for the signal. The latter one unlocks the mutex and this gives a chance + // to `stop` to generate the signal. + if qdata.is_stopping.load(Ordering::SeqCst) { + break; + } if queue_lock.is_empty() { qdata.signal.wait(&mut queue_lock); } @@ -556,8 +563,8 @@ impl Verifier for PassThroughVerifier { header, body, finalized: self.0, - external_justification: justification, - post_runtime_digests: vec![], + justification: justification, + post_digests: vec![], auxiliary: Vec::new(), }, None)) } @@ -692,7 +699,7 @@ pub mod tests { } } - fn prepare_good_block() -> (client::Client, Hash, u64, BlockData) { + fn prepare_good_block() -> (client::Client, Hash, u64, BlockData) { let client = test_client::new(); let block = client.new_block().unwrap().bake().unwrap(); client.justify_and_import(BlockOrigin::File, block).unwrap(); @@ -803,9 +810,12 @@ pub mod tests { #[test] fn async_import_queue_drops() { - let verifier = Arc::new(PassThroughVerifier(true)); - let queue = BasicQueue::new(verifier, Arc::new(test_client::new())); - queue.start(TestLink::new()).unwrap(); - drop(queue); + // Perform this test multiple times since it exhibits non-deterministic behavior. + for _ in 0..100 { + let verifier = Arc::new(PassThroughVerifier(true)); + let queue = BasicQueue::new(verifier, Arc::new(test_client::new())); + queue.start(TestLink::new()).unwrap(); + drop(queue); + } } } diff --git a/substrate/core/network/src/lib.rs b/substrate/core/network/src/lib.rs index 4a441dcc6f..a8ad20496f 100644 --- a/substrate/core/network/src/lib.rs +++ b/substrate/core/network/src/lib.rs @@ -17,10 +17,8 @@ #![warn(unused_extern_crates)] #![warn(missing_docs)] -// tag::description[] //! Substrate-specific P2P networking: synchronizing blocks, propagating BFT messages. //! Allows attachment of an optional subprotocol for chain-specific requests. -// end::description[] extern crate linked_hash_map; extern crate parking_lot; @@ -53,10 +51,10 @@ mod sync; #[macro_use] mod protocol; mod io; -mod config; mod chain; mod blocks; mod on_demand; +pub mod config; pub mod import_queue; pub mod consensus_gossip; pub mod error; @@ -67,13 +65,12 @@ pub mod specialization; pub mod test; pub use chain::Client as ClientHandle; -pub use service::{Service, FetchFuture, TransactionPool, Params, ManageNetwork, SyncProvider}; +pub use service::{Service, FetchFuture, TransactionPool, ManageNetwork, SyncProvider}; pub use protocol::{ProtocolStatus, PeerInfo, Context}; pub use sync::{Status as SyncStatus, SyncState}; -pub use network_libp2p::{NonReservedPeerMode, NetworkConfiguration, NodeIndex, ProtocolId, Severity, Protocol}; +pub use network_libp2p::{NodeIndex, ProtocolId, Severity, Protocol}; pub use message::{generic as generic_message, RequestId, Status as StatusMessage}; pub use error::Error; -pub use config::{Roles, ProtocolConfig}; pub use on_demand::{OnDemand, OnDemandService, RemoteResponse}; #[doc(hidden)] pub use runtime_primitives::traits::Block as BlockT; diff --git a/substrate/core/network/src/message.rs b/substrate/core/network/src/message.rs index f08fce3368..40cd9a435d 100644 --- a/substrate/core/network/src/message.rs +++ b/substrate/core/network/src/message.rs @@ -125,7 +125,7 @@ pub struct RemoteReadResponse { /// Generic types. pub mod generic { use runtime_primitives::Justification; - use service::Roles; + use config::Roles; use super::{ BlockAttributes, RemoteCallResponse, RemoteReadResponse, RequestId, Transactions, Direction diff --git a/substrate/core/network/src/on_demand.rs b/substrate/core/network/src/on_demand.rs index 399ba3f408..5fbf893714 100644 --- a/substrate/core/network/src/on_demand.rs +++ b/substrate/core/network/src/on_demand.rs @@ -30,6 +30,7 @@ use client::light::fetcher::{Fetcher, FetchChecker, RemoteHeaderRequest, use io::SyncIo; use message; use network_libp2p::{Severity, NodeIndex}; +use config::Roles; use service; use runtime_primitives::traits::{Block as BlockT, Header as HeaderT, NumberFor}; @@ -41,7 +42,7 @@ const RETRY_COUNT: usize = 1; /// On-demand service API. pub trait OnDemandService: Send + Sync { /// When new node is connected. - fn on_connect(&self, peer: NodeIndex, role: service::Roles, best_number: NumberFor); + fn on_connect(&self, peer: NodeIndex, role: Roles, best_number: NumberFor); /// When block is announced by the peer. fn on_block_announce(&self, peer: NodeIndex, best_number: NumberFor); @@ -211,8 +212,8 @@ impl OnDemandService for OnDemand where E: service::ExecuteInContext, B::Header: HeaderT, { - fn on_connect(&self, peer: NodeIndex, role: service::Roles, best_number: NumberFor) { - if !role.intersects(service::Roles::FULL | service::Roles::AUTHORITY) { // TODO: correct? + fn on_connect(&self, peer: NodeIndex, role: Roles, best_number: NumberFor) { + if !role.intersects(Roles::FULL | Roles::AUTHORITY) { // TODO: correct? return; } @@ -511,9 +512,10 @@ pub mod tests { use client::{self, error::{ErrorKind as ClientErrorKind, Result as ClientResult}}; use client::light::fetcher::{Fetcher, FetchChecker, RemoteHeaderRequest, RemoteCallRequest, RemoteReadRequest, RemoteChangesRequest}; + use config::Roles; use message; use network_libp2p::NodeIndex; - use service::{Roles, ExecuteInContext}; + use service::ExecuteInContext; use test::TestIo; use super::{REQUEST_TIMEOUT, OnDemand, OnDemandService}; use test_client::runtime::{changes_trie_config, Block, Header}; @@ -820,7 +822,11 @@ pub mod tests { }); let thread = ::std::thread::spawn(move || { let result = response.wait().unwrap(); - assert_eq!(result.hash(), "0x6443a0b46e0412e626363028115a9f2cf963eeed526b8b33e5316f08b50d0dc3".into()); + assert_eq!( + result.hash(), + "6443a0b46e0412e626363028115a9f2c\ + f963eeed526b8b33e5316f08b50d0dc3".parse().unwrap() + ); }); on_demand.on_remote_header_response(&mut network, 0, message::RemoteHeaderResponse { diff --git a/substrate/core/network/src/protocol.rs b/substrate/core/network/src/protocol.rs index 4e98ee8f80..af20a6b1bc 100644 --- a/substrate/core/network/src/protocol.rs +++ b/substrate/core/network/src/protocol.rs @@ -27,11 +27,11 @@ use codec::{Encode, Decode}; use message::{self, Message}; use message::generic::Message as GenericMessage; -use specialization::Specialization; +use specialization::NetworkSpecialization; use sync::{ChainSync, Status as SyncStatus, SyncState}; -use service::{Roles, TransactionPool, ExHashT}; +use service::{TransactionPool, ExHashT}; use import_queue::ImportQueue; -use config::ProtocolConfig; +use config::{ProtocolConfig, Roles}; use chain::Client; use on_demand::OnDemandService; use io::SyncIo; @@ -50,7 +50,7 @@ const MAX_BLOCK_DATA_RESPONSE: u32 = 128; const LIGHT_MAXIMAL_BLOCKS_DIFFERENCE: u64 = 8192; // Lock must always be taken in order declared here. -pub struct Protocol, H: ExHashT> { +pub struct Protocol, H: ExHashT> { config: ProtocolConfig, on_demand: Option>>, genesis_hash: B::Hash, @@ -184,7 +184,7 @@ pub(crate) struct ContextData { pub chain: Arc>, } -impl, H: ExHashT> Protocol { +impl, H: ExHashT> Protocol { /// Create a new instance. pub fn new>( config: ProtocolConfig, @@ -761,7 +761,7 @@ macro_rules! construct_simple_protocol { } } - impl $crate::specialization::Specialization<$block> for $protocol { + impl $crate::specialization::NetworkSpecialization<$block> for $protocol { fn status(&self) -> Vec { $( let status = self.$status_protocol_name.status(); diff --git a/substrate/core/network/src/service.rs b/substrate/core/network/src/service.rs index 37ff1472aa..0b3d0f3f32 100644 --- a/substrate/core/network/src/service.rs +++ b/substrate/core/network/src/service.rs @@ -25,11 +25,9 @@ use network_libp2p::{start_service, Service as NetworkService, ServiceEvent as N use network_libp2p::{RegisteredProtocol, parse_str_addr, Protocol as Libp2pProtocol}; use io::NetSyncIo; use protocol::{self, Protocol, ProtocolContext, Context, ProtocolStatus}; -use config::{ProtocolConfig}; +use config::Params; use error::Error; -use chain::Client; -use specialization::Specialization; -use on_demand::OnDemandService; +use specialization::NetworkSpecialization; use import_queue::ImportQueue; use runtime_primitives::traits::{Block as BlockT}; use tokio::{runtime::Runtime, timer::Interval}; @@ -40,38 +38,10 @@ pub type FetchFuture = oneshot::Receiver>; const TICK_TIMEOUT: Duration = Duration::from_millis(1000); const PROPAGATE_TIMEOUT: Duration = Duration::from_millis(5000); -bitflags! { - /// Node roles bitmask. - pub struct Roles: u8 { - /// No network. - const NONE = 0b00000000; - /// Full node, does not participate in consensus. - const FULL = 0b00000001; - /// Light client node. - const LIGHT = 0b00000010; - /// Act as an authority - const AUTHORITY = 0b00000100; - } -} - -impl ::codec::Encode for Roles { - fn encode_to(&self, dest: &mut T) { - dest.push_byte(self.bits()) - } -} - -impl ::codec::Decode for Roles { - fn decode(input: &mut I) -> Option { - Self::from_bits(input.read_byte()?) - } -} - /// Sync status pub trait SyncProvider: Send + Sync { /// Get sync status fn status(&self) -> ProtocolStatus; - /// Get this node id if available. - fn node_id(&self) -> Option; } pub trait ExHashT: ::std::hash::Hash + Eq + ::std::fmt::Debug + Clone + Send + Sync + 'static {} @@ -93,24 +63,8 @@ pub trait ExecuteInContext: Send + Sync { fn execute_in_context)>(&self, closure: F); } -/// Service initialization parameters. -pub struct Params { - /// Configuration. - pub config: ProtocolConfig, - /// Network layer configuration. - pub network_config: NetworkConfiguration, - /// Substrate relay chain access point. - pub chain: Arc>, - /// On-demand service reference. - pub on_demand: Option>>, - /// Transaction pool. - pub transaction_pool: Arc>, - /// Protocol specialization. - pub specialization: S, -} - /// Substrate network service. Handles network IO and manages connectivity. -pub struct Service, H: ExHashT> { +pub struct Service, H: ExHashT> { /// Network service network: Arc>, /// Protocol handler @@ -123,7 +77,7 @@ pub struct Service, H: ExHashT> { bg_thread: Option<(oneshot::Sender<()>, thread::JoinHandle<()>)>, } -impl, H: ExHashT> Service { +impl, H: ExHashT> Service { /// Creates and register protocol with the network service pub fn new>( params: Params, @@ -179,13 +133,13 @@ impl, H: ExHashT> Service { } } -impl, H: ExHashT> ::consensus::SyncOracle for Service { +impl, H: ExHashT> ::consensus::SyncOracle for Service { fn is_major_syncing(&self) -> bool { self.handler.sync().read().status().is_major_syncing() } } -impl, H:ExHashT> Drop for Service { +impl, H:ExHashT> Drop for Service { fn drop(&mut self) { self.handler.stop(); if let Some((sender, join)) = self.bg_thread.take() { @@ -197,30 +151,17 @@ impl, H:ExHashT> Drop for Service, H: ExHashT> ExecuteInContext for Service { +impl, H: ExHashT> ExecuteInContext for Service { fn execute_in_context)>(&self, closure: F) { closure(&mut ProtocolContext::new(self.handler.context_data(), &mut NetSyncIo::new(&self.network, self.protocol_id))) } } -impl, H: ExHashT> SyncProvider for Service { +impl, H: ExHashT> SyncProvider for Service { /// Get sync status fn status(&self) -> ProtocolStatus { self.handler.status() } - - fn node_id(&self) -> Option { - let network = self.network.lock(); - let ret = network - .listeners() - .next() - .map(|addr| { - let mut addr = addr.clone(); - addr.append(Libp2pProtocol::P2p(network.peer_id().clone().into())); - addr.to_string() - }); - ret - } } /// Trait for managing network @@ -233,9 +174,11 @@ pub trait ManageNetwork: Send + Sync { fn remove_reserved_peer(&self, peer: PeerId); /// Add reserved peer fn add_reserved_peer(&self, peer: String) -> Result<(), String>; + /// Returns a user-friendly identifier of our node. + fn node_id(&self) -> Option; } -impl, H: ExHashT> ManageNetwork for Service { +impl, H: ExHashT> ManageNetwork for Service { fn accept_unreserved_peers(&self) { self.network.lock().accept_unreserved_peers(); } @@ -265,10 +208,23 @@ impl, H: ExHashT> ManageNetwork for Se self.network.lock().add_reserved_peer(addr, peer_id); Ok(()) } + + fn node_id(&self) -> Option { + let network = self.network.lock(); + let ret = network + .listeners() + .next() + .map(|addr| { + let mut addr = addr.clone(); + addr.append(Libp2pProtocol::P2p(network.peer_id().clone().into())); + addr.to_string() + }); + ret + } } /// Starts the background thread that handles the networking. -fn start_thread, H: ExHashT>( +fn start_thread, H: ExHashT>( config: NetworkConfiguration, protocol: Arc>, registered: RegisteredProtocol, @@ -309,7 +265,7 @@ fn start_thread, H: ExHashT>( } /// Runs the background thread that handles the networking. -fn run_thread, H: ExHashT>( +fn run_thread, H: ExHashT>( network_service: Arc>, protocol: Arc>, protocol_id: ProtocolId, diff --git a/substrate/core/network/src/specialization.rs b/substrate/core/network/src/specialization.rs index 70ad9e9b2e..d1cde8b33b 100644 --- a/substrate/core/network/src/specialization.rs +++ b/substrate/core/network/src/specialization.rs @@ -21,7 +21,7 @@ use runtime_primitives::traits::Block as BlockT; use protocol::Context; /// A specialization of the substrate network protocol. Handles events and sends messages. -pub trait Specialization: Send + Sync + 'static { +pub trait NetworkSpecialization: Send + Sync + 'static { /// Get the current specialization-status. fn status(&self) -> Vec; diff --git a/substrate/core/network/src/sync.rs b/substrate/core/network/src/sync.rs index e69b22fc57..1287beffe9 100644 --- a/substrate/core/network/src/sync.rs +++ b/substrate/core/network/src/sync.rs @@ -25,7 +25,7 @@ use blocks::{self, BlockCollection}; use runtime_primitives::traits::{Block as BlockT, Header as HeaderT, As, NumberFor}; use runtime_primitives::generic::BlockId; use message::{self, generic::Message as GenericMessage}; -use service::Roles; +use config::Roles; use import_queue::ImportQueue; // Maximum blocks to request in a single packet. diff --git a/substrate/core/network/src/test/mod.rs b/substrate/core/network/src/test/mod.rs index d3975e032b..d591896159 100644 --- a/substrate/core/network/src/test/mod.rs +++ b/substrate/core/network/src/test/mod.rs @@ -29,7 +29,6 @@ use client::block_builder::BlockBuilder; use runtime_primitives::generic::BlockId; use io::SyncIo; use protocol::{Context, Protocol, ProtocolContext}; -use primitives::{Blake2Hasher}; use config::ProtocolConfig; use service::TransactionPool; use network_libp2p::{NodeIndex, PeerId, Severity}; @@ -37,7 +36,7 @@ use keyring::Keyring; use codec::Encode; use import_queue::{SyncImportQueue, PassThroughVerifier, Verifier}; use consensus::BlockOrigin; -use specialization::Specialization; +use specialization::NetworkSpecialization; use consensus_gossip::ConsensusGossip; use import_queue::{BlockImport, ImportQueue}; use service::ExecuteInContext; @@ -64,7 +63,7 @@ pub struct DummySpecialization { pub gossip: ConsensusGossip, } -impl Specialization for DummySpecialization { +impl NetworkSpecialization for DummySpecialization { fn status(&self) -> Vec { vec![] } fn on_connect(&mut self, ctx: &mut Context, peer_id: NodeIndex, status: ::message::Status) { @@ -138,7 +137,7 @@ pub struct TestPacket { recipient: NodeIndex, } -pub type PeersClient = client::Client; +pub type PeersClient = client::Client; pub struct Peer, D> { client: Arc, @@ -241,7 +240,7 @@ impl, D> Peer { /// Add blocks to the peer -- edit the block before adding pub fn generate_blocks(&self, count: usize, origin: BlockOrigin, mut edit_block: F) - where F: FnMut(BlockBuilder) -> Block + where F: FnMut(BlockBuilder) -> Block { use blocks::BlockData; @@ -280,7 +279,7 @@ impl, D> Peer { amount: 1, nonce, }; - let signature = Keyring::from_raw_public(transfer.from.0).unwrap().sign(&transfer.encode()).into(); + let signature = Keyring::from_raw_public(transfer.from.to_fixed_bytes()).unwrap().sign(&transfer.encode()).into(); builder.push(Extrinsic { transfer, signature }).unwrap(); nonce = nonce + 1; builder.bake().unwrap() diff --git a/substrate/core/network/src/test/sync.rs b/substrate/core/network/src/test/sync.rs index 4d714eb828..22dedf7b3e 100644 --- a/substrate/core/network/src/test/sync.rs +++ b/substrate/core/network/src/test/sync.rs @@ -16,9 +16,9 @@ use client::backend::Backend; use client::blockchain::HeaderBackend as BlockchainHeaderBackend; +use config::Roles; use consensus::BlockOrigin; use sync::SyncState; -use Roles; use super::*; #[test] diff --git a/substrate/core/primitives/Cargo.toml b/substrate/core/primitives/Cargo.toml index 29914fc4ce..171841f1e2 100644 --- a/substrate/core/primitives/Cargo.toml +++ b/substrate/core/primitives/Cargo.toml @@ -4,15 +4,15 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -crunchy = "0.1" +crunchy = { version = "0.2", default-features = false } sr-std = { path = "../sr-std", default-features = false } parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } -fixed-hash = { version = "0.2.2", default-features = false } +fixed-hash = { version = "0.3.0-beta", default-features = false } rustc-hex = { version = "2.0", default-features = false } serde = { version = "1.0", default-features = false } serde_derive = { version = "1.0", optional = true } -uint = { version = "0.4.1", default-features = false } +uint = { version = "0.5.0-beta", default-features = false } twox-hash = { version = "1.1.0", optional = true } byteorder = { version = "1.1", default-features = false } wasmi = { version = "0.4.1", optional = true } @@ -32,10 +32,13 @@ heapsize = "0.4" [features] default = ["std"] std = [ + "crunchy/std", "wasmi", "uint/std", "fixed-hash/std", - "fixed-hash/heapsizeof", + "fixed-hash/heapsize", + "fixed-hash/byteorder", + "fixed-hash/rustc-hex", "fixed-hash/libc", "parity-codec/std", "hash256-std-hasher/std", diff --git a/substrate/core/primitives/README.adoc b/substrate/core/primitives/README.adoc deleted file mode 100644 index ed98cf12ad..0000000000 --- a/substrate/core/primitives/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Primitives - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/primitives/src/ed25519.rs b/substrate/core/primitives/src/ed25519.rs index 027298b4b1..2e30653e81 100644 --- a/substrate/core/primitives/src/ed25519.rs +++ b/substrate/core/primitives/src/ed25519.rs @@ -241,7 +241,7 @@ impl Pair { pub fn derive_child_probably_bad(&self, chain_data: &[u8]) -> Pair { let sig = self.sign(chain_data); let mut seed = [0u8; 32]; - seed.copy_from_slice(&sig.0[..32]); + seed.copy_from_slice(&sig[..32]); Pair::from_seed(&seed) } @@ -251,7 +251,7 @@ impl Pair { pub fn verify_strong>(sig: &Signature, message: &[u8], pubkey: P) -> bool { let public_key = untrusted::Input::from(&pubkey.as_ref().0[..]); let msg = untrusted::Input::from(message); - let sig = untrusted::Input::from(&sig.0[..]); + let sig = untrusted::Input::from(&sig.as_bytes()); match signature::verify(&signature::ED25519, public_key, msg, sig) { Ok(_) => true, @@ -316,7 +316,7 @@ mod test { assert_eq!(public, Public::from_raw(hex!("2f8c6129d816cf51c374bc7f08c3e63ed156cf78aefb4a6550d97b87997977ee"))); let message = hex!("2f8c6129d816cf51c374bc7f08c3e63ed156cf78aefb4a6550d97b87997977ee00000000000000000200d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a4500000000000000"); let signature = pair.sign(&message[..]); - println!("Correct signature: {}", HexDisplay::from(&signature.0)); + println!("Correct signature: {}", HexDisplay::from(&signature.as_bytes())); assert!(verify_strong(&signature, &message[..], &public)); } diff --git a/substrate/core/primitives/src/hash.rs b/substrate/core/primitives/src/hash.rs index 840be7e8a4..8d04df2684 100644 --- a/substrate/core/primitives/src/hash.rs +++ b/substrate/core/primitives/src/hash.rs @@ -35,7 +35,7 @@ macro_rules! impl_rest { impl<'de> Deserialize<'de> for $name { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de> { bytes::deserialize_check_len(deserializer, bytes::ExpectedLen::Exact($len)) - .map(|x| (&*x).into()) + .map(|x| $name::from_slice(&x)) } } @@ -49,16 +49,43 @@ macro_rules! impl_rest { <[u8; $len] as ::codec::Decode>::decode(input).map($name) } } + + #[cfg(feature = "std")] + impl From for $name { + fn from(val: u64) -> Self { + Self::from_low_u64_be(val) + } + } } } -construct_hash!(H160, 20); -construct_hash!(H256, 32); -construct_hash!(H512, 64); +construct_fixed_hash!{ + /// Fixed-size uninterpreted hash type with 20 bytes (160 bits) size. + pub struct H160(20); +} +construct_fixed_hash!{ + /// Fixed-size uninterpreted hash type with 32 bytes (256 bits) size. + pub struct H256(32); +} +construct_fixed_hash!{ + /// Fixed-size uninterpreted hash type with 64 bytes (512 bits) size. + pub struct H512(64); +} + impl_rest!(H160, 20); impl_rest!(H256, 32); impl_rest!(H512, 64); +/// Hash conversion. Used to convert between unbound associated hash types in traits, +/// implemented by the same hash type. +/// Panics if used to convert between different hash types. +pub fn convert_hash, H2: AsRef<[u8]>>(src: &H2) -> H1 { + let mut dest = H1::default(); + assert_eq!(dest.as_mut().len(), src.as_ref().len()); + dest.as_mut().copy_from_slice(src.as_ref()); + dest +} + #[cfg(test)] mod tests { use super::*; @@ -113,7 +140,7 @@ mod tests { #[test] fn test_heapsizeof() { use heapsize::HeapSizeOf; - let h = H256::new(); + let h = H256::zero(); assert_eq!(h.heap_size_of_children(), 0); } } diff --git a/substrate/core/primitives/src/lib.rs b/substrate/core/primitives/src/lib.rs index affa1c5c00..1bbfaafb24 100644 --- a/substrate/core/primitives/src/lib.rs +++ b/substrate/core/primitives/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Shareable Substrate types. -// end::description[] #![warn(missing_docs)] @@ -109,7 +107,7 @@ mod changes_trie; #[cfg(test)] mod tests; -pub use self::hash::{H160, H256, H512}; +pub use self::hash::{H160, H256, H512, convert_hash}; pub use self::uint::U256; pub use authority_id::AuthorityId; pub use changes_trie::ChangesTrieConfiguration; @@ -131,7 +129,30 @@ impl From> for Bytes { fn from(s: Vec) -> Self { Bytes(s) } } +impl From for Bytes { + fn from(s: OpaqueMetadata) -> Self { Bytes(s.0) } +} + impl Deref for Bytes { type Target = [u8]; fn deref(&self) -> &[u8] { &self.0[..] } } + +/// Stores the encoded `RuntimeMetadata` for the native side as opaque type. +#[derive(Encode, Decode)] +pub struct OpaqueMetadata(Vec); + +impl OpaqueMetadata { + /// Creates a new instance with the given metadata blob. + pub fn new(metadata: Vec) -> Self { + OpaqueMetadata(metadata) + } +} + +impl rstd::ops::Deref for OpaqueMetadata { + type Target = Vec; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} diff --git a/substrate/core/rpc-servers/README.adoc b/substrate/core/rpc-servers/README.adoc deleted file mode 100644 index 18840be421..0000000000 --- a/substrate/core/rpc-servers/README.adoc +++ /dev/null @@ -1,14 +0,0 @@ - -= RPC Server - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- - diff --git a/substrate/core/rpc-servers/src/lib.rs b/substrate/core/rpc-servers/src/lib.rs index 47934f805a..8cf763d1e1 100644 --- a/substrate/core/rpc-servers/src/lib.rs +++ b/substrate/core/rpc-servers/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Substrate RPC servers. -// end::description[] #[warn(missing_docs)] @@ -32,7 +30,7 @@ extern crate sr_primitives; extern crate log; use std::io; -use sr_primitives::traits::{Block as BlockT, NumberFor}; +use sr_primitives::{traits::{Block as BlockT, NumberFor}, generic::SignedBlock}; type Metadata = apis::metadata::Metadata; type RpcHandler = pubsub::PubSubHandler; @@ -40,7 +38,7 @@ pub type HttpServer = http::Server; pub type WsServer = ws::Server; /// Construct rpc `IoHandler` -pub fn rpc_handler( +pub fn rpc_handler( state: S, chain: C, author: A, @@ -48,10 +46,10 @@ pub fn rpc_handler( ) -> RpcHandler where Block: BlockT + 'static, ExHash: Send + Sync + 'static + sr_primitives::Serialize + sr_primitives::DeserializeOwned, - PendingExtrinsics: serde::Serialize + serde::de::DeserializeOwned + Send + Sync + 'static, + SignedBlock: serde::Serialize + sr_primitives::DeserializeOwned, S: apis::state::StateApi, - C: apis::chain::ChainApi, Block::Extrinsic, Metadata=Metadata>, - A: apis::author::AuthorApi, + C: apis::chain::ChainApi, SignedBlock, Metadata=Metadata>, + A: apis::author::AuthorApi, Y: apis::system::SystemApi, { let mut io = pubsub::PubSubHandler::default(); diff --git a/substrate/core/rpc/Cargo.toml b/substrate/core/rpc/Cargo.toml index 3f35394c91..0a1c95bb5e 100644 --- a/substrate/core/rpc/Cargo.toml +++ b/substrate/core/rpc/Cargo.toml @@ -11,6 +11,7 @@ jsonrpc-pubsub = { git="https://github.com/paritytech/jsonrpc.git" } log = "0.4" parking_lot = "0.4" parity-codec = "2.1" +serde_json = "1.0" substrate-client = { path = "../client" } substrate-executor = { path = "../executor" } substrate-transaction-pool = { path = "../transaction-pool" } diff --git a/substrate/core/rpc/README.adoc b/substrate/core/rpc/README.adoc deleted file mode 100644 index 5e4db49099..0000000000 --- a/substrate/core/rpc/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= RPC - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/rpc/src/author/mod.rs b/substrate/core/rpc/src/author/mod.rs index ff08c4c840..9d3482f1ee 100644 --- a/substrate/core/rpc/src/author/mod.rs +++ b/substrate/core/rpc/src/author/mod.rs @@ -19,13 +19,12 @@ use std::sync::Arc; use client::{self, Client}; -use codec::Decode; +use codec::{Encode, Decode}; use transaction_pool::{ txpool::{ ChainApi as PoolChainApi, BlockHash, ExHash, - ExtrinsicFor, IntoPoolError, Pool, watcher::Status, @@ -47,19 +46,16 @@ use self::error::Result; build_rpc_trait! { /// Substrate authoring RPC API - pub trait AuthorApi { + pub trait AuthorApi { type Metadata; - /// Submit extrinsic for inclusion in block. - #[rpc(name = "author_submitRichExtrinsic")] - fn submit_rich_extrinsic(&self, Extrinsic) -> Result; /// Submit hex-encoded extrinsic for inclusion in block. #[rpc(name = "author_submitExtrinsic")] fn submit_extrinsic(&self, Bytes) -> Result; /// Returns all pending extrinsics, potentially grouped by sender. #[rpc(name = "author_pendingExtrinsics")] - fn pending_extrinsics(&self) -> Result; + fn pending_extrinsics(&self) -> Result>; #[pubsub(name = "author_extrinsicUpdate")] { /// Submit an extrinsic to watch. @@ -75,23 +71,19 @@ build_rpc_trait! { } /// Authoring API -pub struct Author where - P: PoolChainApi + Sync + Send + 'static, -{ +pub struct Author where P: PoolChainApi + Sync + Send + 'static { /// Substrate client - client: Arc::Block>>, + client: Arc::Block, RA>>, /// Extrinsic pool pool: Arc>, /// Subscriptions manager subscriptions: Subscriptions, } -impl Author where - P: PoolChainApi + Sync + Send + 'static, -{ +impl Author where P: PoolChainApi + Sync + Send + 'static { /// Create new instance of Authoring API. pub fn new( - client: Arc::Block>>, + client: Arc::Block, RA>>, pool: Arc>, subscriptions: Subscriptions, ) -> Self { @@ -103,21 +95,18 @@ impl Author where } } -impl AuthorApi, BlockHash

, ExtrinsicFor

, Vec>> for Author where +impl AuthorApi, BlockHash

> for Author where B: client::backend::Backend<

::Block, Blake2Hasher> + Send + Sync + 'static, E: client::CallExecutor<

::Block, Blake2Hasher> + Send + Sync + 'static, P: PoolChainApi + Sync + Send + 'static, P::Block: traits::Block, P::Error: 'static, + RA: Send + Sync + 'static { type Metadata = ::metadata::Metadata; - fn submit_extrinsic(&self, xt: Bytes) -> Result> { - let dxt = Decode::decode(&mut &xt[..]).ok_or(error::Error::from(error::ErrorKind::BadFormat))?; - self.submit_rich_extrinsic(dxt) - } - - fn submit_rich_extrinsic(&self, xt: <

::Block as traits::Block>::Extrinsic) -> Result> { + fn submit_extrinsic(&self, ext: Bytes) -> Result> { + let xt = Decode::decode(&mut &ext[..]).ok_or(error::Error::from(error::ErrorKind::BadFormat))?; let best_block_hash = self.client.info()?.chain.best_hash; self.pool .submit_one(&generic::BlockId::hash(best_block_hash), xt) @@ -127,8 +116,8 @@ impl AuthorApi, BlockHash

, ExtrinsicFor

, Vec Result>> { - Ok(self.pool.ready().map(|tx| tx.data.clone()).collect()) + fn pending_extrinsics(&self) -> Result> { + Ok(self.pool.ready().map(|tx| tx.data.encode().into()).collect()) } fn watch_extrinsic(&self, _metadata: Self::Metadata, subscriber: pubsub::Subscriber, BlockHash

>>, xt: Bytes) { diff --git a/substrate/core/rpc/src/author/tests.rs b/substrate/core/rpc/src/author/tests.rs index 249d3187c7..82f5d37162 100644 --- a/substrate/core/rpc/src/author/tests.rs +++ b/substrate/core/rpc/src/author/tests.rs @@ -35,7 +35,7 @@ fn uxt(sender: Keyring, nonce: u64) -> Extrinsic { from: sender.to_raw_public().into(), to: Default::default(), }; - let signature = Keyring::from_raw_public(tx.from.0).unwrap().sign(&tx.encode()).into(); + let signature = Keyring::from_raw_public(tx.from.to_fixed_bytes()).unwrap().sign(&tx.encode()).into(); Extrinsic { transfer: tx, signature } } @@ -71,11 +71,11 @@ fn submit_rich_transaction_should_not_cause_error() { let h: H256 = hex!("fccc48291473c53746cd267cf848449edd7711ee6511fba96919d5f9f4859e4f").into(); assert_matches!( - AuthorApi::submit_rich_extrinsic(&p, uxt(Keyring::Alice, 0)), + AuthorApi::submit_extrinsic(&p, uxt(Keyring::Alice, 0).encode().into()), Ok(h2) if h == h2 ); assert!( - AuthorApi::submit_rich_extrinsic(&p, uxt(Keyring::Alice, 0)).is_err() + AuthorApi::submit_extrinsic(&p, uxt(Keyring::Alice, 0).encode().into()).is_err() ); } @@ -105,10 +105,10 @@ fn should_watch_extrinsic() { from: Keyring::Alice.to_raw_public().into(), to: Default::default(), }; - let signature = Keyring::from_raw_public(tx.from.0).unwrap().sign(&tx.encode()).into(); + let signature = Keyring::from_raw_public(tx.from.to_fixed_bytes()).unwrap().sign(&tx.encode()).into(); Extrinsic { transfer: tx, signature } }; - AuthorApi::submit_rich_extrinsic(&p, replacement).unwrap(); + AuthorApi::submit_extrinsic(&p, replacement.encode().into()).unwrap(); let (res, data) = runtime.block_on(data.into_future()).unwrap(); assert_eq!( res, @@ -131,9 +131,9 @@ fn should_return_pending_extrinsics() { subscriptions: Subscriptions::new(runtime.executor()), }; let ex = uxt(Keyring::Alice, 0); - AuthorApi::submit_rich_extrinsic(&p, ex.clone()).unwrap(); + AuthorApi::submit_extrinsic(&p, ex.encode().into()).unwrap(); assert_matches!( p.pending_extrinsics(), - Ok(ref expected) if expected == &vec![ex] + Ok(ref expected) if *expected == vec![Bytes(ex.encode())] ); } diff --git a/substrate/core/rpc/src/chain/mod.rs b/substrate/core/rpc/src/chain/mod.rs index 308a9996ef..e836857bc9 100644 --- a/substrate/core/rpc/src/chain/mod.rs +++ b/substrate/core/rpc/src/chain/mod.rs @@ -39,7 +39,7 @@ use self::error::Result; build_rpc_trait! { /// Substrate blockchain API - pub trait ChainApi { + pub trait ChainApi { type Metadata; /// Get header of a relay chain block. @@ -48,7 +48,7 @@ build_rpc_trait! { /// Get header and body of a relay chain block. #[rpc(name = "chain_getBlock")] - fn block(&self, Trailing) -> Result>>; + fn block(&self, Trailing) -> Result>; /// Get hash of the n-th block in the canon chain. /// @@ -56,6 +56,10 @@ build_rpc_trait! { #[rpc(name = "chain_getBlockHash", alias = ["chain_getHead", ])] fn block_hash(&self, Trailing) -> Result>; + /// Get hash of the last finalised block in the canon chain. + #[rpc(name = "chain_getFinalisedHead")] + fn finalised_head(&self) -> Result; + /// Get the runtime version. #[rpc(name = "chain_getRuntimeVersion")] fn runtime_version(&self, Trailing) -> Result; @@ -70,6 +74,16 @@ build_rpc_trait! { fn unsubscribe_new_head(&self, SubscriptionId) -> RpcResult; } + #[pubsub(name = "chain_finalisedHead")] { + /// New head subscription + #[rpc(name = "chain_subscribeFinalisedHeads")] + fn subscribe_finalised_heads(&self, Self::Metadata, pubsub::Subscriber

); + + /// Unsubscribe from new head subscription. + #[rpc(name = "chain_unsubscribeFinalisedHeads")] + fn unsubscribe_finalised_heads(&self, SubscriptionId) -> RpcResult; + } + #[pubsub(name = "chain_runtimeVersion")] { /// New runtime version subscription #[rpc(name = "chain_subscribeRuntimeVersion")] @@ -83,16 +97,16 @@ build_rpc_trait! { } /// Chain API with subscriptions support. -pub struct Chain { +pub struct Chain { /// Substrate client. - client: Arc>, + client: Arc>, /// Current subscriptions. subscriptions: Subscriptions, } -impl Chain { +impl Chain { /// Create new Chain API RPC handler. - pub fn new(client: Arc>, subscriptions: Subscriptions) -> Self { + pub fn new(client: Arc>, subscriptions: Subscriptions) -> Self { Self { client, subscriptions, @@ -100,10 +114,11 @@ impl Chain { } } -impl Chain where +impl Chain where Block: BlockT + 'static, B: client::backend::Backend + Send + Sync + 'static, E: client::CallExecutor + Send + Sync + 'static, + RA: Send + Sync + 'static { fn unwrap_or_best(&self, hash: Trailing) -> Result { Ok(match hash.into() { @@ -111,43 +126,21 @@ impl Chain where Some(hash) => hash, }) } -} -impl ChainApi, Block::Extrinsic> for Chain where - Block: BlockT + 'static, - B: client::backend::Backend + Send + Sync + 'static, - E: client::CallExecutor + Send + Sync + 'static, -{ - type Metadata = ::metadata::Metadata; - - fn header(&self, hash: Trailing) -> Result> { - let hash = self.unwrap_or_best(hash)?; - Ok(self.client.header(&BlockId::Hash(hash))?) - } - - fn block(&self, hash: Trailing) - -> Result>> + fn subscribe_headers( + &self, + subscriber: pubsub::Subscriber, + best_block_hash: G, + stream: F, + ) where + F: FnOnce() -> S, + G: FnOnce() -> Result>, + ERR: ::std::fmt::Debug, + S: Stream + Send + 'static, { - let hash = self.unwrap_or_best(hash)?; - Ok(self.client.block(&BlockId::Hash(hash))?) - } - - fn block_hash(&self, number: Trailing>) -> Result> { - Ok(match number.into() { - None => Some(self.client.info()?.chain.best_hash), - Some(number) => self.client.header(&BlockId::number(number))?.map(|h| h.hash()), - }) - } - - fn runtime_version(&self, at: Trailing) -> Result { - let at = self.unwrap_or_best(at)?; - Ok(self.client.runtime_version_at(&BlockId::Hash(at))?) - } - - fn subscribe_new_head(&self, _metadata: Self::Metadata, subscriber: pubsub::Subscriber) { self.subscriptions.add(subscriber, |sink| { // send current head right at the start. - let header = self.block_hash(None.into()) + let header = best_block_hash() .and_then(|hash| self.header(hash.into())) .and_then(|header| { header.ok_or_else(|| self::error::ErrorKind::Unimplemented.into()) @@ -155,9 +148,8 @@ impl ChainApi, Block:: .map_err(Into::into); // send further subscriptions - let stream = self.client.import_notification_stream() - .filter(|notification| notification.is_new_best) - .map(|notification| Ok(notification.header)) + let stream = stream() + .map(|res| Ok(res)) .map_err(|e| warn!("Block notification stream error: {:?}", e)); sink @@ -170,11 +162,70 @@ impl ChainApi, Block:: .map(|_| ()) }); } +} + +impl ChainApi, SignedBlock> for Chain where + Block: BlockT + 'static, + B: client::backend::Backend + Send + Sync + 'static, + E: client::CallExecutor + Send + Sync + 'static, + RA: Send + Sync + 'static +{ + type Metadata = ::metadata::Metadata; + + fn header(&self, hash: Trailing) -> Result> { + let hash = self.unwrap_or_best(hash)?; + Ok(self.client.header(&BlockId::Hash(hash))?) + } + + fn block(&self, hash: Trailing) + -> Result>> + { + let hash = self.unwrap_or_best(hash)?; + Ok(self.client.block(&BlockId::Hash(hash))?) + } + + fn block_hash(&self, number: Trailing>) -> Result> { + Ok(match number.into() { + None => Some(self.client.info()?.chain.best_hash), + Some(number) => self.client.header(&BlockId::number(number))?.map(|h| h.hash()), + }) + } + + fn finalised_head(&self) -> Result { + Ok(self.client.info()?.chain.finalized_hash) + } + + fn runtime_version(&self, at: Trailing) -> Result { + let at = self.unwrap_or_best(at)?; + Ok(self.client.runtime_version_at(&BlockId::Hash(at))?) + } + + fn subscribe_new_head(&self, _metadata: Self::Metadata, subscriber: pubsub::Subscriber) { + self.subscribe_headers( + subscriber, + || self.block_hash(None.into()), + || self.client.import_notification_stream() + .filter(|notification| notification.is_new_best) + .map(|notification| notification.header), + ) + } fn unsubscribe_new_head(&self, id: SubscriptionId) -> RpcResult { Ok(self.subscriptions.cancel(id)) } + fn subscribe_finalised_heads(&self, _meta: Self::Metadata, subscriber: pubsub::Subscriber) { + self.subscribe_headers( + subscriber, + || Ok(Some(self.client.info()?.chain.finalized_hash)), + || self.client.finality_notification_stream() + .map(|notification| notification.header), + ) + } + + fn unsubscribe_finalised_heads(&self, id: SubscriptionId) -> RpcResult { + Ok(self.subscriptions.cancel(id)) + } fn subscribe_runtime_version(&self, _meta: Self::Metadata, subscriber: pubsub::Subscriber) { let stream = match self.client.storage_changes_notification_stream(Some(&[storage::StorageKey(storage::well_known_keys::CODE.to_vec())])) { diff --git a/substrate/core/rpc/src/chain/tests.rs b/substrate/core/rpc/src/chain/tests.rs index 644c7fed07..172223b941 100644 --- a/substrate/core/rpc/src/chain/tests.rs +++ b/substrate/core/rpc/src/chain/tests.rs @@ -36,7 +36,7 @@ fn should_return_header() { parent_hash: 0.into(), number: 0, state_root: x.state_root.clone(), - extrinsics_root: "03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314".into(), + extrinsics_root: "03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314".parse().unwrap(), digest: Default::default(), } ); @@ -47,7 +47,7 @@ fn should_return_header() { parent_hash: 0.into(), number: 0, state_root: x.state_root.clone(), - extrinsics_root: "03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314".into(), + extrinsics_root: "03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314".parse().unwrap(), digest: Default::default(), } ); @@ -86,7 +86,7 @@ fn should_return_a_block() { parent_hash: api.client.genesis_hash(), number: 1, state_root: x.block.header.state_root.clone(), - extrinsics_root: "03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314".into(), + extrinsics_root: "03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314".parse().unwrap(), digest: Default::default(), }, extrinsics: vec![], @@ -100,7 +100,7 @@ fn should_return_a_block() { parent_hash: api.client.genesis_hash(), number: 1, state_root: x.block.header.state_root.clone(), - extrinsics_root: "03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314".into(), + extrinsics_root: "03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314".parse().unwrap(), digest: Default::default(), }, extrinsics: vec![], @@ -150,7 +150,39 @@ fn should_return_block_hash() { client.block_hash(Some(1u64).into()), Ok(Some(ref x)) if x == &block.hash() ); +} + +#[test] +fn should_return_finalised_hash() { + let core = ::tokio::runtime::Runtime::new().unwrap(); + let remote = core.executor(); + + let client = Chain { + client: Arc::new(test_client::new()), + subscriptions: Subscriptions::new(remote), + }; + + assert_matches!( + client.finalised_head(), + Ok(ref x) if x == &client.client.genesis_hash() + ); + + // import new block + let builder = client.client.new_block().unwrap(); + client.client.justify_and_import(BlockOrigin::Own, builder.bake().unwrap()).unwrap(); + // no finalisation yet + assert_matches!( + client.finalised_head(), + Ok(ref x) if x == &client.client.genesis_hash() + ); + + // finalise + client.client.finalize_block(BlockId::number(1), true).unwrap(); + assert_matches!( + client.finalised_head(), + Ok(ref x) if x == &client.client.block_hash(1).unwrap().unwrap() + ); } #[test] @@ -184,6 +216,38 @@ fn should_notify_about_latest_block() { assert_eq!(core.block_on(next.into_future()).unwrap().0, None); } +#[test] +fn should_notify_about_finalised_block() { + let mut core = ::tokio::runtime::Runtime::new().unwrap(); + let remote = core.executor(); + let (subscriber, id, transport) = pubsub::Subscriber::new_test("test"); + + { + let api = Chain { + client: Arc::new(test_client::new()), + subscriptions: Subscriptions::new(remote), + }; + + api.subscribe_finalised_heads(Default::default(), subscriber); + + // assert id assigned + assert_eq!(core.block_on(id), Ok(Ok(SubscriptionId::Number(1)))); + + let builder = api.client.new_block().unwrap(); + api.client.justify_and_import(BlockOrigin::Own, builder.bake().unwrap()).unwrap(); + api.client.finalize_block(BlockId::number(1), true).unwrap(); + } + + // assert initial head sent. + let (notification, next) = core.block_on(transport.into_future()).unwrap(); + assert!(notification.is_some()); + // assert notification sent to transport + let (notification, next) = core.block_on(next.into_future()).unwrap(); + assert!(notification.is_some()); + // no more notifications on this channel + assert_eq!(core.block_on(next.into_future()).unwrap().0, None); +} + #[test] fn should_return_runtime_version() { let core = ::tokio::runtime::Runtime::new().unwrap(); diff --git a/substrate/core/rpc/src/lib.rs b/substrate/core/rpc/src/lib.rs index dbbc8e3a6a..cd9b50af79 100644 --- a/substrate/core/rpc/src/lib.rs +++ b/substrate/core/rpc/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Substrate RPC interfaces. -// end::description[] #![warn(missing_docs)] diff --git a/substrate/core/rpc/src/state/mod.rs b/substrate/core/rpc/src/state/mod.rs index d94b8f3dee..f1ad6a67c2 100644 --- a/substrate/core/rpc/src/state/mod.rs +++ b/substrate/core/rpc/src/state/mod.rs @@ -32,7 +32,7 @@ use primitives::{Blake2Hasher, Bytes}; use rpc::Result as RpcResult; use rpc::futures::{stream, Future, Sink, Stream}; use runtime_primitives::generic::BlockId; -use runtime_primitives::traits::{Block as BlockT, Header}; +use runtime_primitives::traits::{Block as BlockT, Header, ProvideRuntimeApi}; use subscriptions::Subscriptions; @@ -87,16 +87,16 @@ build_rpc_trait! { } /// State API with subscriptions support. -pub struct State { +pub struct State { /// Substrate client. - client: Arc>, + client: Arc>, /// Current subscriptions. subscriptions: Subscriptions, } -impl State { +impl State { /// Create new State API RPC handler. - pub fn new(client: Arc>, subscriptions: Subscriptions) -> Self { + pub fn new(client: Arc>, subscriptions: Subscriptions) -> Self { Self { client, subscriptions, @@ -104,7 +104,7 @@ impl State { } } -impl State where +impl State where Block: BlockT, B: client::backend::Backend, E: CallExecutor, @@ -114,10 +114,11 @@ impl State where } } -impl StateApi for State where +impl StateApi for State where Block: BlockT + 'static, B: client::backend::Backend + Send + Sync + 'static, - E: CallExecutor + Send + Sync + 'static, + E: CallExecutor + Send + Sync + 'static + Clone, + RA: Metadata { type Metadata = ::metadata::Metadata; @@ -151,7 +152,7 @@ impl StateApi for State where fn metadata(&self, block: Trailing) -> Result { let block = self.unwrap_or_best(block)?; - self.client.metadata(&BlockId::Hash(block)).map(Bytes).map_err(Into::into) + self.client.runtime_api().metadata(&BlockId::Hash(block)).map(Into::into).map_err(Into::into) } fn query_storage(&self, keys: Vec, from: Block::Hash, to: Trailing) -> Result>> { diff --git a/substrate/core/rpc/src/system/mod.rs b/substrate/core/rpc/src/system/mod.rs index 78fd7dda87..44f9033a2d 100644 --- a/substrate/core/rpc/src/system/mod.rs +++ b/substrate/core/rpc/src/system/mod.rs @@ -37,5 +37,9 @@ build_rpc_trait! { /// Get the chain's type. Given as a string identifier. #[rpc(name = "system_chain")] fn system_chain(&self) -> Result; + + /// Get a custom set of properties as a JSON object, defined in the chain spec. + #[rpc(name = "system_properties")] + fn system_properties(&self) -> Result>; } } diff --git a/substrate/core/rpc/src/system/tests.rs b/substrate/core/rpc/src/system/tests.rs index 95f37e79c8..0a1222c068 100644 --- a/substrate/core/rpc/src/system/tests.rs +++ b/substrate/core/rpc/src/system/tests.rs @@ -27,6 +27,9 @@ impl SystemApi for () { fn system_chain(&self) -> Result { Ok("testchain".into()) } + fn system_properties(&self) -> Result> { + Ok(serde_json::map::Map::new()) + } } #[test] @@ -52,3 +55,11 @@ fn system_chain_works() { "testchain".to_owned() ); } + +#[test] +fn system_properties_works() { + assert_eq!( + SystemApi::system_properties(&()).unwrap(), + serde_json::map::Map::new() + ); +} diff --git a/substrate/core/serializer/README.adoc b/substrate/core/serializer/README.adoc deleted file mode 100644 index 7b780bae43..0000000000 --- a/substrate/core/serializer/README.adoc +++ /dev/null @@ -1,14 +0,0 @@ - -= Serializer - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- - diff --git a/substrate/core/serializer/src/lib.rs b/substrate/core/serializer/src/lib.rs index 2ef799ed8e..667c57eb87 100644 --- a/substrate/core/serializer/src/lib.rs +++ b/substrate/core/serializer/src/lib.rs @@ -14,12 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Substrate customizable serde serializer. //! //! The idea is that we can later change the implementation //! to something more compact, but for now we're using JSON. -// end::description[] #![warn(missing_docs)] diff --git a/substrate/core/service/README.adoc b/substrate/core/service/README.adoc deleted file mode 100644 index 4d74c098b2..0000000000 --- a/substrate/core/service/README.adoc +++ /dev/null @@ -1,14 +0,0 @@ - -= Service - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- - diff --git a/substrate/core/service/src/chain_ops.rs b/substrate/core/service/src/chain_ops.rs index f9b7790863..4f2f10a39c 100644 --- a/substrate/core/service/src/chain_ops.rs +++ b/substrate/core/service/src/chain_ops.rs @@ -18,7 +18,6 @@ use std::{self, io::{Read, Write}}; use futures::Future; -use serde_json; use runtime_primitives::generic::{SignedBlock, BlockId}; use runtime_primitives::traits::{As, Block, Header}; @@ -34,7 +33,10 @@ use chain_spec::ChainSpec; /// Export a range of blocks to a binary stream. pub fn export_blocks(config: FactoryFullConfiguration, exit: E, mut output: W, from: FactoryBlockNumber, to: Option>, json: bool) -> error::Result<()> - where F: ServiceFactory, E: Future + Send + 'static, W: Write, + where + F: ServiceFactory, + E: Future + Send + 'static, + W: Write, { let client = new_client::(&config)?; let mut block = from; @@ -108,14 +110,14 @@ pub fn import_blocks(config: FactoryFullConfiguration, exit: E, mut if exit_recv.try_recv().is_ok() { break; } - if let Some(signed) = SignedBlock::<::Header, ::Extrinsic>::decode(&mut input) { - let header = signed.block.header; + if let Some(signed) = SignedBlock::::decode(&mut input) { + let (header, extrinsics) = signed.block.deconstruct(); let hash = header.hash(); let block = message::BlockData:: { hash: hash, justification: Some(signed.justification), header: Some(header), - body: Some(signed.block.extrinsics), + body: Some(extrinsics), receipt: None, message_queue: None }; diff --git a/substrate/core/service/src/chain_spec.rs b/substrate/core/service/src/chain_spec.rs index 1b9cad490a..bc3ebf63cb 100644 --- a/substrate/core/service/src/chain_spec.rs +++ b/substrate/core/service/src/chain_spec.rs @@ -88,8 +88,12 @@ struct ChainSpecFile { pub telemetry_url: Option, pub protocol_id: Option, pub consensus_engine: Option, + pub properties: Option, } +/// Arbitrary properties defined in chain spec as a JSON object +pub type Properties = json::map::Map; + /// A configuration of a chain. Can be used to build a genesis block. pub struct ChainSpec { spec: ChainSpecFile, @@ -130,6 +134,11 @@ impl ChainSpec { self.spec.consensus_engine.as_ref().map(String::as_str) } + pub fn properties(&self) -> Properties { + // Return an empty JSON object if 'properties' not defined in config + self.spec.properties.as_ref().unwrap_or(&json::map::Map::new()).clone() + } + /// Parse json content into a `ChainSpec` pub fn from_embedded(json: &'static [u8]) -> Result { let spec = json::from_slice(json).map_err(|e| format!("Error parsing spec file: {}", e))?; @@ -158,6 +167,7 @@ impl ChainSpec { telemetry_url: Option<&str>, protocol_id: Option<&str>, consensus_engine: Option<&str>, + properties: Option, ) -> Self { let spec = ChainSpecFile { @@ -167,6 +177,7 @@ impl ChainSpec { telemetry_url: telemetry_url.map(str::to_owned), protocol_id: protocol_id.map(str::to_owned), consensus_engine: consensus_engine.map(str::to_owned), + properties, }; ChainSpec { spec, diff --git a/substrate/core/service/src/components.rs b/substrate/core/service/src/components.rs index a2b9225d3a..0325b75e9e 100644 --- a/substrate/core/service/src/components.rs +++ b/substrate/core/service/src/components.rs @@ -16,21 +16,20 @@ //! Substrate service components. -use std::sync::Arc; -use std::marker::PhantomData; -use std::ops::Deref; +use std::{sync::Arc, net::SocketAddr, marker::PhantomData, ops::Deref}; use serde::{Serialize, de::DeserializeOwned}; use tokio::runtime::TaskExecutor; -use chain_spec::ChainSpec; +use chain_spec::{ChainSpec, Properties}; use client_db; -use client::{self, Client}; -use {error, Service}; +use client::{self, Client, runtime_api::{TaggedTransactionQueue, Metadata}}; +use {error, Service, RpcConfig, maybe_start_server, TransactionPoolAdapter}; use network::{self, OnDemand, import_queue::ImportQueue}; use substrate_executor::{NativeExecutor, NativeExecutionDispatch}; use transaction_pool::txpool::{self, Options as TransactionPoolOptions, Pool as TransactionPool}; -use runtime_primitives::{traits::Block as BlockT, traits::Header as HeaderT, BuildStorage}; +use runtime_primitives::{traits::Block as BlockT, traits::Header as HeaderT, BuildStorage, generic::SignedBlock}; use config::Configuration; -use primitives::{H256, Blake2Hasher}; +use primitives::{Blake2Hasher, H256}; +use rpc; // Type aliases. // These exist mainly to avoid typing `::Foo` all over the code. @@ -70,10 +69,10 @@ pub type LightExecutor = client::light::call_executor::RemoteCallExecutor< >; /// Full client type for a factory. -pub type FullClient = Client, FullExecutor, ::Block>; +pub type FullClient = Client, FullExecutor, ::Block, ::RuntimeApi>; /// Light client type for a factory. -pub type LightClient = Client, LightExecutor, ::Block>; +pub type LightClient = Client, LightExecutor, ::Block, ::RuntimeApi>; /// `ChainSpec` specialization for a factory. pub type FactoryChainSpec = ChainSpec<::Genesis>; @@ -97,7 +96,8 @@ pub type FactoryFullConfiguration = Configuration<::Conf pub type ComponentClient = Client< ::Backend, ::Executor, - FactoryBlock<::Factory> + FactoryBlock<::Factory>, + ::RuntimeApi, >; /// Block type for `Components` @@ -116,12 +116,116 @@ pub type PoolApi = ::TransactionPoolApi; pub trait RuntimeGenesis: Serialize + DeserializeOwned + BuildStorage {} impl RuntimeGenesis for T {} +/// Something that can start the RPC service. +pub trait StartRPC { + fn start_rpc( + client: Arc, C::RuntimeApi>>, + chain_name: String, + impl_name: &'static str, + impl_version: &'static str, + rpc_http: Option, + rpc_ws: Option, + properties: Properties, + task_executor: TaskExecutor, + transaction_pool: Arc>, + ) -> Result<(Option, Option), error::Error>; +} + +impl StartRPC for T where + T::RuntimeApi: Metadata>, + for<'de> SignedBlock>: ::serde::Deserialize<'de>, +{ + fn start_rpc( + client: Arc, T::RuntimeApi>>, + chain_name: String, + impl_name: &'static str, + impl_version: &'static str, + rpc_http: Option, + rpc_ws: Option, + properties: Properties, + task_executor: TaskExecutor, + transaction_pool: Arc>, + ) -> Result<(Option, Option), error::Error> { + let rpc_config = RpcConfig { properties, chain_name, impl_name, impl_version }; + + let handler = || { + let client = client.clone(); + let subscriptions = rpc::apis::Subscriptions::new(task_executor.clone()); + let chain = rpc::apis::chain::Chain::new(client.clone(), subscriptions.clone()); + let state = rpc::apis::state::State::new(client.clone(), subscriptions.clone()); + let author = rpc::apis::author::Author::new( + client.clone(), transaction_pool.clone(), subscriptions + ); + rpc::rpc_handler::, ComponentExHash, _, _, _, _>( + state, + chain, + author, + rpc_config.clone(), + ) + }; + + Ok(( + maybe_start_server(rpc_http, |address| rpc::start_http(address, handler()))?, + maybe_start_server(rpc_ws, |address| rpc::start_ws(address, handler()))?, + )) + } +} + +/// Something that can create an instance of `network::Params`. +pub trait CreateNetworkParams { + fn create_network_params( + client: Arc, C::RuntimeApi>>, + roles: network::config::Roles, + network_config: network::config::NetworkConfiguration, + on_demand: Option, NetworkService>>>, + transaction_pool_adapter: TransactionPoolAdapter, + specialization: S, + ) -> network::config::Params, S, ComponentExHash>; +} + +impl CreateNetworkParams for T where + T::RuntimeApi: TaggedTransactionQueue> +{ + fn create_network_params( + client: Arc, T::RuntimeApi>>, + roles: network::config::Roles, + network_config: network::config::NetworkConfiguration, + on_demand: Option, NetworkService>>>, + transaction_pool_adapter: TransactionPoolAdapter, + specialization: S, + ) -> network::config::Params, S, ComponentExHash> { + network::config::Params { + config: network::config::ProtocolConfig { roles }, + network_config, + chain: client, + on_demand: on_demand.map(|d| d as Arc>>), + transaction_pool: Arc::new(transaction_pool_adapter), + specialization, + } + } +} + +/// The super trait that combines all required traits a `Service` needs to implement. +pub trait ServiceTrait: + Deref> + + Send + + Sync + + 'static + + StartRPC + + CreateNetworkParams +{} +impl ServiceTrait for T where + T: Deref> + Send + Sync + 'static + StartRPC + CreateNetworkParams +{} + /// A collection of types and methods to build a service on top of the substrate service. pub trait ServiceFactory: 'static + Sized { /// Block type. type Block: BlockT; + /// The type that implements the runtime API. + type RuntimeApi: Send + Sync; /// Network protocol extensions. - type NetworkProtocol: network::specialization::Specialization; + type NetworkProtocol: network::specialization::NetworkSpecialization; /// Chain runtime. type RuntimeDispatch: NativeExecutionDispatch + Send + Sync + 'static; /// Extrinsic pool backend type for the full client. @@ -133,9 +237,9 @@ pub trait ServiceFactory: 'static + Sized { /// Other configuration for service members. type Configuration: Default; /// Extended full service type. - type FullService: Deref>> + Send + Sync + 'static; + type FullService: ServiceTrait>; /// Extended light service type. - type LightService: Deref>> + Send + Sync + 'static; + type LightService: ServiceTrait>; /// ImportQueue for full client type FullImportQueue: network::import_queue::ImportQueue + 'static; /// ImportQueue for light clients @@ -192,7 +296,7 @@ pub trait ServiceFactory: 'static + Sized { } /// A collection of types and function to generalise over full / light client type. -pub trait Components: 'static { +pub trait Components: Sized + 'static { /// Associated service factory. type Factory: ServiceFactory; /// Client backend. @@ -204,6 +308,12 @@ pub trait Components: 'static { Hash = <::Block as BlockT>::Hash, Block = FactoryBlock >; + /// The type that implements the runtime API. + type RuntimeApi: Send + Sync; + /// A type that can start the RPC. + type RPC: StartRPC; + /// A type that can create the network params. + type CreateNetworkParams: CreateNetworkParams; /// Our Import Queue type ImportQueue: ImportQueue> + 'static; @@ -212,11 +322,13 @@ pub trait Components: 'static { fn build_client( config: &FactoryFullConfiguration, executor: CodeExecutor, - ) - -> Result<( + ) -> Result< + ( Arc>, Option, NetworkService>>> - ), error::Error>; + ), + error::Error + >; /// Create extrinsic pool. fn build_transaction_pool(config: TransactionPoolOptions, client: Arc>) @@ -232,6 +344,29 @@ pub trait Components: 'static { /// A struct that implement `Components` for the full client. pub struct FullComponents { _factory: PhantomData, + service: Service>, +} + +impl FullComponents { + pub fn new( + config: FactoryFullConfiguration, + task_executor: TaskExecutor + ) -> Result { + Ok( + Self { + _factory: Default::default(), + service: Service::new(config, task_executor)?, + } + ) + } +} + +impl Deref for FullComponents { + type Target = Service; + + fn deref(&self) -> &Self::Target { + &self.service + } } impl Components for FullComponents { @@ -240,6 +375,9 @@ impl Components for FullComponents { type Backend = FullBackend; type TransactionPoolApi = ::FullTransactionPoolApi; type ImportQueue = Factory::FullImportQueue; + type RuntimeApi = Factory::RuntimeApi; + type RPC = Factory::FullService; + type CreateNetworkParams = Factory::FullService; fn build_client( config: &FactoryFullConfiguration, @@ -281,6 +419,29 @@ impl Components for FullComponents { /// A struct that implement `Components` for the light client. pub struct LightComponents { _factory: PhantomData, + service: Service>, +} + +impl LightComponents { + pub fn new( + config: FactoryFullConfiguration, + task_executor: TaskExecutor + ) -> Result { + Ok( + Self { + _factory: Default::default(), + service: Service::new(config, task_executor)?, + } + ) + } +} + +impl Deref for LightComponents { + type Target = Service; + + fn deref(&self) -> &Self::Target { + &self.service + } } impl Components for LightComponents { @@ -289,16 +450,19 @@ impl Components for LightComponents { type Backend = LightBackend; type TransactionPoolApi = ::LightTransactionPoolApi; type ImportQueue = ::LightImportQueue; + type RuntimeApi = Factory::RuntimeApi; + type RPC = Factory::LightService; + type CreateNetworkParams = Factory::LightService; fn build_client( config: &FactoryFullConfiguration, executor: CodeExecutor, ) - -> Result<( - Arc>, - Option, - NetworkService>>> - ), error::Error> + -> Result< + ( + Arc>, + Option, NetworkService>>> + ), error::Error> { let db_settings = client_db::DatabaseSettings { cache_size: None, diff --git a/substrate/core/service/src/config.rs b/substrate/core/service/src/config.rs index 00866d9563..b91c26ed04 100644 --- a/substrate/core/service/src/config.rs +++ b/substrate/core/service/src/config.rs @@ -20,9 +20,8 @@ use std::net::SocketAddr; use transaction_pool; use chain_spec::ChainSpec; pub use client::ExecutionStrategy; -pub use network::Roles; -pub use network::NetworkConfiguration; pub use client_db::PruningMode; +pub use network::config::{NetworkConfiguration, Roles}; use runtime_primitives::BuildStorage; use serde::{Serialize, de::DeserializeOwned}; use target_info::Target; diff --git a/substrate/core/service/src/consensus.rs b/substrate/core/service/src/consensus.rs index c9a528dd27..338c1680cf 100644 --- a/substrate/core/service/src/consensus.rs +++ b/substrate/core/service/src/consensus.rs @@ -23,11 +23,11 @@ use std::time::{self, Duration, Instant}; use std; use client::{self, error, Client as SubstrateClient, CallExecutor}; -use client::runtime_api::{Core, BlockBuilder as BlockBuilderAPI, id::BLOCK_BUILDER}; +use client::{block_builder::api::BlockBuilder as BlockBuilderApi, runtime_api::{id::BLOCK_BUILDER, Core}}; use codec::{Decode, Encode}; use consensus_common::{self, InherentData, evaluation, offline_tracker::OfflineTracker}; use primitives::{H256, AuthorityId, ed25519, Blake2Hasher}; -use runtime_primitives::traits::{Block as BlockT, Hash as HashT, Header as HeaderT}; +use runtime_primitives::traits::{Block as BlockT, Hash as HashT, Header as HeaderT, ProvideRuntimeApi}; use runtime_primitives::generic::BlockId; use transaction_pool::txpool::{self, Pool as TransactionPool}; @@ -47,11 +47,8 @@ pub trait BlockBuilder { } /// Local client abstraction for the consensus. -pub trait AuthoringApi: - Send - + Sync - + BlockBuilderAPI<::Block, Error=::Error> - + Core<::Block, AuthorityId, Error=::Error> +pub trait AuthoringApi: Send + Sync + ProvideRuntimeApi where + ::Api: Core { /// The block used for this API type. type Block: BlockT; @@ -67,20 +64,22 @@ pub trait AuthoringApi: ) -> Result; } -impl<'a, B, E, Block> BlockBuilder for client::block_builder::BlockBuilder<'a, B, E, Block, Blake2Hasher> where - B: client::backend::Backend + Send + Sync + 'static, +impl<'a, B, E, Block, RA> BlockBuilder for client::block_builder::BlockBuilder<'a, Block, SubstrateClient> where + B: client::backend::Backend + 'static, E: CallExecutor + Send + Sync + Clone + 'static, Block: BlockT, + RA: BlockBuilderApi, { fn push_extrinsic(&mut self, extrinsic: ::Extrinsic) -> Result<(), error::Error> { client::block_builder::BlockBuilder::push(self, extrinsic).map_err(Into::into) } } -impl<'a, B, E, Block> AuthoringApi for SubstrateClient where +impl AuthoringApi for SubstrateClient where B: client::backend::Backend + Send + Sync + 'static, E: CallExecutor + Send + Sync + Clone + 'static, Block: BlockT, + RA: BlockBuilderApi, { type Block = Block; type Error = client::error::Error; @@ -95,7 +94,7 @@ impl<'a, B, E, Block> AuthoringApi for SubstrateClient where let mut block_builder = self.new_block_at(at)?; if runtime_version.has_api(BLOCK_BUILDER, 1) { - self.inherent_extrinsics(at, &inherent_data)? + self.runtime_api().inherent_extrinsics(at, &inherent_data)? .into_iter().try_for_each(|i| block_builder.push(i))?; } @@ -106,10 +105,7 @@ impl<'a, B, E, Block> AuthoringApi for SubstrateClient where } /// Proposer factory. -pub struct ProposerFactory where - C: AuthoringApi, - A: txpool::ChainApi, -{ +pub struct ProposerFactory where A: txpool::ChainApi { /// The client instance. pub client: Arc, /// The transaction pool. @@ -122,10 +118,11 @@ pub struct ProposerFactory where impl consensus_common::Environment<::Block> for ProposerFactory where C: AuthoringApi, + ::Api: BlockBuilderApi<::Block>, A: txpool::ChainApi::Block>, client::error::Error: From<::Error> { - type Proposer = Proposer; + type Proposer = Proposer<::Block, C, A>; type Error = error::Error; fn init( @@ -138,7 +135,7 @@ impl consensus_common::Environment<::Block> for Propose let id = BlockId::hash(parent_hash); - let authorities: Vec = self.client.authorities(&id)?; + let authorities: Vec = self.client.runtime_api().authorities(&id)?; self.offline.write().note_new_block(&authorities[..]); info!("Starting consensus session on top of parent {:?}", parent_hash); @@ -161,21 +158,23 @@ impl consensus_common::Environment<::Block> for Propose } /// The proposer logic. -pub struct Proposer { +pub struct Proposer { client: Arc, start: Instant, - parent_hash: <::Block as BlockT>::Hash, - parent_id: BlockId<::Block>, - parent_number: <<::Block as BlockT>::Header as HeaderT>::Number, + parent_hash: ::Hash, + parent_id: BlockId, + parent_number: <::Header as HeaderT>::Number, transaction_pool: Arc>, offline: SharedOfflineTracker, authorities: Vec, minimum_timestamp: u64, } -impl consensus_common::Proposer<::Block> for Proposer where - C: AuthoringApi, - A: txpool::ChainApi::Block>, +impl consensus_common::Proposer<::Block> for Proposer where + Block: BlockT, + C: AuthoringApi, + ::Api: BlockBuilderApi, + A: txpool::ChainApi, client::error::Error: From<::Error> { type Create = Result<::Block, error::Error>; diff --git a/substrate/core/service/src/lib.rs b/substrate/core/service/src/lib.rs index 1265486449..9b0283795f 100644 --- a/substrate/core/service/src/lib.rs +++ b/substrate/core/service/src/lib.rs @@ -14,10 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Substrate service. Starts a thread that spins up the network, client, and extrinsic pool. //! Manages communication between them. -// end::description[] #![warn(unused_extern_crates)] @@ -78,7 +76,7 @@ use codec::{Encode, Decode}; pub use self::error::{ErrorKind, Error}; pub use config::{Configuration, Roles, PruningMode}; -pub use chain_spec::ChainSpec; +pub use chain_spec::{ChainSpec, Properties}; pub use transaction_pool::txpool::{self, Pool as TransactionPool, Options as TransactionPoolOptions, ChainApi, IntoPoolError}; pub use client::ExecutionStrategy; @@ -89,8 +87,11 @@ pub use components::{ServiceFactory, FullBackend, FullExecutor, LightBackend, ComponentBlock, FullClient, LightClient, FullComponents, LightComponents, CodeExecutor, NetworkService, FactoryChainSpec, FactoryBlock, FactoryFullConfiguration, RuntimeGenesis, FactoryGenesis, - ComponentExHash, ComponentExtrinsic, FactoryExtrinsic, + ComponentExHash, ComponentExtrinsic, FactoryExtrinsic }; +use components::{StartRPC, CreateNetworkParams}; +#[doc(hidden)] +pub use network::OnDemand; const DEFAULT_PROTOCOL_ID: &'static str = "sup"; @@ -124,8 +125,7 @@ impl Service where Components: components::Components, ::Executor: std::clone::Clone, - txpool::ExHash: serde::de::DeserializeOwned + serde::Serialize, - txpool::ExtrinsicFor: serde::de::DeserializeOwned + serde::Serialize, + // ::RuntimeApi: client::runtime_api::BlockBuilder<<::Factory as ServiceFactory>::Block, Error=client::error::Error, OverlayedChanges=client::runtime_api::OverlayedChanges> + Sync + Send + client::runtime_api::Core<<::Factory as components::ServiceFactory>::Block, primitives::AuthorityId, Error=client::error::Error, OverlayedChanges=client::runtime_api::OverlayedChanges> + client::runtime_api::ConstructRuntimeApi::Factory as ServiceFactory>::Block> + client::runtime_api::Metadata<<::Factory as components::ServiceFactory>::Block, Vec, Error=client::error::Error> + client::runtime_api::TaggedTransactionQueue<<::Factory as components::ServiceFactory>::Block, Error=client::error::Error>, { /// Creates a new service. pub fn new( @@ -140,10 +140,12 @@ impl Service let executor = NativeExecutor::new(); let mut keystore = Keystore::open(config.keystore_path.as_str().into())?; + + // This is meant to be for testing only + // FIXME: remove this - https://github.com/paritytech/substrate/issues/1063 for seed in &config.keys { keystore.generate_from_seed(seed)?; } - // Keep the public key for telemetry let public_key = match keystore.contents()?.get(0) { Some(public_key) => public_key.clone(), @@ -174,17 +176,10 @@ impl Service client: client.clone(), }; - let network_params = network::Params { - config: network::ProtocolConfig { - roles: config.roles, - }, - network_config: config.network, - chain: client.clone(), - on_demand: on_demand.clone() - .map(|d| d as Arc>>), - transaction_pool: Arc::new(transaction_pool_adapter), - specialization: network_protocol, - }; + let network_params = Components::CreateNetworkParams::create_network_params( + client.clone(), config.roles, config.network, on_demand.clone(), + transaction_pool_adapter, network_protocol + ); let mut protocol_id = network::ProtocolId::default(); let protocol_id_full = config.chain_spec.protocol_id().unwrap_or(DEFAULT_PROTOCOL_ID).as_bytes(); @@ -233,32 +228,13 @@ impl Service task_executor.spawn(events); } - // RPC - let rpc_config = RpcConfig { - chain_name: config.chain_spec.name().to_string(), - impl_name: config.impl_name, - impl_version: config.impl_version, - }; - let (rpc_http, rpc_ws) = { - let handler = || { - let client = client.clone(); - let subscriptions = rpc::apis::Subscriptions::new(task_executor.clone()); - let chain = rpc::apis::chain::Chain::new(client.clone(), subscriptions.clone()); - let state = rpc::apis::state::State::new(client.clone(), subscriptions.clone()); - let author = rpc::apis::author::Author::new(client.clone(), transaction_pool.clone(), subscriptions.clone()); - rpc::rpc_handler::, ComponentExHash, _, _, _, _, _>( - state, - chain, - author, - rpc_config.clone(), - ) - }; - ( - maybe_start_server(config.rpc_http, |address| rpc::start_http(address, handler()))?, - maybe_start_server(config.rpc_ws, |address| rpc::start_ws(address, handler()))?, - ) - }; + // RPC + let (rpc_http, rpc_ws) = Components::RPC::start_rpc( + client.clone(), config.chain_spec.name().to_string(), config.impl_name, + config.impl_version, config.rpc_http, config.rpc_ws, config.chain_spec.properties(), + task_executor.clone(), transaction_pool.clone() + )?; let proposer = Arc::new(ProposerFactory { client: client.clone(), @@ -309,9 +285,7 @@ impl Service } } -impl Service where - Components: components::Components, -{ +impl Service where Components: components::Components { /// Get shared client instance. pub fn client(&self) -> Arc> { self.client.clone() @@ -379,6 +353,7 @@ fn maybe_start_server(address: Option, start: F) -> Result substrate_rpc::system::error::Result { Ok(self.chain_name.clone()) } + + fn system_properties(&self) -> substrate_rpc::system::error::Result { + Ok(self.properties.clone()) + } } /// Transaction pool adapter. @@ -415,7 +394,7 @@ impl TransactionPoolAdapter { } } -impl network::TransactionPool, ComponentBlock> for TransactionPoolAdapter { +impl network::TransactionPool, ComponentBlock> for TransactionPoolAdapter where ::RuntimeApi: Send + Sync{ fn transactions(&self) -> Vec<(ComponentExHash, ComponentExtrinsic)> { self.pool.ready() .map(|t| { @@ -463,41 +442,6 @@ impl network::TransactionPool, ComponentBlock< } } -/// Creates a simple `Service` implementation. -/// This `Service` just holds an instance to a `service::Service` and implements `Deref`. -/// It also provides a `new` function that takes a `config` and a `TaskExecutor`. -#[macro_export] -macro_rules! construct_simple_service { - ( - $name: ident - ) => { - pub struct $name { - inner: $crate::Arc<$crate::Service>, - } - - impl $name { - fn new( - config: FactoryFullConfiguration, - executor: $crate::TaskExecutor - ) -> $crate::Result { - Ok( - Self { - inner: $crate::Arc::new($crate::Service::new(config, executor)?) - } - ) - } - } - - impl $crate::Deref for $name { - type Target = $crate::Service; - - fn deref(&self) -> &Self::Target { - &self.inner - } - } - } -} - /// Constructs a service factory with the given name that implements the `ServiceFactory` trait. /// The required parameters are required to be given in the exact order. Some parameters are followed /// by `{}` blocks. These blocks are required and used to initialize the given parameter. @@ -539,6 +483,7 @@ macro_rules! construct_service_factory { $(#[$attr:meta])* struct $name:ident { Block = $block:ty, + RuntimeApi = $runtime_api:ty, NetworkProtocol = $protocol:ty { $( $protocol_init:tt )* }, RuntimeDispatch = $dispatch:ty, FullTransactionPoolApi = $full_transaction:ty { $( $full_transaction_init:tt )* }, @@ -559,6 +504,7 @@ macro_rules! construct_service_factory { #[allow(unused_variables)] impl $crate::ServiceFactory for $name { type Block = $block; + type RuntimeApi = $runtime_api; type NetworkProtocol = $protocol; type RuntimeDispatch = $dispatch; type FullTransactionPoolApi = $full_transaction; diff --git a/substrate/core/service/test/src/lib.rs b/substrate/core/service/test/src/lib.rs index 0a967e3cd6..7ffa783e97 100644 --- a/substrate/core/service/test/src/lib.rs +++ b/substrate/core/service/test/src/lib.rs @@ -47,7 +47,8 @@ use service::{ Roles, FactoryExtrinsic, }; -use network::{NetworkConfiguration, NonReservedPeerMode, Protocol, SyncProvider, ManageNetwork}; +use network::{Protocol, SyncProvider, ManageNetwork}; +use network::config::{NetworkConfiguration, NonReservedPeerMode}; use sr_primitives::traits::As; use sr_primitives::generic::BlockId; use consensus::{ImportBlock, BlockImport}; @@ -179,7 +180,10 @@ impl TestNet { } } -pub fn connectivity(spec: FactoryChainSpec) { +pub fn connectivity(spec: FactoryChainSpec) where + ::RuntimeApi: + client::block_builder::api::BlockBuilder<::Block> +{ const NUM_NODES: u32 = 10; { let temp = TempDir::new("substrate-connectivity-test").expect("Error creating test dir"); @@ -219,6 +223,9 @@ where F: ServiceFactory, B: Fn(&F::FullService) -> ImportBlock, E: Fn(&F::FullService) -> FactoryExtrinsic, + ::RuntimeApi: + client::block_builder::api::BlockBuilder<::Block> + + client::runtime_api::TaggedTransactionQueue<::Block> { const NUM_NODES: u32 = 10; const NUM_BLOCKS: usize = 512; @@ -255,6 +262,8 @@ where pub fn consensus(spec: FactoryChainSpec, authorities: Vec) where F: ServiceFactory, + ::RuntimeApi: + client::block_builder::api::BlockBuilder<::Block> { const NUM_NODES: u32 = 20; const NUM_BLOCKS: u64 = 200; diff --git a/substrate/core/sr-api/Cargo.toml b/substrate/core/sr-api/Cargo.toml deleted file mode 100644 index 2877dfa919..0000000000 --- a/substrate/core/sr-api/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "sr-api" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -parity-codec = { version = "2.1", default-features = false } -sr-std = { path = "../sr-std", default-features = false } -sr-primitives = { path = "../sr-primitives", default-features = false } -sr-version = { path = "../sr-version", default-features = false } - -[features] -default = ["std"] -std = [ - "sr-std/std", - "parity-codec/std", - "sr-primitives/std", - "sr-version/std", -] diff --git a/substrate/core/sr-api/README.adoc b/substrate/core/sr-api/README.adoc deleted file mode 100644 index debd87e8eb..0000000000 --- a/substrate/core/sr-api/README.adoc +++ /dev/null @@ -1,12 +0,0 @@ -= Runtime API - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/sr-io/README.adoc b/substrate/core/sr-io/README.adoc deleted file mode 100644 index c035be1461..0000000000 --- a/substrate/core/sr-io/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Runtime io - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/sr-io/src/lib.rs b/substrate/core/sr-io/src/lib.rs index 12e09945d2..3394265a84 100644 --- a/substrate/core/sr-io/src/lib.rs +++ b/substrate/core/sr-io/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! This is part of the Substrate runtime. -// end::description[] #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), feature(lang_items))] diff --git a/substrate/core/sr-io/with_std.rs b/substrate/core/sr-io/with_std.rs index ccadb89efc..a608a632fe 100644 --- a/substrate/core/sr-io/with_std.rs +++ b/substrate/core/sr-io/with_std.rs @@ -146,7 +146,7 @@ pub fn chain_id() -> u64 { pub fn storage_root() -> H256 { ext::with(|ext| ext.storage_root() - ).unwrap_or(H256::new()) + ).unwrap_or(H256::zero()) } /// "Commit" all existing operations and compute the resultant child storage root. @@ -157,9 +157,9 @@ pub fn child_storage_root(storage_key: &[u8]) -> Option> { } /// "Commit" all existing operations and get the resultant storage change root. -pub fn storage_changes_root(block: u64) -> Option { +pub fn storage_changes_root(parent_hash: [u8; 32], parent_num: u64) -> Option { ext::with(|ext| - ext.storage_changes_root(block) + ext.storage_changes_root(parent_hash.into(), parent_num) ).unwrap_or(None) } diff --git a/substrate/core/sr-io/without_std.rs b/substrate/core/sr-io/without_std.rs index 5b892ecffe..d0f112b76e 100644 --- a/substrate/core/sr-io/without_std.rs +++ b/substrate/core/sr-io/without_std.rs @@ -72,7 +72,7 @@ extern "C" { fn ext_get_child_storage_into(storage_key_data: *const u8, storage_key_len: u32, key_data: *const u8, key_len: u32, value_data: *mut u8, value_len: u32, value_offset: u32) -> u32; fn ext_storage_root(result: *mut u8); fn ext_child_storage_root(storage_key_data: *const u8, storage_key_len: u32, written_out: *mut u32) -> *mut u8; - fn ext_storage_changes_root(block: u64, result: *mut u8) -> u32; + fn ext_storage_changes_root(parent_hash_data: *const u8, parent_hash_len: u32, parent_num: u64, result: *mut u8) -> u32; fn ext_blake2_256_enumerated_trie_root(values_data: *const u8, lens_data: *const u32, lens_len: u32, result: *mut u8); fn ext_chain_id() -> u64; fn ext_blake2_256(data: *const u8, len: u32, out: *mut u8); @@ -269,10 +269,10 @@ pub fn child_storage_root(storage_key: &[u8]) -> Option> { } /// The current storage' changes root. -pub fn storage_changes_root(block: u64) -> Option<[u8; 32]> { +pub fn storage_changes_root(parent_hash: [u8; 32], parent_num: u64) -> Option<[u8; 32]> { let mut result: [u8; 32] = Default::default(); let is_set = unsafe { - ext_storage_changes_root(block, result.as_mut_ptr()) + ext_storage_changes_root(parent_hash.as_ptr(), parent_hash.len() as u32, parent_num, result.as_mut_ptr()) }; if is_set != 0 { diff --git a/substrate/core/sr-primitives/README.adoc b/substrate/core/sr-primitives/README.adoc deleted file mode 100644 index 0e9d636111..0000000000 --- a/substrate/core/sr-primitives/README.adoc +++ /dev/null @@ -1,12 +0,0 @@ -= Runtime Primitives - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/sr-primitives/src/generic/block.rs b/substrate/core/sr-primitives/src/generic/block.rs index 6cbb7929d8..61452668ad 100644 --- a/substrate/core/sr-primitives/src/generic/block.rs +++ b/substrate/core/sr-primitives/src/generic/block.rs @@ -19,9 +19,13 @@ #[cfg(feature = "std")] use std::fmt; +#[cfg(feature = "std")] +use serde::{Deserialize, Deserializer}; +#[cfg(feature = "std")] +use codec::Decode; use rstd::prelude::*; use codec::Codec; -use traits::{self, Member, Block as BlockT, Header as HeaderT}; +use traits::{self, Member, Block as BlockT, Header as HeaderT, MaybeSerialize}; use ::Justification; /// Something to identify a block. @@ -59,17 +63,28 @@ impl fmt::Display for BlockId { /// Abstraction over a substrate block. #[derive(PartialEq, Eq, Clone, Encode, Decode)] -#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] +#[cfg_attr(feature = "std", derive(Debug, Serialize))] #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] #[cfg_attr(feature = "std", serde(deny_unknown_fields))] -pub struct Block { +pub struct Block { /// The block header. pub header: Header, /// The accompanying extrinsics. pub extrinsics: Vec, } -impl traits::Block for Block +// TODO: Remove Deserialize for Block once RPC no longer needs it #1098 +#[cfg(feature = "std")] +impl<'a, Header: 'a, Extrinsic: 'a + MaybeSerialize> Deserialize<'a> for Block where + Block: Decode, +{ + fn deserialize>(de: D) -> Result { + let r = >::deserialize(de)?; + Decode::decode(&mut &r[..]).ok_or(::serde::de::Error::custom("Invalid value passed into decode")) + } +} + +impl traits::Block for Block where Header: HeaderT, Extrinsic: Member + Codec + traits::Extrinsic, @@ -94,12 +109,25 @@ where /// Abstraction over a substrate block and justification. #[derive(PartialEq, Eq, Clone, Encode, Decode)] -#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] +#[cfg_attr(feature = "std", derive(Debug, Serialize))] #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] #[cfg_attr(feature = "std", serde(deny_unknown_fields))] -pub struct SignedBlock { +pub struct SignedBlock { /// Full block. - pub block: Block, + pub block: Block, /// Block justification. pub justification: Justification, } + +// TODO: Remove Deserialize for SignedBlock once RPC no longer needs it #1098 +#[cfg(feature = "std")] +impl<'a, Block: BlockT,> Deserialize<'a> for SignedBlock where + Block::Header: 'a, + Block::Extrinsic: 'a + Codec + MaybeSerialize, + SignedBlock: Decode, +{ + fn deserialize>(de: D) -> Result { + let r = >::deserialize(de)?; + Decode::decode(&mut &r[..]).ok_or(::serde::de::Error::custom("Invalid value passed into decode")) + } +} diff --git a/substrate/core/sr-primitives/src/generic/checked_extrinsic.rs b/substrate/core/sr-primitives/src/generic/checked_extrinsic.rs index e69ce77336..749577cdd6 100644 --- a/substrate/core/sr-primitives/src/generic/checked_extrinsic.rs +++ b/substrate/core/sr-primitives/src/generic/checked_extrinsic.rs @@ -23,7 +23,7 @@ use traits::{self, Member, SimpleArithmetic, MaybeDisplay}; /// existence implies that it has been checked and is good, particularly with /// regards to the signature. #[derive(PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] +#[cfg_attr(feature = "std", derive(Debug))] pub struct CheckedExtrinsic { /// Who this purports to be from and the number of extrinsics have come before /// from the same signer, if anyone (note this is not a signature). @@ -37,7 +37,7 @@ impl traits::Applyable where AccountId: Member + MaybeDisplay, Index: Member + MaybeDisplay + SimpleArithmetic, - Call: Member + Call: Member, { type Index = Index; type AccountId = AccountId; diff --git a/substrate/core/sr-primitives/src/generic/digest.rs b/substrate/core/sr-primitives/src/generic/digest.rs index 41ffd6da0d..c71ee4c7aa 100644 --- a/substrate/core/sr-primitives/src/generic/digest.rs +++ b/substrate/core/sr-primitives/src/generic/digest.rs @@ -19,7 +19,7 @@ use rstd::prelude::*; use codec::{Decode, Encode, Codec, Input}; -use traits::{self, Member, DigestItem as DigestItemT}; +use traits::{self, Member, DigestItem as DigestItemT, MaybeSerializeDebug}; use substrate_primitives::hash::H512 as Signature; @@ -122,7 +122,10 @@ impl DigestItem { } } -impl traits::DigestItem for DigestItem { +impl< + Hash: Codec + Member + MaybeSerializeDebug, + AuthorityId: Codec + Member + MaybeSerializeDebug +> traits::DigestItem for DigestItem { type Hash = Hash; type AuthorityId = AuthorityId; diff --git a/substrate/core/sr-primitives/src/generic/header.rs b/substrate/core/sr-primitives/src/generic/header.rs index fc6f73b5cf..ec70d5d66b 100644 --- a/substrate/core/sr-primitives/src/generic/header.rs +++ b/substrate/core/sr-primitives/src/generic/header.rs @@ -21,7 +21,7 @@ use serde::{Deserialize, Deserializer}; use codec::{Decode, Encode, Codec, Input, Output, HasCompact}; use traits::{self, Member, SimpleArithmetic, SimpleBitOps, MaybeDisplay, - Hash as HashT, DigestItem as DigestItemT}; + Hash as HashT, DigestItem as DigestItemT, MaybeSerializeDebug, MaybeSerializeDebugButNotDeserialize}; use generic::Digest; /// Abstraction over a block header for a substrate chain. @@ -42,42 +42,14 @@ pub struct Header { pub digest: Digest, } -// Hack to work around the fact that deriving deserialize doesn't work nicely with -// the `hashing` trait used as a parameter. -// dummy struct that uses the hash type directly. -// https://github.com/serde-rs/serde/issues/1296 -#[cfg(feature = "std")] -#[serde(rename_all = "camelCase")] -#[derive(Deserialize)] -struct DeserializeHeader { - parent_hash: H, - number: N, - state_root: H, - extrinsics_root: H, - digest: Digest, -} - -#[cfg(feature = "std")] -impl From> for Header { - fn from(other: DeserializeHeader) -> Self { - Header { - parent_hash: other.parent_hash, - number: other.number, - state_root: other.state_root, - extrinsics_root: other.extrinsics_root, - digest: other.digest, - } - } -} - +// TODO: Remove Deserialize for Header once RPC no longer needs it #1098 #[cfg(feature = "std")] impl<'a, Number: 'a, Hash: 'a + HashT, DigestItem: 'a> Deserialize<'a> for Header where - Number: Deserialize<'a>, - Hash::Output: Deserialize<'a>, - DigestItem: Deserialize<'a>, + Header: Decode, { fn deserialize>(de: D) -> Result { - DeserializeHeader::::deserialize(de).map(Into::into) + let r = >::deserialize(de)?; + Decode::decode(&mut &r[..]).ok_or(::serde::de::Error::custom("Invalid value passed into decode")) } } @@ -114,11 +86,11 @@ impl Encode for Header where } impl traits::Header for Header where - Number: Member + ::rstd::hash::Hash + Copy + MaybeDisplay + SimpleArithmetic + Codec, + Number: Member + MaybeSerializeDebug + ::rstd::hash::Hash + Copy + MaybeDisplay + SimpleArithmetic + Codec, Hash: HashT, DigestItem: DigestItemT + Codec, - Hash::Output: Default + ::rstd::hash::Hash + Copy + Member + MaybeDisplay + SimpleBitOps + Codec, - { + Hash::Output: Default + ::rstd::hash::Hash + Copy + Member + MaybeSerializeDebugButNotDeserialize + MaybeDisplay + SimpleBitOps + Codec, +{ type Number = Number; type Hash = ::Output; type Hashing = Hash; diff --git a/substrate/core/sr-primitives/src/generic/tests.rs b/substrate/core/sr-primitives/src/generic/tests.rs index c095a2b45d..7689610617 100644 --- a/substrate/core/sr-primitives/src/generic/tests.rs +++ b/substrate/core/sr-primitives/src/generic/tests.rs @@ -17,56 +17,8 @@ //! Tests for the generic implementations of Extrinsic/Header/Block. use codec::{Decode, Encode}; -use substrate_primitives::{H256, H512}; -use super::{Digest, Header, DigestItem, UncheckedExtrinsic}; - -type Block = super::Block< - Header>, - UncheckedExtrinsic, ->; - -#[test] -fn block_roundtrip_serialization() { - let block: Block = Block { - header: Header { - parent_hash: [0u8; 32].into(), - number: 100_000, - state_root: [1u8; 32].into(), - extrinsics_root: [2u8; 32].into(), - digest: Digest { logs: vec![ - DigestItem::Other::(vec![1, 2, 3]), - DigestItem::Other::(vec![4, 5, 6]), - ] }, - }, - extrinsics: vec![ - UncheckedExtrinsic::new_signed( - 0, - 100, - [255u8; 32].into(), - H512::from([0u8; 64]).into() - ), - UncheckedExtrinsic::new_signed( - 100, - 99, - [128u8; 32].into(), - H512::from([255u8; 64]).into() - ) - ] - }; - - { - let encoded = ::serde_json::to_vec(&block).unwrap(); - let decoded: Block = ::serde_json::from_slice(&encoded).unwrap(); - - assert_eq!(block, decoded); - } - { - let encoded = block.encode(); - let decoded = Block::decode(&mut &encoded[..]).unwrap(); - - assert_eq!(block, decoded); - } -} +use substrate_primitives::H256; +use super::DigestItem; #[test] fn system_digest_item_encoding() { diff --git a/substrate/core/sr-primitives/src/generic/unchecked_extrinsic.rs b/substrate/core/sr-primitives/src/generic/unchecked_extrinsic.rs index a37affd9ca..d6442cbc0b 100644 --- a/substrate/core/sr-primitives/src/generic/unchecked_extrinsic.rs +++ b/substrate/core/sr-primitives/src/generic/unchecked_extrinsic.rs @@ -21,11 +21,10 @@ use std::fmt; use rstd::prelude::*; use codec::{Decode, Encode, Codec, Input, HasCompact}; -use traits::{self, Member, SimpleArithmetic, MaybeDisplay, Lookup}; +use traits::{self, Member, SimpleArithmetic, MaybeDisplay, Lookup, Extrinsic}; use super::CheckedExtrinsic; #[derive(PartialEq, Eq, Clone, Encode, Decode)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct SignatureContent where Address: Codec, @@ -40,7 +39,6 @@ where /// A extrinsic right from the external world. This is unchecked and so /// can contain a signature. #[derive(PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct UncheckedExtrinsic where Address: Codec, @@ -75,11 +73,6 @@ where function, } } - - /// `true` if there is a signature. - pub fn is_signed(&self) -> bool { - self.signature.is_some() - } } impl traits::Checkable @@ -115,6 +108,17 @@ where } } +impl< + Address: Codec, + Index: HasCompact + Codec, + Signature: Codec, + Call, +> Extrinsic for UncheckedExtrinsic { + fn is_signed(&self) -> Option { + Some(self.signature.is_some()) + } +} + impl Decode for UncheckedExtrinsic { @@ -143,6 +147,15 @@ impl } } +#[cfg(feature = "std")] +impl serde::Serialize + for UncheckedExtrinsic +{ + fn serialize(&self, seq: S) -> Result where S: ::serde::Serializer { + self.using_encoded(|bytes| seq.serialize_bytes(bytes)) + } +} + /// TODO: use derive when possible. #[cfg(feature = "std")] impl fmt::Debug diff --git a/substrate/core/sr-primitives/src/generic/unchecked_mortal_extrinsic.rs b/substrate/core/sr-primitives/src/generic/unchecked_mortal_extrinsic.rs index 5d91556d8c..e15a37c3bf 100644 --- a/substrate/core/sr-primitives/src/generic/unchecked_mortal_extrinsic.rs +++ b/substrate/core/sr-primitives/src/generic/unchecked_mortal_extrinsic.rs @@ -30,7 +30,6 @@ const TRANSACTION_VERSION: u8 = 1; /// A extrinsic right from the external world. This is unchecked and so /// can contain a signature. #[derive(PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct UncheckedMortalExtrinsic { /// The signature, address, number of extrinsics have come before from /// the same signer and an era describing the longevity of this transaction, @@ -58,7 +57,7 @@ impl UncheckedMortalExtrinsic Extrinsic for UncheckedMortalExtrinsic { +impl Extrinsic for UncheckedMortalExtrinsic { fn is_signed(&self) -> Option { Some(self.signature.is_some()) } @@ -158,6 +157,15 @@ where } } +#[cfg(feature = "std")] +impl serde::Serialize + for UncheckedMortalExtrinsic +{ + fn serialize(&self, seq: S) -> Result where S: ::serde::Serializer { + self.using_encoded(|bytes| seq.serialize_bytes(bytes)) + } +} + /// TODO: use derive when possible. #[cfg(feature = "std")] impl fmt::Debug for UncheckedMortalExtrinsic where diff --git a/substrate/core/sr-primitives/src/lib.rs b/substrate/core/sr-primitives/src/lib.rs index 42dcd37a2c..d1cd43242a 100644 --- a/substrate/core/sr-primitives/src/lib.rs +++ b/substrate/core/sr-primitives/src/lib.rs @@ -14,10 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! System manager: Handles all of the top-level stuff; executing block/transaction, setting code //! and depositing logs. -// end::description[] #![cfg_attr(not(feature = "std"), no_std)] @@ -198,7 +196,7 @@ pub struct Ed25519Signature(pub H512); impl Verify for Ed25519Signature { type Signer = H256; fn verify>(&self, mut msg: L, signer: &Self::Signer) -> bool { - runtime_io::ed25519_verify(&(self.0).0, msg.get(), &signer.0[..]) + runtime_io::ed25519_verify((self.0).as_fixed_bytes(), msg.get(), &signer.as_bytes()) } } diff --git a/substrate/core/sr-primitives/src/testing.rs b/substrate/core/sr-primitives/src/testing.rs index 847af9a3c2..cd1ca5cb4a 100644 --- a/substrate/core/sr-primitives/src/testing.rs +++ b/substrate/core/sr-primitives/src/testing.rs @@ -16,9 +16,9 @@ //! Testing utilities. -use serde::{Serialize, de::DeserializeOwned}; -use std::{fmt::Debug, ops::Deref}; -use codec::Codec; +use serde::{Serialize, Serializer, Deserialize, de::Error as DeError, Deserializer}; +use std::{fmt::Debug, ops::Deref, fmt}; +use codec::{Codec, Encode, Decode}; use traits::{self, Checkable, Applyable, BlakeTwo256}; use generic::DigestItem as GenDigestItem; @@ -101,7 +101,7 @@ impl traits::Header for Header { #[derive(PartialEq, Eq, Clone, Serialize, Deserialize, Debug, Encode, Decode)] pub struct ExtrinsicWrapper(Xt); -impl traits::Extrinsic for ExtrinsicWrapper { +impl traits::Extrinsic for ExtrinsicWrapper where Xt: Serialize { fn is_signed(&self) -> Option { None } @@ -121,13 +121,13 @@ impl Deref for ExtrinsicWrapper { } } -#[derive(PartialEq, Eq, Clone, Serialize, Deserialize, Debug, Encode, Decode)] +#[derive(PartialEq, Eq, Clone, Serialize, Debug, Encode, Decode)] pub struct Block { pub header: Header, pub extrinsics: Vec, } -impl traits::Block for Block { +impl traits::Block for Block { type Extrinsic = Xt; type Header = Header; type Hash =
::Hash; @@ -146,20 +146,40 @@ impl Deserialize<'a> for Block where Block: Decode { + fn deserialize>(de: D) -> Result { + let r = >::deserialize(de)?; + Decode::decode(&mut &r[..]).ok_or(DeError::custom("Invalid value passed into decode")) + } +} + +#[derive(PartialEq, Eq, Clone, Encode, Decode)] pub struct TestXt(pub Option, pub u64, pub Call); -impl Checkable for TestXt { +impl Serialize for TestXt where TestXt: Encode +{ + fn serialize(&self, seq: S) -> Result where S: Serializer { + self.using_encoded(|bytes| seq.serialize_bytes(bytes)) + } +} + +impl Debug for TestXt { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "TestXt({:?}, {:?})", self.0, self.1) + } +} + +impl Checkable for TestXt { type Checked = Self; fn check(self, _: &Context) -> Result { Ok(self) } } -impl traits::Extrinsic for TestXt { +impl traits::Extrinsic for TestXt { fn is_signed(&self) -> Option { None } } impl Applyable for TestXt where - Call: 'static + Sized + Send + Sync + Clone + Eq + Codec + Debug + Serialize + DeserializeOwned, + Call: 'static + Sized + Send + Sync + Clone + Eq + Codec + Debug, { type AccountId = u64; type Index = u64; diff --git a/substrate/core/sr-primitives/src/traits.rs b/substrate/core/sr-primitives/src/traits.rs index 0ee2db117a..fe1c6756e2 100644 --- a/substrate/core/sr-primitives/src/traits.rs +++ b/substrate/core/sr-primitives/src/traits.rs @@ -27,8 +27,10 @@ use codec::{Codec, Encode, HasCompact}; pub use integer_sqrt::IntegerSquareRoot; pub use num_traits::{Zero, One, Bounded}; pub use num_traits::ops::checked::{CheckedAdd, CheckedSub, CheckedMul, CheckedDiv}; -use rstd::ops::{Add, Sub, Mul, Div, Rem, AddAssign, SubAssign, MulAssign, DivAssign, - RemAssign, Shl, Shr}; +use rstd::ops::{ + Add, Sub, Mul, Div, Rem, AddAssign, SubAssign, MulAssign, DivAssign, + RemAssign, Shl, Shr +}; /// A lazy value. pub trait Lazy { @@ -246,7 +248,7 @@ tuple_impl!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, pub trait Hash: 'static + MaybeSerializeDebug + Clone + Eq + PartialEq { // Stupid bug in the Rust compiler believes derived // traits must be fulfilled by all type parameters. /// The hash type produced. - type Output: Member + AsRef<[u8]> + AsMut<[u8]>; + type Output: Member + MaybeSerializeDebug + AsRef<[u8]> + AsMut<[u8]>; /// Produce the hash of some byte-slice. fn hash(s: &[u8]) -> Self::Output; @@ -276,7 +278,7 @@ pub trait Hash: 'static + MaybeSerializeDebug + Clone + Eq + PartialEq { // Stup fn storage_root() -> Self::Output; /// Acquire the global storage changes root. - fn storage_changes_root(block: u64) -> Option; + fn storage_changes_root(parent_hash: Self::Output, parent_number: u64) -> Option; } /// Blake2-256 Hash implementation. @@ -308,8 +310,8 @@ impl Hash for BlakeTwo256 { fn storage_root() -> Self::Output { runtime_io::storage_root().into() } - fn storage_changes_root(block: u64) -> Option { - runtime_io::storage_changes_root(block).map(Into::into) + fn storage_changes_root(parent_hash: Self::Output, parent_number: u64) -> Option { + runtime_io::storage_changes_root(parent_hash.into(), parent_number).map(Into::into) } } @@ -322,8 +324,8 @@ impl CheckEqual for substrate_primitives::H256 { #[cfg(feature = "std")] fn check_equal(&self, other: &Self) { use substrate_primitives::hexdisplay::HexDisplay; - if &self.0 != &other.0 { - println!("Hash: given={}, expected={}", HexDisplay::from(&self.0), HexDisplay::from(&other.0)); + if self != other { + println!("Hash: given={}, expected={}", HexDisplay::from(self.as_fixed_bytes()), HexDisplay::from(other.as_fixed_bytes())); } } @@ -331,8 +333,8 @@ impl CheckEqual for substrate_primitives::H256 { fn check_equal(&self, other: &Self) { if self != other { runtime_io::print("Hash not equal"); - runtime_io::print(&self.0[..]); - runtime_io::print(&other.0[..]); + runtime_io::print(self.as_bytes()); + runtime_io::print(other.as_bytes()); } } } @@ -365,6 +367,16 @@ pub trait MaybeSerializeDebugButNotDeserialize {} #[cfg(not(feature = "std"))] impl MaybeSerializeDebugButNotDeserialize for T {} +#[cfg(feature = "std")] +pub trait MaybeSerialize: Serialize {} +#[cfg(feature = "std")] +impl MaybeSerialize for T {} + +#[cfg(not(feature = "std"))] +pub trait MaybeSerialize {} +#[cfg(not(feature = "std"))] +impl MaybeSerialize for T {} + #[cfg(feature = "std")] pub trait MaybeSerializeDebug: Serialize + DeserializeOwned + Debug {} #[cfg(feature = "std")] @@ -375,6 +387,16 @@ pub trait MaybeSerializeDebug {} #[cfg(not(feature = "std"))] impl MaybeSerializeDebug for T {} +#[cfg(feature = "std")] +pub trait MaybeDebug: Debug {} +#[cfg(feature = "std")] +impl MaybeDebug for T {} + +#[cfg(not(feature = "std"))] +pub trait MaybeDebug {} +#[cfg(not(feature = "std"))] +impl MaybeDebug for T {} + #[cfg(feature = "std")] pub trait MaybeDisplay: Display {} #[cfg(feature = "std")] @@ -395,9 +417,8 @@ pub trait MaybeDecode {} #[cfg(not(feature = "std"))] impl MaybeDecode for T {} - -pub trait Member: Send + Sync + Sized + MaybeSerializeDebug + Eq + PartialEq + Clone + 'static {} -impl Member for T {} +pub trait Member: Send + Sync + Sized + MaybeDebug + Eq + PartialEq + Clone + 'static {} +impl Member for T {} /// Something which fulfills the abstract idea of a Substrate header. It has types for a `Number`, /// a `Hash` and a `Digest`. It provides access to an `extrinsics_root`, `state_root` and @@ -405,8 +426,8 @@ impl + AsMut<[u8]>; + type Number: Member + MaybeSerializeDebug + ::rstd::hash::Hash + Copy + MaybeDisplay + SimpleArithmetic + Codec; + type Hash: Member + MaybeSerializeDebug + ::rstd::hash::Hash + Copy + MaybeDisplay + Default + SimpleBitOps + Codec + AsRef<[u8]> + AsMut<[u8]>; type Hashing: Hash; type Digest: Digest; @@ -445,9 +466,9 @@ pub trait Header: Clone + Send + Sync + Codec + Eq + MaybeSerializeDebug + 'stat /// /// You can get an iterator over each of the `extrinsics` and retrieve the `header`. pub trait Block: Clone + Send + Sync + Codec + Eq + MaybeSerializeDebug + 'static { - type Extrinsic: Member + Codec + Extrinsic; + type Extrinsic: Member + Codec + Extrinsic + MaybeSerialize; type Header: Header; - type Hash: Member + ::rstd::hash::Hash + Copy + MaybeDisplay + Default + SimpleBitOps + Codec + AsRef<[u8]> + AsMut<[u8]>; + type Hash: Member + MaybeSerializeDebug + ::rstd::hash::Hash + Copy + MaybeDisplay + Default + SimpleBitOps + Codec + AsRef<[u8]> + AsMut<[u8]>; fn header(&self) -> &Self::Header; fn extrinsics(&self) -> &[Self::Extrinsic]; @@ -458,6 +479,13 @@ pub trait Block: Clone + Send + Sync + Codec + Eq + MaybeSerializeDebug + 'stati } } +/// Something that acts like an `Extrinsic`. +pub trait Extrinsic { + /// Is this `Extrinsic` signed? + /// If no information are available about signed/unsigned, `None` should be returned. + fn is_signed(&self) -> Option { None } +} + /// Extract the hashing type for a block. pub type HashFor = <::Header as Header>::Hashing; /// Extract the number type for a block. @@ -516,8 +544,8 @@ pub trait Applyable: Sized + Send + Sync { /// Something that acts like a `Digest` - it can have `Log`s `push`ed onto it and these `Log`s are /// each `Codec`. -pub trait Digest: Member + Default { - type Hash: Member; +pub trait Digest: Member + MaybeSerializeDebug + Default { + type Hash: Member + MaybeSerializeDebug; type Item: DigestItem; /// Get reference to all digest items. @@ -539,9 +567,9 @@ pub trait Digest: Member + Default { /// for casting member to 'system' log items, known to substrate. /// /// If the runtime does not supports some 'system' items, use `()` as a stub. -pub trait DigestItem: Codec + Member { - type Hash: Member; - type AuthorityId: Member; +pub trait DigestItem: Codec + Member + MaybeSerializeDebug { + type Hash: Member + MaybeSerializeDebug; + type AuthorityId: Member + MaybeSerializeDebug; /// Returns Some if the entry is the `AuthoritiesChange` entry. fn as_authorities_change(&self) -> Option<&[Self::AuthorityId]>; @@ -572,9 +600,32 @@ pub trait ProvideInherent { ) -> Result<(), Self::Error>; } -/// Something that acts like an `Extrinsic`. -pub trait Extrinsic { - /// Is this `Extrinsic` signed? - /// If no information are available about signed/unsigned, `None` should be returned. - fn is_signed(&self) -> Option { None } +/// Auxiliary wrapper that holds an api instance and binds it to the given lifetime. +pub struct ApiRef<'a, T>(T, rstd::marker::PhantomData<&'a ()>); + +impl<'a, T> From for ApiRef<'a, T> { + fn from(api: T) -> Self { + ApiRef(api, Default::default()) + } +} + +impl<'a, T> rstd::ops::Deref for ApiRef<'a, T> { + type Target = T; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +/// Something that provides a runtime api. +pub trait ProvideRuntimeApi { + /// The concrete type that provides the api. + type Api; + + /// Returns the runtime api. + /// The returned instance will keep track of modifications to the storage. Any successful + /// call to an api function, will `commit` its changes to an internal buffer. Otherwise, + /// the modifications will be `discarded`. The modifications will not be applied to the + /// storage, even on a `commit`. + fn runtime_api<'a>(&'a self) -> ApiRef<'a, Self::Api>; } diff --git a/substrate/core/sr-sandbox/README.adoc b/substrate/core/sr-sandbox/README.adoc deleted file mode 100644 index 61a203708c..0000000000 --- a/substrate/core/sr-sandbox/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Runtime Sandbox - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/sr-sandbox/src/lib.rs b/substrate/core/sr-sandbox/src/lib.rs index 6ed3243dc8..09af04747d 100755 --- a/substrate/core/sr-sandbox/src/lib.rs +++ b/substrate/core/sr-sandbox/src/lib.rs @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! This crate provides means to instantiate and execute wasm modules. //! //! It works even when the user of this library executes from @@ -30,12 +29,10 @@ //! When this crate is used in the `std` environment all these functions are implemented by directly //! calling the wasm VM. //! -//! Example of possible use-cases for this library are the following: +//! Examples of possible use-cases for this library are not limited to the following: //! //! - implementing smart-contract runtimes that use wasm for contract code //! - executing a wasm substrate runtime inside of a wasm parachain -//! - etc -// end::description[] #![warn(missing_docs)] #![cfg_attr(not(feature = "std"), no_std)] diff --git a/substrate/core/sr-std/README.adoc b/substrate/core/sr-std/README.adoc deleted file mode 100644 index 36ea8d99c2..0000000000 --- a/substrate/core/sr-std/README.adoc +++ /dev/null @@ -1,14 +0,0 @@ - -= Runtime std - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- - diff --git a/substrate/core/sr-std/src/lib.rs b/substrate/core/sr-std/src/lib.rs index 87c3965646..416c91bc7f 100644 --- a/substrate/core/sr-std/src/lib.rs +++ b/substrate/core/sr-std/src/lib.rs @@ -14,10 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Lowest-abstraction level for the Substrate runtime: just exports useful primitives from std //! or core/alloc to be used with any code that depends on the runtime. -// end::description[] #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), feature(core_intrinsics))] diff --git a/substrate/core/sr-version/README.adoc b/substrate/core/sr-version/README.adoc deleted file mode 100644 index 28db6c615d..0000000000 --- a/substrate/core/sr-version/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Runtime Version - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/sr-version/src/lib.rs b/substrate/core/sr-version/src/lib.rs index 6f91692b82..b34abe901b 100644 --- a/substrate/core/sr-version/src/lib.rs +++ b/substrate/core/sr-version/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Version module for the Substrate runtime; Provides a function that returns the runtime version. -// end::description[] #![cfg_attr(not(feature = "std"), no_std)] diff --git a/substrate/core/state-db/README.adoc b/substrate/core/state-db/README.adoc deleted file mode 100644 index f9934ed8d9..0000000000 --- a/substrate/core/state-db/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= State DB - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/state-db/src/lib.rs b/substrate/core/state-db/src/lib.rs index 598f0c4705..51fffa1f2d 100644 --- a/substrate/core/state-db/src/lib.rs +++ b/substrate/core/state-db/src/lib.rs @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! State database maintenance. Handles canonicalization and pruning in the database. The input to //! this module is a `ChangeSet` which is basically a list of key-value pairs (trie nodes) that //! were added or deleted during block execution. @@ -29,8 +28,6 @@ //! # Pruning. //! See `RefWindow` for pruning algorithm details. `StateDb` prunes on each canonicalization until pruning //! constraints are satisfied. -//! -// end::description[] #[macro_use] extern crate log; #[macro_use] extern crate parity_codec_derive; @@ -363,14 +360,59 @@ mod tests { let mut db = make_db(&[91, 921, 922, 93, 94]); let state_db = StateDb::new(settings, &db).unwrap(); - db.commit(&state_db.insert_block::(&H256::from(1), 1, &H256::from(0), make_changeset(&[1], &[91])).unwrap()); - db.commit(&state_db.insert_block::(&H256::from(21), 2, &H256::from(1), make_changeset(&[21], &[921, 1])).unwrap()); - db.commit(&state_db.insert_block::(&H256::from(22), 2, &H256::from(1), make_changeset(&[22], &[922])).unwrap()); - db.commit(&state_db.insert_block::(&H256::from(3), 3, &H256::from(21), make_changeset(&[3], &[93])).unwrap()); - db.commit(&state_db.canonicalize_block(&H256::from(1))); - db.commit(&state_db.insert_block::(&H256::from(4), 4, &H256::from(3), make_changeset(&[4], &[94])).unwrap()); - db.commit(&state_db.canonicalize_block(&H256::from(21))); - db.commit(&state_db.canonicalize_block(&H256::from(3))); + db.commit( + &state_db + .insert_block::( + &H256::from_low_u64_be(1), + 1, + &H256::from_low_u64_be(0), + make_changeset(&[1], &[91]), + ) + .unwrap(), + ); + db.commit( + &state_db + .insert_block::( + &H256::from_low_u64_be(21), + 2, + &H256::from_low_u64_be(1), + make_changeset(&[21], &[921, 1]), + ) + .unwrap(), + ); + db.commit( + &state_db + .insert_block::( + &H256::from_low_u64_be(22), + 2, + &H256::from_low_u64_be(1), + make_changeset(&[22], &[922]), + ) + .unwrap(), + ); + db.commit( + &state_db + .insert_block::( + &H256::from_low_u64_be(3), + 3, + &H256::from_low_u64_be(21), + make_changeset(&[3], &[93]), + ) + .unwrap(), + ); + db.commit(&state_db.canonicalize_block(&H256::from_low_u64_be(1))); + db.commit( + &state_db + .insert_block::( + &H256::from_low_u64_be(4), + 4, + &H256::from_low_u64_be(3), + make_changeset(&[4], &[94]), + ) + .unwrap(), + ); + db.commit(&state_db.canonicalize_block(&H256::from_low_u64_be(21))); + db.commit(&state_db.canonicalize_block(&H256::from_low_u64_be(3))); (db, state_db) } diff --git a/substrate/core/state-db/src/noncanonical.rs b/substrate/core/state-db/src/noncanonical.rs index b6cd4862e7..b1d34c09ad 100644 --- a/substrate/core/state-db/src/noncanonical.rs +++ b/substrate/core/state-db/src/noncanonical.rs @@ -275,7 +275,7 @@ mod tests { use test::{make_db, make_changeset}; fn contains(overlay: &NonCanonicalOverlay, key: u64) -> bool { - overlay.get(&H256::from(key)) == Some(H256::from(key).to_vec()) + overlay.get(&H256::from_low_u64_be(key)) == Some(H256::from_low_u64_be(key).as_bytes().to_vec()) } #[test] diff --git a/substrate/core/state-db/src/test.rs b/substrate/core/state-db/src/test.rs index 3c83bb03cf..487a5c641d 100644 --- a/substrate/core/state-db/src/test.rs +++ b/substrate/core/state-db/src/test.rs @@ -62,8 +62,13 @@ impl TestDb { pub fn make_changeset(inserted: &[u64], deleted: &[u64]) -> ChangeSet { ChangeSet { - inserted: inserted.iter().map(|v| (H256::from(*v), H256::from(*v).to_vec())).collect(), - deleted: deleted.iter().map(|v| H256::from(*v)).collect(), + inserted: inserted + .iter() + .map(|v| { + (H256::from_low_u64_be(*v), H256::from_low_u64_be(*v).as_bytes().to_vec()) + }) + .collect(), + deleted: deleted.iter().map(|v| H256::from_low_u64_be(*v)).collect(), } } @@ -76,7 +81,12 @@ pub fn make_commit(inserted: &[u64], deleted: &[u64]) -> CommitSet { pub fn make_db(inserted: &[u64]) -> TestDb { TestDb { - data: inserted.iter().map(|v| (H256::from(*v), H256::from(*v).to_vec())).collect(), + data: inserted + .iter() + .map(|v| { + (H256::from_low_u64_be(*v), H256::from_low_u64_be(*v).as_bytes().to_vec()) + }) + .collect(), meta: Default::default(), } } diff --git a/substrate/core/state-machine/README.adoc b/substrate/core/state-machine/README.adoc deleted file mode 100644 index aad08bed98..0000000000 --- a/substrate/core/state-machine/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= State Machine - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/state-machine/src/changes_trie/build.rs b/substrate/core/state-machine/src/changes_trie/build.rs index 991b395938..c183f2b3cc 100644 --- a/substrate/core/state-machine/src/changes_trie/build.rs +++ b/substrate/core/state-machine/src/changes_trie/build.rs @@ -25,7 +25,7 @@ use overlayed_changes::OverlayedChanges; use trie_backend_essence::{TrieBackendStorage, TrieBackendEssence}; use changes_trie::build_iterator::digest_build_iterator; use changes_trie::input::{InputKey, InputPair, DigestIndex, ExtrinsicIndex}; -use changes_trie::{Configuration, Storage}; +use changes_trie::{AnchorBlockId, Configuration, Storage}; /// Prepare input pairs for building a changes trie of given block. /// @@ -37,7 +37,7 @@ pub fn prepare_input<'a, B, S, H>( backend: &B, storage: Option<&'a S>, changes: &OverlayedChanges, - block: u64, + parent: &'a AnchorBlockId, ) -> Result>, String> where B: Backend, @@ -54,10 +54,10 @@ pub fn prepare_input<'a, B, S, H>( let mut input = Vec::new(); input.extend(prepare_extrinsics_input( backend, - block, + parent.number + 1, changes)?); input.extend(prepare_digest_input::<_, H>( - block, + parent, config, storage)?); @@ -73,7 +73,6 @@ fn prepare_extrinsics_input( where B: Backend, H: Hasher, - { let mut extrinsic_map = BTreeMap::, BTreeSet>::new(); for (key, val) in changes.prospective.top.iter().chain(changes.committed.top.iter()) { @@ -103,19 +102,19 @@ fn prepare_extrinsics_input( /// Prepare DigestIndex input pairs. fn prepare_digest_input<'a, S, H>( - block: u64, + parent: &'a AnchorBlockId, config: &Configuration, storage: &'a S -) -> Result, String> +) -> Result + 'a, String> where S: Storage, &'a S: TrieBackendStorage, H: Hasher, - H::Out: HeapSizeOf, + H::Out: 'a + HeapSizeOf, { let mut digest_map = BTreeMap::, BTreeSet>::new(); - for digest_build_block in digest_build_iterator(config, block) { - let trie_root = storage.root(digest_build_block)?; + for digest_build_block in digest_build_iterator(config, parent.number + 1) { + let trie_root = storage.root(parent, digest_build_block)?; let trie_root = trie_root.ok_or_else(|| format!("No changes trie root for block {}", digest_build_block))?; let trie_storage = TrieBackendEssence::<_, H>::new(storage, trie_root); @@ -136,7 +135,7 @@ fn prepare_digest_input<'a, S, H>( Ok(digest_map.into_iter() .map(move |(key, set)| InputPair::DigestIndex(DigestIndex { - block, + block: parent.number + 1, key }, set.into_iter().collect()))) } @@ -228,7 +227,7 @@ mod test { #[test] fn build_changes_trie_nodes_on_non_digest_block() { let (backend, storage, changes) = prepare_for_build(); - let changes_trie_nodes = prepare_input(&backend, Some(&storage), &changes, 5).unwrap(); + let changes_trie_nodes = prepare_input(&backend, Some(&storage), &changes, &AnchorBlockId { hash: Default::default(), number: 4 }).unwrap(); assert_eq!(changes_trie_nodes, Some(vec![ InputPair::ExtrinsicIndex(ExtrinsicIndex { block: 5, key: vec![100] }, vec![0, 2, 3]), InputPair::ExtrinsicIndex(ExtrinsicIndex { block: 5, key: vec![101] }, vec![1]), @@ -239,7 +238,7 @@ mod test { #[test] fn build_changes_trie_nodes_on_digest_block_l1() { let (backend, storage, changes) = prepare_for_build(); - let changes_trie_nodes = prepare_input(&backend, Some(&storage), &changes, 4).unwrap(); + let changes_trie_nodes = prepare_input(&backend, Some(&storage), &changes, &AnchorBlockId { hash: Default::default(), number: 3 }).unwrap(); assert_eq!(changes_trie_nodes, Some(vec![ InputPair::ExtrinsicIndex(ExtrinsicIndex { block: 4, key: vec![100] }, vec![0, 2, 3]), InputPair::ExtrinsicIndex(ExtrinsicIndex { block: 4, key: vec![101] }, vec![1]), @@ -255,7 +254,7 @@ mod test { #[test] fn build_changes_trie_nodes_on_digest_block_l2() { let (backend, storage, changes) = prepare_for_build(); - let changes_trie_nodes = prepare_input(&backend, Some(&storage), &changes, 16).unwrap(); + let changes_trie_nodes = prepare_input(&backend, Some(&storage), &changes, &AnchorBlockId { hash: Default::default(), number: 15 }).unwrap(); assert_eq!(changes_trie_nodes, Some(vec![ InputPair::ExtrinsicIndex(ExtrinsicIndex { block: 16, key: vec![100] }, vec![0, 2, 3]), InputPair::ExtrinsicIndex(ExtrinsicIndex { block: 16, key: vec![101] }, vec![1]), @@ -279,7 +278,7 @@ mod test { extrinsics: Some(vec![1].into_iter().collect()) }); - let changes_trie_nodes = prepare_input(&backend, Some(&storage), &changes, 4).unwrap(); + let changes_trie_nodes = prepare_input(&backend, Some(&storage), &changes, &AnchorBlockId { hash: Default::default(), number: 3 }).unwrap(); assert_eq!(changes_trie_nodes, Some(vec![ InputPair::ExtrinsicIndex(ExtrinsicIndex { block: 4, key: vec![100] }, vec![0, 2, 3]), InputPair::ExtrinsicIndex(ExtrinsicIndex { block: 4, key: vec![101] }, vec![1]), diff --git a/substrate/core/state-machine/src/changes_trie/changes_iterator.rs b/substrate/core/state-machine/src/changes_trie/changes_iterator.rs index 8b4d2bd540..e8bd1e7db6 100644 --- a/substrate/core/state-machine/src/changes_trie/changes_iterator.rs +++ b/substrate/core/state-machine/src/changes_trie/changes_iterator.rs @@ -23,7 +23,7 @@ use codec::{Decode, Encode}; use hash_db::{HashDB, Hasher}; use heapsize::HeapSizeOf; use substrate_trie::{Recorder, MemoryDB}; -use changes_trie::{Configuration, RootsStorage, Storage}; +use changes_trie::{AnchorBlockId, Configuration, RootsStorage, Storage}; use changes_trie::input::{DigestIndex, ExtrinsicIndex, DigestIndexValue, ExtrinsicIndexValue}; use changes_trie::storage::{TrieBackendAdapter, InMemoryStorage}; use proving_backend::ProvingBackendEssence; @@ -35,7 +35,7 @@ pub fn key_changes, H: Hasher>( config: &Configuration, storage: &S, begin: u64, - end: u64, + end: &AnchorBlockId, max: u64, key: &[u8], ) -> Result, String> where H::Out: HeapSizeOf { @@ -46,7 +46,7 @@ pub fn key_changes, H: Hasher>( storage, begin, end, - surface: surface_iterator(config, max, begin, end)?, + surface: surface_iterator(config, max, begin, end.number)?, extrinsics: Default::default(), blocks: Default::default(), @@ -62,7 +62,7 @@ pub fn key_changes_proof, H: Hasher>( config: &Configuration, storage: &S, begin: u64, - end: u64, + end: &AnchorBlockId, max: u64, key: &[u8], ) -> Result>, String> where H::Out: HeapSizeOf { @@ -73,7 +73,7 @@ pub fn key_changes_proof, H: Hasher>( storage, begin, end, - surface: surface_iterator(config, max, begin, end)?, + surface: surface_iterator(config, max, begin, end.number)?, extrinsics: Default::default(), blocks: Default::default(), @@ -98,7 +98,7 @@ pub fn key_changes_proof_check, H: Hasher>( roots_storage: &S, proof: Vec>, begin: u64, - end: u64, + end: &AnchorBlockId, max: u64, key: &[u8] ) -> Result, String> where H::Out: HeapSizeOf { @@ -115,7 +115,7 @@ pub fn key_changes_proof_check, H: Hasher>( storage: &proof_db, begin, end, - surface: surface_iterator(config, max, begin, end)?, + surface: surface_iterator(config, max, begin, end.number)?, extrinsics: Default::default(), blocks: Default::default(), @@ -174,12 +174,12 @@ impl<'a> Iterator for SurfaceIterator<'a> { /// Drilldown iterator - receives 'digest points' from surface iterator and explores /// every point until extrinsic is found. -pub struct DrilldownIteratorEssence<'a, RS: 'a + RootsStorage, S: 'a + Storage, H: Hasher> { +pub struct DrilldownIteratorEssence<'a, RS: 'a + RootsStorage, S: 'a + Storage, H: Hasher> where H::Out: 'a { key: &'a [u8], roots_storage: &'a RS, storage: &'a S, begin: u64, - end: u64, + end: &'a AnchorBlockId, surface: SurfaceIterator<'a>, extrinsics: VecDeque<(u64, u32)>, @@ -213,14 +213,14 @@ impl<'a, RS: 'a + RootsStorage, S: Storage, H: Hasher> DrilldownIteratorEs // not having a changes trie root is an error because: // we never query roots for future blocks // AND trie roots for old blocks are known (both on full + light node) - let trie_root = self.roots_storage.root(block)? + let trie_root = self.roots_storage.root(&self.end, block)? .ok_or_else(|| format!("Changes trie root for block {} is not found", block))?; // only return extrinsics for blocks before self.max // most of blocks will be filtered out beore pushing to `self.blocks` // here we just throwing away changes at digest blocks we're processing debug_assert!(block >= self.begin, "We shall not touch digests earlier than a range' begin"); - if block <= self.end { + if block <= self.end.number { let extrinsics_key = ExtrinsicIndex { block, key: self.key.to_vec() }.encode(); let extrinsics = trie_reader(&self.storage, trie_root, &extrinsics_key); if let Some(extrinsics) = extrinsics? { @@ -239,7 +239,7 @@ impl<'a, RS: 'a + RootsStorage, S: Storage, H: Hasher> DrilldownIteratorEs // filter level0 blocks here because we tend to use digest blocks, // AND digest block changes could also include changes for out-of-range blocks let begin = self.begin; - let end = self.end; + let end = self.end.number; self.blocks.extend(blocks.into_iter() .rev() .filter(|b| level > 1 || (*b >= begin && *b <= end)) @@ -261,7 +261,7 @@ impl<'a, RS: 'a + RootsStorage, S: Storage, H: Hasher> DrilldownIteratorEs } /// Exploring drilldown operator. -struct DrilldownIterator<'a, RS: 'a + RootsStorage, S: 'a + Storage, H: Hasher> { +struct DrilldownIterator<'a, RS: 'a + RootsStorage, S: 'a + Storage, H: Hasher> where H::Out: 'a { essence: DrilldownIteratorEssence<'a, RS, S, H>, } @@ -278,7 +278,7 @@ impl<'a, RS: 'a + RootsStorage, S: Storage, H: Hasher> Iterator } /// Proving drilldown iterator. -struct ProvingDrilldownIterator<'a, RS: 'a + RootsStorage, S: 'a + Storage, H: Hasher> { +struct ProvingDrilldownIterator<'a, RS: 'a + RootsStorage, S: 'a + Storage, H: Hasher> where H::Out: 'a { essence: DrilldownIteratorEssence<'a, RS, S, H>, proof_recorder: RefCell>, } @@ -427,23 +427,23 @@ mod tests { fn drilldown_iterator_works() { let (config, storage) = prepare_for_drilldown(); let drilldown_result = key_changes::, Blake2Hasher>( - &config, &storage, 0, 16, 16, &[42]); + &config, &storage, 0, &AnchorBlockId { hash: Default::default(), number: 16 }, 16, &[42]); assert_eq!(drilldown_result, Ok(vec![(8, 2), (8, 1), (6, 3), (3, 0)])); let drilldown_result = key_changes::, Blake2Hasher>( - &config, &storage, 0, 2, 4, &[42]); + &config, &storage, 0, &AnchorBlockId { hash: Default::default(), number: 2 }, 4, &[42]); assert_eq!(drilldown_result, Ok(vec![])); let drilldown_result = key_changes::, Blake2Hasher>( - &config, &storage, 0, 3, 4, &[42]); + &config, &storage, 0, &AnchorBlockId { hash: Default::default(), number: 3 }, 4, &[42]); assert_eq!(drilldown_result, Ok(vec![(3, 0)])); let drilldown_result = key_changes::, Blake2Hasher>( - &config, &storage, 7, 8, 8, &[42]); + &config, &storage, 7, &AnchorBlockId { hash: Default::default(), number: 8 }, 8, &[42]); assert_eq!(drilldown_result, Ok(vec![(8, 2), (8, 1)])); let drilldown_result = key_changes::, Blake2Hasher>( - &config, &storage, 5, 7, 8, &[42]); + &config, &storage, 5, &AnchorBlockId { hash: Default::default(), number: 7 }, 8, &[42]); assert_eq!(drilldown_result, Ok(vec![(6, 3)])); } @@ -453,16 +453,16 @@ mod tests { storage.clear_storage(); assert!(key_changes::, Blake2Hasher>( - &config, &storage, 0, 100, 1000, &[42]).is_err()); + &config, &storage, 0, &AnchorBlockId { hash: Default::default(), number: 100 }, 1000, &[42]).is_err()); } #[test] fn drilldown_iterator_fails_when_range_is_invalid() { let (config, storage) = prepare_for_drilldown(); assert!(key_changes::, Blake2Hasher>( - &config, &storage, 0, 100, 50, &[42]).is_err()); + &config, &storage, 0, &AnchorBlockId { hash: Default::default(), number: 100 }, 50, &[42]).is_err()); assert!(key_changes::, Blake2Hasher>( - &config, &storage, 20, 10, 100, &[42]).is_err()); + &config, &storage, 20, &AnchorBlockId { hash: Default::default(), number: 10 }, 100, &[42]).is_err()); } @@ -474,7 +474,7 @@ mod tests { let (remote_config, remote_storage) = prepare_for_drilldown(); let remote_proof = key_changes_proof::, Blake2Hasher>( &remote_config, &remote_storage, - 0, 16, 16, &[42]).unwrap(); + 0, &AnchorBlockId { hash: Default::default(), number: 16 }, 16, &[42]).unwrap(); // happens on local light node: @@ -483,7 +483,7 @@ mod tests { local_storage.clear_storage(); let local_result = key_changes_proof_check::, Blake2Hasher>( &local_config, &local_storage, remote_proof, - 0, 16, 16, &[42]); + 0, &AnchorBlockId { hash: Default::default(), number: 16 }, 16, &[42]); // check that drilldown result is the same as if it was happening at the full node assert_eq!(local_result, Ok(vec![(8, 2), (8, 1), (6, 3), (3, 0)])); diff --git a/substrate/core/state-machine/src/changes_trie/mod.rs b/substrate/core/state-machine/src/changes_trie/mod.rs index fb16cb54d6..1d523854ee 100644 --- a/substrate/core/state-machine/src/changes_trie/mod.rs +++ b/substrate/core/state-machine/src/changes_trie/mod.rs @@ -58,10 +58,20 @@ use trie::{DBValue, trie_root}; /// Changes that are made outside of extrinsics are marked with this index; pub const NO_EXTRINSIC_INDEX: u32 = 0xffffffff; +/// Block identifier that could be used to determine fork of this block. +#[derive(Debug)] +pub struct AnchorBlockId { + /// Hash of this block. + pub hash: Hash, + /// Number of this block. + pub number: u64, +} + /// Changes trie storage. Provides access to trie roots and trie nodes. pub trait RootsStorage: Send + Sync { - /// Get changes trie root for given block. - fn root(&self, block: u64) -> Result, String>; + /// Get changes trie root for the block with given number which is an ancestor (or the block + /// itself) of the anchor_block (i.e. anchor_block.number >= block). + fn root(&self, anchor: &AnchorBlockId, block: u64) -> Result, String>; } /// Changes trie storage. Provides access to trie roots and trie nodes. @@ -79,13 +89,13 @@ pub fn compute_changes_trie_root<'a, B: Backend, S: Storage, H: Hasher>( backend: &B, storage: Option<&'a S>, changes: &OverlayedChanges, - block: u64, + parent: &'a AnchorBlockId, ) -> Option<(H::Out, Vec<(Vec, Vec)>)> where &'a S: TrieBackendStorage, H::Out: Ord + HeapSizeOf, { - let input_pairs = prepare_input::(backend, storage, changes, block) + let input_pairs = prepare_input::(backend, storage, changes, parent) .expect("storage is not allowed to fail within runtime")?; let transaction = input_pairs.into_iter() .map(Into::into) diff --git a/substrate/core/state-machine/src/changes_trie/prune.rs b/substrate/core/state-machine/src/changes_trie/prune.rs index 8168a0771d..70bae77b02 100644 --- a/substrate/core/state-machine/src/changes_trie/prune.rs +++ b/substrate/core/state-machine/src/changes_trie/prune.rs @@ -21,7 +21,7 @@ use heapsize::HeapSizeOf; use substrate_trie::Recorder; use proving_backend::ProvingBackendEssence; use trie_backend_essence::TrieBackendEssence; -use changes_trie::{Configuration, Storage}; +use changes_trie::{AnchorBlockId, Configuration, Storage}; use changes_trie::storage::TrieBackendAdapter; /// Prune obslete changes tries. Puning happens at the same block, where highest @@ -33,21 +33,21 @@ pub fn prune, H: Hasher, F: FnMut(H::Out)>( config: &Configuration, storage: &S, min_blocks_to_keep: u64, - current_block: u64, + current_block: &AnchorBlockId, mut remove_trie_node: F, ) where H::Out: HeapSizeOf, { // we only CAN prune at block where max-level-digest is created - let digest_interval = match config.digest_level_at_block(current_block) { + let digest_interval = match config.digest_level_at_block(current_block.number) { Some((digest_level, digest_interval, _)) if digest_level == config.digest_levels => digest_interval, _ => return, }; // select range for pruning - let (first, last) = match pruning_range(min_blocks_to_keep, current_block, digest_interval) { + let (first, last) = match pruning_range(min_blocks_to_keep, current_block.number, digest_interval) { Some((first, last)) => (first, last), None => return, }; @@ -55,7 +55,7 @@ pub fn prune, H: Hasher, F: FnMut(H::Out)>( // delete changes trie for every block in range // TODO: limit `max_digest_interval` so that this cycle won't involve huge ranges for block in first..last+1 { - let root = match storage.root(block) { + let root = match storage.root(current_block, block) { Ok(Some(root)) => root, Ok(None) => continue, Err(error) => { @@ -139,7 +139,7 @@ mod tests { H::Out: HeapSizeOf, { let mut pruned_trie_nodes = HashSet::new(); - prune(config, storage, min_blocks_to_keep, current_block, + prune(config, storage, min_blocks_to_keep, &AnchorBlockId { hash: Default::default(), number: current_block }, |node| { pruned_trie_nodes.insert(node); }); pruned_trie_nodes } diff --git a/substrate/core/state-machine/src/changes_trie/storage.rs b/substrate/core/state-machine/src/changes_trie/storage.rs index 1cdd03841e..088b605e9c 100644 --- a/substrate/core/state-machine/src/changes_trie/storage.rs +++ b/substrate/core/state-machine/src/changes_trie/storage.rs @@ -22,7 +22,7 @@ use trie::DBValue; use heapsize::HeapSizeOf; use trie::MemoryDB; use parking_lot::RwLock; -use changes_trie::{RootsStorage, Storage}; +use changes_trie::{AnchorBlockId, RootsStorage, Storage}; use trie_backend_essence::TrieBackendStorage; #[cfg(test)] @@ -110,7 +110,7 @@ impl InMemoryStorage where H::Out: HeapSizeOf { } impl RootsStorage for InMemoryStorage where H::Out: HeapSizeOf { - fn root(&self, block: u64) -> Result, String> { + fn root(&self, _anchor_block: &AnchorBlockId, block: u64) -> Result, String> { Ok(self.data.read().roots.get(&block).cloned()) } } diff --git a/substrate/core/state-machine/src/ext.rs b/substrate/core/state-machine/src/ext.rs index b03ed28250..1bcb3fb732 100644 --- a/substrate/core/state-machine/src/ext.rs +++ b/substrate/core/state-machine/src/ext.rs @@ -18,7 +18,7 @@ use std::{error, fmt, cmp::Ord}; use backend::{Backend, Consolidate}; -use changes_trie::{Storage as ChangesTrieStorage, compute_changes_trie_root}; +use changes_trie::{AnchorBlockId, Storage as ChangesTrieStorage, compute_changes_trie_root}; use {Externalities, OverlayedChanges}; use hash_db::Hasher; use primitives::storage::well_known_keys::is_child_storage_key; @@ -288,12 +288,12 @@ where Some(self.child_storage_root_transaction(storage_key).0) } - fn storage_changes_root(&mut self, block: u64) -> Option { + fn storage_changes_root(&mut self, parent: H::Out, parent_num: u64) -> Option { let root_and_tx = compute_changes_trie_root::<_, T, H>( self.backend, self.changes_trie_storage.clone(), self.overlay, - block, + &AnchorBlockId { hash: parent, number: parent_num }, ); let root_and_tx = root_and_tx.map(|(root, changes)| { let mut calculated_root = Default::default(); @@ -305,7 +305,7 @@ where } } - (block, mdb, root) + (parent_num + 1, mdb, root) }); let root = root_and_tx.as_ref().map(|(_, _, root)| root.clone()); self.changes_trie_transaction = root_and_tx; @@ -353,7 +353,7 @@ mod tests { let mut overlay = prepare_overlay_with_changes(); let backend = TestBackend::default(); let mut ext = TestExt::new(&mut overlay, &backend, None); - assert_eq!(ext.storage_changes_root(100), None); + assert_eq!(ext.storage_changes_root(Default::default(), 100), None); } #[test] @@ -363,7 +363,7 @@ mod tests { let storage = TestChangesTrieStorage::new(); let backend = TestBackend::default(); let mut ext = TestExt::new(&mut overlay, &backend, Some(&storage)); - assert_eq!(ext.storage_changes_root(100), None); + assert_eq!(ext.storage_changes_root(Default::default(), 100), None); } #[test] @@ -372,7 +372,7 @@ mod tests { let storage = TestChangesTrieStorage::new(); let backend = TestBackend::default(); let mut ext = TestExt::new(&mut overlay, &backend, Some(&storage)); - assert_eq!(ext.storage_changes_root(100), + assert_eq!(ext.storage_changes_root(Default::default(), 99), Some(hex!("5b829920b9c8d554a19ee2a1ba593c4f2ee6fc32822d083e04236d693e8358d5").into())); } @@ -383,7 +383,7 @@ mod tests { let storage = TestChangesTrieStorage::new(); let backend = TestBackend::default(); let mut ext = TestExt::new(&mut overlay, &backend, Some(&storage)); - assert_eq!(ext.storage_changes_root(100), + assert_eq!(ext.storage_changes_root(Default::default(), 99), Some(hex!("bcf494e41e29a15c9ae5caa053fe3cb8b446ee3e02a254efbdec7a19235b76e4").into())); } } diff --git a/substrate/core/state-machine/src/lib.rs b/substrate/core/state-machine/src/lib.rs index 9bb9110886..e88b3f370a 100644 --- a/substrate/core/state-machine/src/lib.rs +++ b/substrate/core/state-machine/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Substrate state machine implementation. -// end::description[] #![warn(missing_docs)] @@ -55,7 +53,9 @@ pub use trie::{TrieMut, TrieDBMut, DBValue, MemoryDB}; pub use testing::TestExternalities; pub use ext::Ext; pub use backend::Backend; -pub use changes_trie::{Storage as ChangesTrieStorage, +pub use changes_trie::{ + AnchorBlockId as ChangesTrieAnchorBlockId, + Storage as ChangesTrieStorage, RootsStorage as ChangesTrieRootsStorage, InMemoryStorage as InMemoryChangesTrieStorage, key_changes, key_changes_proof, key_changes_proof_check, @@ -156,8 +156,8 @@ pub trait Externalities { /// Returns None if key provided is not a storage key. This can due to not being started with CHILD_STORAGE_KEY_PREFIX, or the trie implementation regards the key as invalid. fn child_storage_root(&mut self, storage_key: &[u8]) -> Option>; - /// Get the change trie root of the current storage overlay at given block. - fn storage_changes_root(&mut self, block: u64) -> Option where H::Out: Ord; + /// Get the change trie root of the current storage overlay at a block wth given parent. + fn storage_changes_root(&mut self, parent: H::Out, parent_num: u64) -> Option where H::Out: Ord; } /// Code execution engine. diff --git a/substrate/core/state-machine/src/overlayed_changes.rs b/substrate/core/state-machine/src/overlayed_changes.rs index 15012ac66e..239dc0b438 100644 --- a/substrate/core/state-machine/src/overlayed_changes.rs +++ b/substrate/core/state-machine/src/overlayed_changes.rs @@ -371,7 +371,7 @@ mod tests { let changes_trie_storage = InMemoryChangesTrieStorage::new(); let mut ext = Ext::new(&mut overlay, &backend, Some(&changes_trie_storage)); const ROOT: [u8; 32] = hex!("0b41e488cccbd67d1f1089592c2c235f5c5399b053f7fe9152dd4b5f279914cd"); - assert_eq!(ext.storage_root(), H256(ROOT)); + assert_eq!(ext.storage_root(), H256::from(ROOT)); } #[test] diff --git a/substrate/core/state-machine/src/proving_backend.rs b/substrate/core/state-machine/src/proving_backend.rs index 6aa6eb9da3..a46fd74b5f 100644 --- a/substrate/core/state-machine/src/proving_backend.rs +++ b/substrate/core/state-machine/src/proving_backend.rs @@ -211,7 +211,8 @@ mod tests { #[test] fn proof_is_invalid_when_does_not_contains_root() { - assert!(create_proof_check_backend::(1.into(), vec![]).is_err()); + use primitives::H256; + assert!(create_proof_check_backend::(H256::from_low_u64_be(1), vec![]).is_err()); } #[test] diff --git a/substrate/core/state-machine/src/testing.rs b/substrate/core/state-machine/src/testing.rs index ea67773ed2..876a190a96 100644 --- a/substrate/core/state-machine/src/testing.rs +++ b/substrate/core/state-machine/src/testing.rs @@ -22,7 +22,7 @@ use hash_db::Hasher; use heapsize::HeapSizeOf; use trie::trie_root; use backend::InMemory; -use changes_trie::{compute_changes_trie_root, InMemoryStorage as ChangesTrieInMemoryStorage}; +use changes_trie::{compute_changes_trie_root, InMemoryStorage as ChangesTrieInMemoryStorage, AnchorBlockId}; use primitives::storage::well_known_keys::CHANGES_TRIE_CONFIG; use super::{Externalities, OverlayedChanges}; @@ -136,12 +136,12 @@ impl Externalities for TestExternalities where H::Out: Ord + He None } - fn storage_changes_root(&mut self, block: u64) -> Option { + fn storage_changes_root(&mut self, parent: H::Out, parent_num: u64) -> Option { compute_changes_trie_root::<_, _, H>( &InMemory::default(), Some(&self.changes_trie_storage), &self.changes, - block, + &AnchorBlockId { hash: parent, number: parent_num }, ).map(|(root, _)| root.clone()) } } @@ -158,6 +158,6 @@ mod tests { ext.set_storage(b"dog".to_vec(), b"puppy".to_vec()); ext.set_storage(b"dogglesworth".to_vec(), b"cat".to_vec()); const ROOT: [u8; 32] = hex!("0b41e488cccbd67d1f1089592c2c235f5c5399b053f7fe9152dd4b5f279914cd"); - assert_eq!(ext.storage_root(), H256(ROOT)); + assert_eq!(ext.storage_root(), H256::from(ROOT)); } } diff --git a/substrate/core/state-machine/src/trie_backend.rs b/substrate/core/state-machine/src/trie_backend.rs index c40a5019f3..6dcaf3868e 100644 --- a/substrate/core/state-machine/src/trie_backend.rs +++ b/substrate/core/state-machine/src/trie_backend.rs @@ -212,7 +212,7 @@ pub mod tests { #[test] fn storage_root_is_non_default() { - assert!(test_trie().storage_root(::std::iter::empty()).0 != H256([0; 32])); + assert!(test_trie().storage_root(::std::iter::empty()).0 != H256::repeat_byte(0)); } #[test] diff --git a/substrate/core/telemetry/README.adoc b/substrate/core/telemetry/README.adoc deleted file mode 100644 index 9759c5bc50..0000000000 --- a/substrate/core/telemetry/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Telemetry - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/telemetry/src/lib.rs b/substrate/core/telemetry/src/lib.rs index 8d0ddb1ac9..64e55d48b2 100644 --- a/substrate/core/telemetry/src/lib.rs +++ b/substrate/core/telemetry/src/lib.rs @@ -14,14 +14,12 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Telemetry utils. //! //! `telemetry` macro may be used anywhere in the Substrate codebase //! in order to send real-time logging information to the telemetry //! server (if there is one). We use the async drain adapter of `slog` //! so that the logging thread doesn't get held up at all. -// end::description[] extern crate parking_lot; extern crate ws; diff --git a/substrate/core/test-client/Cargo.toml b/substrate/core/test-client/Cargo.toml index aa48f95211..9f282f9db3 100644 --- a/substrate/core/test-client/Cargo.toml +++ b/substrate/core/test-client/Cargo.toml @@ -10,6 +10,6 @@ substrate-executor = { path = "../executor" } substrate-consensus-common = { path = "../consensus/common" } substrate-keyring = { path = "../../core/keyring" } substrate-primitives = { path = "../primitives" } +substrate-state-machine = { path = "../state-machine" } substrate-test-runtime = { path = "../test-runtime" } sr-primitives = { path = "../sr-primitives" } - diff --git a/substrate/core/test-client/README.adoc b/substrate/core/test-client/README.adoc deleted file mode 100644 index e56c4c7f66..0000000000 --- a/substrate/core/test-client/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Test client - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/test-client/src/block_builder_ext.rs b/substrate/core/test-client/src/block_builder_ext.rs index b2f15db739..3c334b07a1 100644 --- a/substrate/core/test-client/src/block_builder_ext.rs +++ b/substrate/core/test-client/src/block_builder_ext.rs @@ -20,8 +20,8 @@ use codec; use client; use keyring; use runtime; - -use primitives::{Blake2Hasher}; +use runtime_primitives::traits::ProvideRuntimeApi; +use client::block_builder::api::BlockBuilder; /// Extension trait for test block builder. pub trait BlockBuilderExt { @@ -29,10 +29,9 @@ pub trait BlockBuilderExt { fn push_transfer(&mut self, transfer: runtime::Transfer) -> Result<(), client::error::Error>; } -impl<'a, B, E> BlockBuilderExt for client::block_builder::BlockBuilder<'a, B, E, runtime::Block, Blake2Hasher> - where - B: client::backend::Backend, - E: client::CallExecutor + Clone, +impl<'a, A> BlockBuilderExt for client::block_builder::BlockBuilder<'a, runtime::Block, A> where + A: ProvideRuntimeApi + client::blockchain::HeaderBackend + 'a, + A::Api: BlockBuilder { fn push_transfer(&mut self, transfer: runtime::Transfer) -> Result<(), client::error::Error> { self.push(sign_tx(transfer)) @@ -40,6 +39,6 @@ impl<'a, B, E> BlockBuilderExt for client::block_builder::BlockBuilder<'a, B, E, } fn sign_tx(transfer: runtime::Transfer) -> runtime::Extrinsic { - let signature = keyring::Keyring::from_raw_public(transfer.from.0.clone()).unwrap().sign(&codec::Encode::encode(&transfer)).into(); + let signature = keyring::Keyring::from_raw_public(transfer.from.to_fixed_bytes()).unwrap().sign(&codec::Encode::encode(&transfer)).into(); runtime::Extrinsic { transfer, signature } } diff --git a/substrate/core/test-client/src/client_ext.rs b/substrate/core/test-client/src/client_ext.rs index 61133c4d9d..d0a8765255 100644 --- a/substrate/core/test-client/src/client_ext.rs +++ b/substrate/core/test-client/src/client_ext.rs @@ -35,11 +35,11 @@ pub trait TestClient: Sized { fn genesis_hash(&self) -> runtime::Hash; } -impl TestClient for Client +impl TestClient for Client where B: client::backend::Backend, E: client::CallExecutor, - Self: BlockImport + Self: BlockImport, { fn justify_and_import(&self, origin: BlockOrigin, block: runtime::Block) -> client::error::Result<()> @@ -47,8 +47,8 @@ impl TestClient for Client let import = ImportBlock { origin, header: block.header, - external_justification: vec![], - post_runtime_digests: vec![], + justification: vec![], + post_digests: vec![], body: Some(block.extrinsics), finalized: false, auxiliary: Vec::new(), diff --git a/substrate/core/test-client/src/lib.rs b/substrate/core/test-client/src/lib.rs index 98887c2b6e..ce504bd085 100644 --- a/substrate/core/test-client/src/lib.rs +++ b/substrate/core/test-client/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Client testing utilities. -// end::description[] #![warn(missing_docs)] @@ -29,6 +27,7 @@ pub extern crate substrate_client as client; pub extern crate substrate_keyring as keyring; pub extern crate substrate_test_runtime as runtime; pub extern crate substrate_consensus_common as consensus; +extern crate substrate_state_machine as state_machine; pub mod client_ext; pub mod trait_tests; @@ -67,12 +66,12 @@ pub type Executor = client::LocalCallExecutor< >; /// Creates new client instance used for tests. -pub fn new() -> client::Client { +pub fn new() -> client::Client { new_with_backend(Arc::new(Backend::new()), false) } /// Creates new test client instance that suports changes trie creation. -pub fn new_with_changes_trie() -> client::Client { +pub fn new_with_changes_trie() -> client::Client { new_with_backend(Arc::new(Backend::new()), true) } @@ -81,7 +80,7 @@ pub fn new_with_changes_trie() -> client::Client( backend: Arc, support_changes_trie: bool -) -> client::Client>, runtime::Block> +) -> client::Client>, runtime::Block, runtime::ClientWithApi> where B: backend::LocalBackend, { diff --git a/substrate/core/test-runtime/Cargo.toml b/substrate/core/test-runtime/Cargo.toml index 6687c019f6..42f4d1edd1 100644 --- a/substrate/core/test-runtime/Cargo.toml +++ b/substrate/core/test-runtime/Cargo.toml @@ -11,8 +11,8 @@ serde_derive = { version = "1.0", optional = true } parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } substrate-keyring = { path = "../keyring", optional = true } +substrate-client = { path = "../client", optional = true } substrate-primitives = { path = "../primitives", default-features = false } -sr-api = { path = "../sr-api", default-features = false } sr-std = { path = "../sr-std", default-features = false } sr-io = { path = "../sr-io", default-features = false } sr-primitives = { path = "../sr-primitives", default-features = false } @@ -26,9 +26,9 @@ std = [ "hex-literal", "serde", "serde_derive", + "substrate-client", "substrate-keyring", "parity-codec/std", - "sr-api/std", "sr-std/std", "sr-io/std", "srml-support/std", diff --git a/substrate/core/test-runtime/README.adoc b/substrate/core/test-runtime/README.adoc deleted file mode 100644 index 15b3c4c4ac..0000000000 --- a/substrate/core/test-runtime/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Test runtime - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/test-runtime/src/genesismap.rs b/substrate/core/test-runtime/src/genesismap.rs index f212e2c86f..5e6adec86a 100644 --- a/substrate/core/test-runtime/src/genesismap.rs +++ b/substrate/core/test-runtime/src/genesismap.rs @@ -70,6 +70,6 @@ impl GenesisConfig { pub fn additional_storage_with_genesis(genesis_block: &::Block) -> HashMap, Vec> { map![ - twox_128(&b"latest"[..]).to_vec() => genesis_block.hash().0.to_vec() + twox_128(&b"latest"[..]).to_vec() => genesis_block.hash().as_fixed_bytes().to_vec() ] } diff --git a/substrate/core/test-runtime/src/lib.rs b/substrate/core/test-runtime/src/lib.rs index a136f02cf0..686bb14e57 100644 --- a/substrate/core/test-runtime/src/lib.rs +++ b/substrate/core/test-runtime/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! The Substrate runtime. This can be compiled with #[no_std], ready for Wasm. -// end::description[] #![cfg_attr(not(feature = "std"), no_std)] @@ -24,16 +22,13 @@ extern crate sr_std as rstd; extern crate parity_codec as codec; extern crate sr_primitives as runtime_primitives; -#[cfg(feature = "std")] #[macro_use] -extern crate serde_derive; +extern crate substrate_client as client; #[macro_use] extern crate srml_support as runtime_support; #[macro_use] extern crate parity_codec_derive; -#[macro_use] -extern crate sr_api as runtime_api; extern crate sr_io as runtime_io; #[macro_use] extern crate sr_version as runtime_version; @@ -52,12 +47,20 @@ pub mod system; use rstd::prelude::*; use codec::{Encode, Decode}; -use runtime_api::runtime::*; +use client::{runtime_api::runtime::*, block_builder::api::runtime::*}; +#[cfg(feature = "std")] +use client::runtime_api::ApiExt; use runtime_primitives::traits::{BlindCheckable, BlakeTwo256, Block as BlockT, Extrinsic as ExtrinsicT}; +#[cfg(feature = "std")] +use runtime_primitives::traits::ApiRef; use runtime_primitives::{ApplyResult, Ed25519Signature, transaction_validity::TransactionValidity}; +#[cfg(feature = "std")] +use runtime_primitives::generic::BlockId; use runtime_version::RuntimeVersion; pub use primitives::hash::H256; use primitives::AuthorityId; +#[cfg(feature = "std")] +use primitives::OpaqueMetadata; #[cfg(any(feature = "std", test))] use runtime_version::NativeVersion; @@ -157,8 +160,8 @@ pub fn changes_trie_config() -> primitives::ChangesTrieConfiguration { } } -mod test_api { - decl_apis! { +pub mod test_api { + decl_runtime_apis! { pub trait TestAPI { fn balance_of(id: AccountId) -> u64; } @@ -167,10 +170,161 @@ mod test_api { use test_api::runtime::TestAPI; +#[cfg(feature = "std")] +pub struct ClientWithApi { + call: ::std::ptr::NonNull>, + commit_on_success: ::std::cell::RefCell, + initialised_block: ::std::cell::RefCell>>, + changes: ::std::cell::RefCell, +} + +#[cfg(feature = "std")] +unsafe impl Send for ClientWithApi {} +#[cfg(feature = "std")] +unsafe impl Sync for ClientWithApi {} + +#[cfg(feature = "std")] +impl ApiExt for ClientWithApi { + fn map_api_result Result, R, E>(&self, map_call: F) -> Result { + *self.commit_on_success.borrow_mut() = false; + let res = map_call(self); + *self.commit_on_success.borrow_mut() = true; + + self.commit_on_ok(&res); + + res + } +} + +#[cfg(feature = "std")] +impl client::runtime_api::ConstructRuntimeApi for ClientWithApi { + fn construct_runtime_api<'a, T: client::runtime_api::CallApiAt>(call: &'a T) -> ApiRef<'a, Self> { + ClientWithApi { + call: unsafe { + ::std::ptr::NonNull::new_unchecked( + ::std::mem::transmute( + call as &client::runtime_api::CallApiAt + ) + ) + }, + commit_on_success: true.into(), + initialised_block: None.into(), + changes: Default::default(), + }.into() + } +} + +#[cfg(feature = "std")] +impl ClientWithApi { + fn call_api_at( + &self, + at: &BlockId, + function: &'static str, + args: &A + ) -> client::error::Result { + let res = unsafe { + self.call.as_ref().call_api_at( + at, + function, + args.encode(), + &mut *self.changes.borrow_mut(), + &mut *self.initialised_block.borrow_mut() + ).and_then(|r| + R::decode(&mut &r[..]) + .ok_or_else(|| + client::error::ErrorKind::CallResultDecode(function).into() + ) + ) + }; + + self.commit_on_ok(&res); + res + } + + fn commit_on_ok(&self, res: &Result) { + if *self.commit_on_success.borrow() { + if res.is_err() { + self.changes.borrow_mut().discard_prospective(); + } else { + self.changes.borrow_mut().commit_prospective(); + } + } + } +} + +#[cfg(feature = "std")] +impl client::runtime_api::Core for ClientWithApi { + fn version(&self, at: &BlockId) -> Result { + self.call_api_at(at, "version", &()) + } + + fn authorities(&self, at: &BlockId) -> Result, client::error::Error> { + self.call_api_at(at, "authorities", &()) + } + + fn execute_block(&self, at: &BlockId, block: &Block) -> Result<(), client::error::Error> { + self.call_api_at(at, "execute_block", block) + } + + fn initialise_block(&self, at: &BlockId, header: &::Header) -> Result<(), client::error::Error> { + self.call_api_at(at, "initialise_block", header) + } +} + +#[cfg(feature = "std")] +impl client::block_builder::api::BlockBuilder for ClientWithApi { + fn apply_extrinsic(&self, at: &BlockId, extrinsic: &::Extrinsic) -> Result { + self.call_api_at(at, "apply_extrinsic", extrinsic) + } + + fn finalise_block(&self, at: &BlockId) -> Result<::Header, client::error::Error> { + self.call_api_at(at, "finalise_block", &()) + } + + fn inherent_extrinsics( + &self, at: &BlockId, inherent: &Inherent + ) -> Result, client::error::Error> { + self.call_api_at(at, "inherent_extrinsics", inherent) + } + + fn check_inherents(&self, at: &BlockId, block: &Block, inherent: &Inherent) -> Result, client::error::Error> { + self.call_api_at(at, "check_inherents", &(block, inherent)) + } + + fn random_seed(&self, at: &BlockId) -> Result<::Hash, client::error::Error> { + self.call_api_at(at, "random_seed", &()) + } +} + +#[cfg(feature = "std")] +impl client::runtime_api::TaggedTransactionQueue for ClientWithApi { + fn validate_transaction( + &self, + at: &BlockId, + utx: &::Extrinsic + ) -> Result { + self.call_api_at(at, "validate_transaction", utx) + } +} + +#[cfg(feature = "std")] +impl client::runtime_api::Metadata for ClientWithApi { + fn metadata(&self, at: &BlockId) -> Result { + self.call_api_at(at, "metadata", &()) + } +} + +#[cfg(feature = "std")] +impl test_api::TestAPI for ClientWithApi { + fn balance_of(&self, at: &BlockId, id: &AccountId) -> Result { + self.call_api_at(at, "balance_of", id) + } +} + struct Runtime; -impl_apis! { - impl Core for Runtime { +impl_runtime_apis! { + impl Core for Runtime { fn version() -> RuntimeVersion { version() } @@ -182,19 +336,19 @@ impl_apis! { fn execute_block(block: Block) { system::execute_block(block) } + + fn initialise_block(header: ::Header) { + system::initialise_block(header) + } } - impl TaggedTransactionQueue for Runtime { + impl TaggedTransactionQueue for Runtime { fn validate_transaction(utx: ::Extrinsic) -> TransactionValidity { system::validate_transaction(utx) } } impl BlockBuilder for Runtime { - fn initialise_block(header: ::Header) { - system::initialise_block(header) - } - fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyResult { system::execute_transaction(extrinsic) } diff --git a/substrate/core/test-runtime/src/system.rs b/substrate/core/test-runtime/src/system.rs index 6bc70368a1..3703fb553e 100644 --- a/substrate/core/test-runtime/src/system.rs +++ b/substrate/core/test-runtime/src/system.rs @@ -93,7 +93,7 @@ pub fn execute_block(block: Block) { // check digest let mut digest = Digest::default(); - if let Some(storage_changes_root) = storage_changes_root(header.number) { + if let Some(storage_changes_root) = storage_changes_root(header.parent_hash.into(), header.number - 1) { digest.push(generic::DigestItem::ChangesTrieRoot::(storage_changes_root.into())); } assert!(digest == header.digest, "Header digest items must match that calculated."); @@ -117,7 +117,7 @@ pub fn validate_transaction(utx: Extrinsic) -> TransactionValidity { } let hash = |from: &AccountId, nonce: u64| { - twox_128(&nonce.to_keyed_vec(&*from)).to_vec() + twox_128(&nonce.to_keyed_vec(from.as_bytes())).to_vec() }; let requires = if tx.nonce != expected_nonce && tx.nonce > 0 { let mut deps = Vec::new(); @@ -160,7 +160,7 @@ pub fn finalise_block() -> Header { let number = ::take(); let parent_hash = ::take(); let storage_root = BlakeTwo256::storage_root(); - let storage_changes_root = BlakeTwo256::storage_changes_root(number); + let storage_changes_root = BlakeTwo256::storage_changes_root(parent_hash, number - 1); let mut digest = Digest::default(); if let Some(storage_changes_root) = storage_changes_root { @@ -221,7 +221,11 @@ fn execute_transaction_backend(utx: &Extrinsic) -> ApplyResult { fn info_expect_equal_hash(given: &Hash, expected: &Hash) { use primitives::hexdisplay::HexDisplay; if given != expected { - println!("Hash: given={}, expected={}", HexDisplay::from(&given.0), HexDisplay::from(&expected.0)); + println!( + "Hash: given={}, expected={}", + HexDisplay::from(given.as_fixed_bytes()), + HexDisplay::from(expected.as_fixed_bytes()) + ); } } @@ -229,8 +233,8 @@ fn info_expect_equal_hash(given: &Hash, expected: &Hash) { fn info_expect_equal_hash(given: &Hash, expected: &Hash) { if given != expected { ::runtime_io::print("Hash not equal"); - ::runtime_io::print(&given.0[..]); - ::runtime_io::print(&expected.0[..]); + ::runtime_io::print(given.as_bytes()); + ::runtime_io::print(expected.as_bytes()); } } @@ -257,7 +261,7 @@ mod tests { } fn construct_signed_tx(tx: Transfer) -> Extrinsic { - let signature = Keyring::from_raw_public(tx.from.0).unwrap().sign(&tx.encode()).into(); + let signature = Keyring::from_raw_public(tx.from.to_fixed_bytes()).unwrap().sign(&tx.encode()).into(); Extrinsic { transfer: tx, signature } } diff --git a/substrate/core/test-runtime/wasm/Cargo.lock b/substrate/core/test-runtime/wasm/Cargo.lock index 990164654c..f9c0964148 100644 --- a/substrate/core/test-runtime/wasm/Cargo.lock +++ b/substrate/core/test-runtime/wasm/Cargo.lock @@ -6,6 +6,27 @@ dependencies = [ "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "backtrace" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "backtrace-sys" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "base58" version = "0.1.0" @@ -30,11 +51,35 @@ name = "byteorder" version = "1.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "bytes" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cc" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "cfg-if" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "chrono" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cloudabi" version = "0.0.3" @@ -48,6 +93,11 @@ name = "constant_time_eq" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "crossbeam" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "crossbeam-deque" version = "0.2.0" @@ -57,6 +107,15 @@ dependencies = [ "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "crossbeam-deque" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "crossbeam-epoch" version = "0.3.1" @@ -71,6 +130,19 @@ dependencies = [ "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "crossbeam-epoch" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "crossbeam-utils" version = "0.2.2" @@ -79,11 +151,21 @@ dependencies = [ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "crossbeam-utils" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "crunchy" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "crunchy" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "elastic-array" version = "0.10.0" @@ -98,16 +180,44 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "fixed-hash" -version = "0.2.2" +name = "error-chain" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fixed-hash" +version = "0.3.0-beta.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "fnv" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -122,6 +232,11 @@ name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "futures" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "gcc" version = "0.3.54" @@ -165,11 +280,58 @@ dependencies = [ "proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "httparse" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "integer-sqrt" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "iovec" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "kvdb" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "lazy_static" version = "0.2.11" @@ -183,11 +345,25 @@ dependencies = [ "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "lazycell" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "libc" version = "0.2.43" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "lock_api" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "log" version = "0.3.9" @@ -222,6 +398,11 @@ dependencies = [ "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "memoffset" version = "0.2.1" @@ -241,16 +422,84 @@ name = "memory_units" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "mio" +version = "0.6.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-extras" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-uds" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "nan-preserving-float" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "net2" +version = "0.2.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "nodrop" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "num-integer" +version = "0.1.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "num-traits" version = "0.2.6" @@ -264,6 +513,30 @@ dependencies = [ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "openssl" +version = "0.10.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "openssl-sys" +version = "0.9.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "owning_ref" version = "0.3.3" @@ -272,6 +545,11 @@ dependencies = [ "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "parity-bytes" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "parity-codec" version = "2.1.5" @@ -308,6 +586,15 @@ dependencies = [ "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "parking_lot" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "parking_lot_core" version = "0.2.14" @@ -319,6 +606,28 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "parking_lot_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pkg-config" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "proc-macro-hack" version = "0.4.1" @@ -394,6 +703,11 @@ dependencies = [ "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "redox_syscall" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "ring" version = "0.12.1" @@ -407,8 +721,8 @@ dependencies = [ ] [[package]] -name = "rustc-hex" -version = "1.0.0" +name = "rustc-demangle" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -424,6 +738,11 @@ dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ryu" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "scopeguard" version = "0.3.3" @@ -457,6 +776,62 @@ dependencies = [ "syn 0.15.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "serde_json" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sha1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "slab" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "slog" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "slog-async" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "slog-json" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "slog-scope" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "smallvec" version = "0.6.5" @@ -465,16 +840,6 @@ dependencies = [ "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "sr-api" -version = "0.1.0" -dependencies = [ - "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "sr-primitives 0.1.0", - "sr-std 0.1.0", - "sr-version 0.1.0", -] - [[package]] name = "sr-io" version = "0.1.0" @@ -524,6 +889,18 @@ dependencies = [ "sr-std 0.1.0", ] +[[package]] +name = "srml-metadata" +version = "0.1.0" +dependencies = [ + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", +] + [[package]] name = "srml-support" version = "0.1.0" @@ -536,7 +913,7 @@ dependencies = [ "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", - "substrate-metadata 0.1.0", + "srml-metadata 0.1.0", ] [[package]] @@ -545,13 +922,79 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "substrate-metadata" +name = "static_assertions" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "substrate-client" version = "0.1.0" dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", + "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "sr-version 0.1.0", + "substrate-consensus-common 0.1.0", + "substrate-executor 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", + "substrate-telemetry 0.3.0", + "substrate-trie 0.4.0", +] + +[[package]] +name = "substrate-consensus-common" +version = "0.1.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "sr-version 0.1.0", + "substrate-primitives 0.1.0", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-executor" +version = "0.1.0" +dependencies = [ + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-version 0.1.0", + "substrate-primitives 0.1.0", + "substrate-serializer 0.1.0", + "substrate-state-machine 0.1.0", + "substrate-trie 0.4.0", + "wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-keyring" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-primitives 0.1.0", ] [[package]] @@ -561,8 +1004,8 @@ dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.3.0-beta.3 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", "hash256-std-hasher 0.9.0 (git+https://github.com/paritytech/trie)", "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -574,11 +1017,19 @@ dependencies = [ "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-std 0.1.0", "twox-hash 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.5.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "substrate-serializer" +version = "0.1.0" +dependencies = [ + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "substrate-state-machine" version = "0.1.0" @@ -595,6 +1046,20 @@ dependencies = [ "trie-root 0.9.0 (git+https://github.com/paritytech/trie)", ] +[[package]] +name = "substrate-telemetry" +version = "0.3.0" +dependencies = [ + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slog-json 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slog-scope 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ws 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "substrate-test-runtime" version = "0.1.0" @@ -603,12 +1068,12 @@ dependencies = [ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sr-api 0.1.0", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", "sr-version 0.1.0", "srml-support 0.1.0", + "substrate-client 0.1.0", "substrate-primitives 0.1.0", ] @@ -643,6 +1108,182 @@ dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "take_mut" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "thread_local" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "time" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-fs 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-uds 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-codec" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-current-thread" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-executor" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-fs" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-io" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-reactor" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-tcp" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-threadpool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-timer" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-udp" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-uds" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "trie-db" version = "0.9.0" @@ -672,14 +1313,27 @@ dependencies = [ [[package]] name = "uint" -version = "0.4.1" +version = "0.5.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicode-xid" version = "0.1.0" @@ -698,6 +1352,21 @@ name = "untrusted" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "vcpkg" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "version_check" version = "0.1.5" @@ -719,6 +1388,11 @@ dependencies = [ "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "winapi" version = "0.3.6" @@ -728,6 +1402,11 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -738,51 +1417,115 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "ws" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [metadata] "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" +"checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" +"checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0" "checksum base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" "checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" "checksum byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "90492c5858dd7d2e78691cfb89f90d273a2800fc11d98f60786e5d87e2f83781" +"checksum bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0ce55bd354b095246fc34caf4e9e242f5297a7fd938b090cadfea6eee614aa62" +"checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16" "checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3" +"checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" +"checksum crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "bd66663db5a988098a89599d4857919b3acf7f61402e61365acfd3919857b9be" "checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" +"checksum crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3486aefc4c0487b9cb52372c97df0a48b8c249514af1ee99703bf70d2f2ceda1" "checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150" +"checksum crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30fecfcac6abfef8771151f8be4abc9e4edc112c2bcb233314cafde2680536e9" "checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" +"checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015" "checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" +"checksum crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c240f247c278fa08a6d4820a6a222bfc6e0d999e51ba67be94f44c905b2161f2" "checksum elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88d4851b005ef16de812ea9acdb7bece2f0a40dd86c07b85631d7dafa54537bb" "checksum environmental 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db746025e3ea695bfa0ae744dbacd5fcfc8db51b9760cf8bd0ab69708bb93c49" -"checksum fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d5ec8112f00ea8a483e04748a85522184418fd1cf02890b626d8fc28683f7de" +"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" +"checksum fixed-hash 0.3.0-beta.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4e71c99c903a9fe54baed1bc701b43daba8c6dc6d4aec89a32f667ab6b3094c4" +"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" +"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +"checksum futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)" = "49e7653e374fe0d0c12de4250f0bdb60680b8c80eed558c5c7538eec9c89e21b" "checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" "checksum hash-db 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum hash256-std-hasher 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4da5f0e01bd8a71a224a4eedecaacfcabda388dbb7a80faf04d3514287572d95" "checksum hex-literal-impl 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1d340b6514f232f6db1bd16db65302a5278a04fef9ce867cb932e7e5fa21130a" +"checksum httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83" +"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ea155abb3ba6f382a75f1418988c05fe82959ed9ce727de427f9cfd425b0c903" +"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" +"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" +"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +"checksum kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72ae89206cea31c32014b39d5a454b96135894221610dbfd19cf4d2d044fa546" "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" "checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7" +"checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0" "checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" +"checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f" "checksum mashup 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "d886e371548f5c66258a99df9ec03366bff02cc96ea3d3f8f346b5d2d6836de7" "checksum mashup-impl 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8d426741e35fab52542d84dfee615f442c2b37247bee8b1ed5c25ca723487580" +"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" "checksum memory-db 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" +"checksum mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "71646331f2619b1026cc302f87a2b8b648d5c6dd6937846a16cc8ce0f347f432" +"checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" +"checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" +"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34d4f00fcc2f4c9efa8cc971db0da9e28290e28e97af47585e48691ef10ff31f" +"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" +"checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" "checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" +"checksum openssl 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)" = "5e1309181cdcbdb51bc3b6bedb33dfac2a83b3d585033d3f6d9e22e8c1928613" +"checksum openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)" = "278c1ad40a89aa1e741a1eed089a2f60b18fab8089c3139b542140fc7d674106" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" +"checksum parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5168b4cf41f3835e4bc6ffb32f51bc9365dc50cb351904595b3931d917fd0c" "checksum parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dca389ea5e1632c89b2ce54f7e2b4a8a8c9d278042222a91e0bf95451218cb4c" "checksum parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffa42c2cb493b60b12c75b26e8c94cb734af4df4d7f2cc229dc04c1953dac189" "checksum parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)" = "511379a8194230c2395d2f5fa627a5a7e108a9f976656ce723ae68fca4097bfc" "checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" +"checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" "checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" +"checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c" +"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" +"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" "checksum proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2c725b36c99df7af7bf9324e9c999b9e37d92c8f8caf106d82e1d7953218d2d8" "checksum proc-macro-hack-impl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2b753ad9ed99dd8efeaa7d2fb8453c8f6bc3e54b97966d35f1bc77ca6865254a" "checksum proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "ffe022fb8c8bd254524b0b3305906c1921fa37a84a644e29079a9e62200c3901" @@ -792,29 +1535,62 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2" "checksum rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b614fe08b6665cb9a231d07ac1364b0ef3cb3698f1239ee0c4c3a88a524f54c8" "checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356" +"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6f7d28b30a72c01b458428e0ae988d4149c20d902346902be881e3edc4bb325c" -"checksum rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ceb8ce7a5e520de349e1fa172baeba4a9e8d5ef06c47471863530bc4972ee1e" +"checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395" "checksum rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "403bb3a286107a04825a5f82e1270acc1e14028d3d554d7a1e08914549575ab8" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)" = "84257ccd054dc351472528c8587b4de2dbf0dc0fe2e634030c1a90bfdacebaa9" "checksum serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)" = "31569d901045afbff7a9479f793177fe9259819aff10ab4f89ef69bbc5f567fe" +"checksum serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "43344e7ce05d0d8280c5940cabb4964bea626aa58b1ec0e8c73fa2a8512a38ce" +"checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" +"checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d" +"checksum slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1e1a2eec401952cd7b12a84ea120e2d57281329940c3f93c2bf04f462539508e" +"checksum slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e544d16c6b230d84c866662fe55e31aacfca6ae71e6fc49ae9a311cb379bfc2f" +"checksum slog-json 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddd14b8df2df39378b3e933c79784350bf715b11444d99f903df0253bbe524e5" +"checksum slog-scope 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "053344c94c0e2b22da6305efddb698d7c485809427cf40555dc936085f67a9df" "checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +"checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" "checksum syn 0.15.6 (registry+https://github.com/rust-lang/crates.io-index)" = "854b08a640fc8f54728fb95321e3ec485b365a97fe47609797c671addd1dde69" +"checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" +"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +"checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" +"checksum tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6e93c78d23cc61aa245a8acd2c4a79c4d7fa7fb5c3ca90d5737029f043a84895" +"checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" +"checksum tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f90fcd90952f0a496d438a976afba8e5c205fb12123f813d8ab3aa1c8436638c" +"checksum tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c117b6cf86bb730aab4834f10df96e4dd586eff2c3c27d3781348da49e255bde" +"checksum tokio-fs 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "60ae25f6b17d25116d2cba342083abe5255d3c2c79cb21ea11aa049c53bf7c75" +"checksum tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "7392fe0a70d5ce0c882c4778116c519bd5dbaa8a7c3ae3d04578b3afafdcda21" +"checksum tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4b26fd37f1125738b2170c80b551f69ff6fecb277e6e5ca885e53eec2b005018" +"checksum tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ad235e9dadd126b2d47f6736f65aa1fdcd6420e66ca63f44177bc78df89f912" +"checksum tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3929aee321c9220ed838ed6c3928be7f9b69986b0e3c22c972a66dbf8a298c68" +"checksum tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "3a52f00c97fedb6d535d27f65cccb7181c8dd4c6edc3eda9ea93f6d45d05168e" +"checksum tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "da941144b816d0dcda4db3a1ba87596e4df5e860a72b70783fe435891f80601c" +"checksum tokio-uds 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "df195376b43508f01570bacc73e13a1de0854dc59e79d1ec09913e8db6dd2a70" "checksum trie-db 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum trie-root 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum twox-hash 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4f85be565a110ed72ed7048cf56570db04ce0a592c98aa59b7dacde3e5718750" -"checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" +"checksum uint 0.5.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4630460173a57c0af94b8306091e018025d988473f641a4af754b6cde980e1e3" +"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +"checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" "checksum untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f392d7819dbe58833e26872f5f6f0d68b7bbbe90fc3667e98731c4a15ad9a7ae" +"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +"checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d184c4b7081f30316f74f8d73c197314dcb56ea7af9323522b42a2fa9cb19453" +"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" +"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum ws 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "329d3e6dd450a9c5c73024e1047f0be7e24121a68484eb0b5368977bee3cf8c3" +"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/substrate/core/test-runtime/wasm/Cargo.toml b/substrate/core/test-runtime/wasm/Cargo.toml index f606a6b300..02b97a2c7e 100644 --- a/substrate/core/test-runtime/wasm/Cargo.toml +++ b/substrate/core/test-runtime/wasm/Cargo.toml @@ -9,7 +9,7 @@ hex-literal = { version = "0.1.0", optional = true } parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } substrate-primitives = { path = "../../primitives", default-features = false } -sr-api = { path = "../../sr-api", default-features = false } +substrate-client = { path = "../../client", default-features = false } sr-std = { path = "../../sr-std", default-features = false } sr-io = { path = "../../sr-io", default-features = false } sr-version = { path = "../../sr-version", default-features = false } @@ -22,12 +22,12 @@ std = [ "log", "hex-literal", "parity-codec/std", - "sr-api/std", "sr-std/std", "sr-io/std", "srml-support/std", "sr-version/std", "substrate-primitives/std", + "substrate-client/std", "sr-primitives/std" ] diff --git a/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm b/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm index 5d9b1fcac3..76ec888e14 100644 Binary files a/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm and b/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm differ diff --git a/substrate/core/transaction-pool/README.adoc b/substrate/core/transaction-pool/README.adoc deleted file mode 100644 index 336a67a841..0000000000 --- a/substrate/core/transaction-pool/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Transaction Pool - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/transaction-pool/graph/README.adoc b/substrate/core/transaction-pool/graph/README.adoc deleted file mode 100644 index 6746537217..0000000000 --- a/substrate/core/transaction-pool/graph/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= transaction-graph - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/transaction-pool/graph/src/base_pool.rs b/substrate/core/transaction-pool/graph/src/base_pool.rs index 21a52a9750..e6ad3cd6dd 100644 --- a/substrate/core/transaction-pool/graph/src/base_pool.rs +++ b/substrate/core/transaction-pool/graph/src/base_pool.rs @@ -23,6 +23,7 @@ use std::{ sync::Arc, }; +use serde::Serialize; use sr_primitives::traits::Member; use sr_primitives::transaction_validity::{ TransactionTag as Tag, @@ -79,7 +80,7 @@ pub struct PruneStatus { /// Immutable transaction #[cfg_attr(test, derive(Clone))] -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq)] pub struct Transaction { /// Raw extrinsic representing that transaction. pub data: Extrinsic, @@ -120,7 +121,7 @@ impl Default for BasePool { } } -impl BasePool { +impl BasePool { /// Imports transaction to the pool. /// /// The pool consists of two parts: Future and Ready. diff --git a/substrate/core/transaction-pool/graph/src/lib.rs b/substrate/core/transaction-pool/graph/src/lib.rs index e41284efe3..a4879f3cb0 100644 --- a/substrate/core/transaction-pool/graph/src/lib.rs +++ b/substrate/core/transaction-pool/graph/src/lib.rs @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Generic Transaction Pool //! //! The pool is based on dependency graph between transactions @@ -24,7 +23,6 @@ //! //! TODO [ToDr] //! - [ ] Multi-threading (getting ready transactions should not block the pool) -// end::description[] #![warn(missing_docs)] #![warn(unused_extern_crates)] @@ -33,6 +31,7 @@ extern crate futures; extern crate parking_lot; extern crate sr_primitives; +extern crate serde; #[macro_use] extern crate error_chain; #[macro_use] extern crate log; #[macro_use] extern crate serde_derive; diff --git a/substrate/core/transaction-pool/graph/src/listener.rs b/substrate/core/transaction-pool/graph/src/listener.rs index 1947bfb93b..d4645eb2c5 100644 --- a/substrate/core/transaction-pool/graph/src/listener.rs +++ b/substrate/core/transaction-pool/graph/src/listener.rs @@ -19,6 +19,7 @@ use std::{ collections::HashMap, hash, }; +use serde::Serialize; use watcher; use sr_primitives::traits; @@ -35,7 +36,7 @@ impl Default for Listener { } } -impl Listener { +impl Listener { fn fire(&mut self, hash: &H, fun: F) where F: FnOnce(&mut watcher::Sender) { let clean = if let Some(h) = self.watchers.get_mut(hash) { fun(h); diff --git a/substrate/core/transaction-pool/graph/src/pool.rs b/substrate/core/transaction-pool/graph/src/pool.rs index 9f343c23d1..d9b4b33f36 100644 --- a/substrate/core/transaction-pool/graph/src/pool.rs +++ b/substrate/core/transaction-pool/graph/src/pool.rs @@ -26,6 +26,7 @@ use error; use listener::Listener; use rotator::PoolRotator; use watcher::Watcher; +use serde::Serialize; use futures::sync::mpsc; use parking_lot::{Mutex, RwLock}; @@ -54,7 +55,7 @@ pub trait ChainApi: Send + Sync { /// Block type. type Block: traits::Block; /// Hash type - type Hash: hash::Hash + Eq + traits::Member; + type Hash: hash::Hash + Eq + traits::Member + Serialize; /// Error type. type Error: From + error::IntoPoolError; @@ -287,7 +288,7 @@ fn fire_events( listener: &mut Listener, imported: &base::Imported, ) where - H: hash::Hash + Eq + traits::Member, + H: hash::Hash + Eq + traits::Member + Serialize, H2: Clone, { match *imported { @@ -358,7 +359,7 @@ mod tests { /// Hash the extrinsic. fn hash(&self, uxt: &ExtrinsicFor) -> Self::Hash { - (uxt.transfer.from.low_u64() << 5) + uxt.transfer.nonce + (uxt.transfer.from.to_low_u64_be() << 5) + uxt.transfer.nonce } } diff --git a/substrate/core/transaction-pool/graph/src/ready.rs b/substrate/core/transaction-pool/graph/src/ready.rs index 47ab34c7fb..1a531b3f49 100644 --- a/substrate/core/transaction-pool/graph/src/ready.rs +++ b/substrate/core/transaction-pool/graph/src/ready.rs @@ -21,6 +21,7 @@ use std::{ sync::Arc, }; +use serde::Serialize; use parking_lot::RwLock; use sr_primitives::traits::Member; use sr_primitives::transaction_validity::{ @@ -120,7 +121,7 @@ impl Default for ReadyTransactions { } } -impl ReadyTransactions { +impl ReadyTransactions { /// Borrows a map of tags that are provided by transactions in this queue. pub fn provided_tags(&self) -> &HashMap { &self.provided_tags diff --git a/substrate/core/transaction-pool/src/api.rs b/substrate/core/transaction-pool/src/api.rs index a8cb3ada50..a29010b50c 100644 --- a/substrate/core/transaction-pool/src/api.rs +++ b/substrate/core/transaction-pool/src/api.rs @@ -18,8 +18,9 @@ use std::{ sync::Arc, + marker::PhantomData, }; -use client::{self, runtime_api::TaggedTransactionQueue}; +use client::{runtime_api::TaggedTransactionQueue, blockchain::HeaderBackend}; use parity_codec::Encode; use txpool; use substrate_primitives::{ @@ -36,30 +37,34 @@ use sr_primitives::{ use error; /// The transaction pool logic -pub struct ChainApi { - client: Arc>, +pub struct ChainApi { + client: Arc, + _marker: PhantomData, } -impl ChainApi { +impl ChainApi where + Block: traits::Block, + T: traits::ProvideRuntimeApi + HeaderBackend { /// Create new transaction pool logic. - pub fn new(client: Arc>) -> Self { + pub fn new(client: Arc) -> Self { ChainApi { client, + _marker: Default::default() } } } -impl txpool::ChainApi for ChainApi where +impl txpool::ChainApi for ChainApi where Block: traits::Block, - B: client::backend::Backend + Send + Sync + 'static, - E: client::CallExecutor + Send + Sync + Clone + 'static, + T: traits::ProvideRuntimeApi + HeaderBackend, + T::Api: TaggedTransactionQueue { type Block = Block; type Hash = H256; type Error = error::Error; fn validate_transaction(&self, at: &BlockId, uxt: &txpool::ExtrinsicFor) -> error::Result { - Ok(self.client.validate_transaction(at, uxt)?) + Ok(self.client.runtime_api().validate_transaction(at, uxt)?) } // TODO [toDr] Use proper lbock number type diff --git a/substrate/core/transaction-pool/src/lib.rs b/substrate/core/transaction-pool/src/lib.rs index 5d31ac8fb7..44f63ed37d 100644 --- a/substrate/core/transaction-pool/src/lib.rs +++ b/substrate/core/transaction-pool/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Substrate transaction pool. -// end::description[] #![warn(missing_docs)] #![warn(unused_extern_crates)] diff --git a/substrate/core/trie/README.adoc b/substrate/core/trie/README.adoc deleted file mode 100644 index 953724ca12..0000000000 --- a/substrate/core/trie/README.adoc +++ /dev/null @@ -1,12 +0,0 @@ -= Substrate Trie - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/core/trie/src/lib.rs b/substrate/core/trie/src/lib.rs index 68dacf2668..3b9791e99a 100644 --- a/substrate/core/trie/src/lib.rs +++ b/substrate/core/trie/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -// tag::description[] //! Utility functions to interact with Substrate's Base-16 Modified Merkle Patricia tree ("trie"). -// end::description[] // TODO: no_std @@ -428,7 +426,7 @@ mod tests { #[test] fn random_should_work() { - let mut seed = ::Out::new(); + let mut seed = ::Out::zero(); for test_i in 0..10000 { if test_i % 50 == 0 { println!("{:?} of 10000 stress tests done", test_i); @@ -439,7 +437,7 @@ mod tests { journal_key: 0, value_mode: ValueMode::Index, count: 100, - }.make_with(&mut seed.0); + }.make_with(seed.as_fixed_bytes_mut()); let real = trie_root::(x.clone()); let mut memdb = MemoryDB::default(); diff --git a/substrate/doc/packages/misc.adoc b/substrate/doc/packages/misc.adoc deleted file mode 100644 index 2081d34efc..0000000000 --- a/substrate/doc/packages/misc.adoc +++ /dev/null @@ -1,8 +0,0 @@ - -=== Misc packages - -:leveloffset: +3 - -include::../../subkey/README.adoc[] - -:leveloffset: -3 diff --git a/substrate/doc/packages/packages.adoc b/substrate/doc/packages/packages.adoc deleted file mode 100644 index aa95bb1f93..0000000000 --- a/substrate/doc/packages/packages.adoc +++ /dev/null @@ -1,4 +0,0 @@ - -include::substrate.adoc[] - -include::misc.adoc[] diff --git a/substrate/doc/packages/substrate.adoc b/substrate/doc/packages/substrate.adoc deleted file mode 100644 index 3df3366def..0000000000 --- a/substrate/doc/packages/substrate.adoc +++ /dev/null @@ -1,66 +0,0 @@ - -== Substrate Packages - -=== Substrate Core - -:leveloffset: +3 - -include::../../core/client/README.adoc[] - -include::../../core/test-client/README.adoc[] - -include::../../core/client/db/README.adoc[] - -include::../../core/state-db/README.adoc[] - -include::../../core/consensus/common/README.adoc[] - -include::../../core/consensus/rhd/README.adoc[] - -include::../../core/executor/README.adoc[] - -include::../../core/finality-grandpa/README.adoc[] - -include::../../core/transaction-pool/README.adoc[] - -include::../../core/keyring/README.adoc[] - -include::../../core/network/README.adoc[] - -include::../../core/network-libp2p/README.adoc[] - -include::../../core/rpc/README.adoc[] - -include::../../core/rpc-servers/README.adoc[] - -include::../../srml/README.adoc[] - -include::../../core/sr-api/README.adoc[] - -include::../../core/sr-io/README.adoc[] - -include::../../core/sr-primitives/README.adoc[] - -include::../../core/sr-sandbox/README.adoc[] - -include::../../core/sr-std/README.adoc[] - -include::../../core/state-machine/README.adoc[] - -include::../../core/test-runtime/README.adoc[] - -include::../../core/telemetry/README.adoc[] - -include::../../core/cli/README.adoc[] - -include::../../core/service/README.adoc[] - -include::../../core/trie/README.adoc[] - -include::../../core/keystore/README.adoc[] - -include::../../core/primitives/README.adoc[] - -include::../../core/serializer/README.adoc[] - -:leveloffset: -3 diff --git a/substrate/node/cli/Cargo.toml b/substrate/node/cli/Cargo.toml index 6f1f92cc82..2ffabbbabb 100644 --- a/substrate/node/cli/Cargo.toml +++ b/substrate/node/cli/Cargo.toml @@ -24,6 +24,7 @@ substrate-network = { path = "../../core/network" } substrate-consensus-aura = { path = "../../core/consensus/aura" } sr-primitives = { path = "../../core/sr-primitives" } node-executor = { path = "../executor" } +substrate-keystore = { path = "../../core/keystore" } [dev-dependencies] substrate-service-test = { path = "../../core/service/test" } diff --git a/substrate/node/cli/res/bbq-birch.json b/substrate/node/cli/res/bbq-birch.json index 7504b7e8ca..ebd6b19fbd 100644 --- a/substrate/node/cli/res/bbq-birch.json +++ b/substrate/node/cli/res/bbq-birch.json @@ -1,6 +1,9 @@ { "name": "BBQ Birch", "id": "bbq-birch", + "properties": { + "tokenSymbol": "BBQ" + }, "telemetryUrl": "wss://telemetry.polkadot.io/submit/", "protocolId": null, "bootNodes": [ diff --git a/substrate/node/cli/src/chain_spec.rs b/substrate/node/cli/src/chain_spec.rs index 53cf074767..d8bc5bad5d 100644 --- a/substrate/node/cli/src/chain_spec.rs +++ b/substrate/node/cli/src/chain_spec.rs @@ -18,16 +18,20 @@ use primitives::{AuthorityId, ed25519}; use node_primitives::AccountId; -use node_runtime::{GenesisConfig, ConsensusConfig, CouncilSeatsConfig, CouncilVotingConfig, DemocracyConfig, - SessionConfig, StakingConfig, TimestampConfig, BalancesConfig, TreasuryConfig, UpgradeKeyConfig, - ContractConfig, Permill, Perbill}; +use node_runtime::{ConsensusConfig, CouncilSeatsConfig, CouncilVotingConfig, DemocracyConfig, + SessionConfig, StakingConfig, TimestampConfig, BalancesConfig, TreasuryConfig, + UpgradeKeyConfig, ContractConfig, Permill, Perbill}; +pub use node_runtime::GenesisConfig; use substrate_service; +use substrate_keystore::pad_seed; + const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; /// Specialised `ChainSpec`. pub type ChainSpec = substrate_service::ChainSpec; +/// BBQ birch testnet generator pub fn bbq_birch_config() -> Result { ChainSpec::from_embedded(include_bytes!("../res/bbq-birch.json")) } @@ -43,7 +47,7 @@ fn staging_testnet_config_genesis() -> GenesisConfig { hex!["f295940fa750df68a686fcf4abd4111c8a9c5a5a5a83c4c8639c451a94a7adfd"].into(), ]; const MILLICENTS: u128 = 1_000_000_000; - const CENTS: u128 = 1_000 * MILLICENTS; // assume this is worth about a cent. + const CENTS: u128 = 1_000 * MILLICENTS; // assume this is worth about a cent. const DOLLARS: u128 = 100 * CENTS; const SECS_PER_BLOCK: u64 = 4; @@ -53,12 +57,12 @@ fn staging_testnet_config_genesis() -> GenesisConfig { GenesisConfig { consensus: Some(ConsensusConfig { - code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm").to_vec(), // TODO change + code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm").to_vec(), // TODO change authorities: initial_authorities.clone(), }), system: None, balances: Some(BalancesConfig { - balances: endowed_accounts.iter().map(|&k|(k, 10_000_000 * DOLLARS)).collect(), + balances: endowed_accounts.iter().map(|&k| (k, 10_000_000 * DOLLARS)).collect(), transaction_base_fee: 1 * CENTS, transaction_byte_fee: 10 * MILLICENTS, existential_deposit: 1 * DOLLARS, @@ -68,7 +72,7 @@ fn staging_testnet_config_genesis() -> GenesisConfig { }), session: Some(SessionConfig { validators: initial_authorities.iter().cloned().map(Into::into).collect(), - session_length: 5 * MINUTES + session_length: 5 * MINUTES, }), staking: Some(StakingConfig { current_era: 0, @@ -84,9 +88,9 @@ fn staging_testnet_config_genesis() -> GenesisConfig { minimum_validator_count: 4, }), democracy: Some(DemocracyConfig { - launch_period: 5 * MINUTES, // 1 day per public referendum - voting_period: 5 * MINUTES, // 3 days to discuss & vote on an active referendum - minimum_deposit: 50 * DOLLARS, // 12000 as the minimum deposit for a referendum + launch_period: 5 * MINUTES, // 1 day per public referendum + voting_period: 5 * MINUTES, // 3 days to discuss & vote on an active referendum + minimum_deposit: 50 * DOLLARS, // 12000 as the minimum deposit for a referendum }), council_seats: Some(CouncilSeatsConfig { active_council: vec![], @@ -98,8 +102,7 @@ fn staging_testnet_config_genesis() -> GenesisConfig { approval_voting_period: 2 * DAYS, term_duration: 28 * DAYS, desired_seats: 0, - inactive_grace_period: 1, // one additional vote should go by before an inactive voter can be reaped. - + inactive_grace_period: 1, // one additional vote should go by before an inactive voter can be reaped. }), council_voting: Some(CouncilVotingConfig { cooloff_period: 4 * DAYS, @@ -121,6 +124,7 @@ fn staging_testnet_config_genesis() -> GenesisConfig { gas_price: 1 * MILLICENTS, max_depth: 1024, block_gas_limit: 10_000_000, + current_schedule: Default::default(), }), upgrade_key: Some(UpgradeKeyConfig { key: endowed_accounts[0].clone(), @@ -130,8 +134,7 @@ fn staging_testnet_config_genesis() -> GenesisConfig { /// Staging testnet config. pub fn staging_testnet_config() -> ChainSpec { - let boot_nodes = vec![ - ]; + let boot_nodes = vec![]; ChainSpec::from_genesis( "Staging Testnet", "staging_testnet", @@ -140,18 +143,34 @@ pub fn staging_testnet_config() -> ChainSpec { Some(STAGING_TELEMETRY_URL.into()), None, None, + None, ) } -fn testnet_genesis(initial_authorities: Vec, upgrade_key: AccountId) -> GenesisConfig { - let endowed_accounts = vec![ - ed25519::Pair::from_seed(b"Alice ").public().0.into(), - ed25519::Pair::from_seed(b"Bob ").public().0.into(), - ed25519::Pair::from_seed(b"Charlie ").public().0.into(), - ed25519::Pair::from_seed(b"Dave ").public().0.into(), - ed25519::Pair::from_seed(b"Eve ").public().0.into(), - ed25519::Pair::from_seed(b"Ferdie ").public().0.into(), - ]; +/// Helper function to generate AuthorityID from seed +pub fn get_authority_id_from_seed(seed: &str) -> AuthorityId { + let padded_seed = pad_seed(seed); + // NOTE from ed25519 impl: + // prefer pkcs#8 unless security doesn't matter -- this is used primarily for tests. + ed25519::Pair::from_seed(&padded_seed).public().0.into() +} + +/// Helper function to create GenesisConfig for testing +pub fn testnet_genesis( + initial_authorities: Vec, + upgrade_key: AccountId, + endowed_accounts: Option>, +) -> GenesisConfig { + let endowed_accounts = endowed_accounts.unwrap_or_else(|| { + vec![ + get_authority_id_from_seed("Alice"), + get_authority_id_from_seed("Bob"), + get_authority_id_from_seed("Charlie"), + get_authority_id_from_seed("Dave"), + get_authority_id_from_seed("Eve"), + get_authority_id_from_seed("Ferdie"), + ] + }); GenesisConfig { consensus: Some(ConsensusConfig { code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm").to_vec(), @@ -165,7 +184,7 @@ fn testnet_genesis(initial_authorities: Vec, upgrade_key: AccountId transfer_fee: 0, creation_fee: 0, reclaim_rebate: 0, - balances: endowed_accounts.iter().map(|&k|(k, (1 << 60))).collect(), + balances: endowed_accounts.iter().map(|&k| (k.into(), (1 << 60))).collect(), }), session: Some(SessionConfig { validators: initial_authorities.iter().cloned().map(Into::into).collect(), @@ -191,8 +210,8 @@ fn testnet_genesis(initial_authorities: Vec, upgrade_key: AccountId }), council_seats: Some(CouncilSeatsConfig { active_council: endowed_accounts.iter() - .filter(|a| initial_authorities.iter().find(|&b| a.0 == b.0).is_none()) - .map(|a| (a.clone(), 1000000)).collect(), + .filter(|a| initial_authorities.iter().find(|&b| a.0 == b.0).is_none()) + .map(|a| (a.clone().into(), 1000000)).collect(), candidacy_bond: 10, voter_bond: 2, present_slash_per_voter: 1, @@ -208,7 +227,7 @@ fn testnet_genesis(initial_authorities: Vec, upgrade_key: AccountId voting_period: 20, }), timestamp: Some(TimestampConfig { - period: 5, // 5 second block time. + period: 5, // 5 second block time. }), treasury: Some(TreasuryConfig { proposal_bond: Permill::from_percent(5), @@ -223,6 +242,7 @@ fn testnet_genesis(initial_authorities: Vec, upgrade_key: AccountId gas_price: 1, max_depth: 1024, block_gas_limit: 10_000_000, + current_schedule: Default::default(), }), upgrade_key: Some(UpgradeKeyConfig { key: upgrade_key, @@ -231,30 +251,34 @@ fn testnet_genesis(initial_authorities: Vec, upgrade_key: AccountId } fn development_config_genesis() -> GenesisConfig { - testnet_genesis(vec![ - ed25519::Pair::from_seed(b"Alice ").public().into(), - ], - ed25519::Pair::from_seed(b"Alice ").public().0.into() + testnet_genesis( + vec![ + get_authority_id_from_seed("Alice"), + ], + get_authority_id_from_seed("Alice").into(), + None, ) } /// Development config (single validator Alice) pub fn development_config() -> ChainSpec { - ChainSpec::from_genesis("Development", "development", development_config_genesis, vec![], None, None, None) + ChainSpec::from_genesis("Development", "development", development_config_genesis, vec![], None, None, None, None) } fn local_testnet_genesis() -> GenesisConfig { - testnet_genesis(vec![ - ed25519::Pair::from_seed(b"Alice ").public().into(), - ed25519::Pair::from_seed(b"Bob ").public().into(), - ], - ed25519::Pair::from_seed(b"Alice ").public().0.into() + testnet_genesis( + vec![ + get_authority_id_from_seed("Alice"), + get_authority_id_from_seed("Bob"), + ], + get_authority_id_from_seed("Alice").into(), + None, ) } /// Local testnet config (multivalidator Alice + Bob) pub fn local_testnet_config() -> ChainSpec { - ChainSpec::from_genesis("Local Testnet", "local_testnet", local_testnet_genesis, vec![], None, None, None) + ChainSpec::from_genesis("Local Testnet", "local_testnet", local_testnet_genesis, vec![], None, None, None, None) } #[cfg(test)] @@ -271,11 +295,11 @@ mod tests { /// Local testnet config (multivalidator Alice + Bob) pub fn integration_test_config() -> ChainSpec { - ChainSpec::from_genesis("Integration Test", "test", local_testnet_genesis_instant, vec![], None, None, None) + ChainSpec::from_genesis("Integration Test", "test", local_testnet_genesis_instant, vec![], None, None, None, None) } #[test] - fn test_connectivity() { + fn test_connectiviy() { service_test::connectivity::(integration_test_config()); } } diff --git a/substrate/node/cli/src/lib.rs b/substrate/node/cli/src/lib.rs index beb47f91ff..8a56e2edfa 100644 --- a/substrate/node/cli/src/lib.rs +++ b/substrate/node/cli/src/lib.rs @@ -33,21 +33,24 @@ extern crate substrate_transaction_pool as transaction_pool; #[macro_use] extern crate substrate_network as network; extern crate substrate_consensus_aura as consensus; +extern crate substrate_client as client; extern crate node_primitives; #[macro_use] extern crate substrate_service; extern crate node_executor; +extern crate substrate_keystore; #[macro_use] extern crate log; pub use cli::error; -mod chain_spec; +pub mod chain_spec; mod service; use tokio::runtime::Runtime; pub use cli::{VersionInfo, IntoExit}; use substrate_service::{ServiceFactory, Roles as ServiceRoles}; +use std::ops::Deref; /// The chain specification option. #[derive(Clone, Debug)] @@ -117,12 +120,13 @@ pub fn run(args: I, exit: E, version: cli::VersionInfo) -> error::Resul Ok(()) } -fn run_until_exit( +fn run_until_exit( runtime: &mut Runtime, - service: service::Service, + service: T, e: E, ) -> error::Result<()> where + T: Deref>, C: substrate_service::Components, E: IntoExit, { diff --git a/substrate/node/cli/src/service.rs b/substrate/node/cli/src/service.rs index d02ea48767..5a5edb89b0 100644 --- a/substrate/node/cli/src/service.rs +++ b/substrate/node/cli/src/service.rs @@ -20,8 +20,8 @@ use std::sync::Arc; use transaction_pool::{self, txpool::{Pool as TransactionPool}}; +use node_runtime::{GenesisConfig, ClientWithApi}; use node_primitives::Block; -use node_runtime::GenesisConfig; use substrate_service::{ FactoryFullConfiguration, LightComponents, FullComponents, FullBackend, FullClient, LightClient, LightBackend, FullExecutor, LightExecutor, @@ -29,6 +29,7 @@ use substrate_service::{ }; use node_executor; use consensus::{import_queue, start_aura, Config as AuraConfig, AuraImportQueue}; +use client; const AURA_SLOT_DURATION: u64 = 6; @@ -37,23 +38,22 @@ construct_simple_protocol! { pub struct NodeProtocol where Block = Block { } } -construct_simple_service!(Service); - construct_service_factory! { struct Factory { Block = Block, + RuntimeApi = ClientWithApi, NetworkProtocol = NodeProtocol { |config| Ok(NodeProtocol::new()) }, RuntimeDispatch = node_executor::Executor, - FullTransactionPoolApi = transaction_pool::ChainApi, FullExecutor, Block> + FullTransactionPoolApi = transaction_pool::ChainApi, FullExecutor, Block, ClientWithApi>, Block> { |config, client| Ok(TransactionPool::new(config, transaction_pool::ChainApi::new(client))) }, - LightTransactionPoolApi = transaction_pool::ChainApi, LightExecutor, Block> + LightTransactionPoolApi = transaction_pool::ChainApi, LightExecutor, Block, ClientWithApi>, Block> { |config, client| Ok(TransactionPool::new(config, transaction_pool::ChainApi::new(client))) }, Genesis = GenesisConfig, Configuration = (), - FullService = Service> + FullService = FullComponents { |config: FactoryFullConfiguration, executor: TaskExecutor| { let is_auth = config.roles == Roles::AUTHORITY; - Service::>::new(config, executor.clone()).map(move |service|{ + FullComponents::::new(config, executor.clone()).map(move |service|{ if is_auth { if let Ok(Some(Ok(key))) = service.keystore().contents() .map(|keys| keys.get(0).map(|k| service.keystore().load(k, ""))) @@ -77,18 +77,20 @@ construct_service_factory! { }) } }, - LightService = Service> - { |config, executor| Service::>::new(config, executor) }, + LightService = LightComponents + { |config, executor| >::new(config, executor) }, FullImportQueue = AuraImportQueue> { |config, client| Ok(import_queue(AuraConfig { local_key: None, slot_duration: 5 }, client)) }, LightImportQueue = AuraImportQueue> - { |config, client| Ok(import_queue(AuraConfig { - local_key: None, - slot_duration: 5 - }, client)) }, + { |config, client| Ok( + import_queue(AuraConfig { + local_key: None, + slot_duration: 5 + }, client)) + }, } } @@ -122,7 +124,7 @@ mod tests { let block = proposer.propose().expect("Error making test block"); ImportBlock { origin: BlockOrigin::File, - external_justification: Vec::new(), + justification: Vec::new(), internal_justification: Vec::new(), finalized: true, body: Some(block.extrinsics), diff --git a/substrate/node/executor/src/lib.rs b/substrate/node/executor/src/lib.rs index 70f7b8b7d3..704f2d342f 100644 --- a/substrate/node/executor/src/lib.rs +++ b/substrate/node/executor/src/lib.rs @@ -268,7 +268,10 @@ mod tests { use trie::ordered_trie_root; let extrinsics = extrinsics.into_iter().map(sign).collect::>(); - let extrinsics_root = ordered_trie_root::(extrinsics.iter().map(Encode::encode)).0.into(); + let extrinsics_root = ordered_trie_root::(extrinsics.iter() + .map(Encode::encode)) + .to_fixed_bytes() + .into(); let mut digest = generic::Digest::::default(); if let Some(changes_root) = changes_root { @@ -292,9 +295,9 @@ mod tests { 1, GENESIS_HASH.into(), if support_changes_trie { - hex!("978a3ff733a86638da39d36a349c693b5cf562bcc8db30fec6c2b6c40f925a9b").into() + hex!("a998cf2956b526aecc0887903df66457e640bb2debfd7976b5c7696da31cdaef").into() } else { - hex!("7bbad534e3de3db3c8cda015c4e8ed8ba10dde7e3fca21f4fd4fbc686e6c1410").into() + hex!("2caffd5fcc42934e6b758613ff0a7e624a8c5b7c67b7c405bf6985a7e3a19701").into() }, if support_changes_trie { Some(hex!("1f8f44dcae8982350c14dee720d34b147e73279f5a2ce1f9781195a991970978").into()) @@ -318,7 +321,7 @@ mod tests { construct_block( 2, block1(false).1, - hex!("7be30152ee2ee909047cffad5f0a28bf8c2b0a97c124b500aeac112f6917738e").into(), + hex!("72b2afc379ce2161aef95ef6f86a2321867f12b046703ea0af5aed158c2a4f30").into(), None, vec![ CheckedExtrinsic { @@ -341,7 +344,7 @@ mod tests { construct_block( 1, GENESIS_HASH.into(), - hex!("325a73726dc640af41becb42938e7152e218f130219c0695aae35b6a156f93f3").into(), + hex!("5f4461c584ce91dd6862313fd075ffc26dc702fcc1183634ee7b0c5de8b5b4d1").into(), None, vec![ CheckedExtrinsic { @@ -623,7 +626,7 @@ mod tests { let b = construct_block( 1, GENESIS_HASH.into(), - hex!("d68586d5098535e04ff7a12d71a9c9dc719960f318862e636e78a8e98cf4b8d4").into(), + hex!("9885d4297ce0341ec07957d1de32848460565a17ef2ea400df0e2326634914ae").into(), None, vec![ CheckedExtrinsic { @@ -731,7 +734,7 @@ mod tests { let mut t = new_test_ext(true); Executor::new().call(&mut t, 8, COMPACT_CODE, "execute_block", &block1(true).0, true).0.unwrap(); - assert!(t.storage_changes_root(1).is_some()); + assert!(t.storage_changes_root(Default::default(), 0).is_some()); } #[test] @@ -739,6 +742,6 @@ mod tests { let mut t = new_test_ext(true); WasmExecutor::new().call(&mut t, 8, COMPACT_CODE, "execute_block", &block1(true).0).unwrap(); - assert!(t.storage_changes_root(1).is_some()); + assert!(t.storage_changes_root(Default::default(), 0).is_some()); } } diff --git a/substrate/node/runtime/Cargo.toml b/substrate/node/runtime/Cargo.toml index 8add782018..1f6ccad0c3 100644 --- a/substrate/node/runtime/Cargo.toml +++ b/substrate/node/runtime/Cargo.toml @@ -11,11 +11,10 @@ serde_derive = { version = "1.0", optional = true } safe-mix = { version = "1.0", default-features = false } parity-codec = "2.1" parity-codec-derive = "2.1" -sr-api = { path = "../../core/sr-api", default-features = false } sr-std = { path = "../../core/sr-std" } -sr-io = { path = "../../core/sr-io" } srml-support = { path = "../../srml/support" } substrate-primitives = { path = "../../core/primitives" } +substrate-client = { path = "../../core/client", optional = true } substrate-keyring = { path = "../../core/keyring" } srml-balances = { path = "../../srml/balances" } srml-consensus = { path = "../../srml/consensus" } @@ -38,9 +37,7 @@ default = ["std"] std = [ "parity-codec/std", "substrate-primitives/std", - "sr-api/std", "sr-std/std", - "sr-io/std", "srml-support/std", "srml-balances/std", "srml-consensus/std", @@ -59,5 +56,6 @@ std = [ "node-primitives/std", "serde_derive", "serde/std", - "safe-mix/std" + "safe-mix/std", + "substrate-client", ] diff --git a/substrate/node/runtime/src/lib.rs b/substrate/node/runtime/src/lib.rs index 998bb6640b..84ffbb4ab0 100644 --- a/substrate/node/runtime/src/lib.rs +++ b/substrate/node/runtime/src/lib.rs @@ -20,11 +20,6 @@ // `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. #![recursion_limit="256"] -extern crate sr_io as runtime_io; - -#[macro_use] -extern crate sr_api as runtime_api; - #[macro_use] extern crate srml_support; @@ -37,9 +32,14 @@ extern crate serde_derive; extern crate substrate_primitives; +#[macro_use] +extern crate substrate_client as client; + #[macro_use] extern crate parity_codec_derive; +extern crate parity_codec as codec; + extern crate sr_std as rstd; extern crate srml_balances as balances; extern crate srml_consensus as consensus; @@ -57,23 +57,33 @@ extern crate srml_upgrade_key as upgrade_key; extern crate sr_version as version; extern crate node_primitives; +#[cfg(feature = "std")] +use codec::{Encode, Decode}; use rstd::prelude::*; use substrate_primitives::u32_trait::{_2, _4}; use node_primitives::{ - AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, - SessionKey, Signature + AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, SessionKey, Signature }; -use runtime_api::{runtime::*, id::*}; +#[cfg(feature = "std")] +use node_primitives::Block as GBlock; +use client::{block_builder::api::runtime::*, runtime_api::{runtime::*, id::*}}; +#[cfg(feature = "std")] +use client::runtime_api::ApiExt; use runtime_primitives::ApplyResult; use runtime_primitives::transaction_validity::TransactionValidity; use runtime_primitives::generic; use runtime_primitives::traits::{Convert, BlakeTwo256, Block as BlockT}; +#[cfg(feature = "std")] +use runtime_primitives::traits::ApiRef; +#[cfg(feature = "std")] +use substrate_primitives::AuthorityId; use version::RuntimeVersion; use council::{motions as council_motions, voting as council_voting}; #[cfg(feature = "std")] use council::seats as council_seats; #[cfg(any(feature = "std", test))] use version::NativeVersion; +use substrate_primitives::OpaqueMetadata; #[cfg(any(feature = "std", test))] pub use runtime_primitives::BuildStorage; @@ -147,7 +157,7 @@ impl timestamp::Trait for Runtime { pub struct SessionKeyConversion; impl Convert for SessionKeyConversion { fn convert(a: AccountId) -> SessionKey { - a.0.into() + a.to_fixed_bytes().into() } } @@ -228,7 +238,7 @@ pub type Header = generic::Header; /// Block type as expected by this runtime. pub type Block = generic::Block; /// A Block signed with a Justification -pub type SignedBlock = generic::SignedBlock; +pub type SignedBlock = generic::SignedBlock; /// BlockId type as expected by this runtime. pub type BlockId = generic::BlockId; /// Unchecked extrinsic type as expected by this runtime. @@ -238,8 +248,155 @@ pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = executive::Executive, Balances, AllModules>; -impl_apis! { - impl Core for Runtime { +#[cfg(feature = "std")] +pub struct ClientWithApi { + call: ::std::ptr::NonNull>, + commit_on_success: ::std::cell::RefCell, + initialised_block: ::std::cell::RefCell>, + changes: ::std::cell::RefCell, +} + +#[cfg(feature = "std")] +unsafe impl Send for ClientWithApi {} +#[cfg(feature = "std")] +unsafe impl Sync for ClientWithApi {} + +#[cfg(feature = "std")] +impl ApiExt for ClientWithApi { + fn map_api_result Result, R, E>(&self, map_call: F) -> Result { + *self.commit_on_success.borrow_mut() = false; + let res = map_call(self); + *self.commit_on_success.borrow_mut() = true; + + self.commit_on_ok(&res); + + res + } +} + +#[cfg(feature = "std")] +impl client::runtime_api::ConstructRuntimeApi for ClientWithApi { + fn construct_runtime_api<'a, T: client::runtime_api::CallApiAt>(call: &'a T) -> ApiRef<'a, Self> { + ClientWithApi { + call: unsafe { + ::std::ptr::NonNull::new_unchecked( + ::std::mem::transmute( + call as &client::runtime_api::CallApiAt + ) + ) + }, + commit_on_success: true.into(), + initialised_block: None.into(), + changes: Default::default(), + }.into() + } +} + +#[cfg(feature = "std")] +impl ClientWithApi { + fn call_api_at( + &self, + at: &GBlockId, + function: &'static str, + args: &A + ) -> client::error::Result { + let res = unsafe { + self.call.as_ref().call_api_at( + at, + function, + args.encode(), + &mut *self.changes.borrow_mut(), + &mut *self.initialised_block.borrow_mut() + ).and_then(|r| + R::decode(&mut &r[..]) + .ok_or_else(|| + client::error::ErrorKind::CallResultDecode(function).into() + ) + ) + }; + + self.commit_on_ok(&res); + res + } + + fn commit_on_ok(&self, res: &Result) { + if *self.commit_on_success.borrow() { + if res.is_err() { + self.changes.borrow_mut().discard_prospective(); + } else { + self.changes.borrow_mut().commit_prospective(); + } + } + } +} + +#[cfg(feature = "std")] +type GBlockId = generic::BlockId; + +#[cfg(feature = "std")] +impl client::runtime_api::Core for ClientWithApi { + fn version(&self, at: &GBlockId) -> Result { + self.call_api_at(at, "version", &()) + } + + fn authorities(&self, at: &GBlockId) -> Result, client::error::Error> { + self.call_api_at(at, "authorities", &()) + } + + fn execute_block(&self, at: &GBlockId, block: &GBlock) -> Result<(), client::error::Error> { + self.call_api_at(at, "execute_block", block) + } + + fn initialise_block(&self, at: &GBlockId, header: &::Header) -> Result<(), client::error::Error> { + self.call_api_at(at, "initialise_block", header) + } +} + +#[cfg(feature = "std")] +impl client::block_builder::api::BlockBuilder for ClientWithApi { + fn apply_extrinsic(&self, at: &GBlockId, extrinsic: &::Extrinsic) -> Result { + self.call_api_at(at, "apply_extrinsic", extrinsic) + } + + fn finalise_block(&self, at: &GBlockId) -> Result<::Header, client::error::Error> { + self.call_api_at(at, "finalise_block", &()) + } + + fn inherent_extrinsics( + &self, at: &GBlockId, inherent: &Inherent + ) -> Result, client::error::Error> { + self.call_api_at(at, "inherent_extrinsics", inherent) + } + + fn check_inherents(&self, at: &GBlockId, block: &GBlock, inherent: &Inherent) -> Result, client::error::Error> { + self.call_api_at(at, "check_inherents", &(block, inherent)) + } + + fn random_seed(&self, at: &GBlockId) -> Result<::Hash, client::error::Error> { + self.call_api_at(at, "random_seed", &()) + } +} + +#[cfg(feature = "std")] +impl client::runtime_api::TaggedTransactionQueue for ClientWithApi { + fn validate_transaction( + &self, + at: &GBlockId, + utx: &::Extrinsic + ) -> Result { + self.call_api_at(at, "validate_transaction", utx) + } +} + +#[cfg(feature = "std")] +impl client::runtime_api::Metadata for ClientWithApi { + fn metadata(&self, at: &GBlockId) -> Result { + self.call_api_at(at, "metadata", &()) + } +} + +impl_runtime_apis! { + impl Core for Runtime { fn version() -> RuntimeVersion { VERSION } @@ -251,19 +408,19 @@ impl_apis! { fn execute_block(block: Block) { Executive::execute_block(block) } + + fn initialise_block(header: ::Header) { + Executive::initialise_block(&header) + } } - impl Metadata for Runtime { - fn metadata() -> RuntimeMetadata { - Runtime::metadata() + impl Metadata for Runtime { + fn metadata() -> OpaqueMetadata { + Runtime::metadata().into() } } impl BlockBuilder for Runtime { - fn initialise_block(header: ::Header) { - Executive::initialise_block(&header) - } - fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyResult { Executive::apply_extrinsic(extrinsic) } @@ -285,7 +442,7 @@ impl_apis! { } } - impl TaggedTransactionQueue for Runtime { + impl TaggedTransactionQueue for Runtime { fn validate_transaction(tx: ::Extrinsic) -> TransactionValidity { Executive::validate_transaction(tx) } diff --git a/substrate/node/runtime/wasm/Cargo.lock b/substrate/node/runtime/wasm/Cargo.lock index d998a1069f..bb067bc400 100644 --- a/substrate/node/runtime/wasm/Cargo.lock +++ b/substrate/node/runtime/wasm/Cargo.lock @@ -6,6 +6,27 @@ dependencies = [ "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "backtrace" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "backtrace-sys" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "base58" version = "0.1.0" @@ -30,11 +51,35 @@ name = "byteorder" version = "1.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "bytes" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cc" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "cfg-if" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "chrono" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cloudabi" version = "0.0.3" @@ -48,6 +93,11 @@ name = "constant_time_eq" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "crossbeam" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "crossbeam-deque" version = "0.2.0" @@ -57,6 +107,15 @@ dependencies = [ "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "crossbeam-deque" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "crossbeam-epoch" version = "0.3.1" @@ -71,6 +130,19 @@ dependencies = [ "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "crossbeam-epoch" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "crossbeam-utils" version = "0.2.2" @@ -79,11 +151,21 @@ dependencies = [ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "crossbeam-utils" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "crunchy" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "crunchy" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "elastic-array" version = "0.10.0" @@ -98,16 +180,44 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "fixed-hash" -version = "0.2.2" +name = "error-chain" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fixed-hash" +version = "0.3.0-beta.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "fnv" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -122,6 +232,11 @@ name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "futures" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "gcc" version = "0.3.54" @@ -165,11 +280,58 @@ dependencies = [ "proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "httparse" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "integer-sqrt" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "iovec" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "kvdb" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "lazy_static" version = "0.2.11" @@ -183,11 +345,25 @@ dependencies = [ "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "lazycell" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "libc" version = "0.2.43" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "lock_api" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "log" version = "0.3.9" @@ -222,6 +398,11 @@ dependencies = [ "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "memoffset" version = "0.2.1" @@ -241,11 +422,71 @@ name = "memory_units" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "mio" +version = "0.6.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-extras" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-uds" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "nan-preserving-float" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "net2" +version = "0.2.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "node-primitives" version = "0.1.0" @@ -268,8 +509,6 @@ dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sr-api 0.1.0", - "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", "sr-version 0.1.0", @@ -286,6 +525,7 @@ dependencies = [ "srml-timestamp 0.1.0", "srml-treasury 0.1.0", "srml-upgrade-key 0.1.0", + "substrate-client 0.1.0", "substrate-primitives 0.1.0", ] @@ -294,6 +534,14 @@ name = "nodrop" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "num-integer" +version = "0.1.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "num-traits" version = "0.2.6" @@ -307,6 +555,30 @@ dependencies = [ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "openssl" +version = "0.10.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "openssl-sys" +version = "0.9.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "owning_ref" version = "0.3.3" @@ -315,6 +587,11 @@ dependencies = [ "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "parity-bytes" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "parity-codec" version = "2.1.5" @@ -351,6 +628,15 @@ dependencies = [ "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "parking_lot" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "parking_lot_core" version = "0.2.14" @@ -362,6 +648,28 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "parking_lot_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pkg-config" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "proc-macro-hack" version = "0.4.1" @@ -447,6 +755,11 @@ dependencies = [ "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "redox_syscall" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "ring" version = "0.12.1" @@ -460,8 +773,8 @@ dependencies = [ ] [[package]] -name = "rustc-hex" -version = "1.0.0" +name = "rustc-demangle" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -477,6 +790,11 @@ dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ryu" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "safe-mix" version = "1.0.0" @@ -518,6 +836,62 @@ dependencies = [ "syn 0.15.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "serde_json" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sha1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "slab" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "slog" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "slog-async" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "slog-json" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "slog-scope" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "smallvec" version = "0.6.5" @@ -526,16 +900,6 @@ dependencies = [ "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "sr-api" -version = "0.1.0" -dependencies = [ - "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "sr-primitives 0.1.0", - "sr-std 0.1.0", - "sr-version 0.1.0", -] - [[package]] name = "sr-io" version = "0.1.0" @@ -605,7 +969,6 @@ dependencies = [ "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -623,7 +986,6 @@ dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -641,7 +1003,6 @@ dependencies = [ "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", "pwasm-utils 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-sandbox 0.1.0", @@ -661,7 +1022,6 @@ dependencies = [ "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -681,7 +1041,6 @@ dependencies = [ "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -699,7 +1058,6 @@ dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -707,6 +1065,18 @@ dependencies = [ "srml-system 0.1.0", ] +[[package]] +name = "srml-metadata" +version = "0.1.0" +dependencies = [ + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", +] + [[package]] name = "srml-session" version = "0.1.0" @@ -716,7 +1086,6 @@ dependencies = [ "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -736,7 +1105,6 @@ dependencies = [ "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -762,7 +1130,7 @@ dependencies = [ "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", - "substrate-metadata 0.1.0", + "srml-metadata 0.1.0", ] [[package]] @@ -774,7 +1142,6 @@ dependencies = [ "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -790,7 +1157,6 @@ dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -808,7 +1174,6 @@ dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -826,7 +1191,6 @@ dependencies = [ "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -841,6 +1205,73 @@ name = "stable_deref_trait" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "static_assertions" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "substrate-client" +version = "0.1.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", + "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "sr-version 0.1.0", + "substrate-consensus-common 0.1.0", + "substrate-executor 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", + "substrate-telemetry 0.3.0", + "substrate-trie 0.4.0", +] + +[[package]] +name = "substrate-consensus-common" +version = "0.1.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "sr-version 0.1.0", + "substrate-primitives 0.1.0", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-executor" +version = "0.1.0" +dependencies = [ + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-version 0.1.0", + "substrate-primitives 0.1.0", + "substrate-serializer 0.1.0", + "substrate-state-machine 0.1.0", + "substrate-trie 0.4.0", + "wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "substrate-keyring" version = "0.1.0" @@ -850,16 +1281,6 @@ dependencies = [ "substrate-primitives 0.1.0", ] -[[package]] -name = "substrate-metadata" -version = "0.1.0" -dependencies = [ - "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "substrate-primitives" version = "0.1.0" @@ -867,8 +1288,8 @@ dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.3.0-beta.3 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", "hash256-std-hasher 0.9.0 (git+https://github.com/paritytech/trie)", "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -880,11 +1301,19 @@ dependencies = [ "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "sr-std 0.1.0", "twox-hash 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.5.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "substrate-serializer" +version = "0.1.0" +dependencies = [ + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "substrate-state-machine" version = "0.1.0" @@ -901,6 +1330,20 @@ dependencies = [ "trie-root 0.9.0 (git+https://github.com/paritytech/trie)", ] +[[package]] +name = "substrate-telemetry" +version = "0.3.0" +dependencies = [ + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slog-json 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slog-scope 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ws 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "substrate-trie" version = "0.4.0" @@ -932,6 +1375,182 @@ dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "take_mut" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "thread_local" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "time" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-fs 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-uds 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-codec" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-current-thread" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-executor" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-fs" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-io" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-reactor" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-tcp" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-threadpool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-timer" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-udp" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-uds" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "trie-db" version = "0.9.0" @@ -961,14 +1580,27 @@ dependencies = [ [[package]] name = "uint" -version = "0.4.1" +version = "0.5.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicode-xid" version = "0.1.0" @@ -987,6 +1619,21 @@ name = "untrusted" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "vcpkg" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "version_check" version = "0.1.5" @@ -1008,6 +1655,11 @@ dependencies = [ "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "winapi" version = "0.3.6" @@ -1017,6 +1669,11 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -1027,51 +1684,115 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "ws" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [metadata] "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" +"checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" +"checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0" "checksum base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" "checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" "checksum byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "90492c5858dd7d2e78691cfb89f90d273a2800fc11d98f60786e5d87e2f83781" +"checksum bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0ce55bd354b095246fc34caf4e9e242f5297a7fd938b090cadfea6eee614aa62" +"checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16" "checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3" +"checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" +"checksum crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "bd66663db5a988098a89599d4857919b3acf7f61402e61365acfd3919857b9be" "checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" +"checksum crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3486aefc4c0487b9cb52372c97df0a48b8c249514af1ee99703bf70d2f2ceda1" "checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150" +"checksum crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30fecfcac6abfef8771151f8be4abc9e4edc112c2bcb233314cafde2680536e9" "checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" +"checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015" "checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" +"checksum crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c240f247c278fa08a6d4820a6a222bfc6e0d999e51ba67be94f44c905b2161f2" "checksum elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88d4851b005ef16de812ea9acdb7bece2f0a40dd86c07b85631d7dafa54537bb" "checksum environmental 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db746025e3ea695bfa0ae744dbacd5fcfc8db51b9760cf8bd0ab69708bb93c49" -"checksum fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d5ec8112f00ea8a483e04748a85522184418fd1cf02890b626d8fc28683f7de" +"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" +"checksum fixed-hash 0.3.0-beta.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4e71c99c903a9fe54baed1bc701b43daba8c6dc6d4aec89a32f667ab6b3094c4" +"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" +"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +"checksum futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)" = "49e7653e374fe0d0c12de4250f0bdb60680b8c80eed558c5c7538eec9c89e21b" "checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" "checksum hash-db 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum hash256-std-hasher 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4da5f0e01bd8a71a224a4eedecaacfcabda388dbb7a80faf04d3514287572d95" "checksum hex-literal-impl 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1d340b6514f232f6db1bd16db65302a5278a04fef9ce867cb932e7e5fa21130a" +"checksum httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83" +"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ea155abb3ba6f382a75f1418988c05fe82959ed9ce727de427f9cfd425b0c903" +"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" +"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" +"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +"checksum kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72ae89206cea31c32014b39d5a454b96135894221610dbfd19cf4d2d044fa546" "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" "checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7" +"checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0" "checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" +"checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f" "checksum mashup 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "d886e371548f5c66258a99df9ec03366bff02cc96ea3d3f8f346b5d2d6836de7" "checksum mashup-impl 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8d426741e35fab52542d84dfee615f442c2b37247bee8b1ed5c25ca723487580" +"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" "checksum memory-db 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" +"checksum mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "71646331f2619b1026cc302f87a2b8b648d5c6dd6937846a16cc8ce0f347f432" +"checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" +"checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" +"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34d4f00fcc2f4c9efa8cc971db0da9e28290e28e97af47585e48691ef10ff31f" +"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" +"checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" "checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" +"checksum openssl 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)" = "5e1309181cdcbdb51bc3b6bedb33dfac2a83b3d585033d3f6d9e22e8c1928613" +"checksum openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)" = "278c1ad40a89aa1e741a1eed089a2f60b18fab8089c3139b542140fc7d674106" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" +"checksum parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5168b4cf41f3835e4bc6ffb32f51bc9365dc50cb351904595b3931d917fd0c" "checksum parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dca389ea5e1632c89b2ce54f7e2b4a8a8c9d278042222a91e0bf95451218cb4c" "checksum parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffa42c2cb493b60b12c75b26e8c94cb734af4df4d7f2cc229dc04c1953dac189" "checksum parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)" = "511379a8194230c2395d2f5fa627a5a7e108a9f976656ce723ae68fca4097bfc" "checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" +"checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" "checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" +"checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c" +"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" +"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" "checksum proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2c725b36c99df7af7bf9324e9c999b9e37d92c8f8caf106d82e1d7953218d2d8" "checksum proc-macro-hack-impl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2b753ad9ed99dd8efeaa7d2fb8453c8f6bc3e54b97966d35f1bc77ca6865254a" "checksum proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "ffe022fb8c8bd254524b0b3305906c1921fa37a84a644e29079a9e62200c3901" @@ -1082,30 +1803,63 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2" "checksum rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b614fe08b6665cb9a231d07ac1364b0ef3cb3698f1239ee0c4c3a88a524f54c8" "checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356" +"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6f7d28b30a72c01b458428e0ae988d4149c20d902346902be881e3edc4bb325c" -"checksum rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ceb8ce7a5e520de349e1fa172baeba4a9e8d5ef06c47471863530bc4972ee1e" +"checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395" "checksum rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "403bb3a286107a04825a5f82e1270acc1e14028d3d554d7a1e08914549575ab8" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" "checksum safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f7bf422d23a88c16d5090d455f182bc99c60af4df6a345c63428acf5129e347" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)" = "84257ccd054dc351472528c8587b4de2dbf0dc0fe2e634030c1a90bfdacebaa9" "checksum serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)" = "31569d901045afbff7a9479f793177fe9259819aff10ab4f89ef69bbc5f567fe" +"checksum serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "43344e7ce05d0d8280c5940cabb4964bea626aa58b1ec0e8c73fa2a8512a38ce" +"checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" +"checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d" +"checksum slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1e1a2eec401952cd7b12a84ea120e2d57281329940c3f93c2bf04f462539508e" +"checksum slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e544d16c6b230d84c866662fe55e31aacfca6ae71e6fc49ae9a311cb379bfc2f" +"checksum slog-json 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddd14b8df2df39378b3e933c79784350bf715b11444d99f903df0253bbe524e5" +"checksum slog-scope 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "053344c94c0e2b22da6305efddb698d7c485809427cf40555dc936085f67a9df" "checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +"checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" "checksum syn 0.15.6 (registry+https://github.com/rust-lang/crates.io-index)" = "854b08a640fc8f54728fb95321e3ec485b365a97fe47609797c671addd1dde69" +"checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" +"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +"checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" +"checksum tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6e93c78d23cc61aa245a8acd2c4a79c4d7fa7fb5c3ca90d5737029f043a84895" +"checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" +"checksum tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f90fcd90952f0a496d438a976afba8e5c205fb12123f813d8ab3aa1c8436638c" +"checksum tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c117b6cf86bb730aab4834f10df96e4dd586eff2c3c27d3781348da49e255bde" +"checksum tokio-fs 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "60ae25f6b17d25116d2cba342083abe5255d3c2c79cb21ea11aa049c53bf7c75" +"checksum tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "7392fe0a70d5ce0c882c4778116c519bd5dbaa8a7c3ae3d04578b3afafdcda21" +"checksum tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4b26fd37f1125738b2170c80b551f69ff6fecb277e6e5ca885e53eec2b005018" +"checksum tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ad235e9dadd126b2d47f6736f65aa1fdcd6420e66ca63f44177bc78df89f912" +"checksum tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3929aee321c9220ed838ed6c3928be7f9b69986b0e3c22c972a66dbf8a298c68" +"checksum tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "3a52f00c97fedb6d535d27f65cccb7181c8dd4c6edc3eda9ea93f6d45d05168e" +"checksum tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "da941144b816d0dcda4db3a1ba87596e4df5e860a72b70783fe435891f80601c" +"checksum tokio-uds 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "df195376b43508f01570bacc73e13a1de0854dc59e79d1ec09913e8db6dd2a70" "checksum trie-db 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum trie-root 0.9.0 (git+https://github.com/paritytech/trie)" = "" "checksum twox-hash 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4f85be565a110ed72ed7048cf56570db04ce0a592c98aa59b7dacde3e5718750" -"checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" +"checksum uint 0.5.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4630460173a57c0af94b8306091e018025d988473f641a4af754b6cde980e1e3" +"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +"checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" "checksum untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f392d7819dbe58833e26872f5f6f0d68b7bbbe90fc3667e98731c4a15ad9a7ae" +"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +"checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d184c4b7081f30316f74f8d73c197314dcb56ea7af9323522b42a2fa9cb19453" +"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" +"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum ws 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "329d3e6dd450a9c5c73024e1047f0be7e24121a68484eb0b5368977bee3cf8c3" +"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/substrate/node/runtime/wasm/Cargo.toml b/substrate/node/runtime/wasm/Cargo.toml index fbabdc4aaa..9e74ff9d5d 100644 --- a/substrate/node/runtime/wasm/Cargo.toml +++ b/substrate/node/runtime/wasm/Cargo.toml @@ -8,13 +8,12 @@ crate-type = ["cdylib"] [dependencies] integer-sqrt = { version = "0.1.2" } -safe-mix = { version = "1.0", default-features = false} +safe-mix = { version = "1.0", default-features = false } parity-codec-derive = { version = "2.1" } parity-codec = { version = "2.1", default-features = false } substrate-primitives = { path = "../../../core/primitives", default-features = false } -sr-api = { path = "../../../core/sr-api", default-features = false } +substrate-client = { path = "../../../core/client", default-features = false } sr-std = { path = "../../../core/sr-std", default-features = false } -sr-io = { path = "../../../core/sr-io", default-features = false } srml-support = { path = "../../../srml/support", default-features = false } srml-balances = { path = "../../../srml/balances", default-features = false } srml-consensus = { path = "../../../srml/consensus", default-features = false } @@ -38,9 +37,8 @@ std = [ "safe-mix/std", "parity-codec/std", "substrate-primitives/std", - "sr-api/std", + "substrate-client/std", "sr-std/std", - "sr-io/std", "srml-support/std", "srml-balances/std", "srml-consensus/std", diff --git a/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm b/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm index 2a48d20c98..766de4bda3 100644 Binary files a/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm and b/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm differ diff --git a/substrate/node/src/main.rs b/substrate/node/src/main.rs index bf5717042e..1f55cd7aab 100644 --- a/substrate/node/src/main.rs +++ b/substrate/node/src/main.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -//! Substrate CLI +//! Substrate Node CLI #![warn(missing_docs)] diff --git a/substrate/srml/README.adoc b/substrate/srml/README.adoc index 616c12568a..81b4f216e6 100644 --- a/substrate/srml/README.adoc +++ b/substrate/srml/README.adoc @@ -2,5 +2,3 @@ = Runtime Set of libs for the substrate runtime. - -TODO: Add READMEs to packages. diff --git a/substrate/srml/assets/Cargo.toml b/substrate/srml/assets/Cargo.toml index 58d84fb9bb..e695453c1e 100644 --- a/substrate/srml/assets/Cargo.toml +++ b/substrate/srml/assets/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } substrate-primitives = { path = "../../core/primitives", default-features = false } @@ -20,7 +19,6 @@ srml-system = { path = "../system", default-features = false } default = ["std"] std = [ "serde/std", - "serde_derive", "parity-codec/std", "parity-codec-derive/std", "substrate-primitives/std", diff --git a/substrate/srml/assets/src/lib.rs b/substrate/srml/assets/src/lib.rs index e266a00bdd..09f81cb843 100644 --- a/substrate/srml/assets/src/lib.rs +++ b/substrate/srml/assets/src/lib.rs @@ -30,13 +30,6 @@ extern crate sr_io as runtime_io; #[cfg(test)] extern crate substrate_primitives; -// Needed for deriving `Serialize` and `Deserialize` for various types. -// We only implement the serde traits for std builds - they're unneeded -// in the wasm runtime. -#[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; - // Needed for deriving `Encode` and `Decode` for `RawEvent`. #[macro_use] extern crate parity_codec_derive; diff --git a/substrate/srml/balances/Cargo.toml b/substrate/srml/balances/Cargo.toml index 769e801ca9..9f7fd249b0 100644 --- a/substrate/srml/balances/Cargo.toml +++ b/substrate/srml/balances/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } safe-mix = { version = "1.0", default-features = false} parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } @@ -22,7 +21,6 @@ srml-system = { path = "../system", default-features = false } default = ["std"] std = [ "serde/std", - "serde_derive", "safe-mix/std", "substrate-keyring", "parity-codec/std", diff --git a/substrate/srml/balances/src/address.rs b/substrate/srml/balances/src/address.rs index 2cd545d0d1..ccaa6b46a5 100644 --- a/substrate/srml/balances/src/address.rs +++ b/substrate/srml/balances/src/address.rs @@ -22,16 +22,14 @@ use super::{Member, Decode, Encode, As, Input, Output}; /// A vetted and verified extrinsic from the external world. #[derive(PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug, Hash))] +#[cfg_attr(feature = "std", derive(Debug, Hash))] pub enum Address where AccountId: Member, AccountIndex: Member, { /// It's an account ID (pubkey). - #[cfg_attr(feature = "std", serde(deserialize_with="AccountId::deserialize"))] Id(AccountId), /// It's an account index. - #[cfg_attr(feature = "std", serde(deserialize_with="AccountIndex::deserialize"))] Index(AccountIndex), } diff --git a/substrate/srml/balances/src/lib.rs b/substrate/srml/balances/src/lib.rs index 5b633a3d46..ba771662e4 100644 --- a/substrate/srml/balances/src/lib.rs +++ b/substrate/srml/balances/src/lib.rs @@ -14,14 +14,16 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -//! Balances: Handles balances. +//! Balances: Handles setting and retrieval of free balance, +//! retrieving total balance, reserve and unreserve balance, +//! repatriating a reserved balance to a beneficiary account that exists, +//! transfering a balance between accounts (when not reserved), +//! slashing an account balance, account removal, rewards, +//! lookup of an index to reclaim an account (when not balance not reserved), +//! increasing total stake. #![cfg_attr(not(feature = "std"), no_std)] -#[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; - #[macro_use] extern crate srml_support as runtime_support; @@ -106,7 +108,7 @@ impl EnsureAccountLiquid for () { pub trait Trait: system::Trait { /// The balance of an account. - type Balance: Parameter + SimpleArithmetic + Codec + Default + Copy + As + As + As; + type Balance: Parameter + Member + SimpleArithmetic + Codec + Default + Copy + As + As + As; /// Type used for storing an account's index; implies the maximum number of accounts the system /// can hold. type AccountIndex: Parameter + Member + Codec + Default + SimpleArithmetic + As + As + As + As + As + Copy; diff --git a/substrate/srml/balances/src/mock.rs b/substrate/srml/balances/src/mock.rs index d2e62cb83d..5fb6bb80dc 100644 --- a/substrate/srml/balances/src/mock.rs +++ b/substrate/srml/balances/src/mock.rs @@ -72,6 +72,7 @@ impl ExtBuilder { self.existential_deposit = existential_deposit; self } + #[allow(dead_code)] pub fn transfer_fee(mut self, transfer_fee: u64) -> Self { self.transfer_fee = transfer_fee; self diff --git a/substrate/srml/consensus/Cargo.toml b/substrate/srml/consensus/Cargo.toml index c7bbfe03f6..d099cb120f 100644 --- a/substrate/srml/consensus/Cargo.toml +++ b/substrate/srml/consensus/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } substrate-primitives = { path = "../../core/primitives", default-features = false } @@ -20,7 +19,6 @@ srml-system = { path = "../system", default-features = false } default = ["std"] std = [ "serde/std", - "serde_derive", "parity-codec/std", "substrate-primitives/std", "sr-std/std", diff --git a/substrate/srml/consensus/src/lib.rs b/substrate/srml/consensus/src/lib.rs index 0d2bd7f279..302d7a2b35 100644 --- a/substrate/srml/consensus/src/lib.rs +++ b/substrate/srml/consensus/src/lib.rs @@ -25,10 +25,6 @@ extern crate sr_std as rstd; #[macro_use] extern crate srml_support as runtime_support; -#[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; - extern crate parity_codec; #[macro_use] extern crate parity_codec_derive; diff --git a/substrate/srml/contract/Cargo.toml b/substrate/srml/contract/Cargo.toml index 51a0b172db..60da497f0e 100644 --- a/substrate/srml/contract/Cargo.toml +++ b/substrate/srml/contract/Cargo.toml @@ -5,7 +5,6 @@ authors = ["Parity Technologies "] [dependencies] serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } pwasm-utils = { version = "0.3", default-features = false } parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } @@ -26,7 +25,6 @@ assert_matches = "1.1" [features] default = ["std"] std = [ - "serde_derive", "serde/std", "parity-codec/std", "parity-codec-derive/std", diff --git a/substrate/srml/contract/COMPLEXITY.md b/substrate/srml/contract/README.md similarity index 90% rename from substrate/srml/contract/COMPLEXITY.md rename to substrate/srml/contract/README.md index f805eb45f0..5673758cc7 100644 --- a/substrate/srml/contract/COMPLEXITY.md +++ b/substrate/srml/contract/README.md @@ -1,3 +1,5 @@ +# Complexity + This analysis is on the computing and memory complexity of specific procedures. It provides a rough estimate of operations performed in general and especially focusing on DB reads and writes. It is also an attempt to estimate the memory consumption at its peak. The primary goal is to come up with decent pricing for functions that can be invoked by a user (via extrinsics) or by untrusted code that prevents DoS attacks. @@ -132,53 +134,48 @@ Consists of dropping (in the Rust sense) of the `AccountDb`. This function performs the following steps: 1. Querying source and destination balances from an overlay (see `get_balance`), -2. Querying fee for the case. (This hits DB unless pre-loaded) -2. Querying `existential_deposit`. (This hits DB unless pre-loaded) +2. Querying `existential_deposit`. 3. Executing `ensure_account_liquid` hook. 4. Updating source and destination balance in the overlay (see `set_balance`). **Note** that the complexity of executing `ensure_account_liquid` hook should be considered separately. -In the course of the execution this function can perform up to 4 DB reads: 2x `get_balance`, fee and `existential_deposit`. The last two can be pre-loaded pushing the cost of loading to a higher level and making it a one time. It can also induce up to 2 DB writes via `set_balance` if flushed to the storage. +In the course of the execution this function can perform up to 2 DB reads to `get_balance` of source and destination accounts. It can also induce up to 2 DB writes via `set_balance` if flushed to the storage. Moreover, if the source balance goes below `existential_deposit` then the account will be deleted along with all its storage which requires time proportional to the number of storage entries of that account. Assuming marshaled size of a balance value is of the constant size we can neglect its effect on the performance. -**complexity**: up to 4 DB reads and up to 2 DB writes (if flushed to the storage) in the standard case. If removal of the source account takes place then it will additionally perform a DB write per one storage entry that the account has. For the current `AccountDb` implementation computing complexity also depends on the depth of the `AccountDb` cascade. Memorywise it can be assumed to be constant. +**complexity**: up to 2 DB reads and up to 2 DB writes (if flushed to the storage) in the standard case. If removal of the source account takes place then it will additionally perform a DB write per one storage entry that the account has. For the current `AccountDb` implementation computing complexity also depends on the depth of the `AccountDb` cascade. Memorywise it can be assumed to be constant. ## Call This function receives input data for the contract execution. The execution consists of the following steps: -1. Querying `MaxDepth` and `call_base_fee`. (These hit DB unless pre-loaded) -2. Loading code from the DB. -3. `transfer`-ing funds between the caller and the destination account. -4. Executing the code of the destination account. -5. Committing overlayed changed to the underlying `AccountDb`. +1. Loading code from the DB. +2. `transfer`-ing funds between the caller and the destination account. +3. Executing the code of the destination account. +4. Committing overlayed changed to the underlying `AccountDb`. **Note** that the complexity of executing the contract code should be considered separately. -The execution of this function will involve 2 DB reads for querying `MaxDepth` and `MaxDepth` constants. These values can be pre-loaded pushing the cost of loading to a higher level and making it a one time. - Loading code most probably will trigger a DB read, since the code is immutable and therefore will not get into the cache (unless a suicide removes it). -Also, `transfer` can make up to 4 DB reads and up to 2 DB writes (if flushed to the storage) in the standard case. If removal of the source account takes place then it will additionally perform a DB write per one storage entry that the account has. +Also, `transfer` can make up to 2 DB reads and up to 2 DB writes (if flushed to the storage) in the standard case. If removal of the source account takes place then it will additionally perform a DB write per one storage entry that the account has. Finally, all changes are `commit`-ted into the underlying overlay. The complexity of this depends on the number of changes performed by the code. Thus, the pricing of storage modification should account for that. -**complexity**: Up to 7 DB reads. DB read of the code is of dynamic size. There can also be up to 2 DB writes (if flushed to the storage). Additionally, if the source account removal takes place a DB write will be performed per one storage entry that the account has. +**complexity**: Up to 3 DB reads. DB read of the code is of dynamic size. There can also be up to 2 DB writes (if flushed to the storage). Additionally, if the source account removal takes place a DB write will be performed per one storage entry that the account has. ## Create This function takes the code of the constructor and input data. Creation of a contract consists of the following steps: -1. Querying `MaxDepth` and `create_base_fee`. (These hit DB unless pre-loaded) -2. Calling `DetermineContractAddress` hook to determine an address for the contract, -3. `transfer`-ing funds between self and the newly created contract. -4. Executing the constructor code. This will yield the final code of the code. -5. Storing the code for the newly created contract in the overlay. -6. Committing overlayed changed to the underlying `AccountDb`. +1. Calling `DetermineContractAddress` hook to determine an address for the contract, +2. `transfer`-ing funds between self and the newly created contract. +3. Executing the constructor code. This will yield the final code of the code. +4. Storing the code for the newly created contract in the overlay. +5. Committing overlayed changed to the underlying `AccountDb`. **Note** that the complexity of executing the constructor code should be considered separately. @@ -186,15 +183,13 @@ This function takes the code of the constructor and input data. Creation of a co **Note** that the constructor returns code in the owned form and it's obtained via return facilities, which should have take fee for the return value. -The execution of this function involves 2 DB reads for querying `create_base_fee` and `MaxDepth` constants. These values can be pre-loaded pushing the cost of loading to a higher level and making it a one time. - -Also, `transfer` can make up to 4 DB reads and up to 2 DB writes (if flushed to the storage) in the standard case. If removal of the source account takes place then it will additionally perform a DB write per one storage entry that the account has. +Also, `transfer` can make up to 2 DB reads and up to 2 DB writes (if flushed to the storage) in the standard case. If removal of the source account takes place then it will additionally perform a DB write per one storage entry that the account has. Storing the code in the overlay may induce another DB write (if flushed to the storage) with the size proportional to the size of the constructor code. Finally, all changes are `commit`-ted into the underlying overlay. The complexity of this depends on the number of changes performed by the constructor code. Thus, the pricing of storage modification should account for that. -**complexity**: Up to 6 DB reads and induces up to 3 DB writes (if flushed to the storage), one of which is dependent on the size of the code. Additionally, if the source account removal takes place a DB write will be performed per one storage entry that the account has. +**complexity**: Up to 2 DB reads and induces up to 3 DB writes (if flushed to the storage), one of which is dependent on the size of the code. Additionally, if the source account removal takes place a DB write will be performed per one storage entry that the account has. # Externalities diff --git a/substrate/srml/contract/src/exec.rs b/substrate/srml/contract/src/exec.rs index cc74142947..f3cc2139bf 100644 --- a/substrate/srml/contract/src/exec.rs +++ b/substrate/srml/contract/src/exec.rs @@ -14,14 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -use super::{MaxDepth, ContractAddressFor, Module, Trait, Event, RawEvent}; +use super::{ContractAddressFor, Trait, Event, RawEvent, Config}; use account_db::{AccountDb, OverlayAccountDb}; use gas::GasMeter; use vm; use rstd::prelude::*; use runtime_primitives::traits::{Zero, CheckedAdd, CheckedSub}; -use runtime_support::StorageValue; use balances::{self, EnsureAccountLiquid}; // TODO: Add logs @@ -38,6 +37,7 @@ pub struct ExecutionContext<'a, T: Trait + 'a> { pub overlay: OverlayAccountDb<'a, T>, pub depth: usize, pub events: Vec>, + pub config: &'a Config, } impl<'a, T: Trait> ExecutionContext<'a, T> { @@ -51,12 +51,11 @@ impl<'a, T: Trait> ExecutionContext<'a, T> { data: &[u8], output_data: &mut Vec, ) -> Result { - if self.depth == >::get() as usize { + if self.depth == self.config.max_depth as usize { return Err("reached maximum depth, cannot make a call"); } - let call_base_fee = >::call_base_fee(); - if gas_meter.charge(call_base_fee).is_out_of_gas() { + if gas_meter.charge(self.config.call_base_fee).is_out_of_gas() { return Err("not enough gas to pay base call fee"); } @@ -70,6 +69,7 @@ impl<'a, T: Trait> ExecutionContext<'a, T> { self_account: dest.clone(), depth: self.depth + 1, events: Vec::new(), + config: self.config, }; if value > T::Balance::zero() { @@ -92,7 +92,7 @@ impl<'a, T: Trait> ExecutionContext<'a, T> { ctx: &mut nested, _caller: caller, }, - &::vm::Config::default(), + &self.config.schedule, gas_meter, ).map_err(|_| "vm execute returned error while call")?; } @@ -114,12 +114,11 @@ impl<'a, T: Trait> ExecutionContext<'a, T> { init_code: &[u8], data: &[u8], ) -> Result, &'static str> { - if self.depth == >::get() as usize { + if self.depth == self.config.max_depth as usize { return Err("reached maximum depth, cannot create"); } - let create_base_fee = >::create_base_fee(); - if gas_meter.charge(create_base_fee).is_out_of_gas() { + if gas_meter.charge(self.config.create_base_fee).is_out_of_gas() { return Err("not enough gas to pay base create fee"); } @@ -138,6 +137,7 @@ impl<'a, T: Trait> ExecutionContext<'a, T> { self_account: dest.clone(), depth: self.depth + 1, events: Vec::new(), + config: self.config, }; if endowment > T::Balance::zero() { @@ -160,7 +160,7 @@ impl<'a, T: Trait> ExecutionContext<'a, T> { ctx: &mut nested, _caller: caller, }, - &::vm::Config::default(), + &self.config.schedule, gas_meter, ).map_err(|_| "vm execute returned error while create")?; @@ -213,14 +213,15 @@ fn transfer<'a, T: Trait>( // `contract_create` will be `false` but `would_create` will be `true`. let would_create = to_balance.is_zero(); - let fee: T::Balance = if contract_create { - >::contract_fee() - } else { - if would_create { - >::creation_fee() - } else { - >::transfer_fee() - } + let fee: T::Balance = match (contract_create, would_create) { + // If this function is called from `CREATE` routine, then we always + // charge contract account creation fee. + (true, _) => ctx.config.contract_account_create_fee, + + // Otherwise the fee depends on whether we create a new account or transfer + // to an existing one. + (false, true) => ctx.config.account_create_fee, + (false, false) => ctx.config.transfer_fee, }; if gas_meter.charge_by_balance(fee).is_out_of_gas() { @@ -233,7 +234,7 @@ fn transfer<'a, T: Trait>( Some(b) => b, None => return Err("balance too low to send value"), }; - if would_create && value < >::existential_deposit() { + if would_create && value < ctx.config.existential_deposit { return Err("value too low to create account"); } ::EnsureAccountLiquid::ensure_account_liquid(transactor)?; diff --git a/substrate/srml/contract/src/lib.rs b/substrate/srml/contract/src/lib.rs index 5e3722bb04..e87c289ed8 100644 --- a/substrate/srml/contract/src/lib.rs +++ b/substrate/srml/contract/src/lib.rs @@ -52,10 +52,6 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; - #[macro_use] extern crate parity_codec_derive; @@ -172,11 +168,13 @@ decl_module! { // paying for the gas. let mut gas_meter = gas::buy_gas::(&origin, gas_limit)?; + let cfg = Config::preload(); let mut ctx = ExecutionContext { self_account: origin.clone(), depth: 0, overlay: OverlayAccountDb::::new(&account_db::DirectAccountDb), events: Vec::new(), + config: &cfg, }; let mut output_data = Vec::new(); @@ -225,11 +223,13 @@ decl_module! { // paying for the gas. let mut gas_meter = gas::buy_gas::(&origin, gas_limit)?; + let cfg = Config::preload(); let mut ctx = ExecutionContext { self_account: origin.clone(), depth: 0, overlay: OverlayAccountDb::::new(&account_db::DirectAccountDb), events: Vec::new(), + config: &cfg, }; let result = ctx.create(origin.clone(), endowment, &mut gas_meter, &ctor_code, &data); @@ -288,7 +288,8 @@ decl_storage! { BlockGasLimit get(block_gas_limit) config(): T::Gas = T::Gas::sa(1_000_000); /// Gas spent so far in this block. GasSpent get(gas_spent): T::Gas; - + /// Current cost schedule for contracts. + CurrentSchedule get(current_schedule) config(): Schedule = Schedule::default(); /// The code associated with an account. pub CodeOf: map T::AccountId => Vec; // TODO Vec values should be optimised to not do a length prefix. } @@ -314,3 +315,77 @@ impl balances::OnFreeBalanceZero for Module { >::remove_prefix(who.clone()); } } + +/// In-memory cache of configuration values. +/// +/// We assume that these values can't be changed in the +/// course of transaction execution. +pub struct Config { + pub schedule: Schedule, + pub existential_deposit: T::Balance, + pub max_depth: u32, + pub contract_account_create_fee: T::Balance, + pub account_create_fee: T::Balance, + pub transfer_fee: T::Balance, + pub call_base_fee: T::Gas, + pub create_base_fee: T::Gas, +} + +impl Config { + fn preload() -> Config { + Config { + schedule: >::current_schedule(), + existential_deposit: >::existential_deposit(), + max_depth: >::max_depth(), + contract_account_create_fee: >::contract_fee(), + account_create_fee: >::creation_fee(), + transfer_fee: >::transfer_fee(), + call_base_fee: >::call_base_fee(), + create_base_fee: >::create_base_fee(), + } + } +} + +/// Definition of the cost schedule and other parameterizations for wasm vm. +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] +#[derive(Clone, Encode, Decode)] +pub struct Schedule { + /// Gas cost of a growing memory by single page. + pub grow_mem_cost: Gas, + + /// Gas cost of a regular operation. + pub regular_op_cost: Gas, + + /// Gas cost per one byte returned. + pub return_data_per_byte_cost: Gas, + + /// Gas cost per one byte read from the sandbox memory. + sandbox_data_read_cost: Gas, + + /// Gas cost per one byte written to the sandbox memory. + sandbox_data_write_cost: Gas, + + /// How tall the stack is allowed to grow? + /// + /// See https://wiki.parity.io/WebAssembly-StackHeight to find out + /// how the stack frame cost is calculated. + pub max_stack_height: u32, + + //// What is the maximal memory pages amount is allowed to have for + /// a contract. + pub max_memory_pages: u32, +} + +impl> Default for Schedule { + fn default() -> Schedule { + Schedule { + grow_mem_cost: Gas::sa(1), + regular_op_cost: Gas::sa(1), + return_data_per_byte_cost: Gas::sa(1), + sandbox_data_read_cost: Gas::sa(1), + sandbox_data_write_cost: Gas::sa(1), + max_stack_height: 64 * 1024, + max_memory_pages: 16, + } + } +} diff --git a/substrate/srml/contract/src/tests.rs b/substrate/srml/contract/src/tests.rs index 8dca8ad03f..27d6e59a95 100644 --- a/substrate/srml/contract/src/tests.rs +++ b/substrate/srml/contract/src/tests.rs @@ -142,6 +142,7 @@ impl ExtBuilder { gas_price: self.gas_price, max_depth: 100, block_gas_limit: self.block_gas_limit, + current_schedule: Default::default(), }.build_storage() .unwrap().0, ); @@ -204,10 +205,10 @@ fn contract_transfer() { assert_eq!( Balances::free_balance(&0), // 3 - value sent with the transaction - // 2 * 10 - gas used by the contract (10) multiplied by gas price (2) + // 2 * 26 - gas used by the contract (26) multiplied by gas price (2) // 2 * 135 - base gas fee for call (by transaction) // 2 * 135 - base gas fee for call (by the contract) - 100_000_000 - 3 - (2 * 10) - (2 * 135) - (2 * 135), + 100_000_000 - 3 - (2 * 26) - (2 * 135) - (2 * 135), ); assert_eq!( Balances::free_balance(&1), @@ -261,10 +262,10 @@ fn contract_transfer_to_death() { assert_eq!( Balances::free_balance(&0), - // 2 * 10 - gas used by the contract (10) multiplied by gas price (2) + // 2 * 26 - gas used by the contract (26) multiplied by gas price (2) // 2 * 135 - base gas fee for call (by transaction) // 2 * 135 - base gas fee for call (by the contract) - 100_000_000 - (2 * 10) - (2 * 135) - (2 * 135), + 100_000_000 - (2 * 26) - (2 * 135) - (2 * 135), ); assert!(!>::exists(1)); @@ -295,11 +296,11 @@ fn contract_transfer_takes_creation_fee() { assert_eq!( Balances::free_balance(&0), // 3 - value sent with the transaction - // 2 * 10 - gas used by the contract (10) multiplied by gas price (2) + // 2 * 26 - gas used by the contract (26) multiplied by gas price (2) // 2 * 135 - base gas fee for call (by transaction) // 2 * 135 - base gas fee for call (by the contract) // 104 - (rounded) fee per creation (by the contract) - 100_000_000 - 3 - (2 * 10) - (2 * 135) - (2 * 135) - 104, + 100_000_000 - 3 - (2 * 26) - (2 * 135) - (2 * 135) - 104, ); assert_eq!( Balances::free_balance(&1), @@ -336,12 +337,12 @@ fn contract_transfer_takes_transfer_fee() { assert_eq!( Balances::free_balance(&0), // 3 - value sent with the transaction - // 2 * 10 - gas used by the contract (10) multiplied by gas price (2) + // 2 * 26 - gas used by the contract (26) multiplied by gas price (2) // 2 * 135 - base gas fee for call (by transaction) // 44 - (rounded from 45) fee per transfer (by transaction) // 2 * 135 - base gas fee for call (by the contract) // 44 - (rounded from 45) fee per transfer (by the contract) - 100_000_000 - 3 - (2 * 10) - (2 * 135) - 44 - (2 * 135) - 44, + 100_000_000 - 3 - (2 * 26) - (2 * 135) - 44 - (2 * 135) - 44, ); assert_eq!( Balances::free_balance(&1), @@ -412,10 +413,10 @@ fn contract_transfer_max_depth() { assert_eq!( Balances::free_balance(&0), // 3 - value sent with the transaction - // 2 * 10 * 100 - gas used by the contract (10) multiplied by gas price (2) + // 2 * 26 * 100 - gas used by the contract (26) multiplied by gas price (2) // multiplied by max depth (100). // 2 * 135 * 100 - base gas fee for call (by transaction) multiplied by max depth (100). - 100_000_000 - 3 - (2 * 10 * 100) - (2 * 135 * 100), + 100_000_000 - 3 - (2 * 26 * 100) - (2 * 135 * 100), ); assert_eq!(Balances::free_balance(&CONTRACT_SHOULD_TRANSFER_TO), 14); }); @@ -528,12 +529,12 @@ fn contract_create() { ); // 11 - value sent with the transaction - // 2 * 139 - gas spent by the deployer contract (139) multiplied by gas price (2) + // 2 * 362 - gas spent by the deployer contract (362) multiplied by gas price (2) // 2 * 135 - base gas fee for call (top level) // 2 * 175 - base gas fee for create (by contract) // ((21 / 2) * 2) - price per account creation let expected_gas_after_create = - 100_000_000 - 11 - (2 * 139) - (2 * 135) - (2 * 175) - ((21 / 2) * 2); + 100_000_000 - 11 - (2 * 362) - (2 * 135) - (2 * 175) - ((21 / 2) * 2); assert_eq!(Balances::free_balance(&0), expected_gas_after_create); assert_eq!(Balances::free_balance(&1), 8); assert_eq!(Balances::free_balance(&derived_address), 3); @@ -565,10 +566,10 @@ fn contract_create() { assert_eq!( Balances::free_balance(&0), // 22 - value sent with the transaction - // (2 * 10) - gas used by the contract + // (2 * 26) - gas used by the contract // (2 * 135) - base gas fee for call (top level) // (2 * 135) - base gas fee for call (by transfer contract) - expected_gas_after_create - 22 - (2 * 10) - (2 * 135) - (2 * 135), + expected_gas_after_create - 22 - (2 * 26) - (2 * 135) - (2 * 135), ); assert_eq!(Balances::free_balance(&derived_address), 22 - 3); assert_eq!(Balances::free_balance(&9), 36); diff --git a/substrate/srml/contract/src/vm/env_def/macros.rs b/substrate/srml/contract/src/vm/env_def/macros.rs index 16ba669daf..c751bd0c12 100644 --- a/substrate/srml/contract/src/vm/env_def/macros.rs +++ b/substrate/srml/contract/src/vm/env_def/macros.rs @@ -219,7 +219,7 @@ mod tests { #[test] fn macro_define_func() { define_func!( ext_gas (_ctx, amount: u32) => { - let amount = <<::T as Trait>::Gas as As>::sa(amount); + let amount = <::Gas as As>::sa(amount); if !amount.is_zero() { Ok(()) } else { @@ -269,7 +269,7 @@ mod tests { fn macro_define_env() { define_env!(init_env, , ext_gas( _ctx, amount: u32 ) => { - let amount = <<::T as Trait>::Gas as As>::sa(amount); + let amount = <::Gas as As>::sa(amount); if !amount.is_zero() { Ok(()) } else { diff --git a/substrate/srml/contract/src/vm/mod.rs b/substrate/srml/contract/src/vm/mod.rs index 83837740eb..dc59154266 100644 --- a/substrate/srml/contract/src/vm/mod.rs +++ b/substrate/srml/contract/src/vm/mod.rs @@ -20,8 +20,7 @@ use exec::CreateReceipt; use gas::GasMeter; use rstd::prelude::*; -use runtime_primitives::traits::As; -use Trait; +use {Trait, Schedule}; use {balances, sandbox, system}; type BalanceOf = ::Balance; @@ -118,7 +117,7 @@ pub fn execute<'a, E: Ext>( input_data: &[u8], output_data: &mut Vec, ext: &'a mut E, - config: &Config, + schedule: &Schedule<::Gas>, gas_meter: &mut GasMeter, ) -> Result<(), Error> { let env = runtime::init_env(); @@ -126,7 +125,7 @@ pub fn execute<'a, E: Ext>( let PreparedContract { instrumented_code, memory, - } = prepare_contract(code, &config, &env)?; + } = prepare_contract(code, &schedule, &env)?; let mut imports = sandbox::EnvironmentDefinitionBuilder::new(); for (func_name, ext_func) in &env.funcs { @@ -134,7 +133,7 @@ pub fn execute<'a, E: Ext>( } imports.add_memory("env", "memory", memory.clone()); - let mut runtime = Runtime::new(ext, input_data, output_data, &config, memory, gas_meter); + let mut runtime = Runtime::new(ext, input_data, output_data, &schedule, memory, gas_meter); // Instantiate the instance from the instrumented module code. match sandbox::Instance::new(&instrumented_code, &imports, &mut runtime) { @@ -152,41 +151,6 @@ pub fn execute<'a, E: Ext>( } } -// TODO: Extract it to the root of the crate -#[derive(Clone)] -pub struct Config { - /// Gas cost of a growing memory by single page. - grow_mem_cost: T::Gas, - - /// Gas cost of a regular operation. - regular_op_cost: T::Gas, - - /// Gas cost per one byte returned. - return_data_per_byte_cost: T::Gas, - - /// How tall the stack is allowed to grow? - /// - /// See https://wiki.parity.io/WebAssembly-StackHeight to find out - /// how the stack frame cost is calculated. - max_stack_height: u32, - - //// What is the maximal memory pages amount is allowed to have for - /// a contract. - max_memory_pages: u32, -} - -impl Default for Config { - fn default() -> Config { - Config { - grow_mem_cost: T::Gas::sa(1), - regular_op_cost: T::Gas::sa(1), - return_data_per_byte_cost: T::Gas::sa(1), - max_stack_height: 64 * 1024, - max_memory_pages: 16, - } - } -} - #[cfg(test)] mod tests { use super::*; @@ -310,7 +274,7 @@ mod tests { &[], &mut Vec::new(), &mut mock_ext, - &::vm::Config::default(), + &Schedule::::default(), &mut GasMeter::with_limit(50_000, 1), ).unwrap(); @@ -322,7 +286,7 @@ mod tests { data: vec![ 1, 2, 3, 4, ], - gas_left: 49990, + gas_left: 49970, }] ); } @@ -373,7 +337,7 @@ mod tests { &[], &mut Vec::new(), &mut mock_ext, - &::vm::Config::default(), + &Schedule::default(), &mut GasMeter::with_limit(50_000, 1), ).unwrap(); @@ -385,7 +349,7 @@ mod tests { data: vec![ 1, 2, 3, 4, ], - gas_left: 49990, + gas_left: 49970, }] ); } @@ -413,7 +377,7 @@ mod tests { &[], &mut Vec::new(), &mut mock_ext, - &::vm::Config::default(), + &Schedule::default(), &mut GasMeter::with_limit(100_000, 1) ), Err(_) @@ -467,7 +431,7 @@ mod tests { &[], &mut Vec::new(), &mut mock_ext, - &::vm::Config::default(), + &Schedule::default(), &mut GasMeter::with_limit(50_000, 1), ).unwrap(); @@ -560,7 +524,7 @@ mod tests { &[], &mut return_buf, &mut mock_ext, - &Config::default(), + &Schedule::default(), &mut GasMeter::with_limit(50_000, 1), ).unwrap(); diff --git a/substrate/srml/contract/src/vm/prepare.rs b/substrate/srml/contract/src/vm/prepare.rs index b79ce8336d..8ec056dfc7 100644 --- a/substrate/srml/contract/src/vm/prepare.rs +++ b/substrate/srml/contract/src/vm/prepare.rs @@ -18,30 +18,30 @@ //! wasm module before execution. use super::env_def::HostFunctionSet; -use super::{Config, Error, Ext}; +use super::{Error, Ext}; use rstd::prelude::*; use parity_wasm::elements::{self, External, MemoryType, Type}; use pwasm_utils; use pwasm_utils::rules; use runtime_primitives::traits::As; use sandbox; -use Trait; +use {Trait, Schedule}; -struct ContractModule<'a, T: Trait + 'a> { +struct ContractModule<'a, Gas: 'a> { // An `Option` is used here for loaning (`take()`-ing) the module. // Invariant: Can't be `None` (i.e. on enter and on exit from the function // the value *must* be `Some`). module: Option, - config: &'a Config, + schedule: &'a Schedule, } -impl<'a, T: Trait> ContractModule<'a, T> { - fn new(original_code: &[u8], config: &'a Config) -> Result, Error> { +impl<'a, Gas: 'a + As + Clone> ContractModule<'a, Gas> { + fn new(original_code: &[u8], schedule: &'a Schedule) -> Result, Error> { let module = elements::deserialize_buffer(original_code).map_err(|_| Error::Deserialization)?; Ok(ContractModule { module: Some(module), - config, + schedule, }) } @@ -65,8 +65,8 @@ impl<'a, T: Trait> ContractModule<'a, T> { } fn inject_gas_metering(&mut self) -> Result<(), Error> { - let gas_rules = rules::Set::new(self.config.regular_op_cost.as_(), Default::default()) - .with_grow_cost(self.config.grow_mem_cost.as_()) + let gas_rules = rules::Set::new(self.schedule.regular_op_cost.clone().as_(), Default::default()) + .with_grow_cost(self.schedule.grow_mem_cost.clone().as_()) .with_forbidden_floats(); let module = self @@ -88,7 +88,7 @@ impl<'a, T: Trait> ContractModule<'a, T> { .expect("On entry to the function `module` can't be `None`; qed"); let contract_module = - pwasm_utils::stack_height::inject_limiter(module, self.config.max_stack_height) + pwasm_utils::stack_height::inject_limiter(module, self.schedule.max_stack_height) .map_err(|_| Error::StackHeightInstrumentation)?; self.module = Some(contract_module); @@ -167,16 +167,16 @@ pub(super) struct PreparedContract { /// The checks are: /// /// - module doesn't define an internal memory instance, -/// - imported memory (if any) doesn't reserve more memory than permitted by the `config`, +/// - imported memory (if any) doesn't reserve more memory than permitted by the `schedule`, /// - all imported functions from the external environment matches defined by `env` module, /// /// The preprocessing includes injecting code for gas metering and metering the height of stack. pub(super) fn prepare_contract( original_code: &[u8], - config: &Config, + schedule: &Schedule<::Gas>, env: &HostFunctionSet, ) -> Result { - let mut contract_module = ContractModule::new(original_code, config)?; + let mut contract_module = ContractModule::new(original_code, schedule)?; contract_module.ensure_no_internal_memory()?; contract_module.inject_gas_metering()?; contract_module.inject_stack_height_metering()?; @@ -189,7 +189,7 @@ pub(super) fn prepare_contract( // Requested initial number of pages should not exceed the requested maximum. return Err(Error::Memory); } - (_, Some(maximum)) if maximum > config.max_memory_pages => { + (_, Some(maximum)) if maximum > schedule.max_memory_pages => { // Maximum number of pages should not exceed the configured maximum. return Err(Error::Memory); } @@ -218,7 +218,6 @@ pub(super) fn prepare_contract( mod tests { use super::*; use std::fmt; - use tests::Test; use vm::tests::MockExt; use wabt; @@ -230,9 +229,9 @@ mod tests { fn parse_and_prepare_wat(wat: &str) -> Result { let wasm = wabt::Wat2Wasm::new().validate(false).convert(wat).unwrap(); - let config = Config::::default(); + let schedule = Schedule::::default(); let env = ::vm::runtime::init_env(); - prepare_contract::(wasm.as_ref(), &config, &env) + prepare_contract::(wasm.as_ref(), &schedule, &env) } #[test] @@ -244,7 +243,7 @@ mod tests { #[test] fn memory() { // This test assumes that maximum page number is configured to a certain number. - assert_eq!(Config::::default().max_memory_pages, 16); + assert_eq!(Schedule::::default().max_memory_pages, 16); let r = parse_and_prepare_wat(r#"(module (import "env" "memory" (memory 1 1)))"#); assert_matches!(r, Ok(_)); diff --git a/substrate/srml/contract/src/vm/runtime.rs b/substrate/srml/contract/src/vm/runtime.rs index 5d419ffab7..c56953fcdb 100644 --- a/substrate/srml/contract/src/vm/runtime.rs +++ b/substrate/srml/contract/src/vm/runtime.rs @@ -16,7 +16,7 @@ //! Environment definition of the wasm smart-contract runtime. -use super::{BalanceOf, Config, CreateReceipt, Error, Ext}; +use super::{BalanceOf, Schedule, CreateReceipt, Error, Ext}; use rstd::prelude::*; use codec::{Decode, Encode}; use gas::{GasMeter, GasMeterResult}; @@ -25,6 +25,8 @@ use sandbox; use system; use Trait; +type GasOf = <::T as Trait>::Gas; + /// Enumerates all possible *special* trap conditions. /// /// In this runtime traps used not only for signaling about errors but also @@ -39,7 +41,7 @@ pub(crate) struct Runtime<'a, 'data, E: Ext + 'a> { input_data: &'data [u8], output_data: &'data mut Vec, scratch_buf: Vec, - config: &'a Config, + schedule: &'a Schedule<::Gas>, memory: sandbox::Memory, gas_meter: &'a mut GasMeter, special_trap: Option, @@ -49,7 +51,7 @@ impl<'a, 'data, E: Ext + 'a> Runtime<'a, 'data, E> { ext: &'a mut E, input_data: &'data [u8], output_data: &'data mut Vec, - config: &'a Config, + schedule: &'a Schedule<::Gas>, memory: sandbox::Memory, gas_meter: &'a mut GasMeter, ) -> Self { @@ -58,7 +60,7 @@ impl<'a, 'data, E: Ext + 'a> Runtime<'a, 'data, E> { input_data, output_data, scratch_buf: Vec::new(), - config, + schedule, memory, gas_meter, special_trap: None, @@ -89,6 +91,70 @@ pub(crate) fn to_execution_result( } } +/// Charge the specified amount of gas. +/// +/// Returns `Err` if there is not enough gas. +fn charge_gas( + gas_meter: &mut GasMeter, + amount: T::Gas, +) -> Result<(), sandbox::HostError> { + match gas_meter.charge(amount) { + GasMeterResult::Proceed => Ok(()), + GasMeterResult::OutOfGas => Err(sandbox::HostError), + } +} + +/// Read designated chunk from the sandbox memory, consuming an appropriate amount of +/// gas. +/// +/// Returns `Err` if one of the following conditions occurs: +/// +/// - calculating the gas cost resulted in overflow. +/// - out of gas +/// - requested buffer is not within the bounds of the sandbox memory. +fn read_sandbox_memory( + ctx: &mut Runtime, + ptr: u32, + len: u32, +) -> Result, sandbox::HostError> { + let price = (ctx.schedule.sandbox_data_read_cost) + .checked_mul(& as As>::sa(len)) + .ok_or(sandbox::HostError)?; + charge_gas(ctx.gas_meter, price)?; + + let mut buf = Vec::new(); + buf.resize(len as usize, 0); + + ctx.memory().get(ptr, &mut buf)?; + + Ok(buf) +} + +/// Write the given buffer to the designated location in the sandbox memory, consuming +/// an appropriate amount of gas. +/// +/// Returns `Err` if one of the following conditions occurs: +/// +/// - calculating the gas cost resulted in overflow. +/// - out of gas +/// - designated area is not within the bounds of the sandbox memory. +fn write_sandbox_memory( + per_byte_cost: T::Gas, + gas_meter: &mut GasMeter, + memory: &sandbox::Memory, + ptr: u32, + buf: &[u8], +) -> Result<(), sandbox::HostError> { + let price = per_byte_cost + .checked_mul(&>::sa(buf.len() as u32)) + .ok_or(sandbox::HostError)?; + charge_gas(gas_meter, price)?; + + memory.set(ptr, buf)?; + + Ok(()) +} + // *********************************************************** // * AFTER MAKING A CHANGE MAKE SURE TO UPDATE COMPLEXITY.MD * // *********************************************************** @@ -103,17 +169,15 @@ define_env!(init_env, , // // - amount: How much gas is used. gas(ctx, amount: u32) => { - let amount = <<::T as Trait>::Gas as As>::sa(amount); + let amount = <::Gas as As>::sa(amount); + charge_gas(&mut ctx.gas_meter, amount)?; - match ctx.gas_meter.charge(amount) { - GasMeterResult::Proceed => Ok(()), - GasMeterResult::OutOfGas => Err(sandbox::HostError), - } + Ok(()) }, - // Change the value at the given location in storage or remove it. + // Change the value at the given key in the storage or remove the entry. // - // - location_ptr: pointer into the linear + // - key_ptr: pointer into the linear // memory where the location of the requested value is placed. // - value_non_null: if set to 0, then the entry // at the given location will be removed. @@ -121,17 +185,13 @@ define_env!(init_env, , // where the value to set is placed. If `value_non_null` is set to 0, then this parameter is ignored. // - value_len: the length of the value. If `value_non_null` is set to 0, then this parameter is ignored. ext_set_storage(ctx, key_ptr: u32, value_non_null: u32, value_ptr: u32, value_len: u32) => { - let mut key = [0; 32]; - ctx.memory().get(key_ptr, &mut key)?; - - let value = if value_non_null != 0 { - let mut value_buf = Vec::new(); - value_buf.resize(value_len as usize, 0); - ctx.memory().get(value_ptr, &mut value_buf)?; - Some(value_buf) - } else { - None - }; + let key = read_sandbox_memory(ctx, key_ptr, 32)?; + let value = + if value_non_null != 0 { + Some(read_sandbox_memory(ctx, value_ptr, value_len)?) + } else { + None + }; ctx.ext.set_storage(&key, value); Ok(()) @@ -144,9 +204,7 @@ define_env!(init_env, , // - key_ptr: pointer into the linear memory where the key // of the requested value is placed. ext_get_storage(ctx, key_ptr: u32) -> u32 => { - let mut key = [0; 32]; - ctx.memory().get(key_ptr, &mut key)?; - + let key = read_sandbox_memory(ctx, key_ptr, 32)?; if let Some(value) = ctx.ext.get_storage(&key) { ctx.scratch_buf = value; Ok(0) @@ -181,22 +239,17 @@ define_env!(init_env, , input_data_ptr: u32, input_data_len: u32 ) -> u32 => { - let mut callee = Vec::new(); - callee.resize(callee_len as usize, 0); - ctx.memory().get(callee_ptr, &mut callee)?; - let callee = - <::T as system::Trait>::AccountId::decode(&mut &callee[..]) - .ok_or_else(|| sandbox::HostError)?; - - let mut value_buf = Vec::new(); - value_buf.resize(value_len as usize, 0); - ctx.memory().get(value_ptr, &mut value_buf)?; - let value = BalanceOf::<::T>::decode(&mut &value_buf[..]) - .ok_or_else(|| sandbox::HostError)?; - - let mut input_data = Vec::new(); - input_data.resize(input_data_len as usize, 0u8); - ctx.memory().get(input_data_ptr, &mut input_data)?; + let callee = { + let callee_buf = read_sandbox_memory(ctx, callee_ptr, callee_len)?; + <::T as system::Trait>::AccountId::decode(&mut &callee_buf[..]) + .ok_or_else(|| sandbox::HostError)? + }; + let value = { + let value_buf = read_sandbox_memory(ctx, value_ptr, value_len)?; + BalanceOf::<::T>::decode(&mut &value_buf[..]) + .ok_or_else(|| sandbox::HostError)? + }; + let input_data = read_sandbox_memory(ctx, input_data_ptr, input_data_len)?; // Clear the scratch buffer in any case. ctx.scratch_buf.clear(); @@ -204,7 +257,7 @@ define_env!(init_env, , let nested_gas_limit = if gas == 0 { ctx.gas_meter.gas_left() } else { - <<::T as Trait>::Gas as As>::sa(gas) + <::Gas as As>::sa(gas) }; let ext = &mut ctx.ext; let scratch_buf = &mut ctx.scratch_buf; @@ -249,19 +302,13 @@ define_env!(init_env, , input_data_ptr: u32, input_data_len: u32 ) -> u32 => { - let mut value_buf = Vec::new(); - value_buf.resize(value_len as usize, 0); - ctx.memory().get(value_ptr, &mut value_buf)?; - let value = BalanceOf::<::T>::decode(&mut &value_buf[..]) - .ok_or_else(|| sandbox::HostError)?; - - let mut init_code = Vec::new(); - init_code.resize(init_code_len as usize, 0u8); - ctx.memory().get(init_code_ptr, &mut init_code)?; - - let mut input_data = Vec::new(); - input_data.resize(input_data_len as usize, 0u8); - ctx.memory().get(input_data_ptr, &mut input_data)?; + let init_code = read_sandbox_memory(ctx, init_code_ptr, init_code_len)?; + let value = { + let value_buf = read_sandbox_memory(ctx, value_ptr, value_len)?; + BalanceOf::<::T>::decode(&mut &value_buf[..]) + .ok_or_else(|| sandbox::HostError)? + }; + let input_data = read_sandbox_memory(ctx, input_data_ptr, input_data_len)?; // Clear the scratch buffer in any case. ctx.scratch_buf.clear(); @@ -269,7 +316,7 @@ define_env!(init_env, , let nested_gas_limit = if gas == 0 { ctx.gas_meter.gas_left() } else { - <<::T as Trait>::Gas as As>::sa(gas) + <::Gas as As>::sa(gas) }; let ext = &mut ctx.ext; let create_outcome = ctx.gas_meter.with_nested(nested_gas_limit, |nested_meter| { @@ -289,12 +336,13 @@ define_env!(init_env, , } }, - // Save a data buffer as a result of the execution. + // Save a data buffer as a result of the execution, terminate the execution and return a + // successful result to the caller. ext_return(ctx, data_ptr: u32, data_len: u32) => { - let data_len_in_gas = <<::T as Trait>::Gas as As>::sa(data_len as u64); - let price = (ctx.config.return_data_per_byte_cost) + let data_len_in_gas = <::Gas as As>::sa(data_len as u64); + let price = (ctx.schedule.return_data_per_byte_cost) .checked_mul(&data_len_in_gas) - .ok_or_else(|| sandbox::HostError)?; + .ok_or(sandbox::HostError)?; match ctx.gas_meter.charge(price) { GasMeterResult::Proceed => (), @@ -332,7 +380,14 @@ define_env!(init_env, , return Err(sandbox::HostError); } - ctx.memory().set(dest_ptr, src)?; + // Finally, perform the write. + write_sandbox_memory( + ctx.schedule.sandbox_data_write_cost, + ctx.gas_meter, + &ctx.memory, + dest_ptr, + src, + )?; Ok(()) }, @@ -357,7 +412,14 @@ define_env!(init_env, , return Err(sandbox::HostError); } - ctx.memory().set(dest_ptr, src)?; + // Finally, perform the write. + write_sandbox_memory( + ctx.schedule.sandbox_data_write_cost, + ctx.gas_meter, + &ctx.memory, + dest_ptr, + src, + )?; Ok(()) }, diff --git a/substrate/srml/council/Cargo.toml b/substrate/srml/council/Cargo.toml index 39cd73e96c..e2bad6b3c8 100644 --- a/substrate/srml/council/Cargo.toml +++ b/substrate/srml/council/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } safe-mix = { version = "1.0", default-features = false} parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } @@ -23,7 +22,6 @@ srml-system = { path = "../system", default-features = false } default = ["std"] std = [ "serde/std", - "serde_derive", "safe-mix/std", "parity-codec/std", "parity-codec-derive/std", diff --git a/substrate/srml/council/src/lib.rs b/substrate/srml/council/src/lib.rs index 412de7d2b2..26d88c6c7b 100644 --- a/substrate/srml/council/src/lib.rs +++ b/substrate/srml/council/src/lib.rs @@ -21,10 +21,6 @@ #[cfg(feature = "std")] extern crate serde; -#[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; - #[cfg(test)] #[macro_use] extern crate hex_literal; diff --git a/substrate/srml/council/src/motions.rs b/substrate/srml/council/src/motions.rs index 2b3850369b..69af4a563e 100644 --- a/substrate/srml/council/src/motions.rs +++ b/substrate/srml/council/src/motions.rs @@ -20,7 +20,7 @@ use rstd::prelude::*; use rstd::result; use codec::Compact; use substrate_primitives::u32_trait::Value as U32; -use primitives::traits::{Hash, EnsureOrigin, MaybeSerializeDebug}; +use primitives::traits::{Hash, EnsureOrigin}; use srml_support::dispatch::{Result, Dispatchable, Parameter}; use srml_support::{StorageValue, StorageMap}; use super::{Trait as CouncilTrait, Module as Council}; @@ -29,12 +29,12 @@ use system::{self, ensure_signed}; /// Simple index type for proposal counting. pub type ProposalIndex = u32; -pub trait Trait: CouncilTrait + MaybeSerializeDebug { +pub trait Trait: CouncilTrait { /// The outer origin type. type Origin: From; /// The outer call dispatch type. - type Proposal: Parameter + Dispatchable::Origin> + MaybeSerializeDebug; + type Proposal: Parameter + Dispatchable::Origin>; /// The outer event type. type Event: From> + Into<::Event>; @@ -66,7 +66,6 @@ decl_event!( ); decl_module! { - #[cfg_attr(feature = "std", serde(bound(deserialize = "::Proposal: ::serde::de::DeserializeOwned")))] pub struct Module for enum Call where origin: ::Origin { fn deposit_event() = default; fn propose(origin, threshold: Compact, proposal: Box<::Proposal>) -> Result { diff --git a/substrate/srml/democracy/Cargo.toml b/substrate/srml/democracy/Cargo.toml index c037a4b219..ea8b63920f 100644 --- a/substrate/srml/democracy/Cargo.toml +++ b/substrate/srml/democracy/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } safe-mix = { version = "1.0", default-features = false} parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } @@ -22,7 +21,6 @@ srml-system = { path = "../system", default-features = false } default = ["std"] std = [ "serde/std", - "serde_derive", "safe-mix/std", "parity-codec/std", "substrate-primitives/std", diff --git a/substrate/srml/democracy/src/lib.rs b/substrate/srml/democracy/src/lib.rs index 34aad5856c..0c589d5893 100644 --- a/substrate/srml/democracy/src/lib.rs +++ b/substrate/srml/democracy/src/lib.rs @@ -21,10 +21,6 @@ #[cfg(test)] extern crate substrate_primitives; -#[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; - #[macro_use] extern crate parity_codec_derive; #[cfg_attr(not(feature = "std"), macro_use)] @@ -41,7 +37,7 @@ extern crate srml_system as system; use rstd::prelude::*; use rstd::result; use codec::{HasCompact, Compact}; -use primitives::traits::{Zero, As, MaybeSerializeDebug}; +use primitives::traits::{Zero, As}; use srml_support::{StorageValue, StorageMap, Parameter, Dispatchable, IsSubType}; use srml_support::dispatch::Result; use system::ensure_signed; @@ -55,7 +51,7 @@ pub type PropIndex = u32; pub type ReferendumIndex = u32; pub trait Trait: balances::Trait + Sized { - type Proposal: Parameter + Dispatchable + IsSubType> + MaybeSerializeDebug; + type Proposal: Parameter + Dispatchable + IsSubType>; type Event: From> + Into<::Event>; } diff --git a/substrate/srml/example/Cargo.toml b/substrate/srml/example/Cargo.toml index 34d8d058d1..8fe76d9bf0 100644 --- a/substrate/srml/example/Cargo.toml +++ b/substrate/srml/example/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } substrate-primitives = { path = "../../core/primitives", default-features = false } @@ -21,7 +20,6 @@ srml-balances = { path = "../balances", default-features = false } default = ["std"] std = [ "serde/std", - "serde_derive", "parity-codec/std", "parity-codec-derive/std", "sr-std/std", diff --git a/substrate/srml/example/src/lib.rs b/substrate/srml/example/src/lib.rs index 4c2708e953..8dcbb7094b 100644 --- a/substrate/srml/example/src/lib.rs +++ b/substrate/srml/example/src/lib.rs @@ -34,13 +34,6 @@ extern crate substrate_primitives; // Needed for various traits. In our case, `OnFinalise`. extern crate sr_primitives; -// Needed for deriving `Serialize` and `Deserialize` for various types. -// We only implement the serde traits for std builds - they're unneeded -// in the wasm runtime. -#[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; - // Needed for deriving `Encode` and `Decode` for `RawEvent`. #[macro_use] extern crate parity_codec_derive; diff --git a/substrate/srml/executive/Cargo.toml b/substrate/srml/executive/Cargo.toml index 33cd0432e0..ee956e9399 100644 --- a/substrate/srml/executive/Cargo.toml +++ b/substrate/srml/executive/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } sr-std = { path = "../../core/sr-std", default-features = false } @@ -25,7 +24,6 @@ std = [ "sr-std/std", "srml-support/std", "serde/std", - "serde_derive", "parity-codec/std", "parity-codec-derive/std", "sr-primitives/std", diff --git a/substrate/srml/executive/src/lib.rs b/substrate/srml/executive/src/lib.rs index ea83267c91..005b8508db 100644 --- a/substrate/srml/executive/src/lib.rs +++ b/substrate/srml/executive/src/lib.rs @@ -18,10 +18,6 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[cfg(test)] -#[macro_use] -extern crate serde_derive; - #[cfg(test)] #[macro_use] extern crate parity_codec_derive; @@ -295,7 +291,7 @@ mod tests { } // Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. - #[derive(Clone, Eq, PartialEq, Debug, Serialize, Deserialize)] + #[derive(Clone, Eq, PartialEq)] pub struct Runtime; impl system::Trait for Runtime { type Origin = Origin; diff --git a/substrate/srml/metadata/Cargo.toml b/substrate/srml/metadata/Cargo.toml index 2e113ab6f0..d442a5e225 100644 --- a/substrate/srml/metadata/Cargo.toml +++ b/substrate/srml/metadata/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "substrate-metadata" +name = "srml-metadata" version = "0.1.0" authors = ["Parity Technologies "] @@ -8,12 +8,16 @@ parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } serde = { version = "1.0", optional = true } serde_derive = { version = "1.0", optional = true } +sr-std = { path = "../../core/sr-std", default-features = false } +substrate-primitives = { path = "../../core/primitives", default-features = false } [features] default = ["std"] std = [ "parity-codec/std", "parity-codec-derive/std", + "sr-std/std", + "substrate-primitives/std", "serde", "serde_derive" ] diff --git a/substrate/srml/metadata/README.adoc b/substrate/srml/metadata/README.adoc deleted file mode 100644 index 8f4939087e..0000000000 --- a/substrate/srml/metadata/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= Substrate BFT - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- diff --git a/substrate/srml/metadata/src/lib.rs b/substrate/srml/metadata/src/lib.rs index ea722a705e..0809531a9f 100644 --- a/substrate/srml/metadata/src/lib.rs +++ b/substrate/srml/metadata/src/lib.rs @@ -21,14 +21,12 @@ //! codec-encoded metadata. #![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(not(feature = "std"), feature(alloc))] - -#[cfg(not(feature = "std"))] -extern crate alloc; #[macro_use] extern crate parity_codec_derive; extern crate parity_codec as codec; +extern crate sr_std as rstd; +extern crate substrate_primitives as primitives; #[cfg(feature = "std")] extern crate serde; @@ -36,17 +34,10 @@ extern crate serde; #[macro_use] extern crate serde_derive; -#[cfg(feature = "std")] -pub mod alloc { - pub use std::vec; -} - use codec::{Encode, Output}; #[cfg(feature = "std")] use codec::{Decode, Input}; - -// Make Vec available on `std` and `no_std` -use alloc::vec::Vec; +use rstd::vec::Vec; #[cfg(feature = "std")] type StringBuf = String; @@ -294,3 +285,9 @@ pub struct RuntimeMetadata { pub modules: DecodeDifferentArray, pub outer_dispatch: OuterDispatchMetadata, } + +impl Into for RuntimeMetadata { + fn into(self) -> primitives::OpaqueMetadata { + primitives::OpaqueMetadata::new(self.encode()) + } +} diff --git a/substrate/srml/session/Cargo.toml b/substrate/srml/session/Cargo.toml index c006eff0a4..ad798edbdb 100644 --- a/substrate/srml/session/Cargo.toml +++ b/substrate/srml/session/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } safe-mix = { version = "1.0", default-features = false} substrate-primitives = { path = "../../core/primitives", default-features = false } parity-codec = { version = "2.1", default-features = false } @@ -23,7 +22,6 @@ srml-timestamp = { path = "../timestamp", default-features = false } default = ["std"] std = [ "serde/std", - "serde_derive", "safe-mix/std", "parity-codec/std", "parity-codec-derive/std", diff --git a/substrate/srml/session/src/lib.rs b/substrate/srml/session/src/lib.rs index df3afa9aa1..99bf182cf8 100644 --- a/substrate/srml/session/src/lib.rs +++ b/substrate/srml/session/src/lib.rs @@ -19,10 +19,6 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; - extern crate sr_std as rstd; #[macro_use] diff --git a/substrate/srml/staking/Cargo.toml b/substrate/srml/staking/Cargo.toml index 7a1f4ef4eb..4d35592144 100644 --- a/substrate/srml/staking/Cargo.toml +++ b/substrate/srml/staking/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } safe-mix = { version = "1.0", default-features = false} parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } @@ -26,7 +25,6 @@ srml-timestamp = { path = "../timestamp", default-features = false } default = ["std"] std = [ "serde/std", - "serde_derive", "safe-mix/std", "substrate-keyring", "parity-codec/std", diff --git a/substrate/srml/staking/src/lib.rs b/substrate/srml/staking/src/lib.rs index 680da340c5..cd21fe05ad 100644 --- a/substrate/srml/staking/src/lib.rs +++ b/substrate/srml/staking/src/lib.rs @@ -23,10 +23,6 @@ #[cfg(feature = "std")] extern crate serde; -#[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; - #[macro_use] extern crate srml_support as runtime_support; @@ -75,7 +71,7 @@ pub enum LockStatus { /// Preference of what happens on a slash event. #[derive(PartialEq, Eq, Clone, Encode, Decode)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] +#[cfg_attr(feature = "std", derive(Debug))] pub struct ValidatorPrefs { // TODO: @bkchr shouldn't need this Copy but derive(Encode) breaks otherwise /// Validator should ensure this many more slashes than is necessary before being unstaked. #[codec(compact)] @@ -103,7 +99,6 @@ pub trait Trait: balances::Trait + session::Trait { } decl_module! { - #[cfg_attr(feature = "std", serde(bound(deserialize = "T::Balance: ::serde::de::DeserializeOwned")))] pub struct Module for enum Call where origin: T::Origin { fn deposit_event() = default; diff --git a/substrate/srml/support/Cargo.toml b/substrate/srml/support/Cargo.toml index f1254a538d..a2370010d8 100644 --- a/substrate/srml/support/Cargo.toml +++ b/substrate/srml/support/Cargo.toml @@ -8,7 +8,7 @@ hex-literal = { version = "0.1.0", optional = true } serde = { version = "1.0", default-features = false } serde_derive = { version = "1.0", optional = true } parity-codec = { version = "2.1", default-features = false } -substrate-metadata = { path = "../metadata", default-features = false } +srml-metadata = { path = "../metadata", default-features = false } sr-std = { path = "../../core/sr-std", default-features = false } sr-io = { path = "../../core/sr-io", default-features = false } sr-primitives = { path = "../../core/sr-primitives", default-features = false } @@ -28,7 +28,7 @@ std = [ "parity-codec/std", "sr-std/std", "sr-primitives/std", - "substrate-metadata/std", + "srml-metadata/std", ] nightly = [] strict = [] diff --git a/substrate/srml/support/README.adoc b/substrate/srml/support/README.adoc deleted file mode 100644 index 699235e5ae..0000000000 --- a/substrate/srml/support/README.adoc +++ /dev/null @@ -1,14 +0,0 @@ - -= Runtime Support - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- - diff --git a/substrate/srml/support/src/dispatch.rs b/substrate/srml/support/src/dispatch.rs index dd52e35b3c..cfcb3ae972 100644 --- a/substrate/srml/support/src/dispatch.rs +++ b/substrate/srml/support/src/dispatch.rs @@ -20,10 +20,8 @@ pub use rstd::prelude::{Vec, Clone, Eq, PartialEq}; #[cfg(feature = "std")] pub use std::fmt; pub use rstd::result; -#[cfg(feature = "std")] -use serde; pub use codec::{Codec, Decode, Encode, Input, Output}; -pub use substrate_metadata::{ +pub use srml_metadata::{ ModuleMetadata, FunctionMetadata, DecodeDifferent, CallMetadata, FunctionArgumentMetadata, OuterDispatchMetadata, OuterDispatchCall }; @@ -36,11 +34,6 @@ pub trait Dispatchable { fn dispatch(self, origin: Self::Origin) -> Result; } -#[cfg(feature = "std")] -pub trait Callable { - type Call: Dispatchable + Codec + ::serde::Serialize + Clone + PartialEq + Eq; -} -#[cfg(not(feature = "std"))] pub trait Callable { type Call: Dispatchable + Codec + Clone + PartialEq + Eq; } @@ -50,10 +43,10 @@ pub trait Callable { pub type CallableCallFor = ::Call; #[cfg(feature = "std")] -pub trait Parameter: Codec + serde::Serialize + Clone + Eq + fmt::Debug {} +pub trait Parameter: Codec + Clone + Eq + fmt::Debug {} #[cfg(feature = "std")] -impl Parameter for T where T: Codec + serde::Serialize + Clone + Eq + fmt::Debug {} +impl Parameter for T where T: Codec + Clone + Eq + fmt::Debug {} #[cfg(not(feature = "std"))] pub trait Parameter: Codec + Clone + Eq {} @@ -188,6 +181,36 @@ macro_rules! decl_module { $($rest)* ); }; + (@normalize + $(#[$attr:meta])* + pub struct $mod_type:ident<$trait_instance:ident: $trait_name:ident> + for enum $call_type:ident where origin: $origin_type:ty, system = $system:ident + { $( $deposit_event:tt )* } + { $( $on_finalise:tt )* } + [ $($t:tt)* ] + $(#[doc = $doc_attr:tt])* + $fn_vis:vis fn $fn_name:ident($origin:ident : T::Origin $(, $param_name:ident : $param:ty)* ) -> $result:ty { $( $impl:tt )* } + $($rest:tt)* + ) => { + compile_error!("\ +first parameter of dispatch should be marked `origin` only, with no type specified (a bit like `self`)\n\ +(For root-matching dispatches, ensure the first parameter does not use the `T::Origin` type.)") + }; + (@normalize + $(#[$attr:meta])* + pub struct $mod_type:ident<$trait_instance:ident: $trait_name:ident> + for enum $call_type:ident where origin: $origin_type:ty, system = $system:ident + { $( $deposit_event:tt )* } + { $( $on_finalise:tt )* } + [ $($t:tt)* ] + $(#[doc = $doc_attr:tt])* + $fn_vis:vis fn $fn_name:ident(origin : $origin:ty $(, $param_name:ident : $param:ty)* ) -> $result:ty { $( $impl:tt )* } + $($rest:tt)* + ) => { + compile_error!("\ +first parameter of dispatch should be marked `origin` only, with no type specified (a bit like `self`)\n\ +(For root-matching dispatches, ensure the first parameter is not named`origin`.)") + }; (@normalize $(#[$attr:meta])* pub struct $mod_type:ident<$trait_instance:ident: $trait_name:ident> @@ -351,7 +374,7 @@ macro_rules! decl_module { ) => { // Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. #[derive(Clone, Copy, PartialEq, Eq)] - #[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] + #[cfg_attr(feature = "std", derive(Debug))] // TODO: switching based on std feature is because of an issue in // serde-derive for when we attempt to derive `Deserialize` on these types, // in a situation where we've imported `srml_support` as another name. @@ -360,7 +383,7 @@ macro_rules! decl_module { // Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. #[derive(Clone, Copy, PartialEq, Eq)] - #[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] + #[cfg_attr(feature = "std", derive(Debug))] #[cfg(not(feature = "std"))] pub struct $mod_type<$trait_instance: $trait_name>(::core::marker::PhantomData<$trait_instance>); @@ -389,7 +412,6 @@ macro_rules! decl_module { #[cfg(feature = "std")] $(#[$attr])* - #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub enum $call_type<$trait_instance: $trait_name> { __PhantomItem(::std::marker::PhantomData<$trait_instance>), __OtherPhantomItem(::std::marker::PhantomData<$trait_instance>), @@ -401,7 +423,6 @@ macro_rules! decl_module { #[cfg(not(feature = "std"))] $(#[$attr])* - #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub enum $call_type<$trait_instance: $trait_name> { __PhantomItem(::core::marker::PhantomData<$trait_instance>), __OtherPhantomItem(::core::marker::PhantomData<$trait_instance>), @@ -610,7 +631,7 @@ macro_rules! impl_outer_dispatch { ) => { $(#[$attr])* #[derive(Clone, PartialEq, Eq)] - #[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] + #[cfg_attr(feature = "std", derive(Debug))] pub enum $call_type { $( $camelcase ( $crate::dispatch::CallableCallFor<$camelcase> ) diff --git a/substrate/srml/support/src/event.rs b/substrate/srml/support/src/event.rs index ae7ddea412..ddc6b7d64f 100644 --- a/substrate/srml/support/src/event.rs +++ b/substrate/srml/support/src/event.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -pub use substrate_metadata::{EventMetadata, DecodeDifferent, OuterEventMetadata, FnEncode}; +pub use srml_metadata::{EventMetadata, DecodeDifferent, OuterEventMetadata, FnEncode}; /// Implement the `Event` for a module. /// @@ -115,7 +115,7 @@ macro_rules! decl_event { ) => { // Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. #[derive(Clone, PartialEq, Eq, Encode, Decode)] - #[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] + #[cfg_attr(feature = "std", derive(Debug))] $(#[$attr])* pub enum Event { $( @@ -216,7 +216,7 @@ macro_rules! __decl_generic_event { pub type Event<$event_generic_param> = RawEvent<$( <$generic as $trait>::$trait_type ),*>; // Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. #[derive(Clone, PartialEq, Eq, Encode, Decode)] - #[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] + #[cfg_attr(feature = "std", derive(Debug))] $(#[$attr])* pub enum RawEvent<$( $generic_param ),*> { $( @@ -364,7 +364,7 @@ macro_rules! impl_outer_event { ) => { // Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. #[derive(Clone, PartialEq, Eq, Encode, Decode)] - #[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] + #[cfg_attr(feature = "std", derive(Debug))] $(#[$attr])* #[allow(non_camel_case_types)] pub enum $name { @@ -518,7 +518,7 @@ mod tests { ); } - #[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, Serialize)] pub struct TestRuntime; impl_outer_event! { @@ -529,7 +529,7 @@ mod tests { } } - #[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, Serialize)] pub struct TestRuntime2; impl_outer_event! { diff --git a/substrate/srml/support/src/lib.rs b/substrate/srml/support/src/lib.rs index e9cd35afa5..20cf57ca71 100644 --- a/substrate/srml/support/src/lib.rs +++ b/substrate/srml/support/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -// tag::description[] //! Support code for the runtime. -// end::description[] #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), feature(alloc))] @@ -29,14 +27,14 @@ pub extern crate sr_std as rstd; extern crate sr_io as runtime_io; #[doc(hidden)] pub extern crate sr_primitives as runtime_primitives; -extern crate substrate_metadata; +extern crate srml_metadata; extern crate mashup; #[cfg(test)] #[macro_use] extern crate pretty_assertions; -#[cfg(test)] +#[cfg(feature = "std")] #[macro_use] extern crate serde_derive; #[cfg(test)] @@ -122,3 +120,6 @@ pub enum Void {} #[doc(hidden)] pub use mashup::*; + +#[cfg(feature = "std")] +pub use serde_derive::*; diff --git a/substrate/srml/support/src/metadata.rs b/substrate/srml/support/src/metadata.rs index 132415d315..947c8877a6 100644 --- a/substrate/srml/support/src/metadata.rs +++ b/substrate/srml/support/src/metadata.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -pub use substrate_metadata::{ +pub use srml_metadata::{ DecodeDifferent, FnEncode, RuntimeMetadata, RuntimeModuleMetadata }; @@ -98,7 +98,7 @@ macro_rules! __runtime_modules_to_metadata { #[allow(dead_code)] mod tests { use super::*; - use substrate_metadata::{ + use srml_metadata::{ EventMetadata, OuterEventMetadata, RuntimeModuleMetadata, CallMetadata, ModuleMetadata, StorageFunctionModifier, StorageFunctionType, FunctionMetadata, StorageMetadata, StorageFunctionMetadata, OuterDispatchMetadata, OuterDispatchCall diff --git a/substrate/srml/support/src/storage/generator.rs b/substrate/srml/support/src/storage/generator.rs index 899bee44b0..31d583d6c9 100644 --- a/substrate/srml/support/src/storage/generator.rs +++ b/substrate/srml/support/src/storage/generator.rs @@ -53,7 +53,7 @@ pub use rstd::borrow::Borrow; #[doc(hidden)] pub use rstd::marker::PhantomData; -pub use substrate_metadata::{ +pub use srml_metadata::{ DecodeDifferent, StorageMetadata, StorageFunctionMetadata, StorageFunctionType, StorageFunctionModifier }; diff --git a/substrate/srml/system/Cargo.toml b/substrate/srml/system/Cargo.toml index c4bde66fc8..5bc00b1230 100644 --- a/substrate/srml/system/Cargo.toml +++ b/substrate/srml/system/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } safe-mix = { version = "1.0", default-features = false} parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } @@ -20,7 +19,6 @@ srml-support = { path = "../support", default-features = false } default = ["std"] std = [ "serde/std", - "serde_derive", "safe-mix/std", "parity-codec/std", "parity-codec-derive/std", diff --git a/substrate/srml/system/src/lib.rs b/substrate/srml/system/src/lib.rs index b10b311259..c3cffda04f 100644 --- a/substrate/srml/system/src/lib.rs +++ b/substrate/srml/system/src/lib.rs @@ -27,10 +27,6 @@ extern crate sr_std as rstd; #[macro_use] extern crate srml_support as runtime_support; -#[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; - #[macro_use] extern crate parity_codec_derive; @@ -41,7 +37,8 @@ extern crate safe_mix; use rstd::prelude::*; use primitives::traits::{self, CheckEqual, SimpleArithmetic, SimpleBitOps, Zero, One, Bounded, Lookup, - Hash, Member, MaybeDisplay, EnsureOrigin, Digest as DigestT, As, CurrentHeight, BlockNumberToHash}; + Hash, Member, MaybeDisplay, EnsureOrigin, Digest as DigestT, As, CurrentHeight, BlockNumberToHash, + MaybeSerializeDebugButNotDeserialize, MaybeSerializeDebug}; use substrate_primitives::storage::well_known_keys; use runtime_support::{storage, StorageValue, StorageMap, Parameter}; use safe_mix::TripletMix; @@ -68,12 +65,12 @@ pub fn extrinsics_data_root(xts: Vec>) -> H::Output { pub trait Trait: Eq + Clone { type Origin: Into>> + From>; - type Index: Parameter + Member + Default + MaybeDisplay + SimpleArithmetic + Copy; - type BlockNumber: Parameter + Member + MaybeDisplay + SimpleArithmetic + Default + Bounded + Copy + rstd::hash::Hash; - type Hash: Parameter + Member + MaybeDisplay + SimpleBitOps + Default + Copy + CheckEqual + rstd::hash::Hash + AsRef<[u8]> + AsMut<[u8]>; + type Index: Parameter + Member + MaybeSerializeDebugButNotDeserialize + Default + MaybeDisplay + SimpleArithmetic + Copy; + type BlockNumber: Parameter + Member + MaybeSerializeDebug + MaybeDisplay + SimpleArithmetic + Default + Bounded + Copy + rstd::hash::Hash; + type Hash: Parameter + Member + MaybeSerializeDebug + MaybeDisplay + SimpleBitOps + Default + Copy + CheckEqual + rstd::hash::Hash + AsRef<[u8]> + AsMut<[u8]>; type Hashing: Hash; - type Digest: Parameter + Member + Default + traits::Digest; - type AccountId: Parameter + Member + MaybeDisplay + Ord + Default; + type Digest: Parameter + Member + MaybeSerializeDebugButNotDeserialize + Default + traits::Digest; + type AccountId: Parameter + Member + MaybeSerializeDebug + MaybeDisplay + Ord + Default; type Header: Parameter + traits::Header< Number = Self::BlockNumber, Hash = Self::Hash, @@ -287,7 +284,7 @@ impl Module { let mut digest = >::take(); let extrinsics_root = >::take(); let storage_root = T::Hashing::storage_root(); - let storage_changes_root = T::Hashing::storage_changes_root(number.as_()); + let storage_changes_root = T::Hashing::storage_changes_root(parent_hash, number.as_() - 1); // we can't compute changes trie root earlier && put it to the Digest // because it will include all currently existing temporaries diff --git a/substrate/srml/timestamp/Cargo.toml b/substrate/srml/timestamp/Cargo.toml index c07a62aeda..8472bb89ca 100644 --- a/substrate/srml/timestamp/Cargo.toml +++ b/substrate/srml/timestamp/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } parity-codec-derive = { version = "2.1", default-features = false } parity-codec = { version = "2.1", default-features = false } substrate-primitives = { path = "../../core/primitives", default-features = false } @@ -29,7 +28,6 @@ std = [ "sr-primitives/std", "srml-consensus/std", "serde/std", - "serde_derive", "parity-codec-derive/std", "parity-codec/std", "substrate-primitives/std", diff --git a/substrate/srml/timestamp/src/lib.rs b/substrate/srml/timestamp/src/lib.rs index 36004e88c3..35c82b532f 100644 --- a/substrate/srml/timestamp/src/lib.rs +++ b/substrate/srml/timestamp/src/lib.rs @@ -29,7 +29,6 @@ //! ## Finalization //! //! This module should be hooked up to the finalization routine. -//! #![cfg_attr(not(feature = "std"), no_std)] @@ -39,10 +38,6 @@ extern crate sr_std as rstd; #[macro_use] extern crate srml_support as runtime_support; -#[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; - #[cfg(test)] extern crate substrate_primitives; #[cfg(test)] diff --git a/substrate/srml/treasury/Cargo.toml b/substrate/srml/treasury/Cargo.toml index 32621e1561..9090ac4d9b 100644 --- a/substrate/srml/treasury/Cargo.toml +++ b/substrate/srml/treasury/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } substrate-primitives = { path = "../../core/primitives", default-features = false } @@ -21,7 +20,6 @@ srml-balances = { path = "../balances", default-features = false } default = ["std"] std = [ "serde/std", - "serde_derive", "parity-codec/std", "parity-codec-derive/std", "substrate-primitives/std", diff --git a/substrate/srml/treasury/src/lib.rs b/substrate/srml/treasury/src/lib.rs index 94e60e4b32..340ab48a8c 100644 --- a/substrate/srml/treasury/src/lib.rs +++ b/substrate/srml/treasury/src/lib.rs @@ -25,10 +25,6 @@ extern crate srml_support as runtime_support; #[cfg(test)] extern crate sr_io as runtime_io; - -#[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; #[cfg(feature = "std")] extern crate serde; diff --git a/substrate/srml/upgrade-key/Cargo.toml b/substrate/srml/upgrade-key/Cargo.toml index 980a7240a9..74561894ac 100644 --- a/substrate/srml/upgrade-key/Cargo.toml +++ b/substrate/srml/upgrade-key/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -serde_derive = { version = "1.0", optional = true } parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } substrate-primitives = { path = "../../core/primitives", default-features = false } @@ -21,7 +20,6 @@ srml-consensus = { path = "../consensus", default-features = false } default = ["std"] std = [ "serde/std", - "serde_derive", "parity-codec/std", "parity-codec-derive/std", "sr-std/std", diff --git a/substrate/srml/upgrade-key/src/lib.rs b/substrate/srml/upgrade-key/src/lib.rs index 28433d8fbd..9a8e7493e9 100644 --- a/substrate/srml/upgrade-key/src/lib.rs +++ b/substrate/srml/upgrade-key/src/lib.rs @@ -25,9 +25,6 @@ extern crate sr_io; #[cfg(test)] extern crate substrate_primitives; extern crate sr_primitives; -#[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; #[macro_use] extern crate parity_codec_derive; extern crate parity_codec as codec; diff --git a/substrate/subkey/src/cli.yml b/substrate/subkey/src/cli.yml index 30e6be0626..6e1a13dca8 100644 --- a/substrate/subkey/src/cli.yml +++ b/substrate/subkey/src/cli.yml @@ -3,7 +3,7 @@ author: "Parity Team " about: A substrate key utility subcommands: - restore: - about: Gets a SS58 public key from the provided seed phrase + about: Gets a public key and a SS58 address from the provided seed phrase args: - seed: index: 1 diff --git a/substrate/subkey/src/main.rs b/substrate/subkey/src/main.rs index a89f7911ac..190921d750 100644 --- a/substrate/subkey/src/main.rs +++ b/substrate/subkey/src/main.rs @@ -58,10 +58,10 @@ fn main() { seed[..len].copy_from_slice(&raw_seed[..len]); let pair = Pair::from_seed(&seed); - println!("Seed 0x{} is account:\n SS58: {}\n Hex: 0x{}", + println!("Seed 0x{} is account:\n Public key (hex): 0x{}\n Address (SS58): {}", HexDisplay::from(&seed), - pair.public().to_ss58check(), - HexDisplay::from(&pair.public().0) + HexDisplay::from(&pair.public().0), + pair.public().to_ss58check() ); }, _ => print_usage(&matches), diff --git a/substrate/test-utils/chain-spec-builder/Cargo.lock b/substrate/test-utils/chain-spec-builder/Cargo.lock new file mode 100644 index 0000000000..9a05a2818e --- /dev/null +++ b/substrate/test-utils/chain-spec-builder/Cargo.lock @@ -0,0 +1,3943 @@ +[[package]] +name = "aes-ctr" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aes-soft 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "aesni 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ctr 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "stream-cipher 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aes-soft" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-cipher-trait 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aesni" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-cipher-trait 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "stream-cipher 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aho-corasick" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aio-limited" +version = "0.1.0" +source = "git+https://github.com/paritytech/aio-limited.git#a7c0bd6944902b1c9fb2bcf4f8fe1412c824b5b9" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "app_dirs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "shell32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "arrayref" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "arrayvec" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "asn1_der" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "etrace 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "atty" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "backtrace" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "backtrace-sys" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base58" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "base64" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bigint" +version = "4.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bitflags" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "blake2-rfc" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-buffer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-cipher-trait" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bs58" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byte-tools" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bytes" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cc" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "chain-spec-builder" +version = "0.1.0" +dependencies = [ + "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", + "node-cli 0.1.0", + "substrate-primitives 0.1.0", + "substrate-service 0.3.0", +] + +[[package]] +name = "chashmap" +version = "2.2.1" +source = "git+https://github.com/redox-os/tfs#3e7dcdb0c586d0d8bb3f25bfd948d2f418a4ab10" +dependencies = [ + "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "chrono" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "clap" +version = "2.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cmake" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "core-foundation" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation-sys" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "crossbeam-deque" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "crunchy" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ctr" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-cipher-trait 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "stream-cipher 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "datastore" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "base64 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "chashmap 2.2.1 (git+https://github.com/redox-os/tfs)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "digest" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "either" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "elastic-array" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "env_logger" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "env_logger" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "environmental" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "error-chain" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "eth-secp256k1" +version = "0.5.7" +source = "git+https://github.com/paritytech/rust-secp256k1#ccc06e7480148b723eb44ac56cf4d20eec380b6f" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "etrace" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "exit-future" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fdlimit" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fixed-hash" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fnv" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fs-swap" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-cpupool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gcc" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "generic-array" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "getopts" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "globset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "h2" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hash-db" +version = "0.9.0" +source = "git+https://github.com/paritytech/trie#2616db2a2529098949e5d39aa06dd4e502a9e5f7" + +[[package]] +name = "hash256-std-hasher" +version = "0.9.0" +source = "git+https://github.com/paritytech/trie#2616db2a2529098949e5d39aa06dd4e502a9e5f7" +dependencies = [ + "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "heapsize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hex" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hex-literal" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hex-literal-impl 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hex-literal-impl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "http" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "httparse" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "humantime" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper" +version = "0.10.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper" +version = "0.12.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "indexmap" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "integer-sqrt" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "interleaved-ordered" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "iovec" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "jsonrpc-core" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git#2ed142d55662155b0dc76b9b5d2732300f265dd6" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "jsonrpc-http-server" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git#2ed142d55662155b0dc76b9b5d2732300f265dd6" +dependencies = [ + "hyper 0.12.13 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "jsonrpc-server-utils 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "jsonrpc-macros" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git#2ed142d55662155b0dc76b9b5d2732300f265dd6" +dependencies = [ + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "jsonrpc-pubsub 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "jsonrpc-pubsub" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git#2ed142d55662155b0dc76b9b5d2732300f265dd6" +dependencies = [ + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "jsonrpc-server-utils" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git#2ed142d55662155b0dc76b9b5d2732300f265dd6" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "jsonrpc-ws-server" +version = "9.0.0" +source = "git+https://github.com/paritytech/jsonrpc.git#2ed142d55662155b0dc76b9b5d2732300f265dd6" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "jsonrpc-server-utils 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ws 0.7.5 (git+https://github.com/tomusdrw/ws-rs)", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "kvdb" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "kvdb-rocksdb" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fs-swap 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-rocksdb 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "language-tags" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "lazycell" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.43" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libloading" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-dns 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-floodsub 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-identify 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-kad 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-mplex 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-ping 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-ratelimit 0.1.1 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-relay 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-secio 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-tcp-transport 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-transport-timeout 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-uds 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-websocket 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-yamux 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-core" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "multihash 0.8.1-pre (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "multistream-select 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "smallvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-dns" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "tokio-dns-unofficial 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-floodsub" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-identify" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-kad" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bigint 4.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "datastore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-identify 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-ping 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-mplex" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-peerstore" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "datastore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-ping" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "multistream-select 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-ratelimit" +version = "0.1.1" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "aio-limited 0.1.0 (git+https://github.com/paritytech/aio-limited.git)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-relay" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "protobuf 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-secio" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "aes-ctr 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "asn1_der 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "ctr 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "twofish 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-tcp-transport" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "tk-listen 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-transport-timeout" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-uds" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "tokio-uds 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libp2p-websocket" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "websocket 0.20.3 (git+https://github.com/tomaka/rust-websocket?branch=send)", +] + +[[package]] +name = "libp2p-yamux" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "yamux 0.1.0 (git+https://github.com/paritytech/yamux)", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "local-encoding" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "skeptic 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "lock_api" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "log" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "log" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mashup" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "mashup-impl 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mashup-impl" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memchr" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "memoffset" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memory-db" +version = "0.9.0" +source = "git+https://github.com/paritytech/trie#2616db2a2529098949e5d39aa06dd4e502a9e5f7" +dependencies = [ + "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", + "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "memory_units" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "mime" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio" +version = "0.6.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-extras" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-uds" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "multiaddr" +version = "0.3.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "multihash 0.8.1-pre (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "multihash" +version = "0.8.1-pre" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "sha1 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "multistream-select" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "names" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nan-preserving-float" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "native-tls" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", + "schannel 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "net2" +version = "0.2.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "node-cli" +version = "0.1.0" +dependencies = [ + "exit-future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "node-executor 0.1.0", + "node-primitives 0.1.0", + "node-runtime 0.1.0", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "substrate-cli 0.3.0", + "substrate-client 0.1.0", + "substrate-consensus-aura 0.1.0", + "substrate-network 0.1.0", + "substrate-primitives 0.1.0", + "substrate-service 0.3.0", + "substrate-transaction-pool 0.1.0", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "node-executor" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "node-primitives 0.1.0", + "node-runtime 0.1.0", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "substrate-executor 0.1.0", + "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", + "substrate-trie 0.4.0", + "trie-root 0.9.0 (git+https://github.com/paritytech/trie)", +] + +[[package]] +name = "node-primitives" +version = "0.1.0" +dependencies = [ + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "node-runtime" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "node-primitives 0.1.0", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-api 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "sr-version 0.1.0", + "srml-balances 0.1.0", + "srml-consensus 0.1.0", + "srml-contract 0.1.0", + "srml-council 0.1.0", + "srml-democracy 0.1.0", + "srml-executive 0.1.0", + "srml-session 0.1.0", + "srml-staking 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "srml-timestamp 0.1.0", + "srml-treasury 0.1.0", + "srml-upgrade-key 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "nodrop" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "nohash-hasher" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "num-integer" +version = "0.1.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-traits" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "num_cpus" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ole32-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "opaque-debug" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "openssl" +version = "0.9.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "openssl" +version = "0.10.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "openssl-sys" +version = "0.9.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "owning_ref" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parity-bytes" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "parity-codec" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parity-codec-derive" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parity-crypto" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parity-rocksdb" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-rocksdb-sys 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parity-rocksdb-sys" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-snappy-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parity-snappy-sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parity-wasm" +version = "0.31.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot_core" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pkg-config" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro-hack" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack-impl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro-hack-impl" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro2" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "protobuf" +version = "2.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pulldown-cmark" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pwasm-utils" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quick-error" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "quick-error" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "quote" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rayon" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon-core" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "redox_syscall" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "redox_termios" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ucd-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ucd-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "remove_dir_all" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ring" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rust-crypto" +version = "0.2.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc-hex" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc-hex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc-serialize" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rw-stream-sink" +version = "0.1.0" +source = "git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d#8111062f0177fd7423626f2db9560273644a4c4d" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ryu" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "safe-mix" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "safemem" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "safemem" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "schannel" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "scoped-tls" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "scopeguard" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "security-framework" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "security-framework-sys" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde_derive" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_json" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sha1" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "sha1" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "sha1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "sha2" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "shell32-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "skeptic" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "slab" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "slab" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "slog" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "slog-async" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "slog-json" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "slog-scope" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "smallvec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "smallvec" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sr-api" +version = "0.1.0" +dependencies = [ + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "sr-version 0.1.0", +] + +[[package]] +name = "sr-io" +version = "0.1.0" +dependencies = [ + "environmental 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", + "substrate-trie 0.4.0", +] + +[[package]] +name = "sr-primitives" +version = "0.1.0" +dependencies = [ + "integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "sr-sandbox" +version = "0.1.0" +dependencies = [ + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", + "wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sr-std" +version = "0.1.0" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sr-version" +version = "0.1.0" +dependencies = [ + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "sr-std 0.1.0", +] + +[[package]] +name = "srml-balances" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-consensus" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-contract" +version = "0.1.0" +dependencies = [ + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pwasm-utils 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-sandbox 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-council" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-democracy 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-democracy" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-executive" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", +] + +[[package]] +name = "srml-session" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-consensus 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "srml-timestamp 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-staking" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-consensus 0.1.0", + "srml-session 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "srml-timestamp 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-support" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "mashup 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "substrate-metadata 0.1.0", +] + +[[package]] +name = "srml-system" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-support 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-timestamp" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-consensus 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-treasury" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-upgrade-key" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-consensus 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "stdweb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "stream-cipher" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "string" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "strsim" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "substrate-cli" +version = "0.3.0" +dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "app_dirs 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "exit-future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "substrate-client 0.1.0", + "substrate-network 0.1.0", + "substrate-network-libp2p 0.1.0", + "substrate-primitives 0.1.0", + "substrate-service 0.3.0", + "substrate-telemetry 0.3.0", + "sysinfo 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-client" +version = "0.1.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", + "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-api 0.1.0", + "sr-primitives 0.1.0", + "substrate-consensus-common 0.1.0", + "substrate-executor 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", + "substrate-telemetry 0.3.0", + "substrate-trie 0.4.0", +] + +[[package]] +name = "substrate-client-db" +version = "0.1.0" +dependencies = [ + "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", + "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "substrate-client 0.1.0", + "substrate-executor 0.1.0", + "substrate-primitives 0.1.0", + "substrate-state-db 0.1.0", + "substrate-state-machine 0.1.0", + "substrate-trie 0.4.0", +] + +[[package]] +name = "substrate-consensus-aura" +version = "0.1.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-version 0.1.0", + "srml-consensus 0.1.0", + "srml-support 0.1.0", + "substrate-client 0.1.0", + "substrate-consensus-common 0.1.0", + "substrate-network 0.1.0", + "substrate-primitives 0.1.0", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-consensus-common" +version = "0.1.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "sr-version 0.1.0", + "substrate-primitives 0.1.0", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-executor" +version = "0.1.0" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-version 0.1.0", + "substrate-primitives 0.1.0", + "substrate-serializer 0.1.0", + "substrate-state-machine 0.1.0", + "substrate-trie 0.4.0", + "wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-keyring" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "substrate-keystore" +version = "0.1.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-crypto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-primitives 0.1.0", + "subtle 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-metadata" +version = "0.1.0" +dependencies = [ + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-network" +version = "0.1.0" +dependencies = [ + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "substrate-client 0.1.0", + "substrate-consensus-common 0.1.0", + "substrate-keyring 0.1.0", + "substrate-network-libp2p 0.1.0", + "substrate-primitives 0.1.0", + "substrate-test-client 0.1.0", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-network-libp2p" +version = "0.1.0" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-primitives" +version = "0.1.0" +dependencies = [ + "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", + "hash256-std-hasher 0.9.0 (git+https://github.com/paritytech/trie)", + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-std 0.1.0", + "twox-hash 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-rpc" +version = "0.1.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "jsonrpc-macros 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "jsonrpc-pubsub 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "sr-version 0.1.0", + "substrate-client 0.1.0", + "substrate-executor 0.1.0", + "substrate-primitives 0.1.0", + "substrate-transaction-pool 0.1.0", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-rpc-servers" +version = "0.1.0" +dependencies = [ + "jsonrpc-http-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "jsonrpc-pubsub 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "jsonrpc-ws-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "substrate-rpc 0.1.0", +] + +[[package]] +name = "substrate-serializer" +version = "0.1.0" +dependencies = [ + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-service" +version = "0.3.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "exit-future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "substrate-client 0.1.0", + "substrate-client-db 0.1.0", + "substrate-consensus-common 0.1.0", + "substrate-executor 0.1.0", + "substrate-keystore 0.1.0", + "substrate-network 0.1.0", + "substrate-primitives 0.1.0", + "substrate-rpc 0.1.0", + "substrate-rpc-servers 0.1.0", + "substrate-telemetry 0.3.0", + "substrate-transaction-pool 0.1.0", + "target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-state-db" +version = "0.1.0" +dependencies = [ + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "substrate-state-machine" +version = "0.1.0" +dependencies = [ + "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", + "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-primitives 0.1.0", + "substrate-trie 0.4.0", + "trie-db 0.9.0 (git+https://github.com/paritytech/trie)", + "trie-root 0.9.0 (git+https://github.com/paritytech/trie)", +] + +[[package]] +name = "substrate-telemetry" +version = "0.3.0" +dependencies = [ + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slog-json 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slog-scope 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ws 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-test-client" +version = "0.1.0" +dependencies = [ + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "substrate-client 0.1.0", + "substrate-consensus-common 0.1.0", + "substrate-executor 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", + "substrate-test-runtime 0.1.0", +] + +[[package]] +name = "substrate-test-runtime" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-api 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "sr-version 0.1.0", + "srml-support 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "substrate-transaction-graph" +version = "0.1.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", +] + +[[package]] +name = "substrate-transaction-pool" +version = "0.1.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "substrate-client 0.1.0", + "substrate-primitives 0.1.0", + "substrate-transaction-graph 0.1.0", +] + +[[package]] +name = "substrate-trie" +version = "0.4.0" +dependencies = [ + "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", + "memory-db 0.9.0 (git+https://github.com/paritytech/trie)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.9.0 (git+https://github.com/paritytech/trie)", + "trie-root 0.9.0 (git+https://github.com/paritytech/trie)", +] + +[[package]] +name = "subtle" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "syn" +version = "0.14.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "0.15.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sysinfo" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "take_mut" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "target_info" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "tempdir" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tempfile" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "termcolor" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "termion" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "textwrap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thread_local" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "time" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tiny-keccak" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tk-listen" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-fs 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-uds 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-codec" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-core" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-current-thread" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-dns-unofficial" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-executor" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-fs" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-io" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-reactor" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-tcp" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-threadpool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-timer" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-tls" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-udp" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-uds" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "traitobject" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "trie-db" +version = "0.9.0" +source = "git+https://github.com/paritytech/trie#2616db2a2529098949e5d39aa06dd4e502a9e5f7" +dependencies = [ + "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "trie-root" +version = "0.9.0" +source = "git+https://github.com/paritytech/trie#2616db2a2529098949e5d39aa06dd4e502a9e5f7" +dependencies = [ + "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", +] + +[[package]] +name = "try-lock" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "twofish" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-cipher-trait 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "twox-hash" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "typeable" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "typenum" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ucd-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "uint" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicase" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicase" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-width" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unsigned-varint" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unsigned-varint" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "untrusted" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "url" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "utf8-ranges" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "vcpkg" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "vec_map" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "want" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasmi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "websocket" +version = "0.20.3" +source = "git+https://github.com/tomaka/rust-websocket?branch=send#28ea5eb82b573bf3ace2fc75c36d791bcedf08b1" +dependencies = [ + "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wincolor" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ws" +version = "0.7.5" +source = "git+https://github.com/tomusdrw/ws-rs#f12d19c4c19422fc79af28a3181f598bc07ecd1e" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ws" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "xdg" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "yaml-rust" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "yamux" +version = "0.1.0" +source = "git+https://github.com/paritytech/yamux#966f2730f7a32150f282eef29fd2aecb14d7b9fa" +dependencies = [ + "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "nohash-hasher 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[metadata] +"checksum aes-ctr 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f65958ff3692041c36fc009261ccd63f24cd8e0dc1164266f068c2387e8b4e4f" +"checksum aes-soft 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67cc03b0a090a05cb01e96998a01905d7ceedce1bc23b756c0bb7faa0682ccb1" +"checksum aesni 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6810b7fb9f2bb4f76f05ac1c170b8dde285b6308955dc3afd89710268c958d9e" +"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e" +"checksum aio-limited 0.1.0 (git+https://github.com/paritytech/aio-limited.git)" = "" +"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum app_dirs 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e73a24bad9bd6a94d6395382a6c69fe071708ae4409f763c5475e14ee896313d" +"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" +"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" +"checksum asn1_der 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "766afdc5c6d7c15de1abe4c9c15e360be3aa972c363ba5b606be3c4271235886" +"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" +"checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" +"checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0" +"checksum base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" +"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" +"checksum base64 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5032d51da2741729bfdaeb2664d9b8c6d9fd1e2b90715c660b6def36628499c2" +"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" +"checksum bigint 4.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ebecac13b3c745150d7b6c3ea7572d372f09d627c2077e893bf26c5c7f70d282" +"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" +"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" +"checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" +"checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" +"checksum block-cipher-trait 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "370424437b9459f3dfd68428ed9376ddfe03d8b70ede29cc533b3557df186ab4" +"checksum bs58 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0de79cfb98e7aa9988188784d8664b4b5dad6eaaa0863b91d9a4ed871d4f7a42" +"checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" +"checksum byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96c8b41881888cc08af32d47ac4edd52bc7fa27fef774be47a92443756451304" +"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d" +"checksum bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0ce55bd354b095246fc34caf4e9e242f5297a7fd938b090cadfea6eee614aa62" +"checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16" +"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" +"checksum chashmap 2.2.1 (git+https://github.com/redox-os/tfs)" = "" +"checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" +"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" +"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +"checksum cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "6ec65ee4f9c9d16f335091d23693457ed4928657ba4982289d7fafee03bc614a" +"checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" +"checksum core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25bfd746d203017f7d5cbd31ee5d8e17f94b6521c7af77ece6c9e4b2d4b16c67" +"checksum core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "065a5d7ffdcbc8fa145d6f0746f3555025b9097a9e9cda59f7467abae670c78d" +"checksum crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "bd66663db5a988098a89599d4857919b3acf7f61402e61365acfd3919857b9be" +"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" +"checksum crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3486aefc4c0487b9cb52372c97df0a48b8c249514af1ee99703bf70d2f2ceda1" +"checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150" +"checksum crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30fecfcac6abfef8771151f8be4abc9e4edc112c2bcb233314cafde2680536e9" +"checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" +"checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015" +"checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" +"checksum ctr 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4b669fcb8e20124db86dbd9b01e74ec0e9e420e65381311ce5249864fc7ff0c0" +"checksum datastore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90" +"checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" +"checksum elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88d4851b005ef16de812ea9acdb7bece2f0a40dd86c07b85631d7dafa54537bb" +"checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" +"checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" +"checksum environmental 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db746025e3ea695bfa0ae744dbacd5fcfc8db51b9760cf8bd0ab69708bb93c49" +"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" +"checksum eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)" = "" +"checksum etrace 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f17311e68ea07046ee809b8513f6c259518bc10173681d98c21f8c3926f56f40" +"checksum exit-future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9aa7b56cef68c4182db7212dece19cc9f6e2916cf9412e57e6cea53ec02f316d" +"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +"checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" +"checksum fixed-hash 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7afe6ce860afb14422711595a7b26ada9ed7de2f43c0b2ab79d09ee196287273" +"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" +"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +"checksum fs-swap 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "921d332c89b3b61a826de38c61ee5b6e02c56806cade1b0e5d81bd71f57a71bb" +"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +"checksum futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)" = "49e7653e374fe0d0c12de4250f0bdb60680b8c80eed558c5c7538eec9c89e21b" +"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" +"checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" +"checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" +"checksum getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0a7292d30132fb5424b354f5dc02512a86e4c516fe544bb7a25e7f266951b797" +"checksum globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4743617a7464bbda3c8aec8558ff2f9429047e025771037df561d383337ff865" +"checksum h2 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "7dd33bafe2e6370e6c8eb0cf1b8c5f93390b90acde7e9b03723f166b28b648ed" +"checksum hash-db 0.9.0 (git+https://github.com/paritytech/trie)" = "" +"checksum hash256-std-hasher 0.9.0 (git+https://github.com/paritytech/trie)" = "" +"checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" +"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" +"checksum hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4da5f0e01bd8a71a224a4eedecaacfcabda388dbb7a80faf04d3514287572d95" +"checksum hex-literal-impl 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1d340b6514f232f6db1bd16db65302a5278a04fef9ce867cb932e7e5fa21130a" +"checksum http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "24f58e8c2d8e886055c3ead7b28793e1455270b5fb39650984c224bc538ba581" +"checksum httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83" +"checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e" +"checksum hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)" = "df0caae6b71d266b91b4a83111a61d2b94ed2e2bea024c532b933dcff867e58c" +"checksum hyper 0.12.13 (registry+https://github.com/rust-lang/crates.io-index)" = "95ffee0d1d30de4313fdaaa485891ce924991d45bbc18adfc8ac5b1639e62fbb" +"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +"checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" +"checksum integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ea155abb3ba6f382a75f1418988c05fe82959ed9ce727de427f9cfd425b0c903" +"checksum interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "141340095b15ed7491bd3d4ced9d20cebfb826174b6bb03386381f62b01e3d77" +"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" +"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" +"checksum jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)" = "" +"checksum jsonrpc-http-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)" = "" +"checksum jsonrpc-macros 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)" = "" +"checksum jsonrpc-pubsub 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)" = "" +"checksum jsonrpc-server-utils 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)" = "" +"checksum jsonrpc-ws-server 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)" = "" +"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +"checksum kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72ae89206cea31c32014b39d5a454b96135894221610dbfd19cf4d2d044fa546" +"checksum kvdb-rocksdb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "06cf755dc587839ba34d3cbe3f12b6ad55850fbcdfe67336157a021a1a5c43ae" +"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" +"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" +"checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7" +"checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0" +"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" +"checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2" +"checksum libp2p 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-dns 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-floodsub 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-identify 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-kad 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-mplex 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-ping 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-ratelimit 0.1.1 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-relay 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-secio 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-tcp-transport 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-transport-timeout 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-uds 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-websocket 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum libp2p-yamux 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e" +"checksum local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1ceb20f39ff7ae42f3ff9795f3986b1daad821caaa1e1732a0944103a5a1a66" +"checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a" +"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" +"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" +"checksum mashup 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f2d82b34c7fb11bb41719465c060589e291d505ca4735ea30016a91f6fc79c3b" +"checksum mashup-impl 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "aa607bfb674b4efb310512527d64266b065de3f894fc52f84efcbf7eaa5965fb" +"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +"checksum memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0a3eb002f0535929f1199681417029ebea04aadc0c7a4224b46be99c7f5d6a16" +"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" +"checksum memory-db 0.9.0 (git+https://github.com/paritytech/trie)" = "" +"checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" +"checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" +"checksum mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "71646331f2619b1026cc302f87a2b8b648d5c6dd6937846a16cc8ce0f347f432" +"checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" +"checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" +"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +"checksum multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum multihash 0.8.1-pre (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum multistream-select 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef320dab323286b50fb5cdda23f61c796a72a89998ab565ca32525c5c556f2da" +"checksum nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34d4f00fcc2f4c9efa8cc971db0da9e28290e28e97af47585e48691ef10ff31f" +"checksum native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f74dbadc8b43df7864539cedb7bc91345e532fdd913cfdc23ad94f4d2d40fbc0" +"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" +"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" +"checksum nohash-hasher 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "27593c72432b8cec9ae79e92792a73c38341064d525b6b612a9fccf8b7d17407" +"checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" +"checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" +"checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" +"checksum ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2c49021782e5233cd243168edfa8037574afed4eba4bbaf538b3d8d1789d8c" +"checksum opaque-debug 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d620c9c26834b34f039489ac0dfdb12c7ac15ccaf818350a64c9b5334a452ad7" +"checksum openssl 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)" = "5e1309181cdcbdb51bc3b6bedb33dfac2a83b3d585033d3f6d9e22e8c1928613" +"checksum openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "a3605c298474a3aa69de92d21139fb5e2a81688d308262359d85cdd0d12a7985" +"checksum openssl-sys 0.9.39 (registry+https://github.com/rust-lang/crates.io-index)" = "278c1ad40a89aa1e741a1eed089a2f60b18fab8089c3139b542140fc7d674106" +"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" +"checksum parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5168b4cf41f3835e4bc6ffb32f51bc9365dc50cb351904595b3931d917fd0c" +"checksum parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dca389ea5e1632c89b2ce54f7e2b4a8a8c9d278042222a91e0bf95451218cb4c" +"checksum parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffa42c2cb493b60b12c75b26e8c94cb734af4df4d7f2cc229dc04c1953dac189" +"checksum parity-crypto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c1117f6574377d21309bfa1f7d69ff734120685d92b02c3f362b122585758840" +"checksum parity-rocksdb 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cd55d2d6d6000ec99f021cf52c9acc7d2a402e14f95ced4c5de230696fabe00b" +"checksum parity-rocksdb-sys 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0e59eda423021494a6cf1be74f6989add403f53157409993f794e17b123cab51" +"checksum parity-snappy-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c2086caac40c79289cb70d7e1c64f5888e1c53f5d38399d3e95101493739f423" +"checksum parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)" = "511379a8194230c2395d2f5fa627a5a7e108a9f976656ce723ae68fca4097bfc" +"checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" +"checksum parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4d05f1349491390b1730afba60bb20d55761bef489a954546b58b4b34e1e2ac" +"checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" +"checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" +"checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c" +"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" +"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" +"checksum proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2c725b36c99df7af7bf9324e9c999b9e37d92c8f8caf106d82e1d7953218d2d8" +"checksum proc-macro-hack-impl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2b753ad9ed99dd8efeaa7d2fb8453c8f6bc3e54b97966d35f1bc77ca6865254a" +"checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" +"checksum protobuf 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "671a9cce836bd3635b40b2b0a72783481755ee988c493891f4e974b45264cc9d" +"checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07" +"checksum pwasm-utils 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "efd695333cfae6e9dbe2703a6d040e252b57a6fc3b9a65c712615ac042b2e0c5" +"checksum quick-error 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5fb6ccf8db7bbcb9c2eae558db5ab4f3da1c2a87e4e597ed394726bc8ea6ca1d" +"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" +"checksum quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "63b5829244f52738cfee93b3a165c1911388675be000c888d2fae620dee8fa5b" +"checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" +"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd" +"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" +"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372" +"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" +"checksum rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b614fe08b6665cb9a231d07ac1364b0ef3cb3698f1239ee0c4c3a88a524f54c8" +"checksum rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "df7a791f788cb4c516f0e091301a29c2b71ef680db5e644a7d68835c8ae6dbfa" +"checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356" +"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" +"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" +"checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" +"checksum regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2069749032ea3ec200ca51e4a31df41759190a88edca0d2d86ee8bedf7073341" +"checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" +"checksum regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d" +"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" +"checksum ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6f7d28b30a72c01b458428e0ae988d4149c20d902346902be881e3edc4bb325c" +"checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" +"checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395" +"checksum rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ceb8ce7a5e520de349e1fa172baeba4a9e8d5ef06c47471863530bc4972ee1e" +"checksum rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "403bb3a286107a04825a5f82e1270acc1e14028d3d554d7a1e08914549575ab8" +"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" +"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=8111062f0177fd7423626f2db9560273644a4c4d)" = "" +"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" +"checksum safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f7bf422d23a88c16d5090d455f182bc99c60af4df6a345c63428acf5129e347" +"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" +"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" +"checksum schannel 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "0e1a231dc10abf6749cfa5d7767f25888d484201accbd919b66ab5413c502d56" +"checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" +"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" +"checksum security-framework 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "dfa44ee9c54ce5eecc9de7d5acbad112ee58755239381f687e564004ba4a2332" +"checksum security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "5421621e836278a0b139268f36eee0dc7e389b784dc3f79d8f11aabadf41bead" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "15c141fc7027dd265a47c090bf864cf62b42c4d228bbcf4e51a0c9e2b0d3f7ef" +"checksum serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "225de307c6302bec3898c51ca302fc94a7a1697ef0845fcee6448f33c032249c" +"checksum serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "43344e7ce05d0d8280c5940cabb4964bea626aa58b1ec0e8c73fa2a8512a38ce" +"checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c" +"checksum sha1 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "171698ce4ec7cbb93babeb3190021b4d72e96ccb98e33d277ae4ea959d6f2d9e" +"checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" +"checksum sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" +"checksum shell32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9ee04b46101f57121c9da2b151988283b6beb79b34f5bb29a58ee48cb695122c" +"checksum skeptic 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24ebf8a06f5f8bae61ae5bbc7af7aac4ef6907ae975130faba1199e5fe82256a" +"checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" +"checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d" +"checksum slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1e1a2eec401952cd7b12a84ea120e2d57281329940c3f93c2bf04f462539508e" +"checksum slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e544d16c6b230d84c866662fe55e31aacfca6ae71e6fc49ae9a311cb379bfc2f" +"checksum slog-json 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddd14b8df2df39378b3e933c79784350bf715b11444d99f903df0253bbe524e5" +"checksum slog-scope 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "053344c94c0e2b22da6305efddb698d7c485809427cf40555dc936085f67a9df" +"checksum smallvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1347484b6f8bc4b32a9323d9800b6d934376391002ad9c528cc659fe8afc08ee" +"checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d" +"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +"checksum stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" +"checksum stream-cipher 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "30dc6118470d69ce0fdcf7e6f95e95853f7f4f72f80d835d4519577c323814ab" +"checksum string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00caf261d6f90f588f8450b8e1230fa0d5be49ee6140fdfbcb55335aff350970" +"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" +"checksum subtle 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc7f6353c2ee5407358d063a14cccc1630804527090a6fb5a9489ce4924280fb" +"checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" +"checksum syn 0.15.17 (registry+https://github.com/rust-lang/crates.io-index)" = "3391038ebc3e4ab24eb028cb0ef2f2dc4ba0cbf72ee895ed6a6fad730640b5bc" +"checksum sysinfo 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "11c5f6e8a7a7146f26ffed9a5ff8bab2706f1ac8a413a415e1d211b819d5c24d" +"checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" +"checksum target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c63f48baada5c52e65a29eef93ab4f8982681b67f9e8d29c7b05abcfec2b9ffe" +"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +"checksum tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "55c1195ef8513f3273d55ff59fe5da6940287a0d7a98331254397f464833675b" +"checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f" +"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" +"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" +"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +"checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" +"checksum tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e9175261fbdb60781fcd388a4d6cc7e14764a2b629a7ad94abb439aed223a44f" +"checksum tk-listen 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dec7ba6a80b7695fc2abb21af18bed445a362ffd80b64704771ce142d6d2151d" +"checksum tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6e93c78d23cc61aa245a8acd2c4a79c4d7fa7fb5c3ca90d5737029f043a84895" +"checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" +"checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" +"checksum tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f90fcd90952f0a496d438a976afba8e5c205fb12123f813d8ab3aa1c8436638c" +"checksum tokio-dns-unofficial 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bb9bf62ca2c53bf2f2faec3e48a98b6d8c9577c27011cb0203a4beacdc8ab328" +"checksum tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c117b6cf86bb730aab4834f10df96e4dd586eff2c3c27d3781348da49e255bde" +"checksum tokio-fs 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "60ae25f6b17d25116d2cba342083abe5255d3c2c79cb21ea11aa049c53bf7c75" +"checksum tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "7392fe0a70d5ce0c882c4778116c519bd5dbaa8a7c3ae3d04578b3afafdcda21" +"checksum tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4b26fd37f1125738b2170c80b551f69ff6fecb277e6e5ca885e53eec2b005018" +"checksum tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ad235e9dadd126b2d47f6736f65aa1fdcd6420e66ca63f44177bc78df89f912" +"checksum tokio-threadpool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3929aee321c9220ed838ed6c3928be7f9b69986b0e3c22c972a66dbf8a298c68" +"checksum tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "3a52f00c97fedb6d535d27f65cccb7181c8dd4c6edc3eda9ea93f6d45d05168e" +"checksum tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "772f4b04e560117fe3b0a53e490c16ddc8ba6ec437015d91fa385564996ed913" +"checksum tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "da941144b816d0dcda4db3a1ba87596e4df5e860a72b70783fe435891f80601c" +"checksum tokio-uds 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "df195376b43508f01570bacc73e13a1de0854dc59e79d1ec09913e8db6dd2a70" +"checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" +"checksum trie-db 0.9.0 (git+https://github.com/paritytech/trie)" = "" +"checksum trie-root 0.9.0 (git+https://github.com/paritytech/trie)" = "" +"checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" +"checksum twofish 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1eef327f05b0d0ec1b9d7d119d8f4d9f602ceee37e0540aff8071e8e66c2e22e" +"checksum twox-hash 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4f85be565a110ed72ed7048cf56570db04ce0a592c98aa59b7dacde3e5718750" +"checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" +"checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" +"checksum ucd-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d0f8bfa9ff0cadcd210129ad9d2c5f145c13e9ced3d3e5d948a6213487d52444" +"checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" +"checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" +"checksum unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d3218ea14b4edcaccfa0df0a64a3792a2c32cc706f1b336e48867f9d3147f90" +"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +"checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25" +"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" +"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +"checksum unsigned-varint 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5c1441164e5da61f00acd15f5a9e61939693c2c6e8b9fae36a220b82de7e212" +"checksum unsigned-varint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5fb8abc4b7d8158bdfbbaaccc35331ed3c30c2673e99000d7ae665a2eb6576f4" +"checksum untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f392d7819dbe58833e26872f5f6f0d68b7bbbe90fc3667e98731c4a15ad9a7ae" +"checksum url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2a321979c09843d272956e73700d12c4e7d3d92b2ee112b31548aef0d4efc5a6" +"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737" +"checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d" +"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" +"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" +"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +"checksum want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "797464475f30ddb8830cc529aaaae648d581f99e2036a928877dfde027ddf6b3" +"checksum wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d184c4b7081f30316f74f8d73c197314dcb56ea7af9323522b42a2fa9cb19453" +"checksum websocket 0.20.3 (git+https://github.com/tomaka/rust-websocket?branch=send)" = "" +"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" +"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "afc5508759c5bf4285e61feb862b6083c8480aec864fa17a81fdec6f69b461ab" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "561ed901ae465d6185fa7864d63fbd5720d0ef718366c9a4dc83cf6170d7e9ba" +"checksum ws 0.7.5 (git+https://github.com/tomusdrw/ws-rs)" = "" +"checksum ws 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "329d3e6dd450a9c5c73024e1047f0be7e24121a68484eb0b5368977bee3cf8c3" +"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +"checksum xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a66b7c2281ebde13cf4391d70d4c7e5946c3c25e72a7b859ca8f677dcd0b0c61" +"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992" +"checksum yamux 0.1.0 (git+https://github.com/paritytech/yamux)" = "" diff --git a/substrate/test-utils/chain-spec-builder/Cargo.toml b/substrate/test-utils/chain-spec-builder/Cargo.toml new file mode 100644 index 0000000000..7bd99e53aa --- /dev/null +++ b/substrate/test-utils/chain-spec-builder/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "chain-spec-builder" +version = "0.1.0" +authors = ["haydn dufrene "] + +[dependencies] +clap = { version = "~2.32", features = ["yaml"] } +node-cli = { path = "../../node/cli" } +substrate-primitives = { path = "../../core/primitives" } +substrate-service = { path = "../../core/service" } diff --git a/substrate/test-utils/chain-spec-builder/src/cli.yml b/substrate/test-utils/chain-spec-builder/src/cli.yml new file mode 100644 index 0000000000..08c0233c31 --- /dev/null +++ b/substrate/test-utils/chain-spec-builder/src/cli.yml @@ -0,0 +1,24 @@ +name: chain-spec-builder +author: "azban " +about: Utility for creating chain specs primarily for testing +args: +- initial_authority_seed: + short: a + value_name: INITIAL_AUTHORITY_SEED + help: Initial authority seed + takes_value: true + multiple: true + required: true +- endowed_account_seed: + short: e + value_name: ENDOWED_ACCOUNT_SEED + help: Endowed account seed + takes_value: true + multiple: true + required: true +- upgrade_key_seed: + short: u + value_name: UPGRADE_KEY_SEED + help: Upgrade key seed + takes_value: true + required: true diff --git a/substrate/test-utils/chain-spec-builder/src/main.rs b/substrate/test-utils/chain-spec-builder/src/main.rs new file mode 100644 index 0000000000..f0e9ef066f --- /dev/null +++ b/substrate/test-utils/chain-spec-builder/src/main.rs @@ -0,0 +1,51 @@ +#[macro_use] +extern crate clap; + +use clap::App; + +extern crate node_cli; +extern crate substrate_service; +extern crate substrate_primitives; + +use node_cli::chain_spec; +use substrate_service::chain_ops::build_spec; + +fn genesis_constructor() -> chain_spec::GenesisConfig { + let yaml = load_yaml!("./cli.yml"); + let matches = App::from_yaml(yaml).get_matches(); + let authorities = matches.values_of("initial_authority_seed") + .unwrap() + .map(chain_spec::get_authority_id_from_seed) + .collect(); + + let endowed_accounts = matches.values_of("endowed_account_seed") + .unwrap() + .map(chain_spec::get_authority_id_from_seed) + .collect(); + + let upgrade_key_seed = matches.value_of("upgrade_key_seed").unwrap(); + let upgrade_key = chain_spec::get_authority_id_from_seed(upgrade_key_seed); + chain_spec::testnet_genesis( + authorities, + upgrade_key.into(), + Some(endowed_accounts), + ) +} + +fn generate_chain_spec() -> String { + let chain_spec = chain_spec::ChainSpec::from_genesis( + "Custom", + "custom", + genesis_constructor, + vec![], + None, + None, + None, + ); + build_spec(chain_spec, false).unwrap() +} + +fn main() { + let json = generate_chain_spec(); + println!("{}", json); +}