diff --git a/Cargo.lock b/Cargo.lock index d5243301fd25a..84210a9849164 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -150,6 +150,16 @@ name = "cfg-if" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "chrono" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "clap" version = "2.31.2" @@ -367,13 +377,11 @@ dependencies = [ [[package]] name = "eth-secp256k1" version = "0.5.7" -source = "git+https://github.com/paritytech/rust-secp256k1#c1fc9daedee67e1b4028ad1b3669275ed49c22cf" +source = "git+https://github.com/paritytech/rust-secp256k1#db81cfea59014b4d176f10f86ed52e1a130b6822" dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -416,7 +424,7 @@ dependencies = [ [[package]] name = "ethcore-bytes" version = "0.1.0" -source = "git+https://github.com/paritytech/parity.git#1356d6d8d55d98fc328bbf1e0c6ae4e3f64be1ee" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" [[package]] name = "ethcore-bytes" @@ -426,26 +434,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ethcore-crypto" version = "0.1.0" -source = "git+https://github.com/paritytech/parity.git#1356d6d8d55d98fc328bbf1e0c6ae4e3f64be1ee" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" dependencies = [ - "eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)", "ethereum-types 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ethkey 0.3.0 (git+https://github.com/paritytech/parity.git)", + "quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", - "subtle 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ethcore-io" -version = "1.11.0" -source = "git+https://github.com/paritytech/parity.git#1356d6d8d55d98fc328bbf1e0c6ae4e3f64be1ee" +version = "1.12.0" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" dependencies = [ "crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", + "timer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -466,8 +477,8 @@ dependencies = [ [[package]] name = "ethcore-logger" -version = "1.11.0" -source = "git+https://github.com/paritytech/parity.git#1356d6d8d55d98fc328bbf1e0c6ae4e3f64be1ee" +version = "1.12.0" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" dependencies = [ "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -482,12 +493,12 @@ dependencies = [ [[package]] name = "ethcore-network" -version = "1.11.0" -source = "git+https://github.com/paritytech/parity.git#1356d6d8d55d98fc328bbf1e0c6ae4e3f64be1ee" +version = "1.12.0" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-crypto 0.1.0 (git+https://github.com/paritytech/parity.git)", - "ethcore-io 1.11.0 (git+https://github.com/paritytech/parity.git)", + "ethcore-io 1.12.0 (git+https://github.com/paritytech/parity.git)", "ethereum-types 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0 (git+https://github.com/paritytech/parity.git)", "ipnetwork 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -497,17 +508,17 @@ dependencies = [ [[package]] name = "ethcore-network-devp2p" -version = "1.11.0" -source = "git+https://github.com/paritytech/parity.git#1356d6d8d55d98fc328bbf1e0c6ae4e3f64be1ee" +version = "1.12.0" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" dependencies = [ "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bytes 0.1.0 (git+https://github.com/paritytech/parity.git)", "ethcore-crypto 0.1.0 (git+https://github.com/paritytech/parity.git)", - "ethcore-io 1.11.0 (git+https://github.com/paritytech/parity.git)", - "ethcore-logger 1.11.0 (git+https://github.com/paritytech/parity.git)", - "ethcore-network 1.11.0 (git+https://github.com/paritytech/parity.git)", + "ethcore-io 1.12.0 (git+https://github.com/paritytech/parity.git)", + "ethcore-logger 1.12.0 (git+https://github.com/paritytech/parity.git)", + "ethcore-network 1.12.0 (git+https://github.com/paritytech/parity.git)", "ethereum-types 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0 (git+https://github.com/paritytech/parity.git)", "igd 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -569,18 +580,19 @@ dependencies = [ [[package]] name = "ethkey" version = "0.3.0" -source = "git+https://github.com/paritytech/parity.git#1356d6d8d55d98fc328bbf1e0c6ae4e3f64be1ee" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" dependencies = [ "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "edit-distance 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)", + "ethcore-crypto 0.1.0 (git+https://github.com/paritytech/parity.git)", "ethereum-types 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "mem 0.1.0 (git+https://github.com/paritytech/parity.git)", "parity-wordlist 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (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)", "tiny-keccak 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -670,9 +682,6 @@ dependencies = [ name = "gcc" 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)", -] [[package]] name = "getopts" @@ -908,7 +917,7 @@ dependencies = [ [[package]] name = "keccak-hash" version = "0.1.0" -source = "git+https://github.com/paritytech/parity.git#1356d6d8d55d98fc328bbf1e0c6ae4e3f64be1ee" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" dependencies = [ "cc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -937,17 +946,26 @@ dependencies = [ [[package]] name = "kvdb" version = "0.1.0" -source = "git+https://github.com/paritytech/parity.git#1356d6d8d55d98fc328bbf1e0c6ae4e3f64be1ee" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" dependencies = [ "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bytes 0.1.0 (git+https://github.com/paritytech/parity.git)", ] +[[package]] +name = "kvdb-memorydb" +version = "0.1.0" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" +dependencies = [ + "kvdb 0.1.0 (git+https://github.com/paritytech/parity.git)", + "parking_lot 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "kvdb-rocksdb" version = "0.1.0" -source = "git+https://github.com/paritytech/parity.git#1356d6d8d55d98fc328bbf1e0c6ae4e3f64be1ee" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" dependencies = [ "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1019,7 +1037,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "mem" version = "0.1.0" -source = "git+https://github.com/paritytech/parity.git#1356d6d8d55d98fc328bbf1e0c6ae4e3f64be1ee" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" [[package]] name = "memchr" @@ -1102,6 +1120,14 @@ name = "nodrop" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "num-integer" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "num-traits" version = "0.1.42" @@ -1194,7 +1220,7 @@ dependencies = [ [[package]] name = "path" version = "0.1.0" -source = "git+https://github.com/paritytech/parity.git#1356d6d8d55d98fc328bbf1e0c6ae4e3f64be1ee" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" [[package]] name = "patricia-trie" @@ -1510,6 +1536,11 @@ dependencies = [ name = "pwasm-libc" version = "0.1.0" +[[package]] +name = "quick-error" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "quote" version = "0.3.15" @@ -1626,7 +1657,7 @@ dependencies = [ [[package]] name = "rlp" version = "0.2.1" -source = "git+https://github.com/paritytech/parity.git#1356d6d8d55d98fc328bbf1e0c6ae4e3f64be1ee" +source = "git+https://github.com/paritytech/parity.git#1fa95ac236ab280afc9eccb4d6ea51b494f11422" dependencies = [ "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1833,7 +1864,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "snappy" version = "0.1.0" -source = "git+https://github.com/paritytech/rust-snappy#858eac97192ea25d18d3f3626a8cc13ca0b175bb" +source = "git+https://github.com/paritytech/rust-snappy#40ac9a0d9fd613e7f38df800a11a589b7296da73" dependencies = [ "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "snappy-sys 0.1.0 (git+https://github.com/paritytech/rust-snappy)", @@ -1842,9 +1873,9 @@ dependencies = [ [[package]] name = "snappy-sys" version = "0.1.0" -source = "git+https://github.com/paritytech/rust-snappy#858eac97192ea25d18d3f3626a8cc13ca0b175bb" +source = "git+https://github.com/paritytech/rust-snappy#40ac9a0d9fd613e7f38df800a11a589b7296da73" dependencies = [ - "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1903,6 +1934,7 @@ name = "substrate-client-db" version = "0.1.0" dependencies = [ "kvdb 0.1.0 (git+https://github.com/paritytech/parity.git)", + "kvdb-memorydb 0.1.0 (git+https://github.com/paritytech/parity.git)", "kvdb-rocksdb 0.1.0 (git+https://github.com/paritytech/parity.git)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1971,9 +2003,9 @@ dependencies = [ "ed25519 0.1.0", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-io 1.11.0 (git+https://github.com/paritytech/parity.git)", - "ethcore-network 1.11.0 (git+https://github.com/paritytech/parity.git)", - "ethcore-network-devp2p 1.11.0 (git+https://github.com/paritytech/parity.git)", + "ethcore-io 1.12.0 (git+https://github.com/paritytech/parity.git)", + "ethcore-network 1.12.0 (git+https://github.com/paritytech/parity.git)", + "ethcore-network-devp2p 1.12.0 (git+https://github.com/paritytech/parity.git)", "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2374,6 +2406,14 @@ dependencies = [ "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "timer" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "chrono 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tiny-keccak" version = "1.4.0" @@ -2715,6 +2755,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1b7db437d718977f6dc9b2e3fd6fc343c02ac6b899b73fdd2179163447bd9ce9" "checksum cc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "deaf9ec656256bb25b404c51ef50097207b9cbb29c933d31f92cae5a8a0ffee0" "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" +"checksum chrono 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1cce36c92cb605414e9b824f866f5babe0a0368e39ea07393b9b63cf3844c0e6" "checksum clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536" "checksum cmake 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "5cf678ceebedde428000cb3a34465cf3606d1a48da17014948a916deac39da7c" "checksum coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c06169f5beb7e31c7c67ebf5540b8b472d23e3eade3b2ec7d1f5b504a85f91bd" @@ -2737,11 +2778,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum ethcore-bytes 0.1.0 (git+https://github.com/paritytech/parity.git)" = "" "checksum ethcore-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3977c772cd6c5c22e1c7cfa208e4c3b746bd6c3a6c8eeec0999a6b2103015ad5" "checksum ethcore-crypto 0.1.0 (git+https://github.com/paritytech/parity.git)" = "" -"checksum ethcore-io 1.11.0 (git+https://github.com/paritytech/parity.git)" = "" -"checksum ethcore-logger 1.11.0 (git+https://github.com/paritytech/parity.git)" = "" +"checksum ethcore-io 1.12.0 (git+https://github.com/paritytech/parity.git)" = "" +"checksum ethcore-logger 1.12.0 (git+https://github.com/paritytech/parity.git)" = "" "checksum ethcore-logger 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fd5813e49546030be7d134e775088d56b8ff4ab60617b90e93d4f0513da4c5b" -"checksum ethcore-network 1.11.0 (git+https://github.com/paritytech/parity.git)" = "" -"checksum ethcore-network-devp2p 1.11.0 (git+https://github.com/paritytech/parity.git)" = "" +"checksum ethcore-network 1.12.0 (git+https://github.com/paritytech/parity.git)" = "" +"checksum ethcore-network-devp2p 1.12.0 (git+https://github.com/paritytech/parity.git)" = "" "checksum ethereum-types 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5cff74129deda8a155b729cad1a22dc3cdd08115abd1165079c519d0cab6917a" "checksum ethereum-types 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a3ae691a36ce5d25b433e63128ce5579f4a18457b6a9c849832b2c9e0fec92a" "checksum ethereum-types-serialize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ac59a21a9ce98e188f3dace9eb67a6c4a3c67ec7fbc7218cb827852679dc002" @@ -2785,6 +2826,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum keccak-hash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f300c1f149cd9ca5214eed24f6e713a597517420fb8b15499824aa916259ec1" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum kvdb 0.1.0 (git+https://github.com/paritytech/parity.git)" = "" +"checksum kvdb-memorydb 0.1.0 (git+https://github.com/paritytech/parity.git)" = "" "checksum kvdb-rocksdb 0.1.0 (git+https://github.com/paritytech/parity.git)" = "" "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" @@ -2804,6 +2846,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "3a80f842784ef6c9a958b68b7516bc7e35883c614004dd94959a4dca1b716c09" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" +"checksum num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f8d26da319fb45674985c78f1d1caf99aa4941f785d384a2ae36d0740bc3e2fe" "checksum num-traits 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "9936036cc70fe4a8b2d338ab665900323290efb03983c86cbe235ae800ad8017" "checksum num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dee092fcdf725aee04dd7da1d21debff559237d49ef1cb3e69bcb8ece44c7364" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" @@ -2823,6 +2866,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum proc-macro-hack 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ba8d4f9257b85eb6cdf13f055cea3190520aab1409ca2ab43493ea4820c25f0" "checksum proc-macro-hack-impl 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d5cb6f960ad471404618e9817c0e5d10b1ae74cfdf01fab89ea0641fe7fb2892" "checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07" +"checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" @@ -2877,6 +2921,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" "checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" "checksum time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "a15375f1df02096fb3317256ce2cee6a1f42fc84ea5ad5fc8c421cfe40c73098" +"checksum timer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "31d42176308937165701f50638db1c31586f183f1aab416268216577aec7306b" "checksum tiny-keccak 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e9241752647ca572f12c9b520a5d360d9099360c527770647e694001646a1d0" "checksum tokio-core 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "52b4e32d8edbf29501aabb3570f027c6ceb00ccef6538f4bddba0200503e74e8" "checksum tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "514aae203178929dbf03318ad7c683126672d4d96eccb77b29603d33c9e25743" diff --git a/polkadot/keystore/Cargo.toml b/polkadot/keystore/Cargo.toml index 92026c9c8df88..d5d5ec8afe4fd 100644 --- a/polkadot/keystore/Cargo.toml +++ b/polkadot/keystore/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethcore-crypto = { git = "https://github.com/paritytech/parity", default_features = false } +ethcore-crypto = { git = "https://github.com/paritytech/parity.git", default_features = false } ed25519 = { path = "../../substrate/ed25519" } error-chain = "0.11" hex = "0.3" diff --git a/polkadot/keystore/src/lib.rs b/polkadot/keystore/src/lib.rs index 62268edf6ec2e..0518875e74751 100644 --- a/polkadot/keystore/src/lib.rs +++ b/polkadot/keystore/src/lib.rs @@ -91,7 +91,8 @@ impl EncryptedKey { let mut ciphertext = vec![0; PKCS_LEN]; // aes-128-ctr with initial vector of iv - crypto::aes::encrypt(&derived_left_bits, &iv, plain, &mut *ciphertext); + crypto::aes::encrypt_128_ctr(&derived_left_bits, &iv, plain, &mut *ciphertext) + .expect("input lengths of key and iv are both 16; qed"); // KECCAK(DK[16..31] ++ ), where DK[16..31] - derived_right_bits let mac = crypto::derive_mac(&derived_right_bits, &*ciphertext).keccak256(); @@ -116,7 +117,8 @@ impl EncryptedKey { } let mut plain = [0; PKCS_LEN]; - crypto::aes::decrypt(&derived_left_bits, &self.iv, &self.ciphertext, &mut plain[..]); + crypto::aes::decrypt_128_ctr(&derived_left_bits, &self.iv, &self.ciphertext, &mut plain[..]) + .expect("input lengths of key and iv are both 16; qed"); Ok(plain) } } diff --git a/substrate/client/db/Cargo.toml b/substrate/client/db/Cargo.toml index e435271633544..2fae161dd51bd 100644 --- a/substrate/client/db/Cargo.toml +++ b/substrate/client/db/Cargo.toml @@ -15,3 +15,4 @@ substrate-runtime-support = { path = "../../../substrate/runtime-support" } substrate-codec = { path = "../../../substrate/codec" } [dev-dependencies] +kvdb-memorydb = { git = "https://github.com/paritytech/parity.git" } diff --git a/substrate/client/db/src/lib.rs b/substrate/client/db/src/lib.rs index d5f295205eeaa..43136fc894bcb 100644 --- a/substrate/client/db/src/lib.rs +++ b/substrate/client/db/src/lib.rs @@ -24,7 +24,12 @@ extern crate substrate_state_machine as state_machine; extern crate substrate_primitives as primitives; extern crate substrate_runtime_support as runtime_support; extern crate substrate_codec as codec; -#[macro_use] extern crate log; + +#[macro_use] +extern crate log; + +#[cfg(test)] +extern crate kvdb_memorydb; use std::sync::Arc; use std::path::PathBuf; @@ -33,7 +38,7 @@ use parking_lot::RwLock; use runtime_support::Hashable; use primitives::blake2_256; use kvdb_rocksdb::{Database, DatabaseConfig}; -use kvdb::DBTransaction; +use kvdb::{KeyValueDB, DBTransaction}; use primitives::block::{self, Id as BlockId, HeaderHash}; use state_machine::backend::Backend as StateBackend; use state_machine::CodeExecutor; @@ -70,7 +75,7 @@ mod columns { pub const HEADER: Option = Some(3); pub const BODY: Option = Some(4); pub const JUSTIFICATION: Option = Some(5); - pub const NUM_COLUMNS: Option = Some(6); + pub const NUM_COLUMNS: u32 = 6; } mod meta { @@ -97,12 +102,6 @@ struct Meta { genesis_hash: HeaderHash, } -/// Block database -pub struct BlockchainDb { - db: Arc, - meta: RwLock, -} - type BlockKey = [u8; 4]; // Little endian @@ -125,6 +124,12 @@ fn db_err(err: kvdb::Error) -> client::error::Error { } } +/// Block database +pub struct BlockchainDb { + db: Arc, + meta: RwLock, +} + impl BlockchainDb { fn id(&self, id: BlockId) -> Result, client::error::Error> { match id { @@ -145,7 +150,7 @@ impl BlockchainDb { } } - fn new(db: Arc) -> Result { + fn new(db: Arc) -> Result { let (best_hash, best_number) = if let Some(Some(header)) = db.get(columns::META, meta::BEST_BLOCK).and_then(|id| match id { Some(id) => db.get(columns::HEADER, &id).map(|h| h.map(|b| block::Header::decode(&mut &b[..]))), @@ -243,9 +248,9 @@ impl client::blockchain::Backend for BlockchainDb { } fn hash(&self, number: block::Number) -> Result, client::error::Error> { - Ok(self.db.get(columns::BLOCK_INDEX, &number_to_db_key(number)) - .map_err(db_err)? - .map(|hash| block::HeaderHash::from_slice(&hash))) + self.read_db(BlockId::Number(number), columns::HEADER).map(|x| + x.map(|raw| blake2_256(&raw[..])).map(Into::into) + ) } } @@ -304,30 +309,43 @@ impl state_machine::Backend for DbState { /// In-memory backend. Keeps all states and blocks in memory. Useful for testing. pub struct Backend { - db: Arc, + db: Arc, blockchain: BlockchainDb, old_states: RwLock>, } impl Backend { - /// Create a new instance of in-mem backend. + /// Create a new instance of database backend. pub fn new(config: &DatabaseSettings) -> Result { - let mut db_config = DatabaseConfig::with_columns(columns::NUM_COLUMNS); + let mut db_config = DatabaseConfig::with_columns(Some(columns::NUM_COLUMNS)); db_config.memory_budget = config.cache_size; db_config.wal = true; let path = config.path.to_str().ok_or_else(|| client::error::ErrorKind::Backend("Invalid database path".into()))?; let db = Arc::new(Database::open(&db_config, &path).map_err(db_err)?); + + Backend::from_kvdb(db as Arc<_>) + } + + #[cfg(test)] + fn new_test() -> Backend { + let db = Arc::new(::kvdb_memorydb::create(columns::NUM_COLUMNS)); + + Backend::from_kvdb(db as Arc<_>).expect("failed to create test-db") + } + + fn from_kvdb(db: Arc) -> Result { let blockchain = BlockchainDb::new(db.clone())?; //load latest state let mut state = state_machine::backend::InMemory::new(); let mut old_states = HashMap::new(); - if let Some(iter) = db.iter(columns::STATE).map(|iter| iter.map(|(k, v)| (k.to_vec(), Some(v.to_vec())))) { + + { + let iter = db.iter(columns::STATE).map(|(k, v)| (k.to_vec(), Some(v.to_vec()))); state.commit(iter); old_states.insert(number_to_db_key(blockchain.meta.read().best_number), state); } - debug!("DB Opened at {}", path); Ok(Backend { db, blockchain, @@ -397,3 +415,40 @@ impl client::backend::Backend for Backend { } } +#[cfg(test)] +mod tests { + use super::*; + use client::backend::Backend as BTrait; + use client::backend::BlockImportOperation as Op; + use client::blockchain::Backend as BCTrait; + + #[test] + fn block_hash_inserted_correctly() { + let db = Backend::new_test(); + for i in 1..10 { + assert!(db.blockchain().hash(i).unwrap().is_none()); + + { + let mut op = db.begin_operation(BlockId::Number(i - 1)).unwrap(); + let header = block::Header { + number: i, + parent_hash: Default::default(), + state_root: Default::default(), + digest: Default::default(), + extrinsics_root: Default::default(), + }; + + op.set_block_data( + header, + Some(vec![]), + None, + true, + ).unwrap(); + op.set_storage(vec![].into_iter()).unwrap(); + db.commit_operation(op).unwrap(); + } + + assert!(db.blockchain().hash(i).unwrap().is_some()) + } + } +} diff --git a/substrate/network/src/service.rs b/substrate/network/src/service.rs index 952b3b8d9777c..29c70b70a4018 100644 --- a/substrate/network/src/service.rs +++ b/substrate/network/src/service.rs @@ -268,7 +268,7 @@ impl ConsensusService for Service { impl NetworkProtocolHandler for ProtocolHandler { fn initialize(&self, io: &NetworkContext, _host_info: &HostInfo) { - io.register_timer(0, 1000).expect("Error registering sync timer"); + io.register_timer(0, ::std::time::Duration::from_millis(1000)).expect("Error registering sync timer"); } fn read(&self, io: &NetworkContext, peer: &PeerId, _packet_id: u8, data: &[u8]) { diff --git a/substrate/network/src/sync.rs b/substrate/network/src/sync.rs index 1599e162860de..e743cc510309d 100644 --- a/substrate/network/src/sync.rs +++ b/substrate/network/src/sync.rs @@ -178,6 +178,7 @@ impl ChainSync { PeerSyncState::AncestorSearch(n) => { match response.blocks.get(0) { Some(ref block) => { + trace!(target: "sync", "Got ancestry block #{} ({}) from peer {}", n, block.hash, peer_id); match protocol.chain().block_hash(n) { Ok(Some(block_hash)) if block_hash == block.hash => { peer.common_hash = block.hash; @@ -423,6 +424,7 @@ impl ChainSync { } fn request_ancestry(io: &mut SyncIo, protocol: &Protocol, peer_id: PeerId, block: BlockNumber) { + trace!(target: "sync", "Requesting ancestry block #{} from {}", block, peer_id); let request = message::BlockRequest { id: 0, fields: vec![message::BlockAttribute::Header, message::BlockAttribute::Justification],