diff --git a/polkadot/Cargo.lock b/polkadot/Cargo.lock index 37e36094a2..1f996e3f71 100644 --- a/polkadot/Cargo.lock +++ b/polkadot/Cargo.lock @@ -1,3 +1,11 @@ +[[package]] +name = "MacTypes-sys" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "adder" version = "0.1.0" @@ -125,7 +133,7 @@ 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)", + "libc 0.2.47 (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)", ] @@ -137,7 +145,7 @@ 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)", + "libc 0.2.47 (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)", ] @@ -148,7 +156,7 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -161,6 +169,15 @@ name = "base58" version = "0.1.0" source = "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" @@ -195,6 +212,11 @@ name = "bitflags" version = "0.7.0" source = "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" @@ -337,7 +359,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "glob 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -376,6 +398,23 @@ name = "constant_time_eq" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "core-foundation" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation-sys" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "crossbeam" version = "0.2.12" @@ -490,7 +529,7 @@ version = "1.1.1" source = "git+https://github.com/paritytech/rust-ctrlc.git#b523017108bb2d571a7a69bd97bc406e63bc7a9d" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -648,7 +687,7 @@ 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -671,7 +710,7 @@ 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)", + "libc 0.2.47 (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)", @@ -701,7 +740,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 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)", + "libc 0.2.47 (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)", ] @@ -872,6 +911,24 @@ 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.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hyper" version = "0.12.14" @@ -945,7 +1002,7 @@ 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1097,6 +1154,11 @@ dependencies = [ "rocksdb 0.11.0 (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" @@ -1114,7 +1176,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.43" +version = "0.2.47" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1147,6 +1209,7 @@ dependencies = [ "libp2p-secio 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p-tcp 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p-uds 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-websocket 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p-yamux 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multiaddr 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multihash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1401,6 +1464,21 @@ dependencies = [ "tokio-uds 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "libp2p-websocket" +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)", + "libp2p-core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-multiaddr 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rw-stream-sink 0.1.0 (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)", + "websocket 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "libp2p-yamux" version = "0.2.0" @@ -1421,7 +1499,7 @@ dependencies = [ "bindgen 0.43.2 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "glob 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "make-cmd 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1502,7 +1580,7 @@ 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1525,6 +1603,14 @@ 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" @@ -1535,7 +1621,7 @@ dependencies = [ "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)", + "libc 0.2.47 (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)", @@ -1560,7 +1646,7 @@ 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1597,13 +1683,30 @@ dependencies = [ "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "native-tls" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.47 (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.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.0.5 (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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1643,7 +1746,7 @@ 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1679,17 +1782,22 @@ dependencies = [ "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.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.47 (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-probe" +version = "0.1.2" +source = "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.26 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.47 (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)", ] @@ -1826,7 +1934,7 @@ 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)", + "libc 0.2.47 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1837,7 +1945,7 @@ 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)", + "libc 0.2.47 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1849,7 +1957,7 @@ name = "parking_lot_core" version = "0.4.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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.1 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1948,6 +2056,7 @@ dependencies = [ "substrate-keyring 0.1.0 (git+https://github.com/paritytech/substrate)", "substrate-primitives 0.1.0 (git+https://github.com/paritytech/substrate)", "substrate-transaction-pool 0.1.0 (git+https://github.com/paritytech/substrate)", + "substrate-trie 0.4.0 (git+https://github.com/paritytech/substrate)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2174,7 +2283,7 @@ 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2184,7 +2293,7 @@ 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2195,7 +2304,7 @@ 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)", + "libc 0.2.47 (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)", ] @@ -2207,7 +2316,7 @@ 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2290,7 +2399,7 @@ 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.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2327,6 +2436,14 @@ dependencies = [ "ucd-util 0.1.3 (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 = "rhododendron" version = "0.3.4" @@ -2344,7 +2461,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2353,7 +2470,7 @@ name = "rocksdb" version = "0.10.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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "librocksdb-sys 5.14.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2362,7 +2479,7 @@ name = "rocksdb" version = "0.11.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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "librocksdb-sys 5.14.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2372,7 +2489,7 @@ 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)", + "libc 0.2.47 (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)", @@ -2429,6 +2546,25 @@ dependencies = [ "rustc_version 0.2.3 (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.2.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" @@ -2443,6 +2579,27 @@ dependencies = [ "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "security-framework" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "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.47 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "security-framework-sys" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "MacTypes-sys 2.1.0 (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.47 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "semver" version = "0.9.0" @@ -2569,7 +2726,7 @@ dependencies = [ [[package]] name = "sr-api-macros" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2580,7 +2737,7 @@ dependencies = [ [[package]] name = "sr-io" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -2595,7 +2752,7 @@ dependencies = [ [[package]] name = "sr-primitives" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -2612,7 +2769,7 @@ dependencies = [ [[package]] name = "sr-std" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2620,7 +2777,7 @@ dependencies = [ [[package]] name = "sr-version" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2633,7 +2790,7 @@ dependencies = [ [[package]] name = "srml-aura" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2653,7 +2810,7 @@ dependencies = [ [[package]] name = "srml-balances" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2672,7 +2829,7 @@ dependencies = [ [[package]] name = "srml-consensus" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2689,7 +2846,7 @@ dependencies = [ [[package]] name = "srml-council" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2709,7 +2866,7 @@ dependencies = [ [[package]] name = "srml-democracy" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2728,7 +2885,7 @@ dependencies = [ [[package]] name = "srml-executive" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2744,7 +2901,7 @@ dependencies = [ [[package]] name = "srml-grandpa" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2764,7 +2921,7 @@ dependencies = [ [[package]] name = "srml-indices" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2783,7 +2940,7 @@ dependencies = [ [[package]] name = "srml-metadata" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2796,7 +2953,7 @@ dependencies = [ [[package]] name = "srml-session" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2816,7 +2973,7 @@ dependencies = [ [[package]] name = "srml-staking" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2839,7 +2996,7 @@ dependencies = [ [[package]] name = "srml-sudo" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2857,7 +3014,7 @@ dependencies = [ [[package]] name = "srml-support" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -2875,7 +3032,7 @@ dependencies = [ [[package]] name = "srml-support-procedural" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2887,7 +3044,7 @@ dependencies = [ [[package]] name = "srml-support-procedural-tools" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2898,7 +3055,7 @@ dependencies = [ [[package]] name = "srml-support-procedural-tools-derive" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2908,7 +3065,7 @@ dependencies = [ [[package]] name = "srml-system" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2925,7 +3082,7 @@ dependencies = [ [[package]] name = "srml-timestamp" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2942,7 +3099,7 @@ dependencies = [ [[package]] name = "srml-treasury" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2960,7 +3117,7 @@ dependencies = [ [[package]] name = "srml-upgrade-key" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3071,7 +3228,7 @@ dependencies = [ [[package]] name = "substrate-cli" version = "0.3.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -3103,7 +3260,7 @@ dependencies = [ [[package]] name = "substrate-client" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -3132,7 +3289,7 @@ dependencies = [ [[package]] name = "substrate-client-db" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", "kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", @@ -3154,7 +3311,7 @@ dependencies = [ [[package]] name = "substrate-consensus-aura" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -3176,7 +3333,7 @@ dependencies = [ [[package]] name = "substrate-consensus-aura-primitives" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0 (git+https://github.com/paritytech/substrate)", @@ -3190,7 +3347,7 @@ dependencies = [ [[package]] name = "substrate-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -3207,10 +3364,11 @@ dependencies = [ [[package]] name = "substrate-executor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 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)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3229,7 +3387,7 @@ dependencies = [ [[package]] name = "substrate-finality-grandpa" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "finality-grandpa 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3251,7 +3409,7 @@ dependencies = [ [[package]] name = "substrate-finality-grandpa-primitives" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3264,7 +3422,7 @@ dependencies = [ [[package]] name = "substrate-keyring" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3274,7 +3432,7 @@ dependencies = [ [[package]] name = "substrate-keystore" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -3290,7 +3448,7 @@ dependencies = [ [[package]] name = "substrate-network" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3313,13 +3471,12 @@ dependencies = [ [[package]] name = "substrate-network-libp2p" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "bytes 0.4.11 (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.2.2 (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.7.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3338,7 +3495,7 @@ dependencies = [ [[package]] name = "substrate-primitives" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -3363,7 +3520,7 @@ dependencies = [ [[package]] name = "substrate-rpc" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -3388,7 +3545,7 @@ dependencies = [ [[package]] name = "substrate-rpc-servers" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -3402,7 +3559,7 @@ dependencies = [ [[package]] name = "substrate-serializer" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3411,7 +3568,7 @@ dependencies = [ [[package]] name = "substrate-service" version = "0.3.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -3443,7 +3600,7 @@ dependencies = [ [[package]] name = "substrate-state-db" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3455,7 +3612,7 @@ dependencies = [ [[package]] name = "substrate-state-machine" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -3472,7 +3629,7 @@ dependencies = [ [[package]] name = "substrate-telemetry" version = "0.3.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "lazy_static 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)", @@ -3487,7 +3644,7 @@ dependencies = [ [[package]] name = "substrate-transaction-graph" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -3501,7 +3658,7 @@ dependencies = [ [[package]] name = "substrate-transaction-pool" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" 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)", @@ -3517,7 +3674,7 @@ dependencies = [ [[package]] name = "substrate-trie" version = "0.4.0" -source = "git+https://github.com/paritytech/substrate#e920bd2fbc50bbeef8e7a5d6731068a5507b77ee" +source = "git+https://github.com/paritytech/substrate#ec38ea35d02d57787c959a7c56d9992d06ecc2ba" dependencies = [ "hash-db 0.9.0 (git+https://github.com/paritytech/trie)", "memory-db 0.9.0 (git+https://github.com/paritytech/trie)", @@ -3562,7 +3719,7 @@ version = "0.7.0" 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3577,6 +3734,19 @@ name = "target_info" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "tempfile" +version = "3.0.5" +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.47 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.42 (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" @@ -3590,7 +3760,7 @@ 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3616,7 +3786,7 @@ 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)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3671,6 +3841,24 @@ dependencies = [ "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.11 (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" @@ -3774,6 +3962,16 @@ dependencies = [ "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tokio-tls" +version = "0.2.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)", + "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]] name = "tokio-udp" version = "0.1.2" @@ -3796,7 +3994,7 @@ dependencies = [ "bytes 0.4.11 (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)", + "libc 0.2.47 (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)", @@ -3804,6 +4002,11 @@ dependencies = [ "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" @@ -3846,6 +4049,11 @@ 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" @@ -3867,6 +4075,14 @@ dependencies = [ "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" @@ -3989,12 +4205,33 @@ dependencies = [ "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "websocket" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "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.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.11 (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.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.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tls 0.2.1 (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.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "which" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4109,6 +4346,7 @@ dependencies = [ ] [metadata] +"checksum MacTypes-sys 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eaf9f0d0b1cc33a4d2aee14fb4b2eac03462ef4db29c8ac4057327d8a71ad86f" "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" @@ -4125,9 +4363,11 @@ dependencies = [ "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.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 bindgen 0.43.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d52d263eacd15d26cbcf215d254b410bd58212aaa2d3c453a04b2d3b3adcf41" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" +"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 bitvec 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e37e2176261200377c7cde4c6de020394174df556c356f965e4bc239f5ce1c5a" "checksum blake2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91721a6330935673395a0607df4d49a9cb90ae12d259f1b3e0a3f6e1d486872e" @@ -4152,6 +4392,8 @@ dependencies = [ "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 constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" +"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 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.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4fe1b6f945f824c7a25afe44f62e25d714c0cc523f8e99d8db5cd1026e1269d3" @@ -4213,6 +4455,7 @@ dependencies = [ "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.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2f60ae467ef4fc5eba9a34d31648c9c8ed902faf45a217f6734ce9ea64779ac7" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum impl-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9c88568d828291c50eed30cd7fb9f8e688ad0013620186fa3e777b9f206c79f2" @@ -4234,10 +4477,11 @@ dependencies = [ "checksum kvdb-memorydb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=616b40150ded71f57f650067fcbc5c99d7c343e6)" = "" "checksum kvdb-rocksdb 0.1.4 (git+https://github.com/paritytech/parity-common?rev=616b40150ded71f57f650067fcbc5c99d7c343e6)" = "" "checksum kvdb-rocksdb 0.1.4 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)" = "" +"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.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1" "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 libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)" = "48450664a984b25d5b479554c29cc04e3150c97aa4c01da5604a2d4ed9151476" "checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2" "checksum libp2p 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ef2cce57e82d0decdf5464e4e179a319ee14c218c330bb017f62453f4ab74842" "checksum libp2p-core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "26977e332e88c070353864d5ed72b6e1175fc1c63af5709b5174877836a229b6" @@ -4254,6 +4498,7 @@ dependencies = [ "checksum libp2p-secio 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc2bee2dce0d0d054d81447b06f7e923f1a98e6b240e42674e0fdf2e4a4924f" "checksum libp2p-tcp 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fcb2bcb9402f5fe42441dd4558306ff83a28624f67c6066bdbaa98928c180e3" "checksum libp2p-uds 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3e88ac8f419f8d9487aaee9ef8785f592b37d78067c6764fe0adc1874a72c6c" +"checksum libp2p-websocket 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "80b60b65b8d7053220a0c78a09eda0a162db410067639d2b24432a9f1dc06230" "checksum libp2p-yamux 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71b4fd69a1c038152d017366d759177e2580fb4fbb56ce65429a642e011a07b1" "checksum librocksdb-sys 5.14.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b9024327233e7fac7982440f73301c00046d438c5b1011e8f4e394226ce19007" "checksum linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7860ec297f7008ff7a1e3382d7f7e1dcd69efc94751a2284bafc3d013c2aa939" @@ -4270,12 +4515,14 @@ dependencies = [ "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 multistream-select 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "886fe7ba983a194afdd9074323171c8e313b2c145561da69464d5443f1a3d121" "checksum names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef320dab323286b50fb5cdda23f61c796a72a89998ab565ca32525c5c556f2da" +"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 nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" "checksum nohash-hasher 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0d138afcce92d219ccb6eb53d9b1e8a96ac0d633cfd3c53cd9856d96d1741bb8" @@ -4288,6 +4535,7 @@ dependencies = [ "checksum opaque-debug 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d620c9c26834b34f039489ac0dfdb12c7ac15ccaf818350a64c9b5334a452ad7" "checksum opaque-debug 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "51ecbcb821e1bd256d456fe858aaa7f380b63863eab2eb86eee1bd9f33dd6682" "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.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" @@ -4337,6 +4585,7 @@ dependencies = [ "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ee84f70c8c08744ea9641a731c7fadb475bf2ecc52d7f627feb833e0b3990467" "checksum regex-syntax 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fbc557aac2b708fe84121caf261346cc2eed71978024337e42eb46b8a252ac6e" +"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" "checksum rhododendron 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e20523445e693f394c0e487113ae656071311c9ee4c1e914441bece8c929b21d" "checksum ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2c4db68a2e35f3497146b7e4563df7d4773a2433230c5e4b448328e31740458a" "checksum rocksdb 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a806011ca1d26f37729ed4dc78afd607cc86d37ee913718108b0b267e768d46f" @@ -4350,8 +4599,13 @@ dependencies = [ "checksum rw-stream-sink 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "108ad7c3d65ba866ec50a224b7b3b0cb6c682c3d805015cea859d491232346a5" "checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7" "checksum safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f7bf422d23a88c16d5090d455f182bc99c60af4df6a345c63428acf5129e347" +"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 secp256k1 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2e5cd8be8d1f76286ae246f6fc8f3d1f6b806b2d12974e049d290babb7e0a393" +"checksum security-framework 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfab8dda0e7a327c696d893df9ffa19cadc4bd195797997f5223cf5831beaf05" +"checksum security-framework-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3d6696852716b589dff9e886ff83778bb635150168e83afa8ac6b8a78cb82abc" "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" @@ -4434,6 +4688,7 @@ dependencies = [ "checksum sysinfo 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4c747a1fbe091faa7bf76c19f40099f9f12495384c811485d81cf3d60c0eae62" "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 tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7e91405c14320e5c79b3d148e1c86f40749a36e490642202a31689cb1a3452b2" "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" @@ -4443,6 +4698,7 @@ dependencies = [ "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.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "82c65483db54eb91b4ef3a9389a3364558590faf30ce473141707c0e16fda975" "checksum tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c117b6cf86bb730aab4834f10df96e4dd586eff2c3c27d3781348da49e255bde" @@ -4452,16 +4708,20 @@ dependencies = [ "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.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "354b8cd83825b3c20217a9dc174d6a0c67441a2fae5c41bcb1ea6679f6ae0f7c" "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.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" "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" "checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25" @@ -4480,6 +4740,7 @@ dependencies = [ "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.3 (registry+https://github.com/rust-lang/crates.io-index)" = "21ef487a11df1ed468cf613c78798c26282da5c30e9d49f824872d4c77b47d1d" +"checksum websocket 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c9faed2bff8af2ea6b9f8b917d3d00b467583f6781fe3def174a9e33c879703" "checksum which 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e84a603e7e0b1ce1aa1ee2b109c7be00155ce52df5081590d1ffb93f4f515cb2" "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" diff --git a/polkadot/availability-store/src/lib.rs b/polkadot/availability-store/src/lib.rs index 589a451cf3..9ea1ee1618 100644 --- a/polkadot/availability-store/src/lib.rs +++ b/polkadot/availability-store/src/lib.rs @@ -128,11 +128,11 @@ impl Store { data.block_data.encode() ); - if let Some(_extrinsic) = data.extrinsic { + if let Some(extrinsic) = data.extrinsic { tx.put_vec( columns::DATA, extrinsic_key(&data.relay_parent, &data.candidate_hash).as_slice(), - vec![], + extrinsic.encode(), ); } @@ -182,7 +182,9 @@ impl Store { pub fn extrinsic(&self, relay_parent: Hash, candidate_hash: Hash) -> Option { let encoded_key = extrinsic_key(&relay_parent, &candidate_hash); match self.inner.get(columns::DATA, &encoded_key[..]) { - Ok(Some(_raw)) => Some(Extrinsic), + Ok(Some(raw)) => Some( + Extrinsic::decode(&mut &raw[..]).expect("all stored data serialized correctly; qed") + ), Ok(None) => None, Err(e) => { warn!(target: "availability", "Error reading from availability store: {:?}", e); @@ -215,7 +217,7 @@ mod tests { parachain_id: para_id_1, candidate_hash: candidate_1, block_data: block_data_1.clone(), - extrinsic: Some(Extrinsic), + extrinsic: Some(Extrinsic { outgoing_messages: Vec::new() }), }).unwrap(); store.make_available(Data { @@ -223,7 +225,7 @@ mod tests { parachain_id: para_id_2, candidate_hash: candidate_2, block_data: block_data_2.clone(), - extrinsic: Some(Extrinsic), + extrinsic: Some(Extrinsic { outgoing_messages: Vec::new() }), }).unwrap(); assert_eq!(store.block_data(relay_parent, candidate_1).unwrap(), block_data_1); diff --git a/polkadot/consensus/Cargo.toml b/polkadot/consensus/Cargo.toml index 6fe52e5801..95557c19b5 100644 --- a/polkadot/consensus/Cargo.toml +++ b/polkadot/consensus/Cargo.toml @@ -23,6 +23,7 @@ substrate-primitives = { git = "https://github.com/paritytech/substrate" } substrate-transaction-pool = { git = "https://github.com/paritytech/substrate" } srml-support = { git = "https://github.com/paritytech/substrate" } substrate-client = { git = "https://github.com/paritytech/substrate" } +substrate-trie = { git = "https://github.com/paritytech/substrate" } sr-primitives = { git = "https://github.com/paritytech/substrate" } [dev-dependencies] diff --git a/polkadot/consensus/src/collation.rs b/polkadot/consensus/src/collation.rs index 562e48d2ca..a2f77b7946 100644 --- a/polkadot/consensus/src/collation.rs +++ b/polkadot/consensus/src/collation.rs @@ -22,9 +22,10 @@ use std::sync::Arc; use polkadot_primitives::{Block, Hash, AccountId, BlockId}; -use polkadot_primitives::parachain::{Id as ParaId, Collation, Extrinsic}; -use polkadot_primitives::parachain::ParachainHost; +use polkadot_primitives::parachain::{Id as ParaId, Collation, Extrinsic, OutgoingMessage}; +use polkadot_primitives::parachain::{CandidateReceipt, ParachainHost}; use runtime_primitives::traits::ProvideRuntimeApi; +use parachain::{wasm_executor::{self, ExternalitiesError}, MessageRef}; use futures::prelude::*; @@ -100,7 +101,9 @@ impl Future for CollationFetch }; match validate_collation(&*self.client, &self.relay_parent, &x) { - Ok(e) => return Ok(Async::Ready((x, e))), + Ok(e) => { + return Ok(Async::Ready((x, e))) + } Err(e) => { debug!("Failed to validate parachain due to API error: {}", e); @@ -117,36 +120,137 @@ impl Future for CollationFetch error_chain! { types { Error, ErrorKind, ResultExt; } + links { + Client(::client::error::Error, ::client::error::ErrorKind); + WasmValidation(wasm_executor::Error, wasm_executor::ErrorKind); + } + errors { InactiveParachain(id: ParaId) { description("Collated for inactive parachain"), display("Collated for inactive parachain: {:?}", id), } - ValidationFailure { - description("Parachain candidate failed validation."), - display("Parachain candidate failed validation."), + EgressRootMismatch(id: ParaId, expected: Hash, got: Hash) { + description("Got unexpected egress route."), + display( + "Got unexpected egress route to {:?}. (expected: {:?}, got {:?})", + id, expected, got + ), + } + MissingEgressRoute(expected: Option, got: Option) { + description("Missing or extra egress route."), + display("Missing or extra egress route. (expected: {:?}, got {:?})", expected, got), } WrongHeadData(expected: Vec, got: Vec) { description("Parachain validation produced wrong head data."), display("Parachain validation produced wrong head data (expected: {:?}, got {:?}", expected, got), } } +} - links { - Client(::client::error::Error, ::client::error::ErrorKind); +/// Compute the egress trie root for a set of messages. +pub fn egress_trie_root>(messages: I) -> Hash + where A: AsRef<[u8]> +{ + ::trie::ordered_trie_root::(messages) +} + +fn check_and_compute_extrinsic( + mut outgoing: Vec, + expected_egress_roots: &[(ParaId, Hash)], +) -> Result { + // stable sort messages by parachain ID. + outgoing.sort_by_key(|msg| ParaId::from(msg.target)); + + { + let mut messages_iter = outgoing.iter().peekable(); + let mut expected_egress_roots = expected_egress_roots.iter(); + while let Some(batch_target) = messages_iter.peek().map(|o| o.target) { + let expected_root = match expected_egress_roots.next() { + None => return Err(ErrorKind::MissingEgressRoute(Some(batch_target), None).into()), + Some(&(id, ref root)) => if id == batch_target { + root + } else { + return Err(ErrorKind::MissingEgressRoute(Some(batch_target), Some(id)).into()); + } + }; + + // we borrow the iterator mutably to ensure it advances so the + // next iteration of the loop starts with `messages_iter` pointing to + // the next batch. + let messages_to = messages_iter + .clone() + .take_while(|o| o.target == batch_target) + .map(|o| { let _ = messages_iter.next(); &o.data[..] }); + + let computed_root = egress_trie_root(messages_to); + if &computed_root != expected_root { + return Err(ErrorKind::EgressRootMismatch( + batch_target, + expected_root.clone(), + computed_root, + ).into()); + } + } + + // also check that there are no more additional expected roots. + if let Some((next_target, _)) = expected_egress_roots.next() { + return Err(ErrorKind::MissingEgressRoute(None, Some(*next_target)).into()); + } + } + + Ok(Extrinsic { outgoing_messages: outgoing }) +} + +struct Externalities { + parachain_index: ParaId, + outgoing: Vec, +} + +impl wasm_executor::Externalities for Externalities { + fn post_message(&mut self, message: MessageRef) -> Result<(), ExternalitiesError> { + // TODO: https://github.com/paritytech/polkadot/issues/92 + // check per-message and per-byte fees for the parachain. + let target: ParaId = message.target.into(); + if target == self.parachain_index { + return Err(ExternalitiesError::CannotPostMessage("posted message to self")); + } + + self.outgoing.push(OutgoingMessage { + target, + data: message.data.to_vec(), + }); + + Ok(()) + } +} + +impl Externalities { + // Performs final checks of validity, producing the extrinsic data. + fn final_checks( + self, + candidate: &CandidateReceipt, + ) -> Result { + check_and_compute_extrinsic( + self.outgoing, + &candidate.egress_queue_roots[..], + ) } } /// Check whether a given collation is valid. Returns `Ok` on success, error otherwise. +/// +/// This assumes that basic validity checks have been done: +/// - Block data hash is the same as linked in candidate receipt. pub fn validate_collation

( client: &P, relay_parent: &BlockId, collation: &Collation ) -> Result where P: ProvideRuntimeApi, - P::Api: ParachainHost + P::Api: ParachainHost, { - use parachain::{self, ValidationParams}; + use parachain::ValidationParams; let api = client.runtime_api(); let para_id = collation.receipt.parachain_index; @@ -161,10 +265,15 @@ pub fn validate_collation

( block_data: collation.block_data.0.clone(), }; - match parachain::wasm::validate_candidate(&validation_code, params) { + let mut ext = Externalities { + parachain_index: collation.receipt.parachain_index.clone(), + outgoing: Vec::new(), + }; + + match wasm_executor::validate_candidate(&validation_code, params, &mut ext) { Ok(result) => { if result.head_data == collation.receipt.head_data.0 { - Ok(Extrinsic) + ext.final_checks(&collation.receipt) } else { Err(ErrorKind::WrongHeadData( collation.receipt.head_data.0.clone(), @@ -172,6 +281,60 @@ pub fn validate_collation

( ).into()) } } - Err(_) => Err(ErrorKind::ValidationFailure.into()) + Err(e) => Err(e.into()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use parachain::wasm_executor::Externalities as ExternalitiesTrait; + + #[test] + fn egress_roots() { + let messages = vec![ + OutgoingMessage { target: 3.into(), data: vec![1, 1, 1] }, + OutgoingMessage { target: 1.into(), data: vec![1, 2, 3] }, + OutgoingMessage { target: 2.into(), data: vec![4, 5, 6] }, + OutgoingMessage { target: 1.into(), data: vec![7, 8, 9] }, + ]; + + let root_1 = egress_trie_root(&[vec![1, 2, 3], vec![7, 8, 9]]); + let root_2 = egress_trie_root(&[vec![4, 5, 6]]); + let root_3 = egress_trie_root(&[vec![1, 1, 1]]); + + assert!(check_and_compute_extrinsic( + messages.clone(), + &[(1.into(), root_1), (2.into(), root_2), (3.into(), root_3)], + ).is_ok()); + + // missing root. + assert!(check_and_compute_extrinsic( + messages.clone(), + &[(1.into(), root_1), (3.into(), root_3)], + ).is_err()); + + // extra root. + assert!(check_and_compute_extrinsic( + messages.clone(), + &[(1.into(), root_1), (2.into(), root_2), (3.into(), root_3), (4.into(), Default::default())], + ).is_err()); + + // root mismatch. + assert!(check_and_compute_extrinsic( + messages.clone(), + &[(1.into(), root_2), (2.into(), root_1), (3.into(), root_3)], + ).is_err()); + } + + #[test] + fn ext_rejects_local_message() { + let mut ext = Externalities { + parachain_index: 5.into(), + outgoing: Vec::new(), + }; + + assert!(ext.post_message(MessageRef { target: 1, data: &[] }).is_ok()); + assert!(ext.post_message(MessageRef { target: 5, data: &[] }).is_err()); } } diff --git a/polkadot/consensus/src/lib.rs b/polkadot/consensus/src/lib.rs index e15aa77a30..199b33ab73 100644 --- a/polkadot/consensus/src/lib.rs +++ b/polkadot/consensus/src/lib.rs @@ -41,6 +41,7 @@ extern crate substrate_primitives as primitives; extern crate srml_support as runtime_support; extern crate sr_primitives as runtime_primitives; extern crate substrate_client as client; +extern crate substrate_trie as trie; extern crate exit_future; extern crate tokio; @@ -90,7 +91,7 @@ use futures::future::{self, Either}; use collation::CollationFetch; use dynamic_inclusion::DynamicInclusion; -pub use self::collation::{validate_collation, Collators}; +pub use self::collation::{validate_collation, egress_trie_root, Collators}; pub use self::error::{ErrorKind, Error}; pub use self::shared_table::{SharedTable, ParachainWork, PrimedParachainWork, Validated, Statement, SignedStatement, GenericStatement}; @@ -113,8 +114,6 @@ pub trait TableRouter: Clone { type Error; /// Future that resolves when candidate data is fetched. type FetchCandidate: IntoFuture; - /// Future that resolves when extrinsic candidate data is fetched. - type FetchExtrinsic: IntoFuture; /// Call with local candidate data. This will make the data available on the network, /// and sign, import, and broadcast a statement about the candidate. @@ -122,9 +121,6 @@ pub trait TableRouter: Clone { /// Fetch block data for a specific candidate. fn fetch_block_data(&self, candidate: &CandidateReceipt) -> Self::FetchCandidate; - - /// Fetch extrinsic data for a specific candidate. - fn fetch_extrinsic_data(&self, candidate: &CandidateReceipt) -> Self::FetchExtrinsic; } /// A long-lived network which can create parachain statement and BFT message routing processes on demand. @@ -229,7 +225,6 @@ struct ParachainConsensus { extrinsic_store: ExtrinsicStore, /// Live agreements. live_instances: Mutex>>, - } impl ParachainConsensus where diff --git a/polkadot/consensus/src/shared_table/mod.rs b/polkadot/consensus/src/shared_table/mod.rs index a74eae8ea6..8a7967ea76 100644 --- a/polkadot/consensus/src/shared_table/mod.rs +++ b/polkadot/consensus/src/shared_table/mod.rs @@ -156,7 +156,7 @@ pub struct Validated { /// Block data to ensure availability of. pub block_data: BlockData, /// Extrinsic data to ensure availability of. - pub extrinsic: Extrinsic, + pub extrinsic: Option, } /// Future that performs parachain validation work. @@ -172,7 +172,7 @@ impl ParachainWork { pub fn prime(self, api: Arc

) -> PrimedParachainWork< D, - impl Send + FnMut(&BlockId, &Collation) -> bool, + impl Send + FnMut(&BlockId, &Collation) -> Result, > where P: Send + Sync + 'static, @@ -186,10 +186,10 @@ impl ParachainWork { ); match res { - Ok(_) => true, + Ok(e) => Ok(e), Err(e) => { debug!(target: "consensus", "Encountered bad collation: {}", e); - false + Err(()) } } }; @@ -199,7 +199,7 @@ impl ParachainWork { /// Prime the parachain work with a custom validation function. pub fn prime_with(self, validate: F) -> PrimedParachainWork - where F: FnMut(&BlockId, &Collation) -> bool + where F: FnMut(&BlockId, &Collation) -> Result { PrimedParachainWork { inner: self, validate } } @@ -219,7 +219,7 @@ pub struct PrimedParachainWork { impl Future for PrimedParachainWork where D: Future, - F: FnMut(&BlockId, &Collation) -> bool, + F: FnMut(&BlockId, &Collation) -> Result, Err: From<::std::io::Error>, { type Item = Validated; @@ -230,27 +230,30 @@ impl Future for PrimedParachainWork let candidate = &work.candidate_receipt; let block = try_ready!(work.fetch_block_data.poll()); - let is_good = (self.validate)( + let validation_res = (self.validate)( &BlockId::hash(self.inner.relay_parent), &Collation { block_data: block.clone(), receipt: candidate.clone() }, ); let candidate_hash = candidate.hash(); - debug!(target: "consensus", "Making validity statement about candidate {}: is_good? {:?}", candidate_hash, is_good); - let validity_statement = match is_good { - true => GenericStatement::Valid(candidate_hash), - false => GenericStatement::Invalid(candidate_hash), - }; + debug!(target: "consensus", "Making validity statement about candidate {}: is_good? {:?}", + candidate_hash, validation_res.is_ok()); - let extrinsic = Extrinsic; - self.inner.extrinsic_store.make_available(Data { - relay_parent: self.inner.relay_parent, - parachain_id: work.candidate_receipt.parachain_index, - candidate_hash, - block_data: block.clone(), - extrinsic: Some(extrinsic.clone()), - })?; + let (extrinsic, validity_statement) = match validation_res { + Err(()) => (None, GenericStatement::Invalid(candidate_hash)), + Ok(extrinsic) => { + self.inner.extrinsic_store.make_available(Data { + relay_parent: self.inner.relay_parent, + parachain_id: work.candidate_receipt.parachain_index, + candidate_hash, + block_data: block.clone(), + extrinsic: Some(extrinsic.clone()), + })?; + + (Some(extrinsic), GenericStatement::Valid(candidate_hash)) + } + }; Ok(Async::Ready(Validated { validity: validity_statement, @@ -444,7 +447,6 @@ mod tests { impl TableRouter for DummyRouter { type Error = ::std::io::Error; type FetchCandidate = ::futures::future::FutureResult; - type FetchExtrinsic = ::futures::future::FutureResult; fn local_candidate(&self, _candidate: CandidateReceipt, _block_data: BlockData, _extrinsic: Extrinsic) { @@ -452,9 +454,6 @@ mod tests { fn fetch_block_data(&self, _candidate: &CandidateReceipt) -> Self::FetchCandidate { future::ok(BlockData(vec![1, 2, 3, 4, 5])) } - fn fetch_extrinsic_data(&self, _candidate: &CandidateReceipt) -> Self::FetchExtrinsic { - future::ok(Extrinsic) - } } #[test] @@ -586,7 +585,9 @@ mod tests { extrinsic_store: store.clone(), }; - let produced = producer.prime_with(|_, _| true).wait().unwrap(); + let produced = producer.prime_with(|_, _| Ok(Extrinsic { outgoing_messages: Vec::new() })) + .wait() + .unwrap(); assert_eq!(produced.block_data, block_data); assert_eq!(produced.validity, GenericStatement::Valid(hash)); @@ -624,7 +625,9 @@ mod tests { extrinsic_store: store.clone(), }; - let produced = producer.prime_with(|_, _| true).wait().unwrap(); + let produced = producer.prime_with(|_, _| Ok(Extrinsic { outgoing_messages: Vec::new() })) + .wait() + .unwrap(); assert_eq!(produced.block_data, block_data); diff --git a/polkadot/network/src/consensus.rs b/polkadot/network/src/consensus.rs index 75f69819b6..a828342186 100644 --- a/polkadot/network/src/consensus.rs +++ b/polkadot/network/src/consensus.rs @@ -231,13 +231,21 @@ impl Knowledge { /// Note a statement seen from another validator. pub(crate) fn note_statement(&mut self, from: SessionKey, statement: &Statement) { + // those proposing the candidate or declaring it valid know everything. + // those claiming it invalid do not have the extrinsic data as it is + // generated by valid execution. match *statement { GenericStatement::Candidate(ref c) => { let mut entry = self.candidates.entry(c.hash()).or_insert_with(Default::default); entry.knows_block_data.push(from); entry.knows_extrinsic.push(from); } - GenericStatement::Valid(ref hash) | GenericStatement::Invalid(ref hash) => self.candidates.entry(*hash) + GenericStatement::Valid(ref hash) => { + let mut entry = self.candidates.entry(*hash).or_insert_with(Default::default); + entry.knows_block_data.push(from); + entry.knows_extrinsic.push(from); + } + GenericStatement::Invalid(ref hash) => self.candidates.entry(*hash) .or_insert_with(Default::default) .knows_block_data .push(from), diff --git a/polkadot/network/src/router.rs b/polkadot/network/src/router.rs index 58d0c38500..e8e25da7f1 100644 --- a/polkadot/network/src/router.rs +++ b/polkadot/network/src/router.rs @@ -167,7 +167,7 @@ impl Router

knowledge.lock().note_candidate( candidate_hash, Some(produced.block_data), - Some(produced.extrinsic), + produced.extrinsic, ); let mut gossip = network.consensus_gossip().write(); @@ -188,7 +188,6 @@ impl TableRouter for Router

{ type Error = io::Error; type FetchCandidate = BlockDataReceiver; - type FetchExtrinsic = Result; fn local_candidate(&self, receipt: CandidateReceipt, block_data: BlockData, extrinsic: Extrinsic) { // give to network to make available. @@ -207,10 +206,6 @@ impl TableRouter for Router

let rx = self.network.with_spec(|spec, ctx| { spec.fetch_block_data(ctx, candidate, parent_hash) }); BlockDataReceiver { inner: rx } } - - fn fetch_extrinsic_data(&self, _candidate: &CandidateReceipt) -> Self::FetchExtrinsic { - Ok(Extrinsic) - } } impl

Drop for Router

{ diff --git a/polkadot/parachain/Cargo.toml b/polkadot/parachain/Cargo.toml index 83daeb7ed6..d34dd9b2b9 100644 --- a/polkadot/parachain/Cargo.toml +++ b/polkadot/parachain/Cargo.toml @@ -15,4 +15,5 @@ tiny-keccak = "1.4" [features] default = ["std"] +wasm-api = [] std = ["parity-codec/std", "wasmi", "error-chain"] diff --git a/polkadot/parachain/src/lib.rs b/polkadot/parachain/src/lib.rs index e81df3a967..90a8df3ccf 100644 --- a/polkadot/parachain/src/lib.rs +++ b/polkadot/parachain/src/lib.rs @@ -37,8 +37,8 @@ //! ^~~returned pointer //! ``` //! -//! The `load_params` and `write_result` functions provide utilities for setting up -//! a parachain WASM module in Rust. +//! The `wasm_api` module (enabled only with the wasm-api feature) provides utilities +//! for setting up a parachain WASM module in Rust. #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), feature(alloc))] @@ -64,15 +64,17 @@ extern crate error_chain; #[cfg(not(feature = "std"))] use alloc::vec::Vec; -use codec::{Encode, Decode}; #[cfg(feature = "std")] -pub mod wasm; +pub mod wasm_executor; + +#[cfg(feature = "wasm-api")] +pub mod wasm_api; /// Validation parameters for evaluating the parachain validity function. // TODO: consolidated ingress and balance downloads -#[derive(PartialEq, Eq, Encode, Decode)] -#[cfg_attr(feature = "std", derive(Debug))] +#[derive(PartialEq, Eq, Decode)] +#[cfg_attr(feature = "std", derive(Debug, Encode))] pub struct ValidationParams { /// The collation body. pub block_data: Vec, @@ -82,38 +84,19 @@ pub struct ValidationParams { /// The result of parachain validation. // TODO: egress and balance uploads -#[derive(PartialEq, Eq, Encode, Decode)] -#[cfg_attr(feature = "std", derive(Debug))] +#[derive(PartialEq, Eq, Encode)] +#[cfg_attr(feature = "std", derive(Debug, Decode))] pub struct ValidationResult { /// New head data that should be included in the relay chain state. pub head_data: Vec, } -/// Load the validation params from memory when implementing a Rust parachain. -/// -/// Offset and length must have been provided by the validation -/// function's entry point. -pub unsafe fn load_params(offset: usize, len: usize) -> ValidationParams { - let mut slice = ::core::slice::from_raw_parts(offset as *const u8, len); - - ValidationParams::decode(&mut slice).expect("Invalid input data") +/// A reference to a message. +#[cfg(feature = "std")] +pub struct MessageRef<'a> { + /// The target parachain. + pub target: u32, + /// Underlying data of the message. + pub data: &'a [u8], } -/// Allocate the validation result in memory, getting the return-pointer back. -/// -/// As described in the crate docs, this is a pointer to the appended length -/// of the vector. -pub fn write_result(result: ValidationResult) -> usize { - let mut encoded = result.encode(); - let len = encoded.len(); - - assert!(len <= u32::max_value() as usize, "Len too large for parachain-WASM abi"); - (len as u32).using_encoded(|s| encoded.extend(s)); - - // do not alter `encoded` beyond this point. may reallocate. - let end_ptr = &encoded[len] as *const u8 as usize; - - // leak so it doesn't get zeroed. - ::core::mem::forget(encoded); - end_ptr -} diff --git a/polkadot/parachain/src/wasm_api.rs b/polkadot/parachain/src/wasm_api.rs new file mode 100644 index 0000000000..0fa8a2de1a --- /dev/null +++ b/polkadot/parachain/src/wasm_api.rs @@ -0,0 +1,63 @@ +// Copyright 2019 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +//! Utilities for writing parachain WASM. + +use codec::{Encode, Decode}; +use super::{ValidationParams, ValidationResult, Message}; + +mod ll { + extern "C" { + pub(super) fn ext_post_message(target: u32, data_ptr: *const u8, data_len: u32); + } +} + +/// Load the validation params from memory when implementing a Rust parachain. +/// +/// Offset and length must have been provided by the validation +/// function's entry point. +pub unsafe fn load_params(offset: usize, len: usize) -> ValidationParams { + let mut slice = ::core::slice::from_raw_parts(offset as *const u8, len); + + ValidationParams::decode(&mut slice).expect("Invalid input data") +} + +/// Allocate the validation result in memory, getting the return-pointer back. +/// +/// As described in the crate docs, this is a pointer to the appended length +/// of the vector. +pub fn write_result(result: ValidationResult) -> usize { + let mut encoded = result.encode(); + let len = encoded.len(); + + assert!(len <= u32::max_value() as usize, "Len too large for parachain-WASM abi"); + (len as u32).using_encoded(|s| encoded.extend(s)); + + // do not alter `encoded` beyond this point. may reallocate. + let end_ptr = &encoded[len] as *const u8 as usize; + + // leak so it doesn't get zeroed. + ::core::mem::forget(encoded); + end_ptr +} + +/// Post a message to another parachain. +pub fn post_message(message: &Message) { + let data_ptr = message.data.as_ptr(); + let data_len = message.data.len(); + + unsafe { ll::ext_post_message(message.target, data_ptr, data_len as u32) } +} diff --git a/polkadot/parachain/src/wasm.rs b/polkadot/parachain/src/wasm_executor.rs similarity index 51% rename from polkadot/parachain/src/wasm.rs rename to polkadot/parachain/src/wasm_executor.rs index 73ccfdfdaf..c86438290e 100644 --- a/polkadot/parachain/src/wasm.rs +++ b/polkadot/parachain/src/wasm_executor.rs @@ -22,19 +22,25 @@ use codec::{Decode, Encode}; -use wasmi::{self, Module, ModuleInstance, MemoryInstance, MemoryDescriptor, MemoryRef, ModuleImportResolver}; -use wasmi::{memory_units, RuntimeValue}; -use wasmi::Error as WasmError; +use wasmi::{self, Module, ModuleInstance, Trap, MemoryInstance, MemoryDescriptor, MemoryRef, ModuleImportResolver}; +use wasmi::{memory_units, RuntimeValue, Externals, Error as WasmError, ValueType}; use wasmi::memory_units::{Bytes, Pages, RoundUpTo}; -use super::{ValidationParams, ValidationResult}; +use super::{ValidationParams, ValidationResult, MessageRef}; use std::cell::RefCell; +use std::fmt; + +mod ids { + /// Post a message to another parachain. + pub const POST_MESSAGE: usize = 1; +} error_chain! { types { Error, ErrorKind, ResultExt; } foreign_links { Wasm(WasmError); + Externalities(ExternalitiesError); } errors { /// Call data too big. WASM32 only has a 32-bit address space. @@ -50,12 +56,68 @@ error_chain! { } } +/// Errors that can occur in externalities of parachain validation. +#[derive(Debug, Clone)] +pub enum ExternalitiesError { + /// Unable to post a message due to the given reason. + CannotPostMessage(&'static str), +} + +/// Externalities for parachain validation. +pub trait Externalities { + /// Called when a message is to be posted to another parachain. + fn post_message(&mut self, message: MessageRef) -> Result<(), ExternalitiesError>; +} + +impl fmt::Display for ExternalitiesError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + ExternalitiesError::CannotPostMessage(ref s) + => write!(f, "Cannot post message: {}", s), + } + } +} + +impl wasmi::HostError for ExternalitiesError {} +impl ::std::error::Error for ExternalitiesError {} + struct Resolver { max_memory: u32, // in pages. memory: RefCell>, } impl ModuleImportResolver for Resolver { + fn resolve_func( + &self, + field_name: &str, + signature: &wasmi::Signature + ) -> Result { + match field_name { + "ext_post_message" => { + let index = ids::POST_MESSAGE; + let (params, ret_ty): (&[ValueType], Option) = + (&[ValueType::I32, ValueType::I32, ValueType::I32], None); + + if signature.params() != params && signature.return_type() != ret_ty { + Err(WasmError::Instantiation( + format!("Export {} has a bad signature", field_name) + )) + } else { + Ok(wasmi::FuncInstance::alloc_host( + wasmi::Signature::new(¶ms[..], ret_ty), + index, + )) + } + } + _ => { + Err(WasmError::Instantiation( + format!("Export {} not found", field_name), + )) + } + } + + } + fn resolve_memory( &self, field_name: &str, @@ -79,17 +141,69 @@ impl ModuleImportResolver for Resolver { } } +struct ValidationExternals<'a, E: 'a> { + externalities: &'a mut E, + memory: &'a MemoryRef, +} + +impl<'a, E: 'a + Externalities> ValidationExternals<'a, E> { + /// Signature: post_message(u32, *const u8, u32) -> None + /// usage: post_message(target parachain, data ptr, data len). + /// Data is the raw data of the message. + fn ext_post_message(&mut self, args: ::wasmi::RuntimeArgs) -> Result<(), Trap> { + let target: u32 = args.nth_checked(0)?; + let data_ptr: u32 = args.nth_checked(1)?; + let data_len: u32 = args.nth_checked(2)?; + + let (data_ptr, data_len) = (data_ptr as usize, data_len as usize); + + self.memory.with_direct_access(|mem| { + if mem.len() < (data_ptr + data_len) { + Err(Trap::new(wasmi::TrapKind::MemoryAccessOutOfBounds)) + } else { + let res = self.externalities.post_message(MessageRef { + target, + data: &mem[data_ptr..][..data_len], + }); + + res.map_err(|e| Trap::new(wasmi::TrapKind::Host( + Box::new(e) as Box<_> + ))) + } + }) + } +} + +impl<'a, E: 'a + Externalities> Externals for ValidationExternals<'a, E> { + fn invoke_index( + &mut self, + index: usize, + args: ::wasmi::RuntimeArgs, + ) -> Result, Trap> { + match index { + ids::POST_MESSAGE => self.ext_post_message(args).map(|_| None), + _ => panic!("no externality at given index"), + } + } +} + /// Validate a candidate under the given validation code. /// /// This will fail if the validation code is not a proper parachain validation module. -pub fn validate_candidate(validation_code: &[u8], params: ValidationParams) -> Result { +pub fn validate_candidate( + validation_code: &[u8], + params: ValidationParams, + externalities: &mut E, +) -> Result { use wasmi::LINEAR_MEMORY_PAGE_SIZE; // maximum memory in bytes const MAX_MEM: u32 = 1024 * 1024 * 1024; // 1 GiB // instantiate the module. - let (module, memory) = { + let memory; + let mut externals; + let module = { let module = Module::from_buffer(validation_code)?; let module_resolver = Resolver { @@ -100,14 +214,19 @@ pub fn validate_candidate(validation_code: &[u8], params: ValidationParams) -> R let module = ModuleInstance::new( &module, &wasmi::ImportsBuilder::new().with_resolver("env", &module_resolver), - )?.run_start(&mut wasmi::NopExternals).map_err(WasmError::Trap)?; + )?; - let memory = module_resolver.memory.borrow() + memory = module_resolver.memory.borrow() .as_ref() .ok_or_else(|| WasmError::Instantiation("No imported memory instance".to_owned()))? .clone(); - (module, memory) + externals = ValidationExternals { + externalities, + memory: &memory, + }; + + module.run_start(&mut externals).map_err(WasmError::Trap)? }; // allocate call data in memory. @@ -135,8 +254,14 @@ pub fn validate_candidate(validation_code: &[u8], params: ValidationParams) -> R let output = module.invoke_export( "validate", &[RuntimeValue::I32(offset as i32), RuntimeValue::I32(len as i32)], - &mut wasmi::NopExternals, - )?; + &mut externals, + ) + .map_err(|e| -> Error { + e.as_host_error() + .and_then(|he| he.downcast_ref::()) + .map(|ee| ErrorKind::Externalities(ee.clone()).into()) + .unwrap_or_else(move || e.into()) + })?; match output { Some(RuntimeValue::I32(len_offset)) => { @@ -144,9 +269,10 @@ pub fn validate_candidate(validation_code: &[u8], params: ValidationParams) -> R let mut len_bytes = [0u8; 4]; memory.get_into(len_offset, &mut len_bytes)?; + let len_offset = len_offset as usize; let len = u32::decode(&mut &len_bytes[..]) - .ok_or_else(|| ErrorKind::BadReturn)?; + .ok_or_else(|| ErrorKind::BadReturn)? as usize; let return_offset = if len > len_offset { bail!(ErrorKind::BadReturn); @@ -154,11 +280,15 @@ pub fn validate_candidate(validation_code: &[u8], params: ValidationParams) -> R len_offset - len }; - // TODO: optimize when `wasmi` lets you inspect memory with a closure. - let raw_return = memory.get(return_offset, len as usize)?; - ValidationResult::decode(&mut &raw_return[..]) - .ok_or_else(|| ErrorKind::BadReturn) - .map_err(Into::into) + memory.with_direct_access(|mem| { + if mem.len() < return_offset + len { + return Err(ErrorKind::BadReturn.into()); + } + + ValidationResult::decode(&mut &mem[return_offset..][..len]) + .ok_or_else(|| ErrorKind::BadReturn) + .map_err(Into::into) + }) } _ => bail!(ErrorKind::BadReturn), } diff --git a/polkadot/parachain/tests/adder.rs b/polkadot/parachain/tests/adder.rs index 9903db1fbb..b0086e4a72 100644 --- a/polkadot/parachain/tests/adder.rs +++ b/polkadot/parachain/tests/adder.rs @@ -22,7 +22,8 @@ extern crate parity_codec as codec; extern crate polkadot_parachain as parachain; extern crate tiny_keccak; -use parachain::ValidationParams; +use parachain::{MessageRef, ValidationParams}; +use parachain::wasm_executor::{Externalities, ExternalitiesError}; use codec::{Decode, Encode}; /// Head data for this parachain. @@ -45,6 +46,13 @@ struct BlockData { add: u64, } +struct DummyExt; +impl Externalities for DummyExt { + fn post_message(&mut self, _message: MessageRef) -> Result<(), ExternalitiesError> { + Ok(()) + } +} + const TEST_CODE: &[u8] = include_bytes!("res/adder.wasm"); fn hash_state(state: u64) -> [u8; 32] { @@ -68,10 +76,14 @@ fn execute_good_on_parent() { add: 512, }; - let ret = parachain::wasm::validate_candidate(TEST_CODE, ValidationParams { - parent_head: parent_head.encode(), - block_data: block_data.encode(), - }).unwrap(); + let ret = parachain::wasm_executor::validate_candidate( + TEST_CODE, + ValidationParams { + parent_head: parent_head.encode(), + block_data: block_data.encode(), + }, + &mut DummyExt, + ).unwrap(); let new_head = HeadData::decode(&mut &ret.head_data[..]).unwrap(); @@ -98,10 +110,14 @@ fn execute_good_chain_on_parent() { add, }; - let ret = parachain::wasm::validate_candidate(TEST_CODE, ValidationParams { - parent_head: parent_head.encode(), - block_data: block_data.encode(), - }).unwrap(); + let ret = parachain::wasm_executor::validate_candidate( + TEST_CODE, + ValidationParams { + parent_head: parent_head.encode(), + block_data: block_data.encode(), + }, + &mut DummyExt, + ).unwrap(); let new_head = HeadData::decode(&mut &ret.head_data[..]).unwrap(); @@ -128,8 +144,12 @@ fn execute_bad_on_parent() { add: 256, }; - let _ret = parachain::wasm::validate_candidate(TEST_CODE, ValidationParams { - parent_head: parent_head.encode(), - block_data: block_data.encode(), - }).unwrap_err(); + let _ret = parachain::wasm_executor::validate_candidate( + TEST_CODE, + ValidationParams { + parent_head: parent_head.encode(), + block_data: block_data.encode(), + }, + &mut DummyExt, + ).unwrap_err(); } diff --git a/polkadot/parachain/tests/res/adder.wasm b/polkadot/parachain/tests/res/adder.wasm index 924cc0444a..3261356729 100644 Binary files a/polkadot/parachain/tests/res/adder.wasm and b/polkadot/parachain/tests/res/adder.wasm differ diff --git a/polkadot/primitives/src/parachain.rs b/polkadot/primitives/src/parachain.rs index d2bc3b46b6..e5bb9ffe03 100644 --- a/polkadot/primitives/src/parachain.rs +++ b/polkadot/primitives/src/parachain.rs @@ -66,12 +66,44 @@ pub struct DutyRoster { pub validator_duty: Vec, } -/// Extrinsic data for a parachain. -#[derive(PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] +/// An outgoing message +#[derive(Clone, PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug, Encode, Decode))] #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] #[cfg_attr(feature = "std", serde(deny_unknown_fields))] -pub struct Extrinsic; +pub struct OutgoingMessage { + /// The target parachain. + pub target: Id, + /// The message data. + pub data: Vec, +} + +impl PartialOrd for OutgoingMessage { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.target.cmp(&other.target)) + } +} + +impl Ord for OutgoingMessage { + fn cmp(&self, other: &Self) -> Ordering { + self.target.cmp(&other.target) + } +} + +/// Extrinsic data for a parachain candidate. +/// +/// This is data produced by evaluating the candidate. It contains +/// full records of all outgoing messages to other parachains. +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug, Encode, Decode))] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +#[cfg_attr(feature = "std", serde(deny_unknown_fields))] +pub struct Extrinsic { + /// The outgoing messages from the execution of the parachain. + /// + /// This must be sorted in ascending order by parachain ID. + pub outgoing_messages: Vec +} /// Candidate receipt type. #[derive(PartialEq, Eq, Clone, Encode, Decode)] @@ -89,7 +121,8 @@ pub struct CandidateReceipt { pub head_data: HeadData, /// Balance uploads to the relay chain. pub balance_uploads: Vec<(super::AccountId, u64)>, - /// Egress queue roots. + /// Egress queue roots. Must be sorted lexicographically (ascending) + /// by parachain ID. pub egress_queue_roots: Vec<(Id, Hash)>, /// Fees paid from the chain to the relay chain validators pub fees: u64, diff --git a/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm index d7d1db7585..218354264c 100644 Binary files a/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm and b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm differ diff --git a/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm index a008cafd69..6c6448ec9c 100755 Binary files a/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm and b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm differ diff --git a/polkadot/test-parachains/adder/src/src b/polkadot/test-parachains/adder/src/src deleted file mode 100644 index e8310385c5..0000000000 --- a/polkadot/test-parachains/adder/src/src +++ /dev/null @@ -1 +0,0 @@ -src \ No newline at end of file diff --git a/polkadot/test-parachains/adder/wasm/Cargo.toml b/polkadot/test-parachains/adder/wasm/Cargo.toml index 087b937b64..55e96b6b66 100644 --- a/polkadot/test-parachains/adder/wasm/Cargo.toml +++ b/polkadot/test-parachains/adder/wasm/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] [dependencies] adder = { path = ".." } -polkadot-parachain = { path = "../../../parachain", default-features = false } +polkadot-parachain = { path = "../../../parachain", default-features = false, features = ["wasm-api"] } wee_alloc = { version = "0.4.1" } pwasm-libc = { version = "0.2" } tiny-keccak = "1.4" diff --git a/polkadot/test-parachains/adder/wasm/src/lib.rs b/polkadot/test-parachains/adder/wasm/src/lib.rs index 1d14c3bc51..3a687a748a 100644 --- a/polkadot/test-parachains/adder/wasm/src/lib.rs +++ b/polkadot/test-parachains/adder/wasm/src/lib.rs @@ -23,13 +23,11 @@ )] extern crate alloc; -extern crate wee_alloc; extern crate pwasm_libc; extern crate adder; extern crate polkadot_parachain as parachain; extern crate tiny_keccak; -// Define global allocator. #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; @@ -56,7 +54,7 @@ pub fn oom(_: ::core::alloc::Layout) -> ! { #[no_mangle] pub extern fn validate(offset: usize, len: usize) -> usize { - let params = unsafe { ::parachain::load_params(offset, len) }; + let params = unsafe { ::parachain::wasm_api::load_params(offset, len) }; let parent_head = HeadData::decode(&mut ¶ms.parent_head[..]) .expect("invalid parent head format."); @@ -66,7 +64,9 @@ pub extern fn validate(offset: usize, len: usize) -> usize { let parent_hash = ::tiny_keccak::keccak256(¶ms.parent_head[..]); match ::adder::execute(parent_hash, parent_head, &block_data) { - Ok(new_head) => parachain::write_result(ValidationResult { head_data: new_head.encode() }), + Ok(new_head) => parachain::wasm_api::write_result( + ValidationResult { head_data: new_head.encode() } + ), Err(_) => panic!("execution failure"), } }