diff --git a/Cargo.lock b/Cargo.lock index 7b5d8f5e3..e98ecfd8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,7 +7,7 @@ dependencies = [ "ethcore-logger 1.8.0", "ethcore-util 1.8.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-wasm 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-wasm 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", "wasm-utils 0.1.0 (git+https://github.com/paritytech/wasm-utils)", ] @@ -78,7 +78,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -87,11 +87,11 @@ name = "backtrace" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace-sys 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -101,22 +101,22 @@ name = "backtrace" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace-sys 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "backtrace-sys" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -157,7 +157,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -243,11 +243,16 @@ name = "cargo_metadata" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "cc" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "cfg-if" version = "0.1.2" @@ -274,7 +279,7 @@ dependencies = [ [[package]] name = "clap" -version = "2.26.0" +version = "2.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -282,8 +287,7 @@ dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "textwrap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -298,11 +302,11 @@ dependencies = [ [[package]] name = "clippy" -version = "0.0.158" +version = "0.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cargo_metadata 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "clippy_lints 0.0.158 (registry+https://github.com/rust-lang/crates.io-index)", + "clippy_lints 0.0.163 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -321,18 +325,18 @@ dependencies = [ [[package]] name = "clippy_lints" -version = "0.0.158" +version = "0.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "itertools 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -385,7 +389,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -393,7 +397,7 @@ name = "core-foundation-sys" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -421,7 +425,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.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -435,7 +439,7 @@ name = "daemonize" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -459,8 +463,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -513,8 +517,8 @@ version = "0.5.6" source = "git+https://github.com/paritytech/rust-secp256k1#b6b67055edc929057e97d64f036c78ad91f58a7f" dependencies = [ "arrayvec 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", - "gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -525,8 +529,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -536,9 +540,11 @@ name = "ethash" version = "1.8.0" dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "hash 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "memmap 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "primal 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -573,7 +579,7 @@ dependencies = [ "ethkey 0.2.0", "ethstore 0.1.0", "evm 0.1.0", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "hardware-wallet 1.8.0", "hash 0.1.0", "hashdb 0.1.0", @@ -588,7 +594,7 @@ dependencies = [ "native-contracts 0.1.0", "num 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "patricia_trie 0.1.0", "price-info 1.7.0", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", @@ -616,7 +622,7 @@ version = "0.1.3" dependencies = [ "bigint 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "plain_hasher 0.1.0", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -647,7 +653,7 @@ dependencies = [ "crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -667,7 +673,7 @@ name = "ethcore-ipc-codegen" version = "1.8.0" dependencies = [ "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", - "clippy 0.0.158 (registry+https://github.com/rust-lang/crates.io-index)", + "clippy 0.0.163 (registry+https://github.com/rust-lang/crates.io-index)", "quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "quasi_macros 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -728,19 +734,19 @@ dependencies = [ "ethcore-network 1.8.0", "ethcore-util 1.8.0", "evm 0.1.0", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "hash 0.1.0", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "memorydb 0.1.0", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "patricia_trie 0.1.0", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", "rlp_derive 0.1.0", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", @@ -758,7 +764,7 @@ dependencies = [ "isatty 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -781,10 +787,10 @@ dependencies = [ "hash 0.1.0", "igd 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipnetwork 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "path 0.1.0", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", @@ -813,17 +819,17 @@ dependencies = [ "ethcore-util 1.8.0", "ethcrypto 0.1.0", "ethkey 0.2.0", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "hash 0.1.0", "hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "native-contracts 0.1.0", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -844,14 +850,14 @@ dependencies = [ "ethcore-ipc-nano 1.8.0", "ethcore-logger 1.8.0", "ethcore-util 1.8.0", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "hash 0.1.0", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-macros 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-tcp-server 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -873,13 +879,13 @@ dependencies = [ "hash 0.1.0", "hashdb 0.1.0", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "memorydb 0.1.0", "nibbleslice 0.1.0", "nibblevec 0.1.0", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "patricia_trie 0.1.0", "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", @@ -911,8 +917,8 @@ dependencies = [ "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.1.3", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -938,8 +944,8 @@ dependencies = [ "ethkey 0.2.0", "panic_hook 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -950,15 +956,15 @@ dependencies = [ "ethcrypto 0.1.0", "ethkey 0.2.0", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wordlist 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -974,8 +980,8 @@ dependencies = [ "ethstore 0.1.0", "panic_hook 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1000,7 +1006,7 @@ dependencies = [ "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "ipnetwork 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1025,7 +1031,7 @@ dependencies = [ "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", @@ -1045,8 +1051,8 @@ dependencies = [ "evm 0.1.0", "panic_hook 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", ] @@ -1062,28 +1068,28 @@ name = "fdlimit" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "fetch" version = "0.1.0" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "flate2" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1096,23 +1102,33 @@ name = "foreign-types" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "fs2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "futures" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "futures-cpupool" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gcc" -version = "0.3.53" +version = "0.3.54" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1154,7 +1170,7 @@ dependencies = [ "hidapi 0.3.1 (git+https://github.com/paritytech/hidapi-rs)", "libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "trezor-sys 1.0.0 (git+https://github.com/paritytech/trezor-sys)", @@ -1165,7 +1181,7 @@ name = "hash" version = "0.1.0" dependencies = [ "ethcore-bigint 0.1.3", - "gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1204,8 +1220,8 @@ name = "hidapi" version = "0.3.1" source = "git+https://github.com/paritytech/hidapi-rs#2e6182139763e31883c24d0c2dac4c28db16245b" dependencies = [ - "gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1292,7 +1308,7 @@ name = "iovec" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1318,7 +1334,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1332,7 +1348,7 @@ dependencies = [ [[package]] name = "itertools" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1340,7 +1356,7 @@ dependencies = [ [[package]] name = "itoa" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1348,10 +1364,10 @@ name = "jsonrpc-core" version = "7.0.0" source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#b5490782884218c5ccf74cd61e54904cb3a3aeed" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1364,7 +1380,7 @@ dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1388,7 +1404,7 @@ source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#b54907 dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-pubsub 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1400,7 +1416,7 @@ dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-minihttp 0.1.0 (git+https://github.com/tomusdrw/tokio-minihttp)", "tokio-proto 0.1.0 (git+https://github.com/tomusdrw/tokio-proto)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1413,7 +1429,7 @@ source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#b54907 dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1438,7 +1454,7 @@ dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1451,7 +1467,7 @@ dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "ws 0.7.1 (git+https://github.com/tomusdrw/ws-rs)", ] @@ -1482,7 +1498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.30" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1500,7 +1516,7 @@ version = "0.3.0" source = "git+https://github.com/paritytech/libusb-rs#47c3d09cab346d629328d4bd691ed3509ffb8cbb" dependencies = [ "bit-set 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "libusb-sys 0.2.3 (git+https://github.com/paritytech/libusb-sys)", ] @@ -1509,8 +1525,8 @@ name = "libusb-sys" version = "0.2.3" source = "git+https://github.com/paritytech/libusb-sys#c10b1180646c9dc3f23a9b6bb825abcd3b7487ce" dependencies = [ - "gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1573,7 +1589,18 @@ name = "memchr" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "memmap" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fs2 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1597,6 +1624,14 @@ dependencies = [ "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mime" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicase 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "mime_guess" version = "1.8.2" @@ -1609,12 +1644,23 @@ dependencies = [ ] [[package]] -name = "miniz-sys" -version = "0.1.9" +name = "mime_guess" +version = "2.0.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miniz-sys" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1625,7 +1671,7 @@ dependencies = [ "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1652,7 +1698,7 @@ name = "mio-uds" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1699,7 +1745,7 @@ name = "nanomsg" version = "0.5.1" source = "git+https://github.com/paritytech/nanomsg.rs.git?branch=parity-1.7#673b79beef6e149273899850d7692335a481a920" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "nanomsg-sys 0.5.0 (git+https://github.com/paritytech/nanomsg.rs.git?branch=parity-1.7)", ] @@ -1708,8 +1754,8 @@ name = "nanomsg-sys" version = "0.5.0" source = "git+https://github.com/paritytech/nanomsg.rs.git?branch=parity-1.7#673b79beef6e149273899850d7692335a481a920" dependencies = [ - "gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1727,7 +1773,7 @@ dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.1.3", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "native-contract-generator 0.1.0", ] @@ -1736,8 +1782,8 @@ name = "native-tls" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "openssl 0.9.17 (registry+https://github.com/rust-lang/crates.io-index)", - "schannel 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.19 (registry+https://github.com/rust-lang/crates.io-index)", + "schannel 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "security-framework 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1750,7 +1796,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 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)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1780,24 +1826,24 @@ dependencies = [ "ethcore-io 1.8.0", "ethcore-network 1.8.0", "ethcore-util 1.8.0", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "native-contracts 0.1.0", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "node-health" version = "0.1.0" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "ntp 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-reactor 0.1.0", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1898,7 +1944,7 @@ name = "num_cpus" version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1925,23 +1971,23 @@ dependencies = [ [[package]] name = "openssl" -version = "0.9.17" +version = "0.9.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.17 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.19 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "openssl-sys" -version = "0.9.17" +version = "0.9.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1981,7 +2027,7 @@ version = "1.8.0" dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_dirs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "clap 2.26.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.26.2 (registry+https://github.com/rust-lang/crates.io-index)", "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "ctrlc 1.1.1 (git+https://github.com/paritytech/rust-ctrlc.git)", "daemonize 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2005,8 +2051,8 @@ dependencies = [ "ethkey 0.2.0", "ethsync 1.8.0", "fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "hash 0.1.0", "ipnetwork 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)", "isatty 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2026,7 +2072,7 @@ dependencies = [ "parity-rpc-client 1.4.0", "parity-updater 1.8.0", "parity-whisper 0.1.0", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "path 0.1.0", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2036,8 +2082,8 @@ dependencies = [ "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2057,7 +2103,7 @@ dependencies = [ "ethcore-devtools 1.8.0", "ethcore-util 1.8.0", "fetch 0.1.0", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "hash 0.1.0", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", @@ -2067,15 +2113,15 @@ dependencies = [ "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 1.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "node-health 0.1.0", - "parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-dapps-glue 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-hash-fetch 1.8.0", "parity-reactor 0.1.0", "parity-ui 1.8.0", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2085,12 +2131,12 @@ dependencies = [ [[package]] name = "parity-dapps-glue" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "mime_guess 1.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 2.0.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", "quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2106,14 +2152,14 @@ dependencies = [ "ethcore-bytes 0.1.0", "ethcore-util 1.8.0", "fetch 0.1.0", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "hash 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 1.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "native-contracts 0.1.0", "parity-reactor 0.1.0", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2143,8 +2189,8 @@ dependencies = [ "ethkey 0.2.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2152,7 +2198,7 @@ dependencies = [ name = "parity-reactor" version = "0.1.0" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2180,8 +2226,8 @@ dependencies = [ "ethstore 0.1.0", "ethsync 1.8.0", "fetch 0.1.0", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "hardware-wallet 1.8.0", "hash 0.1.0", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2198,15 +2244,15 @@ dependencies = [ "order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "parity-reactor 0.1.0", "parity-updater 1.8.0", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2220,16 +2266,16 @@ name = "parity-rpc-client" version = "1.4.0" dependencies = [ "ethcore-util 1.8.0", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "hash 0.1.0", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-ws-server 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.8.0", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2241,7 +2287,7 @@ version = "0.1.5" source = "git+https://github.com/nikvolf/parity-tokio-ipc#d6c5b3cfcc913a1b9cf0f0562a10b083ceb9fb7c" dependencies = [ "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio-named-pipes 0.1.4 (git+https://github.com/alexcrichton/mio-named-pipes)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2265,7 +2311,7 @@ dependencies = [ name = "parity-ui-dev" version = "1.8.0" dependencies = [ - "parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-dapps-glue 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2273,7 +2319,7 @@ name = "parity-ui-precompiled" version = "1.4.0" source = "git+https://github.com/paritytech/js-precompiled.git#f86d1a2c442a441e79f695da844addb70cf10bd6" dependencies = [ - "parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-dapps-glue 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2288,24 +2334,24 @@ dependencies = [ "ethcore-ipc-codegen 1.8.0", "ethcore-util 1.8.0", "ethsync 1.8.0", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-common-types 1.8.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-hash-fetch 1.8.0", "parity-reactor 0.1.0", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "path 0.1.0", "target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parity-wasm" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2318,19 +2364,19 @@ dependencies = [ "ethcore-network 1.8.0", "ethcrypto 0.1.0", "ethkey 0.2.0", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-macros 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-pubsub 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "ordered-float 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2350,7 +2396,7 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2363,7 +2409,7 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2462,9 +2508,9 @@ name = "price-info" version = "1.7.0" dependencies = [ "fetch 0.1.0", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2580,7 +2626,7 @@ name = "rand" version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2606,9 +2652,9 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2649,7 +2695,7 @@ dependencies = [ "hyper-native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "libflate 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2660,9 +2706,9 @@ name = "ring" version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2692,7 +2738,7 @@ name = "rocksdb" version = "0.4.5" source = "git+https://github.com/paritytech/rust-rocksdb#4364caec4dd5da1a1d78c39276774ee65bf55c7d" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rocksdb-sys 0.3.0 (git+https://github.com/paritytech/rust-rocksdb)", ] @@ -2702,8 +2748,8 @@ name = "rocksdb-sys" version = "0.3.0" source = "git+https://github.com/paritytech/rust-rocksdb#4364caec4dd5da1a1d78c39276774ee65bf55c7d" dependencies = [ - "gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2724,7 +2770,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "termios 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2735,7 +2781,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "termios 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2746,7 +2792,7 @@ version = "1.4.0" dependencies = [ "bigint 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-util 1.8.0", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.8.0", "parity-rpc-client 1.4.0", "rpassword 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2757,8 +2803,8 @@ name = "rust-crypto" version = "0.2.36" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (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.38 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2802,7 +2848,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "schannel" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2840,7 +2886,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2850,7 +2896,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2885,12 +2931,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_derive" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2912,7 +2958,7 @@ name = "serde_ignored" version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2921,9 +2967,9 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2932,8 +2978,8 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3055,7 +3101,7 @@ name = "syntex_errors" version = "0.58.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3120,7 +3166,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3129,12 +3175,12 @@ name = "termios" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "textwrap" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3156,7 +3202,7 @@ version = "0.1.38" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3172,7 +3218,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3187,7 +3233,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3197,7 +3243,7 @@ version = "0.1.0" source = "git+https://github.com/tomusdrw/tokio-minihttp#67a400060bd29e51beaf206c552845255b6f699f" dependencies = [ "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3214,7 +3260,7 @@ version = "0.1.0" source = "git+https://github.com/nikvolf/tokio-named-pipes#0b9b728eaeb0a6673c287ac7692be398fd651752" dependencies = [ "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "mio-named-pipes 0.1.4 (git+https://github.com/alexcrichton/mio-named-pipes)", "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3225,7 +3271,7 @@ name = "tokio-proto" version = "0.1.0" source = "git+https://github.com/tomusdrw/tokio-proto#f6ee08cb594fa2fc1b4178eaaca0855d66e68fd3" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3241,7 +3287,7 @@ name = "tokio-proto" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3258,7 +3304,7 @@ name = "tokio-service" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3266,7 +3312,7 @@ name = "tokio-timer" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3276,9 +3322,9 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", "mio-uds 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3299,7 +3345,7 @@ name = "toml" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3349,6 +3395,14 @@ dependencies = [ "version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "unicase" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "unicode-bidi" version = "0.3.4" @@ -3476,14 +3530,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasm-utils" version = "0.1.0" -source = "git+https://github.com/paritytech/wasm-utils#c69d8327c805c3f904feb3da425eafbd73e68d9f" +source = "git+https://github.com/paritytech/wasm-utils#a6b6d75be0680568209813924a5ec0ad89e86697" dependencies = [ - "clap 2.26.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.26.2 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-wasm 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-wasm 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3547,7 +3601,7 @@ name = "zip" version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", "msdos_time 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "podio 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3565,7 +3619,7 @@ dependencies = [ "checksum atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d912da0db7fa85514874458ca3651fe2cddace8d0b0505571dbdcd41ab490159" "checksum backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "346d7644f0b5f9bc73082d3b2236b69a05fd35cce0cfa3724e184e6a5c9e2a2f" "checksum backtrace 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "99f2ce94e22b8e664d95c57fff45b98a966c2252b60691d0b7aeeccd88d70983" -"checksum backtrace-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "afccc5772ba333abccdf60d55200fa3406f8c59dcf54d5f7998c9107d3799c7c" +"checksum backtrace-sys 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "c63ea141ef8fdb10409d0f5daf30ac51f84ef43bff66f16627773d2a292cd189" "checksum base-x 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2f59103b47307f76e03bef1633aec7fa9e29bfb5aa6daf5a334f94233c71f6c1" "checksum base32 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b9605ba46d61df0410d8ac686b0007add8172eba90e8e909c347856fe794d8c" "checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" @@ -3583,13 +3637,14 @@ dependencies = [ "checksum byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff81738b726f5d099632ceaffe7fb65b90212e8dce59d518729e7e8634032d3d" "checksum bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d828f97b58cc5de3e40c421d0cf2132d6b2da4ee0e11b8632fa838f0f9333ad6" "checksum cargo_metadata 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "be1057b8462184f634c3a208ee35b0f935cfd94b694b26deadccd98732088d7b" +"checksum cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7db2f146208d7e0fbee761b09cd65a7f51ccc38705d4e7262dad4d73b12a76b1" "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" "checksum cid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "34aa7da06f10541fbca6850719cdaa8fa03060a5d2fb33840f149cf8133a00c7" -"checksum clap 2.26.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2267a8fdd4dce6956ba6649e130f62fb279026e5e84b92aa939ac8f85ce3f9f0" +"checksum clap 2.26.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3451e409013178663435d6f15fdb212f14ee4424a3d74f979d081d0a66b6f1f2" "checksum clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "5b4fabf979ddf6419a313c1c0ada4a5b95cfd2049c56e8418d622d27b4b6ff32" -"checksum clippy 0.0.158 (registry+https://github.com/rust-lang/crates.io-index)" = "c8a3fc7f7731535d15c5eceaf0107a9d238ea79778cff580e211573799ef7db5" +"checksum clippy 0.0.163 (registry+https://github.com/rust-lang/crates.io-index)" = "5ad3f3dc94d81a6505eb28bf545b501fc9d7525ee9864df5a4b2b6d82629f038" "checksum clippy_lints 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "ce96ec05bfe018a0d5d43da115e54850ea2217981ff0f2e462780ab9d594651a" -"checksum clippy_lints 0.0.158 (registry+https://github.com/rust-lang/crates.io-index)" = "98c9d24e3756cbf8657a225c72660f847b41776c2d29c5efdd92c2977af439f9" +"checksum clippy_lints 0.0.163 (registry+https://github.com/rust-lang/crates.io-index)" = "c058b299bb1289c7e8c063bd49477715c91cb3c3344bcf2e25326860b0675654" "checksum coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c06169f5beb7e31c7c67ebf5540b8b472d23e3eade3b2ec7d1f5b504a85f91bd" "checksum conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299" "checksum cookie 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d53b80dde876f47f03cda35303e368a79b91c70b0d65ecba5fd5280944a08591" @@ -3613,12 +3668,13 @@ dependencies = [ "checksum eth-secp256k1 0.5.6 (git+https://github.com/paritytech/rust-secp256k1)" = "" "checksum ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c3d62319ee0f35abf20afe8859dd2668195912614346447bb2dee9fb8da7c62" "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" -"checksum flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "36df0166e856739905cd3d7e0b210fe818592211a008862599845e012d8d304c" +"checksum flate2 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "e6234dd4468ae5d1e2dbb06fe2b058696fdc50a339c68a393aefbf00bc81e423" "checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" "checksum foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e4056b9bd47f8ac5ba12be771f77a0dae796d1bbaaf5fd0b9c2d38b69b8a29d" -"checksum futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4b63a4792d4f8f686defe3b39b92127fea6344de5d38202b2ee5a11bbbf29d6a" -"checksum futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a283c84501e92cade5ea673a2a7ca44f71f209ccdd302a3e0896f50083d2c5ff" -"checksum gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)" = "e8310f7e9c890398b0e80e301c4f474e9918d2b27fca8f48486ca775fa9ffc5a" +"checksum fs2 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9ab76cfd2aaa59b7bf6688ad9ba15bbae64bff97f04ea02144cfd3443e5c2866" +"checksum futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "05a23db7bd162d4e8265968602930c476f688f0c180b44bdaf55e0cb2c687558" +"checksum futures-cpupool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "77d49e7de8b91b20d6fda43eea906637eff18b96702eb6b2872df8bfab1ad2b5" +"checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" "checksum getopts 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "65922871abd2f101a2eb0eaebadc66668e54a87ad9c3dd82520b5f86ede5eff9" "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" "checksum globset 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90d069fe6beb9be359ef505650b3f73228c5591a3c4b1f32be2f4f44459ffa3a" @@ -3638,8 +3694,8 @@ dependencies = [ "checksum ipnetwork 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)" = "2134e210e2a024b5684f90e1556d5f71a1ce7f8b12e9ac9924c67fb36f63b336" "checksum isatty 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fa500db770a99afe2a0f2229be2a3d09c7ed9d7e4e8440bf71253141994e240f" "checksum itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4833d6978da405305126af4ac88569b5d71ff758581ce5a987dbfa3755f694fc" -"checksum itertools 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "22c285d60139cf413244894189ca52debcfd70b57966feed060da76802e415a0" -"checksum itoa 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ac17257442c2ed77dbc9fd555cf83c58b0c7f7d0e8f2ae08c0ac05c72842e1f6" +"checksum itertools 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ab4d6a273c31ef276c917019239588b23bc696f277af8db10742cba3c27ec2f0" +"checksum itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8324a32baf01e2ae060e9de58ed0bc2320c9a2833491ee36cd3b4c414de4db8c" "checksum jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)" = "" "checksum jsonrpc-http-server 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)" = "" "checksum jsonrpc-ipc-server 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)" = "" @@ -3653,7 +3709,7 @@ dependencies = [ "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" "checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" "checksum lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3b585b7a6811fb03aa10e74b278a0f00f8dd9b45dc681f148bb29fa5cb61859b" -"checksum libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)" = "2370ca07ec338939e356443dac2296f581453c35fe1e3a3ed06023c49435f915" +"checksum libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "d1419b2939a0bc44b77feb34661583c7546b532b192feab36249ab584b86856c" "checksum libflate 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "a2aa04ec0100812d31a5366130ff9e793291787bc31da845bede4a00ea329830" "checksum libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)" = "" "checksum libusb-sys 0.2.3 (git+https://github.com/paritytech/libusb-sys)" = "" @@ -3666,9 +3722,12 @@ dependencies = [ "checksum magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40d014c7011ac470ae28e2f76a02bfea4a8480f73e701353b49ad7a8d75f4699" "checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" +"checksum memmap 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46f3c7359028b31999287dae4e5047ddfe90a23b7dca2282ce759b491080c99b" "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" +"checksum mime 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e3d709ffbb330e1566dc2f2a3c9b58a5ad4a381f740b810cd305dc3f089bc160" "checksum mime_guess 1.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bbee1a836f344ac39d4a59bfe7be2bd3150353ff71678afb740216f8270b333e" -"checksum miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "28eaee17666671fa872e567547e8428e83308ebe5808cdf6a0e28397dbe2c726" +"checksum mime_guess 2.0.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)" = "27a5e6679a0614e25adc14c6434ba84e41632b765a6d9cb2031a0cca682699ae" +"checksum miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "609ce024854aeb19a0ef7567d348aaa5a746b32fb72e336df7fcc16869d7e2b4" "checksum mio 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "dbd91d3bfbceb13897065e97b2ef177a09a438cb33612b2d371bf568819a9313" "checksum mio-named-pipes 0.1.4 (git+https://github.com/alexcrichton/mio-named-pipes)" = "" "checksum mio-uds 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1731a873077147b626d89cc6c2a0db6288d607496c5d10c0cfcf3adc697ec673" @@ -3694,17 +3753,17 @@ dependencies = [ "checksum number_prefix 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "59a14be9c211cb9c602bad35ac99f41e9a84b44d71b8cbd3040e3bd02a214902" "checksum odds 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)" = "c3df9b730298cea3a1c3faa90b7e2f9df3a9c400d0936d6015e6165734eefcba" "checksum ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2c49021782e5233cd243168edfa8037574afed4eba4bbaf538b3d8d1789d8c" -"checksum openssl 0.9.17 (registry+https://github.com/rust-lang/crates.io-index)" = "085aaedcc89a2fac1eb2bc19cd66f29d4ea99fec60f82a5f3a88a6be7dbd90b5" -"checksum openssl-sys 0.9.17 (registry+https://github.com/rust-lang/crates.io-index)" = "7e3a9845a4c9fdb321931868aae5549e96bb7b979bf9af7de03603d74691b5f3" +"checksum openssl 0.9.19 (registry+https://github.com/rust-lang/crates.io-index)" = "816914b22eb15671d62c73442a51978f311e911d6a6f6cbdafa6abce1b5038fc" +"checksum openssl-sys 0.9.19 (registry+https://github.com/rust-lang/crates.io-index)" = "1e4c63a7d559c1e5afa6d6a9e6fa34bbc5f800ffc9ae08b72c605420b0c4f5e8" "checksum order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "efa535d5117d3661134dbf1719b6f0ffe06f2375843b13935db186cd094105eb" "checksum ordered-float 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "58d25b6c0e47b20d05226d288ff434940296e7e2f8b877975da32f862152241f" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" -"checksum parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1d06f6ee0fda786df3784a96ee3f0629f529b91cbfb7d142f6410e6bcd1ce2c" +"checksum parity-dapps-glue 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddaeb8543c6823e93dae65a25eb8083ebfeee8f0000031119d7a0055b2e8fc63" "checksum parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc)" = "" "checksum parity-ui-precompiled 1.4.0 (git+https://github.com/paritytech/js-precompiled.git)" = "" -"checksum parity-wasm 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)" = "466c01423614bbf89a37b0fc081e1ed3523dfd9064497308ad3f9c7c9f0092bb" +"checksum parity-wasm 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4502e18417d96bd8e72fca9ea4cc18f4d80288ff565582d10aefe86f18b4fc3" "checksum parity-wordlist 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "81451bfab101d186f8fc4a0aa13cb5539b31b02c4ed96425a0842e2a413daba6" -"checksum parking_lot 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "fa3ebeb90814c5c7965885f0d29a540387f0589804b3b0f4acbb065af8c1df5f" +"checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" "checksum parking_lot_core 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4f610cb9664da38e417ea3225f23051f589851999535290e077939838ab7a595" "checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" "checksum phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "cb325642290f28ee14d8c6201159949a872f220c62af6e110a56ea914fbe42fc" @@ -3750,7 +3809,7 @@ dependencies = [ "checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" "checksum rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9743a7670d88d5d52950408ecdb7c71d8986251ab604d4689dd2ca25c9bca69" "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" -"checksum schannel 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "14a5f8491ae5fc8c51aded1f5806282a0218b4d69b1b76913a0559507e559b90" +"checksum schannel 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7554288337c1110e34d7a2433518d889374c1de1a45f856b7bcddb03702131fc" "checksum scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f417c22df063e9450888a7561788e9bd46d3bb3c1466435b4eccb903807f147d" "checksum scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c79eb2c3ac4bc2507cda80e7f3ac5b88bd8eae4c0914d5663e6a8933994be918" "checksum secur32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3f412dfa83308d893101dd59c10d6fda8283465976c28c287c5c855bf8d216bc" @@ -3760,8 +3819,8 @@ dependencies = [ "checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f" "checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "bcb6a7637a47663ee073391a139ed07851f27ed2532c2abc88c6bf27a16cdf34" -"checksum serde_derive 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "812ff66056fd9a9a5b7c119714243b0862cf98340e7d4b5ee05a932c40d5ea6c" +"checksum serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7046c9d4c6c522d10b2d098f9bebe2bef227e0e74044d8c1bfcf6b476af799" +"checksum serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "1afcaae083fd1c46952a315062326bc9957f182358eb7da03b57ef1c688f7aa9" "checksum serde_derive_internals 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bd381f6d01a6616cdba8530492d453b7761b456ba974e98768a18cad2cd76f58" "checksum serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "190e9765dcedb56be63b6e0993a006c7e3b071a016a304736e4a315dc01fb142" "checksum serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d243424e06f9f9c39e3cd36147470fd340db785825e367625f79298a6ac6b7ac" @@ -3791,7 +3850,7 @@ dependencies = [ "checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1" "checksum term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209" "checksum termios 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d9cf598a6d7ce700a4e6a9199da127e6819a61e64b68609683cc9a01b5683a" -"checksum textwrap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f728584ea33b0ad19318e20557cb0a39097751dbb07171419673502f848c7af6" +"checksum textwrap 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df8e08afc40ae3459e4838f303e465aa50d823df8d7f83ca88108f6d3afe7edd" "checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" "checksum time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520" "checksum tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d52d12ad79e4063e0cb0ca5efa202ed7244b6ce4d25f4d3abe410b2a66128292" @@ -3811,6 +3870,7 @@ dependencies = [ "checksum trezor-sys 1.0.0 (git+https://github.com/paritytech/trezor-sys)" = "" "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" +"checksum unicase 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e01da42520092d0cd2d6ac3ae69eb21a22ad43ff195676b86f8c37f487d6b80" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" "checksum unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8083c594e02b8ae1654ae26f0ade5158b119bd88ad0e8227a5d8fcd72407946" diff --git a/ethash/Cargo.toml b/ethash/Cargo.toml index aa415c1f9..f2d6f2790 100644 --- a/ethash/Cargo.toml +++ b/ethash/Cargo.toml @@ -11,6 +11,8 @@ hash = { path = "../util/hash" } primal = "0.2.3" parking_lot = "0.4" crunchy = "0.1.0" +memmap = "0.5.2" +either = "1.0.0" [features] benches = [] diff --git a/ethash/src/cache.rs b/ethash/src/cache.rs new file mode 100644 index 000000000..99966c9ea --- /dev/null +++ b/ethash/src/cache.rs @@ -0,0 +1,352 @@ +// Copyright 2015-2017 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity 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. + +// Parity 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 Parity. If not, see . + +use compute::Light; +use either::Either; +use keccak::{H256, keccak_512}; +use memmap::{Mmap, Protection}; +use parking_lot::Mutex; +use seed_compute::SeedHashCompute; + +use shared::{ETHASH_CACHE_ROUNDS, NODE_BYTES, NODE_DWORDS, Node, epoch, get_cache_size, to_hex}; + +use std::borrow::Cow; +use std::fs; +use std::io::{self, Read, Write}; +use std::path::{Path, PathBuf}; +use std::slice; +use std::sync::Arc; + +type Cache = Either, Mmap>; + +#[derive(PartialEq, Eq, Debug, Clone, Copy)] +pub enum OptimizeFor { + Cpu, + Memory, +} + +impl Default for OptimizeFor { + fn default() -> Self { + OptimizeFor::Cpu + } +} + +fn byte_size(cache: &Cache) -> usize { + use self::Either::{Left, Right}; + + match *cache { + Left(ref vec) => vec.len() * NODE_BYTES, + Right(ref mmap) => mmap.len(), + } +} + +fn new_buffer(path: &Path, num_nodes: usize, ident: &H256, optimize_for: OptimizeFor) -> Cache { + let memmap = match optimize_for { + OptimizeFor::Cpu => None, + OptimizeFor::Memory => make_memmapped_cache(path, num_nodes, ident).ok(), + }; + + memmap.map(Either::Right).unwrap_or_else(|| { + Either::Left(make_memory_cache(num_nodes, ident)) + }) +} + +#[derive(Clone)] +pub struct NodeCacheBuilder { + // TODO: Remove this locking and just use an `Rc`? + seedhash: Arc>, + optimize_for: OptimizeFor, +} + +// TODO: Abstract the "optimize for" logic +pub struct NodeCache { + builder: NodeCacheBuilder, + cache_dir: Cow<'static, Path>, + cache_path: PathBuf, + epoch: u64, + cache: Cache, +} + +impl NodeCacheBuilder { + pub fn light(&self, cache_dir: &Path, block_number: u64) -> Light { + Light::new_with_builder(self, cache_dir, block_number) + } + + pub fn light_from_file(&self, cache_dir: &Path, block_number: u64) -> io::Result { + Light::from_file_with_builder(self, cache_dir, block_number) + } + + pub fn new>>(optimize_for: T) -> Self { + NodeCacheBuilder { + seedhash: Arc::new(Mutex::new(SeedHashCompute::new())), + optimize_for: optimize_for.into().unwrap_or_default(), + } + } + + fn block_number_to_ident(&self, block_number: u64) -> H256 { + self.seedhash.lock().hash_block_number(block_number) + } + + fn epoch_to_ident(&self, epoch: u64) -> H256 { + self.seedhash.lock().hash_epoch(epoch) + } + + pub fn from_file>>( + &self, + cache_dir: P, + block_number: u64, + ) -> io::Result { + let cache_dir = cache_dir.into(); + let ident = self.block_number_to_ident(block_number); + + let path = cache_path(cache_dir.as_ref(), &ident); + + let cache = cache_from_path(&path, self.optimize_for)?; + let expected_cache_size = get_cache_size(block_number); + + if byte_size(&cache) == expected_cache_size { + Ok(NodeCache { + builder: self.clone(), + epoch: epoch(block_number), + cache_dir: cache_dir, + cache_path: path, + cache: cache, + }) + } else { + Err(io::Error::new( + io::ErrorKind::InvalidData, + "Node cache is of incorrect size", + )) + } + } + + pub fn new_cache>>( + &self, + cache_dir: P, + block_number: u64, + ) -> NodeCache { + let cache_dir = cache_dir.into(); + let ident = self.block_number_to_ident(block_number); + + let cache_size = get_cache_size(block_number); + + // We use `debug_assert` since it is impossible for `get_cache_size` to return an unaligned + // value with the current implementation. If the implementation changes, CI will catch it. + debug_assert!(cache_size % NODE_BYTES == 0, "Unaligned cache size"); + let num_nodes = cache_size / NODE_BYTES; + + let path = cache_path(cache_dir.as_ref(), &ident); + let nodes = new_buffer(&path, num_nodes, &ident, self.optimize_for); + + NodeCache { + builder: self.clone(), + epoch: epoch(block_number), + cache_dir: cache_dir.into(), + cache_path: path, + cache: nodes, + } + } +} + +impl NodeCache { + pub fn cache_path(&self) -> &Path { + &self.cache_path + } + + pub fn flush(&mut self) -> io::Result<()> { + if let Some(last) = self.epoch.checked_sub(2).map(|ep| { + cache_path(self.cache_dir.as_ref(), &self.builder.epoch_to_ident(ep)) + }) + { + fs::remove_file(last).unwrap_or_else(|error| match error.kind() { + io::ErrorKind::NotFound => (), + _ => warn!("Error removing stale DAG cache: {:?}", error), + }); + } + + consume_cache(&mut self.cache, &self.cache_path) + } +} + +fn make_memmapped_cache(path: &Path, num_nodes: usize, ident: &H256) -> io::Result { + use std::fs::OpenOptions; + + let file = OpenOptions::new() + .read(true) + .write(true) + .create(true) + .open(&path)?; + file.set_len((num_nodes * NODE_BYTES) as _)?; + + let mut memmap = Mmap::open(&file, Protection::ReadWrite)?; + + unsafe { initialize_memory(memmap.mut_ptr() as *mut Node, num_nodes, ident) }; + + Ok(memmap) +} + +fn make_memory_cache(num_nodes: usize, ident: &H256) -> Vec { + let mut nodes: Vec = Vec::with_capacity(num_nodes); + // Use uninit instead of unnecessarily writing `size_of::() * num_nodes` 0s + unsafe { + initialize_memory(nodes.as_mut_ptr(), num_nodes, ident); + nodes.set_len(num_nodes); + } + + nodes +} + +fn cache_path<'a, P: Into>>(path: P, ident: &H256) -> PathBuf { + let mut buf = path.into().into_owned(); + buf.push(to_hex(ident)); + buf +} + +fn consume_cache(cache: &mut Cache, path: &Path) -> io::Result<()> { + use std::fs::OpenOptions; + + match *cache { + Either::Left(ref mut vec) => { + let mut file = OpenOptions::new() + .read(true) + .write(true) + .create(true) + .open(&path)?; + + let buf = unsafe { + slice::from_raw_parts_mut(vec.as_mut_ptr() as *mut u8, vec.len() * NODE_BYTES) + }; + + file.write_all(buf).map(|_| ()) + } + Either::Right(ref mmap) => { + mmap.flush() + } + } +} + +fn cache_from_path(path: &Path, optimize_for: OptimizeFor) -> io::Result { + let memmap = match optimize_for { + OptimizeFor::Cpu => None, + OptimizeFor::Memory => Mmap::open_path(path, Protection::ReadWrite).ok(), + }; + + memmap.map(Either::Right).ok_or(()).or_else(|_| { + read_from_path(path).map(Either::Left) + }) +} + +fn read_from_path(path: &Path) -> io::Result> { + use std::fs::File; + use std::mem; + + let mut file = File::open(path)?; + + let mut nodes: Vec = Vec::with_capacity(file.metadata().map(|m| m.len() as _).unwrap_or( + NODE_BYTES * 1_000_000, + )); + file.read_to_end(&mut nodes)?; + + nodes.shrink_to_fit(); + + if nodes.len() % NODE_BYTES != 0 || nodes.capacity() % NODE_BYTES != 0 { + return Err(io::Error::new( + io::ErrorKind::Other, + "Node cache is not a multiple of node size", + )); + } + + let out: Vec = unsafe { + Vec::from_raw_parts( + nodes.as_mut_ptr() as *mut _, + nodes.len() / NODE_BYTES, + nodes.capacity() / NODE_BYTES, + ) + }; + + mem::forget(nodes); + + Ok(out) +} + +impl AsRef<[Node]> for NodeCache { + fn as_ref(&self) -> &[Node] { + match self.cache { + Either::Left(ref vec) => vec, + Either::Right(ref mmap) => unsafe { + let bytes = mmap.ptr(); + // This isn't a safety issue, so we can keep this a debug lint. We don't care about + // people manually messing with the files unless it can cause unsafety, but if we're + // generating incorrect files then we want to catch that in CI. + debug_assert_eq!(mmap.len() % NODE_BYTES, 0); + slice::from_raw_parts(bytes as _, mmap.len() / NODE_BYTES) + }, + } + } +} + +// This takes a raw pointer and a counter because `memory` may be uninitialized. `memory` _must_ be +// a pointer to the beginning of an allocated but possibly-uninitialized block of +// `num_nodes * NODE_BYTES` bytes +// +// We have to use raw pointers to read/write uninit, using "normal" indexing causes LLVM to freak +// out. It counts as a read and causes all writes afterwards to be elided. Yes, really. I know, I +// want to refactor this to use less `unsafe` as much as the next rustacean. +unsafe fn initialize_memory(memory: *mut Node, num_nodes: usize, ident: &H256) { + let dst = memory as *mut u8; + + debug_assert_eq!(ident.len(), 32); + keccak_512::unchecked(dst, NODE_BYTES, ident.as_ptr(), ident.len()); + + for i in 1..num_nodes { + // We use raw pointers here, see above + let dst = memory.offset(i as _) as *mut u8; + let src = memory.offset(i as isize - 1) as *mut u8; + + keccak_512::unchecked(dst, NODE_BYTES, src, NODE_BYTES); + } + + // Now this is initialized, we can treat it as a slice. + let nodes: &mut [Node] = slice::from_raw_parts_mut(memory, num_nodes); + + // For `unroll!`, see below. If the literal in `unroll!` is not the same as the RHS here then + // these have got out of sync! Don't let this happen! + debug_assert_eq!(NODE_DWORDS, 8); + + // This _should_ get unrolled by the compiler, since it's not using the loop variable. + for _ in 0..ETHASH_CACHE_ROUNDS { + for i in 0..num_nodes { + let data_idx = (num_nodes - 1 + i) % num_nodes; + let idx = nodes.get_unchecked_mut(i).as_words()[0] as usize % num_nodes; + + let data = { + let mut data: Node = nodes.get_unchecked(data_idx).clone(); + let rhs: &Node = nodes.get_unchecked(idx); + + unroll! { + for w in 0..8 { + *data.as_dwords_mut().get_unchecked_mut(w) ^= + *rhs.as_dwords().get_unchecked(w); + } + } + + data + }; + + keccak_512::write(&data.bytes, &mut nodes.get_unchecked_mut(i).bytes); + } + } +} diff --git a/ethash/src/compute.rs b/ethash/src/compute.rs index 9eb042147..50644157e 100644 --- a/ethash/src/compute.rs +++ b/ethash/src/compute.rs @@ -19,30 +19,16 @@ // TODO: fix endianess for big endian -use primal::is_prime; -use std::cell::Cell; +use keccak::{keccak_512, keccak_256, H256}; +use cache::{NodeCache, NodeCacheBuilder}; +use seed_compute::SeedHashCompute; +use shared::*; +use std::io; + use std::mem; +use std::path::Path; use std::ptr; -use hash; -use std::slice; -use std::path::{Path, PathBuf}; -use std::io::{self, Read, Write}; -use std::fs::{self, File}; -use parking_lot::Mutex; - -pub const ETHASH_EPOCH_LENGTH: u64 = 30000; -pub const ETHASH_CACHE_ROUNDS: usize = 3; -pub const ETHASH_MIX_BYTES: usize = 128; -pub const ETHASH_ACCESSES: usize = 64; -pub const ETHASH_DATASET_PARENTS: u32 = 256; - -const DATASET_BYTES_INIT: u64 = 1 << 30; -const DATASET_BYTES_GROWTH: u64 = 1 << 23; -const CACHE_BYTES_INIT: u64 = 1 << 24; -const CACHE_BYTES_GROWTH: u64 = 1 << 17; -const NODE_WORDS: usize = 64 / 4; -const NODE_BYTES: usize = 64; const MIX_WORDS: usize = ETHASH_MIX_BYTES / 4; const MIX_NODES: usize = MIX_WORDS / NODE_WORDS; const FNV_PRIME: u32 = 0x01000193; @@ -55,48 +41,24 @@ pub struct ProofOfWork { pub mix_hash: H256, } -struct Node { - bytes: [u8; NODE_BYTES], -} - -impl Default for Node { - fn default() -> Self { - Node { bytes: [0u8; NODE_BYTES] } - } -} - -impl Clone for Node { - fn clone(&self) -> Self { - Node { bytes: *&self.bytes } - } -} - -impl Node { - #[inline] - fn as_words(&self) -> &[u32; NODE_WORDS] { - unsafe { mem::transmute(&self.bytes) } - } - - #[inline] - fn as_words_mut(&mut self) -> &mut [u32; NODE_WORDS] { - unsafe { mem::transmute(&mut self.bytes) } - } -} - -pub type H256 = [u8; 32]; - pub struct Light { - cache_dir: PathBuf, block_number: u64, - cache: Vec, - seed_compute: Mutex, + cache: NodeCache, } /// Light cache structure impl Light { - /// Create a new light cache for a given block number - pub fn new>(cache_dir: T, block_number: u64) -> Light { - light_new(cache_dir, block_number) + pub fn new_with_builder( + builder: &NodeCacheBuilder, + cache_dir: &Path, + block_number: u64, + ) -> Self { + let cache = builder.new_cache(cache_dir.to_path_buf(), block_number); + + Light { + block_number: block_number, + cache: cache, + } } /// Calculate the light boundary data @@ -106,107 +68,25 @@ impl Light { light_compute(self, header_hash, nonce) } - pub fn file_path>(cache_dir: T, seed_hash: H256) -> PathBuf { - let mut cache_dir = cache_dir.as_ref().to_path_buf(); - cache_dir.push(to_hex(&seed_hash)); - cache_dir - } - - pub fn from_file>(cache_dir: T, block_number: u64) -> io::Result { - let seed_compute = SeedHashCompute::new(); - let path = Light::file_path(&cache_dir, seed_compute.get_seedhash(block_number)); - let mut file = File::open(path)?; - - let cache_size = get_cache_size(block_number); - if file.metadata()?.len() != cache_size as u64 { - return Err(io::Error::new(io::ErrorKind::Other, "Cache file size mismatch")); - } - let num_nodes = cache_size / NODE_BYTES; - let mut nodes: Vec = Vec::with_capacity(num_nodes); - - unsafe { nodes.set_len(num_nodes) }; - - let buf = unsafe { slice::from_raw_parts_mut(nodes.as_mut_ptr() as *mut u8, cache_size) }; - file.read_exact(buf)?; + pub fn from_file_with_builder( + builder: &NodeCacheBuilder, + cache_dir: &Path, + block_number: u64, + ) -> io::Result { + let cache = builder.from_file(cache_dir.to_path_buf(), block_number)?; Ok(Light { - block_number, - cache_dir: cache_dir.as_ref().to_path_buf(), - cache: nodes, - seed_compute: Mutex::new(seed_compute), + block_number: block_number, + cache: cache, }) } - pub fn to_file(&self) -> io::Result { - let seed_compute = self.seed_compute.lock(); - let path = Light::file_path(&self.cache_dir, seed_compute.get_seedhash(self.block_number)); - - if self.block_number >= ETHASH_EPOCH_LENGTH * 2 { - let deprecated = Light::file_path( - &self.cache_dir, - seed_compute.get_seedhash(self.block_number - ETHASH_EPOCH_LENGTH * 2) - ); - - if deprecated.exists() { - debug!(target: "ethash", "removing: {:?}", &deprecated); - fs::remove_file(deprecated)?; - } - } - - fs::create_dir_all(path.parent().unwrap())?; - let mut file = File::create(&path)?; - - let cache_size = self.cache.len() * NODE_BYTES; - let buf = unsafe { slice::from_raw_parts(self.cache.as_ptr() as *const u8, cache_size) }; - file.write(buf)?; - Ok(path) + pub fn to_file(&mut self) -> io::Result<&Path> { + self.cache.flush()?; + Ok(self.cache.cache_path()) } } -pub struct SeedHashCompute { - prev_epoch: Cell, - prev_seedhash: Cell, -} - -impl SeedHashCompute { - #[inline] - pub fn new() -> SeedHashCompute { - SeedHashCompute { - prev_epoch: Cell::new(0), - prev_seedhash: Cell::new([0u8; 32]), - } - } - - #[inline] - fn reset_cache(&self) { - self.prev_epoch.set(0); - self.prev_seedhash.set([0u8; 32]); - } - - #[inline] - pub fn get_seedhash(&self, block_number: u64) -> H256 { - let epoch = block_number / ETHASH_EPOCH_LENGTH; - if epoch < self.prev_epoch.get() { - // can't build on previous hash if requesting an older block - self.reset_cache(); - } - if epoch > self.prev_epoch.get() { - let seed_hash = SeedHashCompute::resume_compute_seedhash(self.prev_seedhash.get(), self.prev_epoch.get(), epoch); - self.prev_seedhash.set(seed_hash); - self.prev_epoch.set(epoch); - } - self.prev_seedhash.get() - } - - #[inline] - pub fn resume_compute_seedhash(mut hash: H256, start_epoch: u64, end_epoch: u64) -> H256 { - for _ in start_epoch..end_epoch { - unsafe { hash::keccak_256(hash[..].as_mut_ptr(), 32, hash[..].as_ptr(), 32) }; - } - hash - } -} - -pub fn slow_get_seedhash(block_number: u64) -> H256 { +pub fn slow_hash_block_number(block_number: u64) -> H256 { SeedHashCompute::resume_compute_seedhash([0u8; 32], 0, block_number / ETHASH_EPOCH_LENGTH) } @@ -214,34 +94,6 @@ fn fnv_hash(x: u32, y: u32) -> u32 { return x.wrapping_mul(FNV_PRIME) ^ y; } -fn keccak_512(input: &[u8], output: &mut [u8]) { - unsafe { hash::keccak_512(output.as_mut_ptr(), output.len(), input.as_ptr(), input.len()) }; -} - -fn keccak_512_inplace(input: &mut [u8]) { - // This is safe since `keccak_*` uses an internal buffer and copies the result to the output. This - // means that we can reuse the input buffer for both input and output. - unsafe { hash::keccak_512(input.as_mut_ptr(), input.len(), input.as_ptr(), input.len()) }; -} - -fn get_cache_size(block_number: u64) -> usize { - let mut sz: u64 = CACHE_BYTES_INIT + CACHE_BYTES_GROWTH * (block_number / ETHASH_EPOCH_LENGTH); - sz = sz - NODE_BYTES as u64; - while !is_prime(sz / NODE_BYTES as u64) { - sz = sz - 2 * NODE_BYTES as u64; - } - sz as usize -} - -fn get_data_size(block_number: u64) -> usize { - let mut sz: u64 = DATASET_BYTES_INIT + DATASET_BYTES_GROWTH * (block_number / ETHASH_EPOCH_LENGTH); - sz = sz - ETHASH_MIX_BYTES as u64; - while !is_prime(sz / ETHASH_MIX_BYTES as u64) { - sz = sz - 2 * ETHASH_MIX_BYTES as u64; - } - sz as usize -} - /// Difficulty quick check for POW preverification /// /// `header_hash` The hash of the header @@ -261,12 +113,12 @@ pub fn quick_get_difficulty(header_hash: &H256, nonce: u64, mix_hash: &H256) -> ptr::copy_nonoverlapping(header_hash.as_ptr(), buf.as_mut_ptr(), 32); ptr::copy_nonoverlapping(mem::transmute(&nonce), buf[32..].as_mut_ptr(), 8); - hash::keccak_512(buf.as_mut_ptr(), 64, buf.as_ptr(), 40); + keccak_512::unchecked(buf.as_mut_ptr(), 64, buf.as_ptr(), 40); ptr::copy_nonoverlapping(mix_hash.as_ptr(), buf[64..].as_mut_ptr(), 32); // This is initialized in `keccak_256` let mut hash: [u8; 32] = mem::uninitialized(); - hash::keccak_256(hash.as_mut_ptr(), hash.len(), buf.as_ptr(), buf.len()); + keccak_256::unchecked(hash.as_mut_ptr(), hash.len(), buf.as_ptr(), buf.len()); hash } @@ -324,11 +176,7 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64) // leaving it fully initialized. let mut out: [u8; NODE_BYTES] = mem::uninitialized(); - ptr::copy_nonoverlapping( - header_hash.as_ptr(), - out.as_mut_ptr(), - header_hash.len(), - ); + ptr::copy_nonoverlapping(header_hash.as_ptr(), out.as_mut_ptr(), header_hash.len()); ptr::copy_nonoverlapping( mem::transmute(&nonce), out[header_hash.len()..].as_mut_ptr(), @@ -336,11 +184,11 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64) ); // compute keccak-512 hash and replicate across mix - hash::keccak_512( + keccak_512::unchecked( out.as_mut_ptr(), NODE_BYTES, out.as_ptr(), - header_hash.len() + mem::size_of::() + header_hash.len() + mem::size_of::(), ); Node { bytes: out } @@ -354,7 +202,7 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64) let page_size = 4 * MIX_WORDS; let num_full_pages = (full_size / page_size) as u32; // deref once for better performance - let cache: &[Node] = &light.cache; + let cache: &[Node] = light.cache.as_ref(); let first_val = buf.half_mix.as_words()[0]; debug_assert_eq!(MIX_NODES, 2); @@ -364,14 +212,10 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64) let index = { // This is trivially safe, but does not work on big-endian. The safety of this is // asserted in debug builds (see the definition of `make_const_array!`). - let mix_words: &mut [u32; MIX_WORDS] = unsafe { - make_const_array!(MIX_WORDS, &mut mix) - }; + let mix_words: &mut [u32; MIX_WORDS] = + unsafe { make_const_array!(MIX_WORDS, &mut mix) }; - fnv_hash( - first_val ^ i, - mix_words[i as usize % MIX_WORDS] - ) % num_full_pages + fnv_hash(first_val ^ i, mix_words[i as usize % MIX_WORDS]) % num_full_pages }; unroll! { @@ -403,9 +247,8 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64) // times and set each index, leaving the array fully initialized. THIS ONLY WORKS ON LITTLE- // ENDIAN MACHINES. See a future PR to make this and the rest of the code work correctly on // big-endian arches like mips. - let mut compress: &mut [u32; MIX_WORDS / 4] = unsafe { - make_const_array!(MIX_WORDS / 4, &mut buf.compress_bytes) - }; + let compress: &mut [u32; MIX_WORDS / 4] = + unsafe { make_const_array!(MIX_WORDS / 4, &mut buf.compress_bytes) }; // Compress mix debug_assert_eq!(MIX_WORDS / 4, 8); @@ -430,7 +273,7 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64) // We overwrite the second half since `keccak_256` has an internal buffer and so allows // overlapping arrays as input. let write_ptr: *mut u8 = mem::transmute(&mut buf.compress_bytes); - hash::keccak_256( + keccak_256::unchecked( write_ptr, buf.compress_bytes.len(), read_ptr, @@ -439,25 +282,21 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64) buf.compress_bytes }; - ProofOfWork { - mix_hash: mix_hash, - value: value, - } + ProofOfWork { mix_hash: mix_hash, value: value } } +// TODO: Use the `simd` crate fn calculate_dag_item(node_index: u32, cache: &[Node]) -> Node { let num_parent_nodes = cache.len(); let mut ret = cache[node_index as usize % num_parent_nodes].clone(); ret.as_words_mut()[0] ^= node_index; - keccak_512_inplace(&mut ret.bytes); + keccak_512::inplace(ret.as_bytes_mut()); debug_assert_eq!(NODE_WORDS, 16); for i in 0..ETHASH_DATASET_PARENTS as u32 { - let parent_index = fnv_hash( - node_index ^ i, - ret.as_words()[i as usize % NODE_WORDS], - ) % num_parent_nodes as u32; + let parent_index = fnv_hash(node_index ^ i, ret.as_words()[i as usize % NODE_WORDS]) % + num_parent_nodes as u32; let parent = &cache[parent_index as usize]; unroll! { @@ -467,159 +306,107 @@ fn calculate_dag_item(node_index: u32, cache: &[Node]) -> Node { } } - keccak_512_inplace(&mut ret.bytes); + keccak_512::inplace(ret.as_bytes_mut()); ret } -fn light_new>(cache_dir: T, block_number: u64) -> Light { - let seed_compute = SeedHashCompute::new(); - let seedhash = seed_compute.get_seedhash(block_number); - let cache_size = get_cache_size(block_number); +#[cfg(test)] +mod test { + use super::*; + use std::fs; - assert!(cache_size % NODE_BYTES == 0, "Unaligned cache size"); - let num_nodes = cache_size / NODE_BYTES; - - let mut nodes: Vec = Vec::with_capacity(num_nodes); - unsafe { - // Use uninit instead of unnecessarily writing `size_of::() * num_nodes` 0s - nodes.set_len(num_nodes); - - keccak_512(&seedhash[0..32], &mut nodes.get_unchecked_mut(0).bytes); - for i in 1..num_nodes { - hash::keccak_512(nodes.get_unchecked_mut(i).bytes.as_mut_ptr(), NODE_BYTES, nodes.get_unchecked(i - 1).bytes.as_ptr(), NODE_BYTES); - } - - debug_assert_eq!(NODE_WORDS, 16); - - // This _should_ get unrolled by the compiler, since it's not using the loop variable. - for _ in 0..ETHASH_CACHE_ROUNDS { - for i in 0..num_nodes { - let idx = *nodes.get_unchecked_mut(i).as_words().get_unchecked(0) as usize % num_nodes; - let mut data = nodes.get_unchecked((num_nodes - 1 + i) % num_nodes).clone(); - - unroll! { - for w in 0..16 { - *data.as_words_mut().get_unchecked_mut(w) ^= *nodes.get_unchecked(idx).as_words().get_unchecked(w); - } - } - - keccak_512(&data.bytes, &mut nodes.get_unchecked_mut(i).bytes); - } - } + #[test] + fn test_get_cache_size() { + // https://github.com/ethereum/wiki/wiki/Ethash/ef6b93f9596746a088ea95d01ca2778be43ae68f#data-sizes + assert_eq!(16776896usize, get_cache_size(0)); + assert_eq!(16776896usize, get_cache_size(1)); + assert_eq!(16776896usize, get_cache_size(ETHASH_EPOCH_LENGTH - 1)); + assert_eq!(16907456usize, get_cache_size(ETHASH_EPOCH_LENGTH)); + assert_eq!(16907456usize, get_cache_size(ETHASH_EPOCH_LENGTH + 1)); + assert_eq!(284950208usize, get_cache_size(2046 * ETHASH_EPOCH_LENGTH)); + assert_eq!(285081536usize, get_cache_size(2047 * ETHASH_EPOCH_LENGTH)); + assert_eq!(285081536usize, get_cache_size(2048 * ETHASH_EPOCH_LENGTH - 1)); } - Light { - block_number, - cache_dir: cache_dir.as_ref().to_path_buf(), - cache: nodes, - seed_compute: Mutex::new(seed_compute), - } -} - -static CHARS: &'static [u8] = b"0123456789abcdef"; -fn to_hex(bytes: &[u8]) -> String { - let mut v = Vec::with_capacity(bytes.len() * 2); - for &byte in bytes.iter() { - v.push(CHARS[(byte >> 4) as usize]); - v.push(CHARS[(byte & 0xf) as usize]); + #[test] + fn test_get_data_size() { + // https://github.com/ethereum/wiki/wiki/Ethash/ef6b93f9596746a088ea95d01ca2778be43ae68f#data-sizes + assert_eq!(1073739904usize, get_data_size(0)); + assert_eq!(1073739904usize, get_data_size(1)); + assert_eq!(1073739904usize, get_data_size(ETHASH_EPOCH_LENGTH - 1)); + assert_eq!(1082130304usize, get_data_size(ETHASH_EPOCH_LENGTH)); + assert_eq!(1082130304usize, get_data_size(ETHASH_EPOCH_LENGTH + 1)); + assert_eq!(18236833408usize, get_data_size(2046 * ETHASH_EPOCH_LENGTH)); + assert_eq!(18245220736usize, get_data_size(2047 * ETHASH_EPOCH_LENGTH)); } - unsafe { String::from_utf8_unchecked(v) } -} - -#[test] -fn test_get_cache_size() { - // https://github.com/ethereum/wiki/wiki/Ethash/ef6b93f9596746a088ea95d01ca2778be43ae68f#data-sizes - assert_eq!(16776896usize, get_cache_size(0)); - assert_eq!(16776896usize, get_cache_size(1)); - assert_eq!(16776896usize, get_cache_size(ETHASH_EPOCH_LENGTH - 1)); - assert_eq!(16907456usize, get_cache_size(ETHASH_EPOCH_LENGTH)); - assert_eq!(16907456usize, get_cache_size(ETHASH_EPOCH_LENGTH + 1)); - assert_eq!(284950208usize, get_cache_size(2046 * ETHASH_EPOCH_LENGTH)); - assert_eq!(285081536usize, get_cache_size(2047 * ETHASH_EPOCH_LENGTH)); - assert_eq!(285081536usize, get_cache_size(2048 * ETHASH_EPOCH_LENGTH - 1)); -} - -#[test] -fn test_get_data_size() { - // https://github.com/ethereum/wiki/wiki/Ethash/ef6b93f9596746a088ea95d01ca2778be43ae68f#data-sizes - assert_eq!(1073739904usize, get_data_size(0)); - assert_eq!(1073739904usize, get_data_size(1)); - assert_eq!(1073739904usize, get_data_size(ETHASH_EPOCH_LENGTH - 1)); - assert_eq!(1082130304usize, get_data_size(ETHASH_EPOCH_LENGTH)); - assert_eq!(1082130304usize, get_data_size(ETHASH_EPOCH_LENGTH + 1)); - assert_eq!(18236833408usize, get_data_size(2046 * ETHASH_EPOCH_LENGTH)); - assert_eq!(18245220736usize, get_data_size(2047 * ETHASH_EPOCH_LENGTH)); -} - -#[test] -fn test_difficulty_test() { - let hash = [0xf5, 0x7e, 0x6f, 0x3a, 0xcf, 0xc0, 0xdd, 0x4b, 0x5b, 0xf2, 0xbe, 0xe4, 0x0a, 0xb3, 0x35, 0x8a, 0xa6, 0x87, 0x73, 0xa8, 0xd0, 0x9f, 0x5e, 0x59, 0x5e, 0xab, 0x55, 0x94, 0x05, 0x52, 0x7d, 0x72]; - let mix_hash = [0x1f, 0xff, 0x04, 0xce, 0xc9, 0x41, 0x73, 0xfd, 0x59, 0x1e, 0x3d, 0x89, 0x60, 0xce, 0x6b, 0xdf, 0x8b, 0x19, 0x71, 0x04, 0x8c, 0x71, 0xff, 0x93, 0x7b, 0xb2, 0xd3, 0x2a, 0x64, 0x31, 0xab, 0x6d]; - let nonce = 0xd7b3ac70a301a249; - let boundary_good = [0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3e, 0x9b, 0x6c, 0x69, 0xbc, 0x2c, 0xe2, 0xa2, 0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a, 0xe9, 0x7e, 0x53, 0x84]; - assert_eq!(quick_get_difficulty(&hash, nonce, &mix_hash)[..], boundary_good[..]); - let boundary_bad = [0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3a, 0x9b, 0x6c, 0x69, 0xbc, 0x2c, 0xe2, 0xa2, 0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a, 0xe9, 0x7e, 0x53, 0x84]; - assert!(quick_get_difficulty(&hash, nonce, &mix_hash)[..] != boundary_bad[..]); -} - -#[test] -fn test_light_compute() { - let hash = [0xf5, 0x7e, 0x6f, 0x3a, 0xcf, 0xc0, 0xdd, 0x4b, 0x5b, 0xf2, 0xbe, 0xe4, 0x0a, 0xb3, 0x35, 0x8a, 0xa6, 0x87, 0x73, 0xa8, 0xd0, 0x9f, 0x5e, 0x59, 0x5e, 0xab, 0x55, 0x94, 0x05, 0x52, 0x7d, 0x72]; - let mix_hash = [0x1f, 0xff, 0x04, 0xce, 0xc9, 0x41, 0x73, 0xfd, 0x59, 0x1e, 0x3d, 0x89, 0x60, 0xce, 0x6b, 0xdf, 0x8b, 0x19, 0x71, 0x04, 0x8c, 0x71, 0xff, 0x93, 0x7b, 0xb2, 0xd3, 0x2a, 0x64, 0x31, 0xab, 0x6d]; - let boundary = [0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3e, 0x9b, 0x6c, 0x69, 0xbc, 0x2c, 0xe2, 0xa2, 0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a, 0xe9, 0x7e, 0x53, 0x84]; - let nonce = 0xd7b3ac70a301a249; - // difficulty = 0x085657254bd9u64; - let light = Light::new(&::std::env::temp_dir(), 486382); - let result = light_compute(&light, &hash, nonce); - assert_eq!(result.mix_hash[..], mix_hash[..]); - assert_eq!(result.value[..], boundary[..]); -} - -#[test] -fn test_seed_compute_once() { - let seed_compute = SeedHashCompute::new(); - let hash = [241, 175, 44, 134, 39, 121, 245, 239, 228, 236, 43, 160, 195, 152, 46, 7, 199, 5, 253, 147, 241, 206, 98, 43, 3, 104, 17, 40, 192, 79, 106, 162]; - assert_eq!(seed_compute.get_seedhash(486382), hash); -} - -#[test] -fn test_seed_compute_zero() { - let seed_compute = SeedHashCompute::new(); - assert_eq!(seed_compute.get_seedhash(0), [0u8; 32]); -} - -#[test] -fn test_seed_compute_after_older() { - let seed_compute = SeedHashCompute::new(); - // calculating an older value first shouldn't affect the result - let _ = seed_compute.get_seedhash(50000); - let hash = [241, 175, 44, 134, 39, 121, 245, 239, 228, 236, 43, 160, 195, 152, 46, 7, 199, 5, 253, 147, 241, 206, 98, 43, 3, 104, 17, 40, 192, 79, 106, 162]; - assert_eq!(seed_compute.get_seedhash(486382), hash); -} - -#[test] -fn test_seed_compute_after_newer() { - let seed_compute = SeedHashCompute::new(); - // calculating an newer value first shouldn't affect the result - let _ = seed_compute.get_seedhash(972764); - let hash = [241, 175, 44, 134, 39, 121, 245, 239, 228, 236, 43, 160, 195, 152, 46, 7, 199, 5, 253, 147, 241, 206, 98, 43, 3, 104, 17, 40, 192, 79, 106, 162]; - assert_eq!(seed_compute.get_seedhash(486382), hash); -} - -#[test] -fn test_drop_old_data() { - let path = ::std::env::temp_dir(); - let first = Light::new(&path, 0).to_file().unwrap(); - - let second = Light::new(&path, ETHASH_EPOCH_LENGTH).to_file().unwrap(); - assert!(fs::metadata(&first).is_ok()); - - let _ = Light::new(&path, ETHASH_EPOCH_LENGTH * 2).to_file(); - assert!(fs::metadata(&first).is_err()); - assert!(fs::metadata(&second).is_ok()); - - let _ = Light::new(&path, ETHASH_EPOCH_LENGTH * 3).to_file(); - assert!(fs::metadata(&second).is_err()); + #[test] + fn test_difficulty_test() { + let hash = [ + 0xf5, 0x7e, 0x6f, 0x3a, 0xcf, 0xc0, 0xdd, 0x4b, 0x5b, 0xf2, 0xbe, 0xe4, 0x0a, 0xb3, + 0x35, 0x8a, 0xa6, 0x87, 0x73, 0xa8, 0xd0, 0x9f, 0x5e, 0x59, 0x5e, 0xab, 0x55, 0x94, + 0x05, 0x52, 0x7d, 0x72, + ]; + let mix_hash = [ + 0x1f, 0xff, 0x04, 0xce, 0xc9, 0x41, 0x73, 0xfd, 0x59, 0x1e, 0x3d, 0x89, 0x60, 0xce, + 0x6b, 0xdf, 0x8b, 0x19, 0x71, 0x04, 0x8c, 0x71, 0xff, 0x93, 0x7b, 0xb2, 0xd3, 0x2a, + 0x64, 0x31, 0xab, 0x6d, + ]; + let nonce = 0xd7b3ac70a301a249; + let boundary_good = [ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3e, 0x9b, 0x6c, 0x69, 0xbc, 0x2c, 0xe2, 0xa2, + 0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a, + 0xe9, 0x7e, 0x53, 0x84, + ]; + assert_eq!(quick_get_difficulty(&hash, nonce, &mix_hash)[..], boundary_good[..]); + let boundary_bad = [ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3a, 0x9b, 0x6c, 0x69, 0xbc, 0x2c, 0xe2, 0xa2, + 0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a, + 0xe9, 0x7e, 0x53, 0x84, + ]; + assert!(quick_get_difficulty(&hash, nonce, &mix_hash)[..] != boundary_bad[..]); + } + + #[test] + fn test_light_compute() { + let hash = [ + 0xf5, 0x7e, 0x6f, 0x3a, 0xcf, 0xc0, 0xdd, 0x4b, 0x5b, 0xf2, 0xbe, 0xe4, 0x0a, 0xb3, + 0x35, 0x8a, 0xa6, 0x87, 0x73, 0xa8, 0xd0, 0x9f, 0x5e, 0x59, 0x5e, 0xab, 0x55, 0x94, + 0x05, 0x52, 0x7d, 0x72, + ]; + let mix_hash = [ + 0x1f, 0xff, 0x04, 0xce, 0xc9, 0x41, 0x73, 0xfd, 0x59, 0x1e, 0x3d, 0x89, 0x60, 0xce, + 0x6b, 0xdf, 0x8b, 0x19, 0x71, 0x04, 0x8c, 0x71, 0xff, 0x93, 0x7b, 0xb2, 0xd3, 0x2a, + 0x64, 0x31, 0xab, 0x6d, + ]; + let boundary = [ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3e, 0x9b, 0x6c, 0x69, 0xbc, 0x2c, 0xe2, 0xa2, + 0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a, + 0xe9, 0x7e, 0x53, 0x84, + ]; + let nonce = 0xd7b3ac70a301a249; + // difficulty = 0x085657254bd9u64; + let light = NodeCacheBuilder::new(None).light(&::std::env::temp_dir(), 486382); + let result = light_compute(&light, &hash, nonce); + assert_eq!(result.mix_hash[..], mix_hash[..]); + assert_eq!(result.value[..], boundary[..]); + } + + #[test] + fn test_drop_old_data() { + let path = ::std::env::temp_dir(); + let builder = NodeCacheBuilder::new(None); + let first = builder.light(&path, 0).to_file().unwrap().to_owned(); + + let second = builder.light(&path, ETHASH_EPOCH_LENGTH).to_file().unwrap().to_owned(); + assert!(fs::metadata(&first).is_ok()); + + let _ = builder.light(&path, ETHASH_EPOCH_LENGTH * 2).to_file(); + assert!(fs::metadata(&first).is_err()); + assert!(fs::metadata(&second).is_ok()); + + let _ = builder.light(&path, ETHASH_EPOCH_LENGTH * 3).to_file(); + assert!(fs::metadata(&second).is_err()); + } } diff --git a/ethash/src/keccak.rs b/ethash/src/keccak.rs new file mode 100644 index 000000000..752b0230b --- /dev/null +++ b/ethash/src/keccak.rs @@ -0,0 +1,52 @@ +// Copyright 2015-2017 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity 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. + +// Parity 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 Parity. If not, see . + +extern crate hash; + +pub type H256 = [u8; 32]; + +pub mod keccak_512 { + use super::hash; + + pub use self::hash::keccak_512 as unchecked; + + pub fn write(input: &[u8], output: &mut [u8]) { + unsafe { hash::keccak_512(output.as_mut_ptr(), output.len(), input.as_ptr(), input.len()) }; + } + + pub fn inplace(input: &mut [u8]) { + // This is safe since `sha3_*` uses an internal buffer and copies the result to the output. This + // means that we can reuse the input buffer for both input and output. + unsafe { hash::keccak_512(input.as_mut_ptr(), input.len(), input.as_ptr(), input.len()) }; + } +} + +pub mod keccak_256 { + use super::hash; + + pub use self::hash::keccak_256 as unchecked; + + #[allow(dead_code)] + pub fn write(input: &[u8], output: &mut [u8]) { + unsafe { hash::keccak_256(output.as_mut_ptr(), output.len(), input.as_ptr(), input.len()) }; + } + + pub fn inplace(input: &mut [u8]) { + // This is safe since `sha3_*` uses an internal buffer and copies the result to the output. This + // means that we can reuse the input buffer for both input and output. + unsafe { hash::keccak_256(input.as_mut_ptr(), input.len(), input.as_ptr(), input.len()) }; + } +} diff --git a/ethash/src/lib.rs b/ethash/src/lib.rs index f88e8a3f5..57bf46ade 100644 --- a/ethash/src/lib.rs +++ b/ethash/src/lib.rs @@ -14,28 +14,35 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -//! Ethash implementation -//! See https://github.com/ethereum/wiki/wiki/Ethash - #![cfg_attr(feature = "benches", feature(test))] extern crate primal; -extern crate hash; extern crate parking_lot; +extern crate either; +extern crate memmap; #[macro_use] extern crate crunchy; #[macro_use] extern crate log; -mod compute; +mod compute; +mod seed_compute; +mod cache; +mod keccak; +mod shared; + +pub use cache::{NodeCacheBuilder, OptimizeFor}; +pub use compute::{ProofOfWork, quick_get_difficulty, slow_hash_block_number}; +use compute::Light; +use keccak::H256; +use parking_lot::Mutex; +pub use seed_compute::SeedHashCompute; +pub use shared::ETHASH_EPOCH_LENGTH; use std::mem; use std::path::{Path, PathBuf}; -use compute::Light; -pub use compute::{ETHASH_EPOCH_LENGTH, H256, ProofOfWork, SeedHashCompute, quick_get_difficulty, slow_get_seedhash}; use std::sync::Arc; -use parking_lot::Mutex; struct LightCache { recent_epoch: Option, @@ -46,15 +53,17 @@ struct LightCache { /// Light/Full cache manager. pub struct EthashManager { + nodecache_builder: NodeCacheBuilder, cache: Mutex, cache_dir: PathBuf, } impl EthashManager { /// Create a new new instance of ethash manager - pub fn new>(cache_dir: T) -> EthashManager { + pub fn new>>(cache_dir: &Path, optimize_for: T) -> EthashManager { EthashManager { - cache_dir: cache_dir.as_ref().to_path_buf(), + cache_dir: cache_dir.to_path_buf(), + nodecache_builder: NodeCacheBuilder::new(optimize_for.into().unwrap_or_default()), cache: Mutex::new(LightCache { recent_epoch: None, recent: None, @@ -96,11 +105,19 @@ impl EthashManager { }; match light { None => { - let light = match Light::from_file(&self.cache_dir, block_number) { + let light = match Light::from_file_with_builder( + &self.nodecache_builder, + &self.cache_dir, + block_number, + ) { Ok(light) => Arc::new(light), Err(e) => { debug!("Light cache file not found for {}:{}", block_number, e); - let light = Light::new(&self.cache_dir, block_number); + let mut light = Light::new_with_builder( + &self.nodecache_builder, + &self.cache_dir, + block_number, + ); if let Err(e) = light.to_file() { warn!("Light cache file write error: {}", e); } @@ -120,7 +137,7 @@ impl EthashManager { #[test] fn test_lru() { - let ethash = EthashManager::new(&::std::env::temp_dir()); + let ethash = EthashManager::new(&::std::env::temp_dir(), None); let hash = [0u8; 32]; ethash.compute_light(1, &hash, 1); ethash.compute_light(50000, &hash, 1); @@ -138,24 +155,89 @@ fn test_lru() { mod benchmarks { extern crate test; - use compute::{Light, light_compute, SeedHashCompute}; use self::test::Bencher; + use cache::{NodeCacheBuilder, OptimizeFor}; + use compute::{Light, light_compute}; + + const HASH: [u8; 32] = [0xf5, 0x7e, 0x6f, 0x3a, 0xcf, 0xc0, 0xdd, 0x4b, 0x5b, 0xf2, 0xbe, + 0xe4, 0x0a, 0xb3, 0x35, 0x8a, 0xa6, 0x87, 0x73, 0xa8, 0xd0, 0x9f, + 0x5e, 0x59, 0x5e, 0xab, 0x55, 0x94, 0x05, 0x52, 0x7d, 0x72]; + const NONCE: u64 = 0xd7b3ac70a301a249; #[bench] - fn bench_light_compute(b: &mut Bencher) { - use ::std::env; + fn bench_light_compute_memmap(b: &mut Bencher) { + use std::env; - let hash = [0xf5, 0x7e, 0x6f, 0x3a, 0xcf, 0xc0, 0xdd, 0x4b, 0x5b, 0xf2, 0xbe, 0xe4, 0x0a, 0xb3, 0x35, 0x8a, 0xa6, 0x87, 0x73, 0xa8, 0xd0, 0x9f, 0x5e, 0x59, 0x5e, 0xab, 0x55, 0x94, 0x05, 0x52, 0x7d, 0x72]; - let nonce = 0xd7b3ac70a301a249; - let light = Light::new(env::temp_dir(), 486382); + let builder = NodeCacheBuilder::new(OptimizeFor::Memory); + let light = Light::new_with_builder(&builder, &env::temp_dir(), 486382); - b.iter(|| light_compute(&light, &hash, nonce)); + b.iter(|| light_compute(&light, &HASH, NONCE)); } #[bench] - fn bench_seedhash(b: &mut Bencher) { - let seed_compute = SeedHashCompute::new(); + fn bench_light_compute_memory(b: &mut Bencher) { + use std::env; - b.iter(|| seed_compute.get_seedhash(486382)); + let light = Light::new(&env::temp_dir(), 486382); + + b.iter(|| light_compute(&light, &HASH, NONCE)); + } + + #[bench] + #[ignore] + fn bench_light_new_round_trip_memmap(b: &mut Bencher) { + use std::env; + + b.iter(|| { + let builder = NodeCacheBuilder::new(OptimizeFor::Memory); + let light = Light::new_with_builder(&builder, &env::temp_dir(), 486382); + light_compute(&light, &HASH, NONCE); + }); + } + + #[bench] + #[ignore] + fn bench_light_new_round_trip_memory(b: &mut Bencher) { + use std::env; + b.iter(|| { + let light = Light::new(&env::temp_dir(), 486382); + light_compute(&light, &HASH, NONCE); + }); + } + + #[bench] + fn bench_light_from_file_round_trip_memory(b: &mut Bencher) { + use std::env; + + let dir = env::temp_dir(); + let height = 486382; + { + let mut dummy = Light::new(&dir, height); + dummy.to_file().unwrap(); + } + + b.iter(|| { + let light = Light::from_file(&dir, 486382).unwrap(); + light_compute(&light, &HASH, NONCE); + }); + } + + #[bench] + fn bench_light_from_file_round_trip_memmap(b: &mut Bencher) { + use std::env; + + let dir = env::temp_dir(); + let height = 486382; + { + let builder = NodeCacheBuilder::new(OptimizeFor::Memory); + let mut dummy = Light::new_with_builder(&builder, &dir, height); + dummy.to_file().unwrap(); + } + + b.iter(|| { + let builder = NodeCacheBuilder::new(OptimizeFor::Memory); + let light = Light::from_file_with_builder(&builder, &dir, 486382).unwrap(); + light_compute(&light, &HASH, NONCE); + }); } } diff --git a/ethash/src/seed_compute.rs b/ethash/src/seed_compute.rs new file mode 100644 index 000000000..04774b3e3 --- /dev/null +++ b/ethash/src/seed_compute.rs @@ -0,0 +1,109 @@ +// Copyright 2015-2017 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity 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. + +// Parity 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 Parity. If not, see . + +use shared; +use keccak::{keccak_256, H256}; + +use std::cell::Cell; + +pub struct SeedHashCompute { + prev_epoch: Cell, + prev_seedhash: Cell, +} + +impl SeedHashCompute { + #[inline] + pub fn new() -> SeedHashCompute { + SeedHashCompute { + prev_epoch: Cell::new(0), + prev_seedhash: Cell::new([0u8; 32]), + } + } + + #[inline] + fn reset_cache(&self) { + self.prev_epoch.set(0); + self.prev_seedhash.set([0u8; 32]); + } + + #[inline] + pub fn hash_block_number(&self, block_number: u64) -> H256 { + self.hash_epoch(shared::epoch(block_number)) + } + + #[inline] + pub fn hash_epoch(&self, epoch: u64) -> H256 { + if epoch < self.prev_epoch.get() { + // can't build on previous hash if requesting an older block + self.reset_cache(); + } + if epoch > self.prev_epoch.get() { + let seed_hash = SeedHashCompute::resume_compute_seedhash( + self.prev_seedhash.get(), + self.prev_epoch.get(), + epoch, + ); + self.prev_seedhash.set(seed_hash); + self.prev_epoch.set(epoch); + } + self.prev_seedhash.get() + } + + #[inline] + pub fn resume_compute_seedhash(mut hash: H256, start_epoch: u64, end_epoch: u64) -> H256 { + for _ in start_epoch..end_epoch { + keccak_256::inplace(&mut hash); + } + hash + } +} + +#[cfg(test)] +mod tests { + use super::SeedHashCompute; + + #[test] + fn test_seed_compute_once() { + let seed_compute = SeedHashCompute::new(); + let hash = [241, 175, 44, 134, 39, 121, 245, 239, 228, 236, 43, 160, 195, 152, 46, 7, 199, 5, 253, 147, 241, 206, 98, 43, 3, 104, 17, 40, 192, 79, 106, 162]; + assert_eq!(seed_compute.hash_block_number(486382), hash); + } + + #[test] + fn test_seed_compute_zero() { + let seed_compute = SeedHashCompute::new(); + assert_eq!(seed_compute.hash_block_number(0), [0u8; 32]); + } + + #[test] + fn test_seed_compute_after_older() { + let seed_compute = SeedHashCompute::new(); + // calculating an older value first shouldn't affect the result + let _ = seed_compute.hash_block_number(50000); + let hash = [241, 175, 44, 134, 39, 121, 245, 239, 228, 236, 43, 160, 195, 152, 46, 7, 199, 5, 253, 147, 241, 206, 98, 43, 3, 104, 17, 40, 192, 79, 106, 162]; + assert_eq!(seed_compute.hash_block_number(486382), hash); + } + + #[test] + fn test_seed_compute_after_newer() { + let seed_compute = SeedHashCompute::new(); + // calculating an newer value first shouldn't affect the result + let _ = seed_compute.hash_block_number(972764); + let hash = [241, 175, 44, 134, 39, 121, 245, 239, 228, 236, 43, 160, 195, 152, 46, 7, 199, 5, 253, 147, 241, 206, 98, 43, 3, 104, 17, 40, 192, 79, 106, 162]; + assert_eq!(seed_compute.hash_block_number(486382), hash); + } + +} diff --git a/ethash/src/shared.rs b/ethash/src/shared.rs new file mode 100644 index 000000000..39e1c8eb8 --- /dev/null +++ b/ethash/src/shared.rs @@ -0,0 +1,149 @@ +// Copyright 2015-2017 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity 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. + +// Parity 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 Parity. If not, see . + +use primal::is_prime; + +pub const DATASET_BYTES_INIT: u64 = 1 << 30; +pub const DATASET_BYTES_GROWTH: u64 = 1 << 23; +pub const CACHE_BYTES_INIT: u64 = 1 << 24; +pub const CACHE_BYTES_GROWTH: u64 = 1 << 17; + +pub const ETHASH_EPOCH_LENGTH: u64 = 30000; +pub const ETHASH_CACHE_ROUNDS: usize = 3; +pub const ETHASH_MIX_BYTES: usize = 128; +pub const ETHASH_ACCESSES: usize = 64; +pub const ETHASH_DATASET_PARENTS: u32 = 256; +pub const NODE_DWORDS: usize = NODE_WORDS / 2; +pub const NODE_WORDS: usize = NODE_BYTES / 4; +pub const NODE_BYTES: usize = 64; + +pub fn epoch(block_number: u64) -> u64 { + block_number / ETHASH_EPOCH_LENGTH +} + +static CHARS: &'static [u8] = b"0123456789abcdef"; +pub fn to_hex(bytes: &[u8]) -> String { + let mut v = Vec::with_capacity(bytes.len() * 2); + for &byte in bytes.iter() { + v.push(CHARS[(byte >> 4) as usize]); + v.push(CHARS[(byte & 0xf) as usize]); + } + + unsafe { String::from_utf8_unchecked(v) } +} + +pub fn get_cache_size(block_number: u64) -> usize { + // TODO: Memoise + let mut sz: u64 = CACHE_BYTES_INIT + CACHE_BYTES_GROWTH * (block_number / ETHASH_EPOCH_LENGTH); + sz = sz - NODE_BYTES as u64; + while !is_prime(sz / NODE_BYTES as u64) { + sz = sz - 2 * NODE_BYTES as u64; + } + sz as usize +} + +pub fn get_data_size(block_number: u64) -> usize { + // TODO: Memoise + let mut sz: u64 = DATASET_BYTES_INIT + DATASET_BYTES_GROWTH * (block_number / ETHASH_EPOCH_LENGTH); + sz = sz - ETHASH_MIX_BYTES as u64; + while !is_prime(sz / ETHASH_MIX_BYTES as u64) { + sz = sz - 2 * ETHASH_MIX_BYTES as u64; + } + sz as usize +} + +pub type NodeBytes = [u8; NODE_BYTES]; +pub type NodeWords = [u32; NODE_WORDS]; +pub type NodeDwords = [u64; NODE_DWORDS]; + +macro_rules! static_assert_size_eq { + (@inner $a:ty, $b:ty, $($rest:ty),*) => { + fn first() { + static_assert_size_eq!($a, $b); + } + + fn second() { + static_assert_size_eq!($b, $($rest),*); + } + }; + (@inner $a:ty, $b:ty) => { + unsafe { + let val: $b = ::std::mem::uninitialized(); + let _: $a = ::std::mem::transmute(val); + } + }; + ($($rest:ty),*) => { + static_assert_size_eq!(size_eq: $($rest),*); + }; + ($name:ident : $($rest:ty),*) => { + #[allow(dead_code)] + fn $name() { + static_assert_size_eq!(@inner $($rest),*); + } + }; +} + +static_assert_size_eq!(Node, NodeBytes, NodeWords, NodeDwords); + +#[repr(C)] +pub union Node { + pub dwords: NodeDwords, + pub words: NodeWords, + pub bytes: NodeBytes, +} + +impl Clone for Node { + fn clone(&self) -> Self { + unsafe { Node { bytes: *&self.bytes } } + } +} + +// We use `inline(always)` because I was experiencing an 100% slowdown and `perf` showed that these +// calls were taking up ~30% of the runtime. Adding these annotations fixes the issue. Remove at +// your peril, if and only if you have benchmarks to prove that this doesn't reintroduce the +// performance regression. It's not caused by the `debug_assert_eq!` either, your guess is as good +// as mine. +impl Node { + #[inline(always)] + pub fn as_bytes(&self) -> &NodeBytes { + unsafe { &self.bytes } + } + + #[inline(always)] + pub fn as_bytes_mut(&mut self) -> &mut NodeBytes { + unsafe { &mut self.bytes } + } + + #[inline(always)] + pub fn as_words(&self) -> &NodeWords { + unsafe { &self.words } + } + + #[inline(always)] + pub fn as_words_mut(&mut self) -> &mut NodeWords { + unsafe { &mut self.words } + } + + #[inline(always)] + pub fn as_dwords(&self) -> &NodeDwords { + unsafe { &self.dwords } + } + + #[inline(always)] + pub fn as_dwords_mut(&mut self) -> &mut NodeDwords { + unsafe { &mut self.dwords } + } +} diff --git a/ethcore/node_filter/src/lib.rs b/ethcore/node_filter/src/lib.rs index 276e6a5d7..fb098f60f 100644 --- a/ethcore/node_filter/src/lib.rs +++ b/ethcore/node_filter/src/lib.rs @@ -133,7 +133,7 @@ mod test { fn node_filter() { let contract_addr = Address::from_str("0000000000000000000000000000000000000005").unwrap(); let data = include_bytes!("../res/node_filter.json"); - let spec = Spec::load(::std::env::temp_dir(), &data[..]).unwrap(); + let spec = Spec::load(&::std::env::temp_dir(), &data[..]).unwrap(); let client_db = Arc::new(::util::kvdb::in_memory(::ethcore::db::NUM_COLUMNS.unwrap_or(0))); let client = Client::new( diff --git a/ethcore/src/engines/basic_authority.rs b/ethcore/src/engines/basic_authority.rs index b96769837..5382c8fe3 100644 --- a/ethcore/src/engines/basic_authority.rs +++ b/ethcore/src/engines/basic_authority.rs @@ -270,7 +270,7 @@ mod tests { /// Create a new test chain spec with `BasicAuthority` consensus engine. fn new_test_authority() -> Spec { let bytes: &[u8] = include_bytes!("../../res/basic_authority.json"); - Spec::load(::std::env::temp_dir(), bytes).expect("invalid chain spec") + Spec::load(&::std::env::temp_dir(), bytes).expect("invalid chain spec") } #[test] diff --git a/ethcore/src/ethereum/ethash.rs b/ethcore/src/ethereum/ethash.rs index 91e326b64..07508a93a 100644 --- a/ethcore/src/ethereum/ethash.rs +++ b/ethcore/src/ethereum/ethash.rs @@ -19,7 +19,7 @@ use std::cmp; use std::collections::{BTreeMap, HashMap}; use std::sync::{Arc, Weak}; use hash::{KECCAK_EMPTY_LIST_RLP}; -use ethash::{quick_get_difficulty, slow_get_seedhash, EthashManager}; +use ethash::{quick_get_difficulty, slow_hash_block_number, EthashManager, OptimizeFor}; use bigint::prelude::U256; use bigint::hash::{H256, H64}; use util::*; @@ -161,18 +161,19 @@ pub struct Ethash { impl Ethash { /// Create a new instance of Ethash engine - pub fn new>( - cache_dir: T, + pub fn new>>( + cache_dir: &Path, params: CommonParams, ethash_params: EthashParams, builtins: BTreeMap, + optimize_for: T, ) -> Arc { Arc::new(Ethash { tx_filter: TransactionFilter::from_params(¶ms), params, ethash_params, builtins, - pow: EthashManager::new(cache_dir), + pow: EthashManager::new(cache_dir.as_ref(), optimize_for.into()), }) } } @@ -416,7 +417,7 @@ impl Engine for Arc { let result = self.pow.compute_light(header.number() as u64, &header.bare_hash().0, header.nonce().low_u64()); let mix = H256(result.mix_hash); let difficulty = Ethash::boundary_to_difficulty(&H256(result.value)); - trace!(target: "miner", "num: {}, seed: {}, h: {}, non: {}, mix: {}, res: {}" , header.number() as u64, H256(slow_get_seedhash(header.number() as u64)), header.bare_hash(), header.nonce().low_u64(), H256(result.mix_hash), H256(result.value)); + trace!(target: "miner", "num: {}, seed: {}, h: {}, non: {}, mix: {}, res: {}" , header.number() as u64, H256(slow_hash_block_number(header.number() as u64)), header.bare_hash(), header.nonce().low_u64(), H256(result.mix_hash), H256(result.value)); if mix != header.mix_hash() { return Err(From::from(BlockError::MismatchedH256SealElement(Mismatch { expected: mix, found: header.mix_hash() }))); } @@ -849,7 +850,7 @@ mod tests { fn difficulty_frontier() { let spec = new_homestead_test(); let ethparams = get_default_ethash_params(); - let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new()); + let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new(), None); let mut parent_header = Header::default(); parent_header.set_number(1000000); @@ -867,7 +868,7 @@ mod tests { fn difficulty_homestead() { let spec = new_homestead_test(); let ethparams = get_default_ethash_params(); - let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new()); + let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new(), None); let mut parent_header = Header::default(); parent_header.set_number(1500000); @@ -920,7 +921,7 @@ mod tests { ecip1010_pause_transition: 3000000, ..get_default_ethash_params() }; - let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new()); + let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new(), None); let mut parent_header = Header::default(); parent_header.set_number(3500000); @@ -954,7 +955,7 @@ mod tests { ecip1010_continue_transition: 5000000, ..get_default_ethash_params() }; - let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new()); + let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new(), None); let mut parent_header = Header::default(); parent_header.set_number(5000102); @@ -1000,7 +1001,7 @@ mod tests { fn gas_limit_is_multiple_of_determinant() { let spec = new_homestead_test(); let ethparams = get_default_ethash_params(); - let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new()); + let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new(), None); let mut parent = Header::new(); let mut header = Header::new(); header.set_number(1); @@ -1044,7 +1045,7 @@ mod tests { fn difficulty_max_timestamp() { let spec = new_homestead_test(); let ethparams = get_default_ethash_params(); - let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new()); + let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new(), None); let mut parent_header = Header::default(); parent_header.set_number(1000000); @@ -1072,7 +1073,7 @@ mod tests { header.set_number(parent_header.number() + 1); header.set_gas_limit(100_001.into()); header.set_difficulty(ethparams.minimum_difficulty); - let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new()); + let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new(), None); assert!(ethash.verify_block_family(&header, &parent_header, None).is_ok()); parent_header.set_number(9); @@ -1127,7 +1128,7 @@ mod tests { nonce: U256::zero(), }.sign(keypair.secret(), None).into(); - let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new()); + let ethash = Ethash::new(&::std::env::temp_dir(), spec.params().clone(), ethparams, BTreeMap::new(), None); assert!(ethash.verify_transaction_basic(&tx1, &header).is_ok()); assert!(ethash.verify_transaction_basic(&tx2, &header).is_ok()); diff --git a/ethcore/src/ethereum/mod.rs b/ethcore/src/ethereum/mod.rs index 2135ea267..617980e0f 100644 --- a/ethcore/src/ethereum/mod.rs +++ b/ethcore/src/ethereum/mod.rs @@ -27,7 +27,6 @@ pub mod denominations; pub use self::ethash::{Ethash}; pub use self::denominations::*; -use std::path::Path; use super::spec::*; /// Most recent fork block that we support on Mainnet. @@ -39,33 +38,47 @@ pub const FORK_SUPPORTED_ROPSTEN: u64 = 10; /// Most recent fork block that we support on Kovan. pub const FORK_SUPPORTED_KOVAN: u64 = 0; -fn load<'a, T: 'a + Into>>(cache_dir: T, b: &[u8]) -> Spec { - match cache_dir.into() { - Some(path) => Spec::load(path, b), +fn load<'a, T: Into>>>(params: T, b: &[u8]) -> Spec { + match params.into() { + Some(params) => Spec::load(params, b), None => Spec::load(&::std::env::temp_dir(), b) }.expect("chain spec is invalid") } /// Create a new Foundation Olympic chain spec. -pub fn new_olympic(cache_dir: &Path) -> Spec { load(cache_dir, include_bytes!("../../res/ethereum/olympic.json")) } +pub fn new_olympic<'a, T: Into>>(params: T) -> Spec { + load(params.into(), include_bytes!("../../res/ethereum/olympic.json")) +} /// Create a new Foundation Mainnet chain spec. -pub fn new_foundation(cache_dir: &Path) -> Spec { load(cache_dir, include_bytes!("../../res/ethereum/foundation.json")) } +pub fn new_foundation<'a, T: Into>>(params: T) -> Spec { + load(params.into(), include_bytes!("../../res/ethereum/foundation.json")) +} /// Create a new Classic Mainnet chain spec without the DAO hardfork. -pub fn new_classic(cache_dir: &Path) -> Spec { load(cache_dir, include_bytes!("../../res/ethereum/classic.json")) } +pub fn new_classic<'a, T: Into>>(params: T) -> Spec { + load(params.into(), include_bytes!("../../res/ethereum/classic.json")) +} /// Create a new Expanse mainnet chain spec. -pub fn new_expanse(cache_dir: &Path) -> Spec { load(cache_dir, include_bytes!("../../res/ethereum/expanse.json")) } +pub fn new_expanse<'a, T: Into>>(params: T) -> Spec { + load(params.into(), include_bytes!("../../res/ethereum/expanse.json")) +} /// Create a new Kovan testnet chain spec. -pub fn new_kovan(cache_dir: &Path) -> Spec { load(cache_dir, include_bytes!("../../res/ethereum/kovan.json")) } +pub fn new_kovan<'a, T: Into>>(params: T) -> Spec { + load(params.into(), include_bytes!("../../res/ethereum/kovan.json")) +} /// Create a new Foundation Ropsten chain spec. -pub fn new_ropsten(cache_dir: &Path) -> Spec { load(cache_dir, include_bytes!("../../res/ethereum/ropsten.json")) } +pub fn new_ropsten<'a, T: Into>>(params: T) -> Spec { + load(params.into(), include_bytes!("../../res/ethereum/ropsten.json")) +} /// Create a new Morden chain spec. -pub fn new_morden(cache_dir: &Path) -> Spec { load(cache_dir, include_bytes!("../../res/ethereum/morden.json")) } +pub fn new_morden<'a, T: Into>>(params: T) -> Spec { + load(params.into(), include_bytes!("../../res/ethereum/morden.json")) +} // For tests diff --git a/ethcore/src/json_tests/test_common.rs b/ethcore/src/json_tests/test_common.rs index 33564cd87..383b52c18 100644 --- a/ethcore/src/json_tests/test_common.rs +++ b/ethcore/src/json_tests/test_common.rs @@ -52,7 +52,8 @@ pub fn run_test_file(path: &Path, runner: fn (json_data: &[u8]) -> Vec) let mut file = File::open(&path).expect("Error opening test file"); file.read_to_end(&mut data).expect("Error reading test file"); let results = runner(&data); - assert!(results.is_empty()); + let empty: [String; 0] = []; + assert_eq!(results, empty); } macro_rules! test { diff --git a/ethcore/src/miner/stratum.rs b/ethcore/src/miner/stratum.rs index f1eeaf2b4..2e353e807 100644 --- a/ethcore/src/miner/stratum.rs +++ b/ethcore/src/miner/stratum.rs @@ -171,7 +171,7 @@ impl StratumJobDispatcher { fn payload(&self, pow_hash: H256, difficulty: U256, number: u64) -> String { // TODO: move this to engine let target = Ethash::difficulty_to_boundary(&difficulty); - let seed_hash = &self.seed_compute.lock().get_seedhash(number); + let seed_hash = &self.seed_compute.lock().hash_block_number(number); let seed_hash = H256::from_slice(&seed_hash[..]); format!( r#"["0x", "0x{}","0x{}","0x{}","0x{:x}"]"#, diff --git a/ethcore/src/miner/work_notify.rs b/ethcore/src/miner/work_notify.rs index 76bc0a371..5db8b5be4 100644 --- a/ethcore/src/miner/work_notify.rs +++ b/ethcore/src/miner/work_notify.rs @@ -72,7 +72,7 @@ impl NotifyWork for WorkPoster { fn notify(&self, pow_hash: H256, difficulty: U256, number: u64) { // TODO: move this to engine let target = Ethash::difficulty_to_boundary(&difficulty); - let seed_hash = &self.seed_compute.lock().get_seedhash(number); + let seed_hash = &self.seed_compute.lock().hash_block_number(number); let seed_hash = H256::from_slice(&seed_hash[..]); let body = format!( r#"{{ "result": ["0x{}","0x{}","0x{}","0x{:x}"] }}"#, diff --git a/ethcore/src/spec/spec.rs b/ethcore/src/spec/spec.rs index f4f961cc0..422892fd0 100644 --- a/ethcore/src/spec/spec.rs +++ b/ethcore/src/spec/spec.rs @@ -16,34 +16,37 @@ //! Parameters for a block chain. -use std::io::Read; -use std::collections::BTreeMap; -use std::path::Path; -use std::sync::Arc; -use rustc_hex::FromHex; -use hash::{KECCAK_NULL_RLP, keccak}; use super::genesis::Genesis; use super::seal::Generic as GenericSeal; +use bigint::hash::{H2048, H256}; +use bigint::prelude::U256; use builtin::Builtin; -use engines::{Engine, NullEngine, InstantSeal, BasicAuthority, AuthorityRound, Tendermint, DEFAULT_BLOCKHASH_CONTRACT}; -use vm::{EnvInfo, CallType, ActionValue, ActionParams}; +use bytes::Bytes; +use engines::{AuthorityRound, BasicAuthority, DEFAULT_BLOCKHASH_CONTRACT, Engine, InstantSeal, + NullEngine, Tendermint}; use error::Error; + +pub use ethash::OptimizeFor; use ethereum; use ethjson; use executive::Executive; use factory::Factories; +use hash::{KECCAK_NULL_RLP, keccak}; use header::{BlockNumber, Header}; +use parking_lot::RwLock; use pod_state::*; use rlp::{Rlp, RlpStream}; +use rustc_hex::FromHex; use state::{Backend, State, Substate}; use state::backend::Basic as BasicBackend; +use std::collections::BTreeMap; +use std::io::Read; +use std::path::Path; +use std::sync::Arc; use trace::{NoopTracer, NoopVMTracer}; -use bigint::prelude::U256; -use bigint::hash::{H256, H2048}; -use parking_lot::RwLock; use util::*; -use bytes::Bytes; +use vm::{ActionParams, ActionValue, CallType, EnvInfo}; /// Parameters common to ethereum-like blockchains. /// NOTE: when adding bugfix hard-fork parameters, @@ -88,7 +91,8 @@ pub struct CommonParams { pub eip210_contract_code: Bytes, /// Gas allocated for EIP-210 blockhash update. pub eip210_contract_gas: U256, - /// Number of first block where EIP-211 (Metropolis: RETURNDATASIZE/RETURNDATACOPY) rules begin. + /// Number of first block where EIP-211 (Metropolis: RETURNDATASIZE/RETURNDATACOPY) rules + /// begin. pub eip211_transition: BlockNumber, /// Number of first block where EIP-214 rules begin. pub eip214_transition: BlockNumber, @@ -121,7 +125,7 @@ impl CommonParams { } /// Apply common spec config parameters to the schedule. - pub fn update_schedule(&self, block_number: u64, schedule: &mut ::vm::Schedule) { + pub fn update_schedule(&self, block_number: u64, schedule: &mut ::vm::Schedule) { schedule.have_create2 = block_number >= self.eip86_transition; schedule.have_revert = block_number >= self.eip140_transition; schedule.have_static_call = block_number >= self.eip214_transition; @@ -139,14 +143,10 @@ impl CommonParams { /// Whether these params contain any bug-fix hard forks. pub fn contains_bugfix_hard_fork(&self) -> bool { - self.eip98_transition != 0 && - self.eip155_transition != 0 && - self.validate_receipts_transition != 0 && - self.eip86_transition != 0 && - self.eip140_transition != 0 && - self.eip210_transition != 0 && - self.eip211_transition != 0 && - self.eip214_transition != 0 && + self.eip98_transition != 0 && self.eip155_transition != 0 && + self.validate_receipts_transition != 0 && self.eip86_transition != 0 && + self.eip140_transition != 0 && self.eip210_transition != 0 && + self.eip211_transition != 0 && self.eip214_transition != 0 && self.dust_protection_transition != 0 } } @@ -157,25 +157,59 @@ impl From for CommonParams { account_start_nonce: p.account_start_nonce.map_or_else(U256::zero, Into::into), maximum_extra_data_size: p.maximum_extra_data_size.into(), network_id: p.network_id.into(), - chain_id: if let Some(n) = p.chain_id { n.into() } else { p.network_id.into() }, + chain_id: if let Some(n) = p.chain_id { + n.into() + } else { + p.network_id.into() + }, subprotocol_name: p.subprotocol_name.unwrap_or_else(|| "eth".to_owned()), min_gas_limit: p.min_gas_limit.into(), - fork_block: if let (Some(n), Some(h)) = (p.fork_block, p.fork_hash) { Some((n.into(), h.into())) } else { None }, + fork_block: if let (Some(n), Some(h)) = (p.fork_block, p.fork_hash) { + Some((n.into(), h.into())) + } else { + None + }, eip98_transition: p.eip98_transition.map_or(0, Into::into), eip155_transition: p.eip155_transition.map_or(0, Into::into), validate_receipts_transition: p.validate_receipts_transition.map_or(0, Into::into), - eip86_transition: p.eip86_transition.map_or(BlockNumber::max_value(), Into::into), - eip140_transition: p.eip140_transition.map_or(BlockNumber::max_value(), Into::into), - eip210_transition: p.eip210_transition.map_or(BlockNumber::max_value(), Into::into), + eip86_transition: p.eip86_transition.map_or( + BlockNumber::max_value(), + Into::into, + ), + eip140_transition: p.eip140_transition.map_or( + BlockNumber::max_value(), + Into::into, + ), + eip210_transition: p.eip210_transition.map_or( + BlockNumber::max_value(), + Into::into, + ), eip210_contract_address: p.eip210_contract_address.map_or(0xf0.into(), Into::into), eip210_contract_code: p.eip210_contract_code.map_or_else( - || DEFAULT_BLOCKHASH_CONTRACT.from_hex().expect("Default BLOCKHASH contract is valid"), - Into::into), + || { + DEFAULT_BLOCKHASH_CONTRACT.from_hex().expect( + "Default BLOCKHASH contract is valid", + ) + }, + Into::into, + ), eip210_contract_gas: p.eip210_contract_gas.map_or(1000000.into(), Into::into), - eip211_transition: p.eip211_transition.map_or(BlockNumber::max_value(), Into::into), - eip214_transition: p.eip214_transition.map_or(BlockNumber::max_value(), Into::into), - eip658_transition: p.eip658_transition.map_or(BlockNumber::max_value(), Into::into), - dust_protection_transition: p.dust_protection_transition.map_or(BlockNumber::max_value(), Into::into), + eip211_transition: p.eip211_transition.map_or( + BlockNumber::max_value(), + Into::into, + ), + eip214_transition: p.eip214_transition.map_or( + BlockNumber::max_value(), + Into::into, + ), + eip658_transition: p.eip658_transition.map_or( + BlockNumber::max_value(), + Into::into, + ), + dust_protection_transition: p.dust_protection_transition.map_or( + BlockNumber::max_value(), + Into::into, + ), nonce_cap_increment: p.nonce_cap_increment.map_or(64, Into::into), remove_dust_contracts: p.remove_dust_contracts.unwrap_or(false), wasm: p.wasm.unwrap_or(false), @@ -188,6 +222,44 @@ impl From for CommonParams { } } +/// Runtime parameters for the spec that are related to how the software should run the chain, +/// rather than integral properties of the chain itself. +#[derive(Debug, Clone, Copy)] +pub struct SpecParams<'a> { + /// The path to the folder used to cache nodes. This is typically /tmp/ on Unix-like systems + pub cache_dir: &'a Path, + /// Whether to run slower at the expense of better memory usage, or run faster while using + /// more + /// memory. This may get more fine-grained in the future but for now is simply a binary + /// option. + pub optimization_setting: Option, +} + +impl<'a> SpecParams<'a> { + /// Create from a cache path, with null values for the other fields + pub fn from_path(path: &'a Path) -> Self { + SpecParams { + cache_dir: path, + optimization_setting: None, + } + } + + /// Create from a cache path and an optimization setting + pub fn new(path: &'a Path, optimization: OptimizeFor) -> Self { + SpecParams { + cache_dir: path, + optimization_setting: Some(optimization), + } + } +} + +impl<'a, T: AsRef> From<&'a T> for SpecParams<'a> { + fn from(path: &'a T) -> Self { + Self::from_path(path.as_ref()) + } +} + + /// Parameters for a block chain; includes both those intrinsic to the design of the /// chain and those to be interpreted by the active chain engine. pub struct Spec { @@ -258,15 +330,19 @@ impl Clone for Spec { } /// Load from JSON object. -pub fn load_from>(cache_dir: T, s: ethjson::spec::Spec) -> Result { - let builtins = s.accounts.builtins().into_iter().map(|p| (p.0.into(), From::from(p.1))).collect(); +fn load_from(spec_params: SpecParams, s: ethjson::spec::Spec) -> Result { + let builtins = s.accounts + .builtins() + .into_iter() + .map(|p| (p.0.into(), From::from(p.1))) + .collect(); let g = Genesis::from(s.genesis); let GenericSeal(seal_rlp) = g.seal.into(); let params = CommonParams::from(s.params); let mut s = Spec { name: s.name.clone().into(), - engine: Spec::engine(cache_dir, s.engine, params, builtins), + engine: Spec::engine(spec_params, s.engine, params, builtins), data_dir: s.data_dir.unwrap_or(s.name).into(), nodes: s.nodes.unwrap_or_else(Vec::new), parent_hash: g.parent_hash, @@ -279,7 +355,11 @@ pub fn load_from>(cache_dir: T, s: ethjson::spec::Spec) -> Result timestamp: g.timestamp, extra_data: g.extra_data, seal_rlp: seal_rlp, - constructors: s.accounts.constructors().into_iter().map(|(a, c)| (a.into(), c.into())).collect(), + constructors: s.accounts + .constructors() + .into_iter() + .map(|(a, c)| (a.into(), c.into())) + .collect(), state_root_memo: RwLock::new(Default::default()), // will be overwritten right after. genesis_state: s.accounts.into(), }; @@ -287,7 +367,12 @@ pub fn load_from>(cache_dir: T, s: ethjson::spec::Spec) -> Result // use memoized state root if provided. match g.state_root { Some(root) => *s.state_root_memo.get_mut() = root, - None => { let _ = s.run_constructors(&Default::default(), BasicBackend(MemoryDB::new()))?; }, + None => { + let _ = s.run_constructors( + &Default::default(), + BasicBackend(MemoryDB::new()), + )?; + } } Ok(s) @@ -305,8 +390,8 @@ macro_rules! load_bundled { impl Spec { /// Convert engine spec into a arc'd Engine of the right underlying type. /// TODO avoid this hard-coded nastiness - use dynamic-linked plugin framework instead. - fn engine>( - cache_dir: T, + fn engine( + spec_params: SpecParams, engine_spec: ethjson::spec::Engine, params: CommonParams, builtins: BTreeMap, @@ -314,14 +399,43 @@ impl Spec { match engine_spec { ethjson::spec::Engine::Null => Arc::new(NullEngine::new(params, builtins)), ethjson::spec::Engine::InstantSeal => Arc::new(InstantSeal::new(params, builtins)), - ethjson::spec::Engine::Ethash(ethash) => Arc::new(ethereum::Ethash::new(cache_dir, params, From::from(ethash.params), builtins)), - ethjson::spec::Engine::BasicAuthority(basic_authority) => Arc::new(BasicAuthority::new(params, From::from(basic_authority.params), builtins)), - ethjson::spec::Engine::AuthorityRound(authority_round) => AuthorityRound::new(params, From::from(authority_round.params), builtins).expect("Failed to start AuthorityRound consensus engine."), - ethjson::spec::Engine::Tendermint(tendermint) => Tendermint::new(params, From::from(tendermint.params), builtins).expect("Failed to start the Tendermint consensus engine."), + ethjson::spec::Engine::Ethash(ethash) => Arc::new(ethereum::Ethash::new( + spec_params.cache_dir, + params, + From::from(ethash.params), + builtins, + spec_params.optimization_setting, + )), + ethjson::spec::Engine::BasicAuthority(basic_authority) => Arc::new( + BasicAuthority::new( + params, + From::from( + basic_authority.params, + ), + builtins, + ), + ), + ethjson::spec::Engine::AuthorityRound(authority_round) => AuthorityRound::new( + params, + From::from( + authority_round.params, + ), + builtins, + ).expect( + "Failed to start AuthorityRound consensus engine.", + ), + ethjson::spec::Engine::Tendermint(tendermint) => Tendermint::new( + params, + From::from(tendermint.params), + builtins, + ).expect( + "Failed to start the Tendermint consensus engine.", + ), } } - // given a pre-constructor state, run all the given constructors and produce a new state and state root. + // given a pre-constructor state, run all the given constructors and produce a new state and + // state root. fn run_constructors(&self, factories: &Factories, mut db: T) -> Result { let mut root = KECCAK_NULL_RLP; @@ -337,20 +451,18 @@ impl Spec { for (address, account) in self.genesis_state.get().iter() { db.note_non_null_account(address); account.insert_additional( - &mut *factories.accountdb.create(db.as_hashdb_mut(), keccak(address)), - &factories.trie + &mut *factories.accountdb.create( + db.as_hashdb_mut(), + keccak(address), + ), + &factories.trie, ); } let start_nonce = self.engine.account_start_nonce(0); let (root, db) = { - let mut state = State::from_existing( - db, - root, - start_nonce, - factories.clone(), - )?; + let mut state = State::from_existing(db, root, start_nonce, factories.clone())?; // Execute contract constructors. let env_info = EnvInfo { @@ -385,7 +497,14 @@ impl Spec { { let mut exec = Executive::new(&mut state, &env_info, self.engine.as_ref()); - if let Err(e) = exec.create(params, &mut substate, &mut None, &mut NoopTracer, &mut NoopVMTracer) { + if let Err(e) = exec.create( + params, + &mut substate, + &mut None, + &mut NoopTracer, + &mut NoopVMTracer, + ) + { warn!(target: "spec", "Genesis constructor execution at {} failed: {}.", address, e); } } @@ -410,22 +529,34 @@ impl Spec { } /// Get common blockchain parameters. - pub fn params(&self) -> &CommonParams { &self.engine.params() } + pub fn params(&self) -> &CommonParams { + &self.engine.params() + } /// Get the known knodes of the network in enode format. - pub fn nodes(&self) -> &[String] { &self.nodes } + pub fn nodes(&self) -> &[String] { + &self.nodes + } /// Get the configured Network ID. - pub fn network_id(&self) -> u64 { self.params().network_id } + pub fn network_id(&self) -> u64 { + self.params().network_id + } /// Get the chain ID used for signing. - pub fn chain_id(&self) -> u64 { self.params().chain_id } + pub fn chain_id(&self) -> u64 { + self.params().chain_id + } /// Get the configured subprotocol name. - pub fn subprotocol_name(&self) -> String { self.params().subprotocol_name.clone() } + pub fn subprotocol_name(&self) -> String { + self.params().subprotocol_name.clone() + } /// Get the configured network fork block. - pub fn fork_block(&self) -> Option<(BlockNumber, H256)> { self.params().fork_block } + pub fn fork_block(&self) -> Option<(BlockNumber, H256)> { + self.params().fork_block + } /// Get the header of the genesis block. pub fn genesis_header(&self) -> Header { @@ -480,7 +611,10 @@ impl Spec { /// Alter the value of the genesis state. pub fn set_genesis_state(&mut self, s: PodState) -> Result<(), Error> { self.genesis_state = s; - let _ = self.run_constructors(&Default::default(), BasicBackend(MemoryDB::new()))?; + let _ = self.run_constructors( + &Default::default(), + BasicBackend(MemoryDB::new()), + )?; Ok(()) } @@ -496,7 +630,7 @@ impl Spec { /// Ensure that the given state DB has the trie nodes in for the genesis state. pub fn ensure_db_good(&self, db: T, factories: &Factories) -> Result { if db.as_hashdb().contains(&self.state_root()) { - return Ok(db) + return Ok(db); } // TODO: could optimize so we don't re-run, but `ensure_db_good` is barely ever @@ -507,13 +641,19 @@ impl Spec { /// Loads spec from json file. Provide factories for executing contracts and ensuring /// storage goes to the right place. - pub fn load, R>(cache_dir: T, reader: R) -> Result where R: Read { + pub fn load<'a, T: Into>, R>(params: T, reader: R) -> Result + where + R: Read, + { fn fmt(f: F) -> String { format!("Spec json is invalid: {}", f) } - ethjson::spec::Spec::load(reader).map_err(fmt) - .and_then(|x| load_from(cache_dir, x).map_err(fmt)) + ethjson::spec::Spec::load(reader).map_err(fmt).and_then( + |x| { + load_from(params.into(), x).map_err(fmt) + }, + ) } /// initialize genesis epoch data, using in-memory database for @@ -543,7 +683,7 @@ impl Spec { difficulty: *genesis.difficulty(), gas_limit: *genesis.gas_limit(), last_hashes: Arc::new(Vec::new()), - gas_used: 0.into() + gas_used: 0.into(), }; let from = Address::default(); @@ -566,86 +706,139 @@ impl Spec { true, ); - res.map(|(out, proof)| (out, proof.into_iter().map(|x| x.into_vec()).collect())) - .ok_or_else(|| "Failed to prove call: insufficient state".into()) + res.map(|(out, proof)| { + (out, proof.into_iter().map(|x| x.into_vec()).collect()) + }).ok_or_else(|| "Failed to prove call: insufficient state".into()) }; self.engine.genesis_epoch_data(&genesis, &call) } - /// Create a new Spec which conforms to the Frontier-era Morden chain except that it's a NullEngine consensus. - pub fn new_test() -> Spec { load_bundled!("null_morden") } + /// Create a new Spec which conforms to the Frontier-era Morden chain except that it's a + /// NullEngine consensus. + pub fn new_test() -> Spec { + load_bundled!("null_morden") + } - /// Create a new Spec which conforms to the Frontier-era Morden chain except that it's a NullEngine consensus with applying reward on block close. - pub fn new_test_with_reward() -> Spec { load_bundled!("null_morden_with_reward") } + /// Create a new Spec which conforms to the Frontier-era Morden chain except that it's a + /// NullEngine consensus with applying reward on block close. + pub fn new_test_with_reward() -> Spec { + load_bundled!("null_morden_with_reward") + } - /// Create a new Spec which is a NullEngine consensus with a premine of address whose secret is keccak(''). - pub fn new_null() -> Spec { load_bundled!("null") } + /// Create a new Spec which is a NullEngine consensus with a premine of address whose + /// secret is keccak(''). + pub fn new_null() -> Spec { + load_bundled!("null") + } /// Create a new Spec which constructs a contract at address 5 with storage at 0 equal to 1. - pub fn new_test_constructor() -> Spec { load_bundled!("constructor") } + pub fn new_test_constructor() -> Spec { + load_bundled!("constructor") + } - /// Create a new Spec with InstantSeal consensus which does internal sealing (not requiring work). - pub fn new_instant() -> Spec { load_bundled!("instant_seal") } + /// Create a new Spec with InstantSeal consensus which does internal sealing (not requiring + /// work). + pub fn new_instant() -> Spec { + load_bundled!("instant_seal") + } - /// Create a new Spec with AuthorityRound consensus which does internal sealing (not requiring work). + /// Create a new Spec with AuthorityRound consensus which does internal sealing (not + /// requiring work). /// Accounts with secrets keccak("0") and keccak("1") are the validators. - pub fn new_test_round() -> Self { load_bundled!("authority_round") } + pub fn new_test_round() -> Self { + load_bundled!("authority_round") + } - /// Create a new Spec with Tendermint consensus which does internal sealing (not requiring work). + /// Create a new Spec with Tendermint consensus which does internal sealing (not requiring + /// work). /// Account keccak("0") and keccak("1") are a authorities. - pub fn new_test_tendermint() -> Self { load_bundled!("tendermint") } + pub fn new_test_tendermint() -> Self { + load_bundled!("tendermint") + } /// TestList.sol used in both specs: https://github.com/paritytech/contracts/pull/30/files /// Accounts with secrets keccak("0") and keccak("1") are initially the validators. - /// Create a new Spec with BasicAuthority which uses a contract at address 5 to determine the current validators using `getValidators`. - /// Second validator can be removed with "0xbfc708a000000000000000000000000082a978b3f5962a5b0957d9ee9eef472ee55b42f1" and added back in using "0x4d238c8e00000000000000000000000082a978b3f5962a5b0957d9ee9eef472ee55b42f1". - pub fn new_validator_safe_contract() -> Self { load_bundled!("validator_safe_contract") } + /// Create a new Spec with BasicAuthority which uses a contract at address 5 to determine + /// the current validators using `getValidators`. + /// Second validator can be removed with + /// "0xbfc708a000000000000000000000000082a978b3f5962a5b0957d9ee9eef472ee55b42f1" and added + /// back in using + /// "0x4d238c8e00000000000000000000000082a978b3f5962a5b0957d9ee9eef472ee55b42f1". + pub fn new_validator_safe_contract() -> Self { + load_bundled!("validator_safe_contract") + } /// The same as the `safeContract`, but allows reporting and uses AuthorityRound. /// Account is marked with `reportBenign` it can be checked as disliked with "0xd8f2e0bf". /// Validator can be removed with `reportMalicious`. - pub fn new_validator_contract() -> Self { load_bundled!("validator_contract") } + pub fn new_validator_contract() -> Self { + load_bundled!("validator_contract") + } - /// Create a new Spec with BasicAuthority which uses multiple validator sets changing with height. - /// Account with secrets keccak("0") is the validator for block 1 and with keccak("1") onwards. - pub fn new_validator_multi() -> Self { load_bundled!("validator_multi") } + /// Create a new Spec with BasicAuthority which uses multiple validator sets changing with + /// height. + /// Account with secrets keccak("0") is the validator for block 1 and with keccak("1") + /// onwards. + pub fn new_validator_multi() -> Self { + load_bundled!("validator_multi") + } /// Create a new spec for a PoW chain - pub fn new_pow_test_spec() -> Self { load_bundled!("ethereum/olympic") } + pub fn new_pow_test_spec() -> Self { + load_bundled!("ethereum/olympic") + } } #[cfg(test)] mod tests { + use super::*; + use state::State; use std::str::FromStr; + use tests::helpers::get_temp_state_db; use util::*; use views::*; - use tests::helpers::get_temp_state_db; - use state::State; - use super::*; // https://github.com/paritytech/parity/issues/1840 #[test] fn test_load_empty() { - assert!(Spec::load(::std::env::temp_dir(), &[] as &[u8]).is_err()); + assert!(Spec::load(&::std::env::temp_dir(), &[] as &[u8]).is_err()); } #[test] fn test_chain() { let test_spec = Spec::new_test(); - assert_eq!(test_spec.state_root(), H256::from_str("f3f4696bbf3b3b07775128eb7a3763279a394e382130f27c21e70233e04946a9").unwrap()); + assert_eq!( + test_spec.state_root(), + H256::from_str( + "f3f4696bbf3b3b07775128eb7a3763279a394e382130f27c21e70233e04946a9", + ).unwrap() + ); let genesis = test_spec.genesis_block(); - assert_eq!(BlockView::new(&genesis).header_view().hash(), H256::from_str("0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303").unwrap()); + assert_eq!( + BlockView::new(&genesis).header_view().hash(), + H256::from_str( + "0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303", + ).unwrap() + ); } #[test] fn genesis_constructor() { ::ethcore_logger::init_log(); let spec = Spec::new_test_constructor(); - let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap(); - let state = State::from_existing(db.boxed_clone(), spec.state_root(), spec.engine.account_start_nonce(0), Default::default()).unwrap(); - let expected = H256::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap(); + let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()) + .unwrap(); + let state = State::from_existing( + db.boxed_clone(), + spec.state_root(), + spec.engine.account_start_nonce(0), + Default::default(), + ).unwrap(); + let expected = H256::from_str( + "0000000000000000000000000000000000000000000000000000000000000001", + ).unwrap(); let address = Address::from_str("0000000000000000000000000000000000000005").unwrap(); assert_eq!(state.storage_at(&address, &H256::zero()).unwrap(), expected); diff --git a/ethcore/src/tx_filter.rs b/ethcore/src/tx_filter.rs index e9863a154..0c46590d6 100644 --- a/ethcore/src/tx_filter.rs +++ b/ethcore/src/tx_filter.rs @@ -196,7 +196,7 @@ mod test { } "#; - let spec = Spec::load(::std::env::temp_dir(), spec_data.as_bytes()).unwrap(); + let spec = Spec::load(&::std::env::temp_dir(), spec_data.as_bytes()).unwrap(); let client_db = Arc::new(::util::kvdb::in_memory(::db::NUM_COLUMNS.unwrap_or(0))); let client = Client::new( diff --git a/evmbin/src/main.rs b/evmbin/src/main.rs index 58b4e983b..d3668037f 100644 --- a/evmbin/src/main.rs +++ b/evmbin/src/main.rs @@ -230,7 +230,7 @@ impl Args { Ok(match self.flag_chain { Some(ref filename) => { let file = fs::File::open(filename).map_err(|e| format!("{}", e))?; - spec::Spec::load(::std::env::temp_dir(), file)? + spec::Spec::load(&::std::env::temp_dir(), file)? }, None => { ethcore::ethereum::new_foundation(&::std::env::temp_dir()) diff --git a/parity/params.rs b/parity/params.rs index fda57f99a..2c0e534ba 100644 --- a/parity/params.rs +++ b/parity/params.rs @@ -14,12 +14,12 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use std::{str, fs, fmt, path}; +use std::{str, fs, fmt}; use std::time::Duration; use bigint::prelude::U256; use util::{Address, version_data}; use util::journaldb::Algorithm; -use ethcore::spec::Spec; +use ethcore::spec::{Spec, SpecParams}; use ethcore::ethereum; use ethcore::client::Mode; use ethcore::miner::{GasPricer, GasPriceCalibratorOptions}; @@ -81,20 +81,20 @@ impl fmt::Display for SpecType { } impl SpecType { - pub fn spec>(&self, cache_dir: T) -> Result { - let cache_dir = cache_dir.as_ref(); + pub fn spec<'a, T: Into>>(&self, params: T) -> Result { + let params = params.into(); match *self { - SpecType::Foundation => Ok(ethereum::new_foundation(cache_dir)), - SpecType::Morden => Ok(ethereum::new_morden(cache_dir)), - SpecType::Ropsten => Ok(ethereum::new_ropsten(cache_dir)), - SpecType::Olympic => Ok(ethereum::new_olympic(cache_dir)), - SpecType::Classic => Ok(ethereum::new_classic(cache_dir)), - SpecType::Expanse => Ok(ethereum::new_expanse(cache_dir)), - SpecType::Kovan => Ok(ethereum::new_kovan(cache_dir)), + SpecType::Foundation => Ok(ethereum::new_foundation(params)), + SpecType::Morden => Ok(ethereum::new_morden(params)), + SpecType::Ropsten => Ok(ethereum::new_ropsten(params)), + SpecType::Olympic => Ok(ethereum::new_olympic(params)), + SpecType::Classic => Ok(ethereum::new_classic(params)), + SpecType::Expanse => Ok(ethereum::new_expanse(params)), + SpecType::Kovan => Ok(ethereum::new_kovan(params)), SpecType::Dev => Ok(Spec::new_instant()), SpecType::Custom(ref filename) => { let file = fs::File::open(filename).map_err(|e| format!("Could not load specification file at {}: {}", filename, e))?; - Spec::load(cache_dir, file) + Spec::load(params, file) } } } diff --git a/parity/run.rs b/parity/run.rs index 1ec29e942..4e1e33d5b 100644 --- a/parity/run.rs +++ b/parity/run.rs @@ -29,6 +29,7 @@ use ethcore::service::ClientService; use ethcore::snapshot; use ethcore::verification::queue::VerifierSettings; use ethsync::{self, SyncConfig}; +use ethcore::spec::{SpecParams, OptimizeFor}; use fdlimit::raise_fd_limit; use hash_fetch::fetch::{Fetch, Client as FetchClient}; use informant::{Informant, LightNodeInformantData, FullNodeInformantData}; @@ -175,7 +176,7 @@ fn execute_light(cmd: RunCmd, can_restart: bool, logger: Arc) -> use parking_lot::{Mutex, RwLock}; // load spec - let spec = cmd.spec.spec(&cmd.dirs.cache)?; + let spec = cmd.spec.spec(SpecParams::new(cmd.dirs.cache.as_ref(), OptimizeFor::Memory))?; // load genesis hash let genesis_hash = spec.genesis_header().hash(); diff --git a/rpc/src/v1/impls/eth.rs b/rpc/src/v1/impls/eth.rs index 29d18188c..5cf8590ce 100644 --- a/rpc/src/v1/impls/eth.rs +++ b/rpc/src/v1/impls/eth.rs @@ -555,7 +555,7 @@ impl Eth for EthClient where self.miner.map_sealing_work(&*self.client, |b| { let pow_hash = b.hash(); let target = Ethash::difficulty_to_boundary(b.block().header().difficulty()); - let seed_hash = self.seed_compute.lock().get_seedhash(b.block().header().number()); + let seed_hash = self.seed_compute.lock().hash_block_number(b.block().header().number()); if no_new_work_timeout > 0 && b.block().header().timestamp() + no_new_work_timeout < get_time().sec as u64 { Err(errors::no_new_work()) diff --git a/rustfmt.toml b/rustfmt.toml index b1dd4575b..16016b1b2 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,8 +1,8 @@ verbose=false -max_width=1000 -comment_width=1000 +max_width=100 +comment_width=100 tab_spaces=4 -fn_call_width=1000 +fn_call_width=100 struct_lit_width=32 fn_call_style="Visual" single_line_if_else_max_width=100 @@ -13,3 +13,4 @@ reorder_imports=true format_strings=false hard_tabs=true wrap_match_arms=false +error_on_line_overflow=false \ No newline at end of file