diff --git a/Cargo.lock b/Cargo.lock index e327642216f..8d60c228956 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,12 +4,12 @@ name = "account-db" version = "0.1.0" dependencies = [ - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -19,25 +19,25 @@ dependencies = [ "account-db 0.1.0", "common-types 0.1.0", "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "memory-db 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memory-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie-ethereum 0.1.0", "pod 0.1.0", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_compress 0.1.0", "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "trace 0.1.0", - "trie-db 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "trie-vm-factories 0.1.0", ] @@ -82,6 +82,14 @@ dependencies = [ "stream-cipher 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ahash" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "aho-corasick" version = "0.6.8" @@ -172,12 +180,16 @@ dependencies = [ "block-reward 0.1.0", "client-traits 0.1.0", "common-types 0.1.0", + "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "engine 0.1.0", "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 9.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-contract 9.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi-derive 9.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", "ethcore-accounts 0.1.0", "ethcore-io 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -186,9 +198,11 @@ dependencies = [ "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", "macros 0.1.0", + "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", "spec 0.1.0", "state-db 0.1.0", @@ -254,14 +268,14 @@ dependencies = [ "engine 0.1.0", "ethcore 1.12.0", "ethcore-accounts 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "spec 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "validator-set 0.1.0", @@ -377,7 +391,7 @@ dependencies = [ "ethabi-contract 9.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 9.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", "spec 0.1.0", @@ -389,7 +403,7 @@ name = "blooms-db" version = "0.1.0" dependencies = [ "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethbloom 0.8.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethbloom 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -543,7 +557,7 @@ dependencies = [ name = "cli-signer" version = "1.4.0" dependencies = [ - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.12.0", "parity-rpc-client 1.4.0", @@ -560,8 +574,8 @@ dependencies = [ "ethcore-call-contract 0.1.0", "ethcore-db 0.1.0", "ethcore-miner 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "registrar 0.0.1", "stats 0.1.0", @@ -577,7 +591,7 @@ dependencies = [ "common-types 0.1.0", "engine 0.1.0", "ethcore 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -588,7 +602,7 @@ dependencies = [ "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "spec 0.1.0", "state-db 0.1.0", "time-utils 0.1.0", @@ -628,23 +642,41 @@ name = "common-types" version = "0.1.0" dependencies = [ "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethbloom 0.8.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethbloom 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-io 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-snappy 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie-ethereum 0.1.0", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "unexpected 0.1.0", "vm 0.1.0", ] +[[package]] +name = "const-random" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "const-random-macro" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "criterion" version = "0.3.0" @@ -847,7 +879,7 @@ name = "dir" version = "0.1.2" dependencies = [ "app_dirs 1.2.1 (git+https://github.com/paritytech/app-dirs-rs)", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", ] @@ -883,7 +915,7 @@ name = "eip-712" version = "0.1.1" dependencies = [ "ethabi 9.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -921,7 +953,7 @@ dependencies = [ "ethcore-accounts 0.1.0", "ethcore-blockchain 0.1.0", "ethcore-builtin 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.4.0", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", @@ -976,7 +1008,7 @@ version = "9.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1008,7 +1040,7 @@ dependencies = [ "common-types 0.1.0", "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1029,13 +1061,13 @@ dependencies = [ "engine 0.1.0", "ethash 1.12.0", "ethcore 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", "macros 0.1.0", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "spec 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "unexpected 0.1.0", @@ -1044,13 +1076,13 @@ dependencies = [ [[package]] name = "ethbloom" version = "0.8.1" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.5.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "impl-rlp 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "impl-serde 0.2.3 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "tiny-keccak 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-rlp 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1076,7 +1108,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-miner 1.12.0", "ethcore-stratum 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "evm 0.1.0", "executive-state 0.1.0", @@ -1086,9 +1118,9 @@ dependencies = [ "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb-memorydb 0.1.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb-rocksdb 0.2.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-memorydb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-rocksdb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", @@ -1104,7 +1136,7 @@ dependencies = [ "rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "registrar 0.0.1", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1117,7 +1149,7 @@ dependencies = [ "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "trace 0.1.0", "trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-db 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "trie-standardmap 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "trie-vm-factories 0.1.0", "triehash-ethereum 0.2.0", @@ -1131,7 +1163,7 @@ dependencies = [ name = "ethcore-accounts" version = "0.1.0" dependencies = [ - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.4.0", "ethstore 0.2.1", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1152,19 +1184,19 @@ dependencies = [ "common-types 0.1.0", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-db 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb-memorydb 0.1.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-memorydb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_compress 0.1.0", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1187,7 +1219,7 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "common-types 0.1.0", "eip-152 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1203,7 +1235,7 @@ name = "ethcore-call-contract" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1212,11 +1244,11 @@ name = "ethcore-db" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_derive 0.1.0", ] @@ -1252,7 +1284,7 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-miner 1.12.0", "ethcore-network 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "executive-state 0.1.0", "failsafe 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "fastmap 0.1.0", @@ -1261,18 +1293,18 @@ dependencies = [ "journaldb 0.2.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb-memorydb 0.1.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-memorydb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", "memory-cache 0.1.0", - "memory-db 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memory-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie-ethereum 0.1.0", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_derive 0.1.0", "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1280,7 +1312,7 @@ dependencies = [ "spec 0.1.0", "stats 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-db 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "triehash-ethereum 0.2.0", "verification 0.1.0", "vm 0.1.0", @@ -1313,7 +1345,7 @@ dependencies = [ "ethabi-derive 9.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.12.0", "ethcore-call-contract 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "fetch 0.1.0", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1322,11 +1354,11 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-runtime 0.1.0", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "price-info 1.12.0", "registrar 0.0.1", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (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.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1343,13 +1375,13 @@ dependencies = [ "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-io 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-snappy 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1365,7 +1397,7 @@ dependencies = [ "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-io 1.12.0", "ethcore-network 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "igd 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1373,13 +1405,14 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "natpmp 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-snappy 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (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.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1405,7 +1438,7 @@ dependencies = [ "ethcore-db 0.1.0", "ethcore-io 1.12.0", "ethcore-miner 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "fetch 0.1.0", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1413,16 +1446,16 @@ dependencies = [ "journaldb 0.2.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie-ethereum 0.1.0", "registrar 0.0.1", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1434,7 +1467,7 @@ dependencies = [ "tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "trace 0.1.0", "transaction-pool 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-db 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", ] @@ -1454,14 +1487,14 @@ dependencies = [ "ethcore-accounts 0.1.0", "ethcore-call-contract 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.4.0", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-server-utils 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb-rocksdb 0.2.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-rocksdb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1495,9 +1528,9 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb-rocksdb 0.2.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-rocksdb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "snapshot 0.1.0", "spec 0.1.0", @@ -1510,7 +1543,7 @@ name = "ethcore-stratum" version = "1.12.0" dependencies = [ "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-tcp-server 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1535,23 +1568,23 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", "ethcore-private-tx 1.0.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "fastmap 0.1.0", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "kvdb-memorydb 0.1.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb-memorydb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", "macros 0.1.0", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-runtime 0.1.0", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "snapshot 0.1.0", "spec 0.1.0", @@ -1562,21 +1595,21 @@ dependencies = [ [[package]] name = "ethereum-types" version = "0.8.0" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ethbloom 0.8.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "fixed-hash 0.5.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "impl-rlp 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "impl-serde 0.2.3 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "primitive-types 0.6.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "uint 0.8.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethbloom 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-rlp 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "primitive-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ethjson" version = "0.1.0" dependencies = [ - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "macros 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1616,7 +1649,7 @@ name = "ethstore" version = "0.2.1" dependencies = [ "dir 0.1.2", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.4.0", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1661,14 +1694,14 @@ version = "0.1.0" dependencies = [ "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "memory-cache 0.1.0", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", @@ -1684,7 +1717,7 @@ dependencies = [ "docopt 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "evm 0.1.0", "panic_hook 0.1.0", @@ -1708,12 +1741,12 @@ dependencies = [ "common-types 0.1.0", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "evm 0.1.0", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1723,7 +1756,7 @@ dependencies = [ "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "spec 0.1.0", "trace 0.1.0", - "trie-db 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "trie-vm-factories 0.1.0", "vm 0.1.0", ] @@ -1776,7 +1809,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "fastmap" version = "0.1.0" dependencies = [ - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1804,8 +1837,8 @@ dependencies = [ [[package]] name = "fixed-hash" -version = "0.5.1" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1964,14 +1997,10 @@ name = "hashbrown" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "hashmap_core" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "heapsize" version = "0.4.2" @@ -2132,7 +2161,7 @@ dependencies = [ [[package]] name = "impl-codec" version = "0.4.2" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2140,15 +2169,15 @@ dependencies = [ [[package]] name = "impl-rlp" version = "0.2.1" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "impl-serde" version = "0.2.3" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2169,11 +2198,11 @@ dependencies = [ "common-types 0.1.0", "engine 0.1.0", "ethcore 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "spec 0.1.0", "trace 0.1.0", ] @@ -2283,19 +2312,19 @@ name = "journaldb" version = "0.2.0" dependencies = [ "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "fastmap 0.1.0", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb-memorydb 0.1.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-memorydb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "memory-db 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memory-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2404,7 +2433,7 @@ name = "keccak-hash" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "primitive-types 0.6.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "primitive-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2412,7 +2441,7 @@ dependencies = [ name = "keccak-hasher" version = "0.1.1" dependencies = [ - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2439,37 +2468,37 @@ dependencies = [ [[package]] name = "kvdb" -version = "0.1.1" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-bytes 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "kvdb-memorydb" -version = "0.1.2" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "kvdb-rocksdb" -version = "0.2.0" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "fs-swap 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rocksdb 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2597,7 +2626,7 @@ dependencies = [ "ethcore-builtin 0.1.0", "ethcore-call-contract 0.1.0", "ethcore-io 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "evm 0.1.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2607,7 +2636,7 @@ dependencies = [ "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "spec 0.1.0", "state-db 0.1.0", @@ -2666,17 +2695,18 @@ name = "memory-cache" version = "0.1.0" dependencies = [ "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "memory-db" -version = "0.15.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hashmap_core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2688,8 +2718,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "migration-rocksdb" version = "0.1.0" dependencies = [ - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb-rocksdb 0.2.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-rocksdb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "macros 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2806,6 +2836,14 @@ name = "nan-preserving-float" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "natpmp" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "net2" version = "0.2.33" @@ -2829,8 +2867,8 @@ dependencies = [ "ethcore-io 1.12.0", "ethcore-network 1.12.0", "ethcore-network-devp2p 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb-memorydb 0.1.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-memorydb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2859,7 +2897,7 @@ dependencies = [ "block-reward 0.1.0", "common-types 0.1.0", "engine 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "machine 0.1.0", ] @@ -2984,11 +3022,6 @@ name = "parity-bytes" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "parity-bytes" -version = "0.1.1" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" - [[package]] name = "parity-clib" version = "1.12.0" @@ -3010,7 +3043,7 @@ dependencies = [ "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "block-modes 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "digest 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "hmac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-secp256k1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3065,7 +3098,7 @@ dependencies = [ "ethcore-secretstore 1.0.0", "ethcore-service 0.1.0", "ethcore-sync 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.4.0", "ethstore 0.2.1", "fake-fetch 0.0.1", @@ -3075,8 +3108,8 @@ dependencies = [ "journaldb 0.2.0", "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb-rocksdb 0.2.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-rocksdb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "migration-rocksdb 0.1.0", "node-filter 1.12.0", @@ -3093,13 +3126,13 @@ dependencies = [ "parity-rpc 1.12.0", "parity-runtime 0.1.0", "parity-updater 1.12.0", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-version 2.7.0", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "registrar 0.0.1", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3126,7 +3159,7 @@ dependencies = [ "ethabi-contract 9.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 9.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-call-contract 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "fake-fetch 0.0.1", "fetch 0.1.0", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3150,12 +3183,12 @@ dependencies = [ "client-traits 0.1.0", "common-types 0.1.0", "ethcore 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-http-server 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "multihash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3166,11 +3199,11 @@ dependencies = [ "common-types 0.1.0", "ethcore-io 1.12.0", "ethkey 0.4.0", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb-memorydb 0.1.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-memorydb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3202,7 +3235,7 @@ dependencies = [ "ethcore-network 1.12.0", "ethcore-private-tx 1.0.0", "ethcore-sync 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "ethkey 0.4.0", "ethstore 0.2.1", @@ -3232,7 +3265,7 @@ dependencies = [ "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (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.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3255,7 +3288,7 @@ dependencies = [ name = "parity-rpc-client" version = "1.4.0" dependencies = [ - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-ws-server 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3346,7 +3379,7 @@ dependencies = [ "ethabi-derive 9.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.12.0", "ethcore-sync 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3364,15 +3397,15 @@ dependencies = [ [[package]] name = "parity-util-mem" -version = "0.2.1" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "malloc_size_of_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3381,7 +3414,7 @@ name = "parity-version" version = "2.7.0" dependencies = [ "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3459,15 +3492,15 @@ version = "0.1.0" dependencies = [ "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", - "memory-db 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memory-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "trie-db 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3556,21 +3589,21 @@ name = "pod" version = "0.1.0" dependencies = [ "common-types 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "macros 0.1.0", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie-ethereum 0.1.0", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (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.103 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-db 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "triehash-ethereum 0.2.0", ] @@ -3644,13 +3677,13 @@ dependencies = [ [[package]] name = "primitive-types" version = "0.6.1" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "fixed-hash 0.5.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "impl-codec 0.4.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "impl-rlp 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "impl-serde 0.2.3 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "uint 0.8.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "fixed-hash 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-codec 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-rlp 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3693,7 +3726,7 @@ version = "0.1.0" dependencies = [ "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4014,7 +4047,7 @@ dependencies = [ [[package]] name = "rlp" version = "0.4.4" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4025,7 +4058,7 @@ version = "0.1.0" dependencies = [ "elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4034,7 +4067,7 @@ version = "0.1.0" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4277,6 +4310,11 @@ name = "smallvec" version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "smallvec" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "snapshot" version = "0.1.0" @@ -4298,15 +4336,15 @@ dependencies = [ "ethcore-bloom-journal 0.1.0", "ethcore-db 0.1.0", "ethcore-io 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.4.0", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb-rocksdb 0.2.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-rocksdb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4316,14 +4354,14 @@ dependencies = [ "patricia-trie-ethereum 0.1.0", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_derive 0.1.0", "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "snapshot-tests 0.1.0", "spec 0.1.0", "state-db 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-db 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "trie-standardmap 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "triehash-ethereum 0.2.0", ] @@ -4346,13 +4384,13 @@ dependencies = [ "ethcore-blockchain 0.1.0", "ethcore-db 0.1.0", "ethcore-io 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", - "kvdb-rocksdb 0.2.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kvdb-rocksdb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4362,11 +4400,11 @@ dependencies = [ "patricia-trie-ethereum 0.1.0", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "snapshot 0.1.0", "spec 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-db 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "trie-standardmap 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "triehash-ethereum 0.2.0", ] @@ -4397,7 +4435,7 @@ dependencies = [ "ethash-engine 0.1.0", "ethcore 1.12.0", "ethcore-builtin 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "evm 0.1.0", "executive-state 0.1.0", @@ -4405,13 +4443,13 @@ dependencies = [ "instant-seal 0.1.0", "journaldb 0.2.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "kvdb-memorydb 0.1.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb-memorydb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", "null-engine 0.1.0", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pod 0.1.0", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "trace 0.1.0", "trie-vm-factories 0.1.0", @@ -4438,12 +4476,12 @@ dependencies = [ "ethcore 1.12.0", "ethcore-bloom-journal 0.1.0", "ethcore-db 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.2.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "memory-cache 0.1.0", @@ -4659,14 +4697,6 @@ dependencies = [ "crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tiny-keccak" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tinytemplate" version = "1.0.2" @@ -4915,14 +4945,14 @@ dependencies = [ "ethcore 1.12.0", "ethcore-blockchain 0.1.0", "ethcore-db 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "evm 0.1.0", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rlp_derive 0.1.0", "vm 0.1.0", ] @@ -4952,14 +4982,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "trie-db" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4979,7 +5009,7 @@ dependencies = [ "evm 0.1.0", "keccak-hasher 0.1.1", "patricia-trie-ethereum 0.1.0", - "trie-db 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", "wasm 0.1.0", ] @@ -4987,19 +5017,19 @@ dependencies = [ [[package]] name = "triehash" version = "0.8.2" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "triehash-ethereum" version = "0.2.0" dependencies = [ - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.1.1", - "triehash 0.8.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "triehash 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5015,7 +5045,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "uint" version = "0.8.2" -source = "git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637#83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5146,20 +5176,20 @@ dependencies = [ "ethcore 1.12.0", "ethcore-accounts 0.1.0", "ethcore-call-contract 0.1.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "executive-state 0.1.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", "memory-cache 0.1.0", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "spec 0.1.0", "triehash-ethereum 0.2.0", @@ -5209,7 +5239,7 @@ dependencies = [ "ethcore-blockchain 0.1.0", "ethcore-call-contract 0.1.0", "ethcore-io 1.12.0", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "len-caching-lock 0.1.1", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5218,9 +5248,9 @@ dependencies = [ "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "spec 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "time-utils 0.1.0", @@ -5237,12 +5267,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "vm" version = "0.1.0" dependencies = [ - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethjson 0.1.0", "keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie-ethereum 0.1.0", - "rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5281,7 +5311,7 @@ version = "0.1.0" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)", + "ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5445,6 +5475,7 @@ dependencies = [ "checksum aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2e5b0458ea3beae0d1d8c0f3946564f8e10f90646cf78c06b4351052058d1ee" "checksum aes-soft 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d" "checksum aesni 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" +"checksum ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3" "checksum aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "68f56c7353e5a9547cbd76ed90f7bb5ffc3ba09d4ea9bd1d8c06c8b1142eeb5a" "checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" @@ -5493,6 +5524,8 @@ dependencies = [ "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "6ec65ee4f9c9d16f335091d23693457ed4928657ba4982289d7fafee03bc614a" "checksum combine 3.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +"checksum const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b641a8c9867e341f3295564203b1c250eb8ce6cb6126e007941f78c4d2ed7fe" +"checksum const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c750ec12b83377637110d5a57f5ae08e895b06c4b16e2bdbf1a94ef717428c59" "checksum criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "938703e165481c8d612ea3479ac8342e5615185db37765162e762ec3523e2fc6" "checksum criterion-plot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eccdc6ce8bbe352ca89025bee672aa6d24f4eb8c53e3a8b5d1bc58011da072a2" "checksum crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "05e44b8cf3e1a625844d1750e1f7820da46044ff6d28f4d43e455ba3e5bb2c13" @@ -5525,14 +5558,14 @@ dependencies = [ "checksum ethabi 9.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "965126c64662832991f5a748893577630b558e47fa94e7f35aefcd20d737cef7" "checksum ethabi-contract 9.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf407dce0290374bfbb1528493bc14320e663f75856b73a5b76262d8e2cec3c9" "checksum ethabi-derive 9.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bd0753d4f9e1dba99450da5f2400b20527702ae8ce0309a5f7c239d305539884" -"checksum ethbloom 0.8.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" -"checksum ethereum-types 0.8.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" +"checksum ethbloom 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "32cfe1c169414b709cf28aa30c74060bdb830a03a8ba473314d079ac79d80a5f" +"checksum ethereum-types 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba744248e3553a393143d5ebb68939fc3a4ec0c22a269682535f5ffe7fed728c" "checksum failsafe 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad3bf1642583ea2f1fa38a1e8546613a7488816941b33e5f0fccceac61879118" "checksum failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6dd377bcc1b1b7ce911967e3ec24fa19c3224394ec05b54aa7b083d498341ac7" "checksum failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "64c2d913fe8ed3b6c6518eedf4538255b989945c14c2a7d5cbff62a5e2120596" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" -"checksum fixed-hash 0.5.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" +"checksum fixed-hash 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3367952ceb191f4ab95dd5685dc163ac539e36202f9fcfd0cb22f9f9c542fefc" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum fs-swap 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "921d332c89b3b61a826de38c61ee5b6e02c56806cade1b0e5d81bd71f57a71bb" @@ -5553,7 +5586,6 @@ dependencies = [ "checksum hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" "checksum hash256-std-hasher 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16293646125e09e5bc216d9f73fa81ab31c4f97007d56c036bbf15a58e970540" "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" -"checksum hashmap_core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "8e04cb7a5051270ef3fa79f8c7604d581ecfa73d520e74f554e45541c4b5881a" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea04fa3ead4e05e51a7c806fc07271fdbde4e246a6c6d1efd52e72230b771b82" "checksum hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "961de220ec9a91af2e1e5bd80d02109155695e516771762381ef8581317066e0" @@ -5569,9 +5601,9 @@ dependencies = [ "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" "checksum if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4bac95d9aa0624e7b78187d6fb8ab012b41d9f6f54b1bcb61e61c4845f8357ec" "checksum igd 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96f0f346ff76d5143011b2de50fbe72c3e521304868dfbd0d781b4f262a75dd5" -"checksum impl-codec 0.4.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" -"checksum impl-rlp 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" -"checksum impl-serde 0.2.3 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" +"checksum impl-codec 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1be51a921b067b0eaca2fad532d9400041561aa922221cc65f95a85641c6bf53" +"checksum impl-rlp 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8f7a72f11830b52333f36e3b09a288333888bf54380fd0ac0790a3c31ab0f3c5" +"checksum impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "58e3cae7e99c7ff5a995da2cf78dd0a5383740eda71d98cf7b1910c301ac69b8" "checksum indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2" "checksum integer-encoding 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "26746cbc2e680af687e88d717f20ff90079bd10fc984ad57d277cd0e37309fa5" "checksum interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "141340095b15ed7491bd3d4ced9d20cebfb826174b6bb03386381f62b01e3d77" @@ -5597,9 +5629,9 @@ dependencies = [ "checksum keccak-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e563fa6fe52b2686094846118bf2cb2e6f75e6b8cec6c3aba09be8e835c7f998" "checksum keccak-hasher 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bf18164fd7ce989041f8fc4a1ae72a8bd1bec3575f2aeaf1d4968fc053aabef" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum kvdb 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" -"checksum kvdb-memorydb 0.1.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" -"checksum kvdb-rocksdb 0.2.0 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" +"checksum kvdb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cecee8d85a74f6b8284710d52a7d1196f09e31f8217e1f184a475b509d360554" +"checksum kvdb-memorydb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a5d70712b1fe0f02ce7ee36a962fcb0b15d0fe11262ba21a4aa839ef22cf60d" +"checksum kvdb-rocksdb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "54cc6b52f7e511de9f07fd77cda70247adfc6b8192e4b5a1b6dbca416dc425b5" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0" "checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" @@ -5618,7 +5650,7 @@ dependencies = [ "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" "checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff" "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" -"checksum memory-db 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a688133a81c915553c1dd9c3e859949f43a854cb8f8773e690e849b53b1f89f0" +"checksum memory-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "828bdf600636e90c56652689f7c3823ae2072104e4b0b5e83ea984f592f12ab9" "checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" "checksum mime 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "0a907b83e7b9e987032439a387e187119cddafc92d5c2aaeb1d92580a793f630" "checksum mime_guess 2.0.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)" = "30de2e4613efcba1ec63d8133f344076952090c122992a903359be5a4f99c3ed" @@ -5631,6 +5663,7 @@ dependencies = [ "checksum multibase 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b9c35dac080fd6e16a99924c8dfdef0af89d797dd851adab25feaffacf7850d6" "checksum multihash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c62469025f45dee2464ef9fc845f4683c543993792c1993e7d903c17a4546b74" "checksum nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34d4f00fcc2f4c9efa8cc971db0da9e28290e28e97af47585e48691ef10ff31f" +"checksum natpmp 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d85b74917d95eab8b26ab6fe28e21d3fede3a614411ca4d3b01265c05bf86a12" "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" @@ -5649,7 +5682,6 @@ dependencies = [ "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" "checksum parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5168b4cf41f3835e4bc6ffb32f51bc9365dc50cb351904595b3931d917fd0c" -"checksum parity-bytes 0.1.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" "checksum parity-crypto 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "27a9c2b525c93d717a234eb220c26474f8d97b08ac50d79faeac4cb6c74bf0b9" "checksum parity-daemonize 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "69b1910b2793ff52713fca0a4ee92544ebec59ccd218ea74560be6f947b4ca77" "checksum parity-path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5962540f99d3895d9addf535f37ab1397886bc2c68e59efd040ef458e5f8c3f7" @@ -5658,7 +5690,7 @@ dependencies = [ "checksum parity-snappy 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2c5f9d149b13134b8b354d93a92830efcbee6fe5b73a2e6e540fe70d4dd8a63" "checksum parity-snappy-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1a413d51e5e1927320c9de992998e4a279dffb8c8a7363570198bd8383e66f1b" "checksum parity-tokio-ipc 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e57fea504fea33f9fbb5f49f378359030e7e026a6ab849bb9e8f0787376f1bf" -"checksum parity-util-mem 0.2.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" +"checksum parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8174d85e62c4d615fddd1ef67966bdc5757528891d0742f15b131ad04667b3f9" "checksum parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)" = "511379a8194230c2395d2f5fa627a5a7e108a9f976656ce723ae68fca4097bfc" "checksum parity-wordlist 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "573d08f0d3bc8a6ffcdac1de2725b5daeed8db26345a9c12d91648e2d6457f3e" "checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" @@ -5682,7 +5714,7 @@ dependencies = [ "checksum primal-check 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e65f96c0a171f887198c274392c99a116ef65aa7f53f3b6d4902f493965c2d1" "checksum primal-estimate 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56ea4531dde757b56906493c8604641da14607bf9cdaa80fb9c9cabd2429f8d5" "checksum primal-sieve 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "da2d6ed369bb4b0273aeeb43f07c105c0117717cbae827b20719438eb2eb798c" -"checksum primitive-types 0.6.1 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" +"checksum primitive-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a0253db64c26d8b4e7896dd2063b516d2a1b9e0a5da26b5b78335f236d1e9522" "checksum proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e10d4b51f154c8a7fb96fd6dad097cb74b863943ec010ac94b9fd1be8861fe1e" "checksum proc-macro-hack 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e688f31d92ffd7c1ddc57a1b4e6d773c0f2a14ee437a4b0a4f5a69c80eb221c8" "checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" @@ -5720,7 +5752,7 @@ dependencies = [ "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" "checksum ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)" = "426bc186e3e95cac1e4a4be125a4aca7e84c2d616ffc02244eef36e2a60a093c" "checksum ripemd160 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad5112e0dbbb87577bfbc56c42450235e3012ce336e29c5befd7807bd626da4a" -"checksum rlp 0.4.4 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" +"checksum rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3a44d5ae8afcb238af8b75640907edc6c931efcfab2c854e81ed35fa080f84cd" "checksum rocksdb 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12069b106981c6103d3eab7dd1c86751482d0779a520b7c14954c8b586c1e643" "checksum rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b273c91bd242ca03ad6d71c143b6f17a48790e61f21a6c78568fa2b6774a24a4" "checksum rprompt 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1601f32bc5858aae3cbfa1c645c96c4d820cc5c16be0194f089560c00b6eb625" @@ -5754,6 +5786,7 @@ dependencies = [ "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" "checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d" "checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" +"checksum smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" "checksum socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d11a52082057d87cb5caa31ad812f4504b97ab44732cd8359df2e9ff9f48e7" "checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" @@ -5782,7 +5815,6 @@ dependencies = [ "checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" "checksum timer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "31d42176308937165701f50638db1c31586f183f1aab416268216577aec7306b" "checksum tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d8a021c69bb74a44ccedb824a046447e2c84a01df9e5c20779750acb38e11b2" -"checksum tiny-keccak 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2953ca5148619bc99695c1274cb54c5275bbb913c6adad87e72eaf8db9787f69" "checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" "checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" "checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" @@ -5807,12 +5839,12 @@ dependencies = [ "checksum trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe82f2f0bf1991e163e757baf044282823155dd326e70f44ce2186c3c320cc9" "checksum transaction-pool 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "454adc482e32785c3beab9415dd0f3c689f29cc2d16717eb62f6a784d53544b4" "checksum transient-hashmap 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aeb4b191d033a35edfce392a38cdcf9790b6cebcb30fa690c312c29da4dc433e" -"checksum trie-db 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "784a9813d23f18bccab728ab039c39b8a87d0d6956dcdece39e92f5cffe5076e" +"checksum trie-db 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5756812179defbff624e0ca766bedf6298cc7164037cc945584dc37833a4b3f9" "checksum trie-standardmap 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "64fda153c00484d640bc91334624be22ead0e5baca917d9fd53ff29bdebcf9b2" -"checksum triehash 0.8.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" +"checksum triehash 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a518c10ed2591fd67bbafd7d5daf725767d07b129d8c99b3b3831eeabd639ed9" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" -"checksum uint 0.8.2 (git+https://github.com/paritytech/parity-common?rev=83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637)" = "" +"checksum uint 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e75a4cdd7b87b28840dba13c483b9a88ee6bbf16ba5c951ee1ecfcf723078e0d" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d3218ea14b4edcaccfa0df0a64a3792a2c32cc706f1b336e48867f9d3147f90" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" diff --git a/Cargo.toml b/Cargo.toml index 93ec540377a..13dda73718a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,8 +39,8 @@ futures = "0.1" journaldb = { path = "util/journaldb" } jsonrpc-core = "14.0.3" keccak-hash = "0.4.0" -kvdb = "0.1" -kvdb-rocksdb = "0.2.0" +kvdb = "0.2" +kvdb-rocksdb = "0.3.0" log = "0.4" migration-rocksdb = { path = "util/migration-rocksdb" } node-filter = { path = "ethcore/node-filter" } @@ -57,7 +57,7 @@ parity-path = "0.1" parity-rpc = { path = "rpc" } parity-runtime = { path = "util/runtime" } parity-updater = { path = "updater" } -parity-util-mem = { version = "0.2.1", features = ["jemalloc-global"] } +parity-util-mem = { version = "0.3.0", features = ["jemalloc-global"] } parity-version = { path = "util/version" } parking_lot = "0.9" regex = "1.0" @@ -137,14 +137,14 @@ members = [ ] # todo[dvdplm] remove before merge -[patch.crates-io] -kvdb = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } -kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } -kvdb-memorydb = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } -parity-util-mem = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } -ethereum-types = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } -primitive-types = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } -rlp = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } -ethbloom = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } -triehash = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } -fixed-hash = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } +#[patch.crates-io] +#kvdb = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } +#kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } +#kvdb-memorydb = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } +#parity-util-mem = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } +#ethereum-types = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } +#primitive-types = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } +#rlp = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } +#ethbloom = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } +#triehash = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } +#fixed-hash = { git = "https://github.com/paritytech/parity-common", rev = "83c9ccdaa7c598a8afb2fe0baa76f6270e2b4637" } diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 2095cfd7ea1..84a56a1aca3 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -31,9 +31,9 @@ hash-db = "0.15.0" itertools = "0.5" journaldb = { path = "../util/journaldb" } keccak-hash = "0.4.0" -kvdb = "0.1" -kvdb-memorydb = { version = "0.1.2", optional = true } -kvdb-rocksdb = { version = "0.2.0", optional = true } +kvdb = "0.2" +kvdb-memorydb = { version = "0.2.0", optional = true } +kvdb-rocksdb = { version = "0.3.0", optional = true } lazy_static = { version = "1.3", optional = true } log = "0.4" macros = { path = "../util/macros", optional = true } @@ -42,7 +42,7 @@ memory-cache = { path = "../util/memory-cache" } parity-bytes = "0.1" parking_lot = "0.9" pod = { path = "pod", optional = true } -trie-db = "0.16.0" +trie-db = "0.18.0" parity-crypto = { version = "0.4.2", features = ["publickey"], optional = true } patricia-trie-ethereum = { path = "../util/patricia-trie-ethereum" } rand = "0.7" @@ -73,14 +73,13 @@ blooms-db = { path = "../util/blooms-db" } criterion = "0.3" engine = { path = "./engine", features = ["test-helpers"] } env_logger = "0.5" -ethash = { path = "../ethash" } ethcore-accounts = { path = "../accounts" } ethcore-builtin = { path = "./builtin" } ethjson = { path = "../json", features = ["test-helpers"] } parity-crypto = { version = "0.4.2", features = ["publickey"] } fetch = { path = "../util/fetch" } -kvdb-memorydb = "0.1.2" -kvdb-rocksdb = "0.2.0" +kvdb-memorydb = "0.2.0" +kvdb-rocksdb = "0.3.0" lazy_static = "1.3" machine = { path = "./machine", features = ["test-helpers"] } macros = { path = "../util/macros" } diff --git a/ethcore/account-db/Cargo.toml b/ethcore/account-db/Cargo.toml index c1a18bf1057..a0a12136da8 100644 --- a/ethcore/account-db/Cargo.toml +++ b/ethcore/account-db/Cargo.toml @@ -11,5 +11,5 @@ ethereum-types = "0.8.0" hash-db = "0.15.0" keccak-hash = "0.4.0" keccak-hasher = { path = "../../util/keccak-hasher" } -kvdb = "0.1" +kvdb = "0.2" rlp = "0.4" diff --git a/ethcore/account-db/src/lib.rs b/ethcore/account-db/src/lib.rs index e88464dab81..e4a128dcff2 100644 --- a/ethcore/account-db/src/lib.rs +++ b/ethcore/account-db/src/lib.rs @@ -93,7 +93,7 @@ impl<'db> AsHashDB for AccountDB<'db> { impl<'db> HashDB for AccountDB<'db> { fn get(&self, key: &H256, prefix: Prefix) -> Option { if key == &KECCAK_NULL_RLP { - return Some(DBValue::from_slice(&NULL_RLP)); + return Some(NULL_RLP.to_vec()); } self.db.get(&combine_key(&self.address_hash, key), prefix) } @@ -139,7 +139,7 @@ impl<'db> AccountDBMut<'db> { impl<'db> HashDB for AccountDBMut<'db>{ fn get(&self, key: &H256, prefix: Prefix) -> Option { if key == &KECCAK_NULL_RLP { - return Some(DBValue::from_slice(&NULL_RLP)); + return Some(NULL_RLP.to_vec()); } self.db.get(&combine_key(&self.address_hash, key), prefix) } @@ -157,7 +157,7 @@ impl<'db> HashDB for AccountDBMut<'db>{ } let k = keccak(value); let ak = combine_key(&self.address_hash, &k); - self.db.emplace(ak, prefix, DBValue::from_slice(value)); + self.db.emplace(ak, prefix, value.to_vec()); k } @@ -193,7 +193,7 @@ impl<'db> AsHashDB for Wrapping<'db> { impl<'db> HashDB for Wrapping<'db> { fn get(&self, key: &H256, prefix: Prefix) -> Option { if key == &KECCAK_NULL_RLP { - return Some(DBValue::from_slice(&NULL_RLP)); + return Some(NULL_RLP.to_vec()); } self.0.get(key, prefix) } @@ -227,7 +227,7 @@ impl<'db> AsHashDB for WrappingMut<'db> { impl<'db> HashDB for WrappingMut<'db>{ fn get(&self, key: &H256, prefix: Prefix) -> Option { if key == &KECCAK_NULL_RLP { - return Some(DBValue::from_slice(&NULL_RLP)); + return Some(NULL_RLP.to_vec()); } self.0.get(key, prefix) } diff --git a/ethcore/account-state/Cargo.toml b/ethcore/account-state/Cargo.toml index 840ae7d6464..9dc01caddfe 100644 --- a/ethcore/account-state/Cargo.toml +++ b/ethcore/account-state/Cargo.toml @@ -16,18 +16,18 @@ hash-db = "0.15.0" journaldb = { path = "../../util/journaldb" } keccak-hash = "0.4.0" keccak-hasher = { path = "../../util/keccak-hasher" } -kvdb = "0.1" +kvdb = "0.2" log = "0.4" lru-cache = "0.1.2" -memory-db = "0.15.0" +memory-db = "0.18.0" parity-bytes = "0.1.0" -parity-util-mem = "0.2.1" +parity-util-mem = "0.3.0" parking_lot = "0.9" pod = { path = "../pod" } rlp = "0.4.0" serde = { version = "1.0", features = ["derive"] } trace = { path = "../trace" } -trie-db = "0.16.0" +trie-db = "0.18.0" [dev-dependencies] account-db = { path = "../account-db" } diff --git a/ethcore/account-state/src/account.rs b/ethcore/account-state/src/account.rs index 48d52801419..ea8b1ab32e1 100644 --- a/ethcore/account-state/src/account.rs +++ b/ethcore/account-state/src/account.rs @@ -390,7 +390,7 @@ impl Account { match db.get(&self.code_hash, hash_db::EMPTY_PREFIX) { Some(x) => { self.code_size = Some(x.len()); - self.code_cache = Arc::new(x.into_vec()); + self.code_cache = Arc::new(x); Some(self.code_cache.clone()) }, _ => { @@ -530,7 +530,7 @@ impl Account { self.code_filth = Filth::Clean; }, (true, false) => { - db.emplace(self.code_hash.clone(), hash_db::EMPTY_PREFIX, DBValue::from_slice(&*self.code_cache)); + db.emplace(self.code_hash.clone(), hash_db::EMPTY_PREFIX, self.code_cache.to_vec()); self.code_size = Some(self.code_cache.len()); self.code_filth = Filth::Clean; }, diff --git a/ethcore/blockchain/Cargo.toml b/ethcore/blockchain/Cargo.toml index 6f6299ccce2..6e9b2275541 100644 --- a/ethcore/blockchain/Cargo.toml +++ b/ethcore/blockchain/Cargo.toml @@ -14,9 +14,9 @@ common-types = { path = "../types" } ethcore-db = { path = "../db" } ethereum-types = "0.8.0" keccak-hash = "0.4.0" -parity-util-mem = "0.2.1" +parity-util-mem = "0.3.0" itertools = "0.5" -kvdb = "0.1" +kvdb = "0.2" log = "0.4" parity-bytes = "0.1" rand = "0.7" @@ -32,4 +32,4 @@ env_logger = "0.5" parity-crypto = { version = "0.4.2", features = ["publickey"] } rustc-hex = "1.0" tempdir = "0.3" -kvdb-memorydb = "0.1.2" +kvdb-memorydb = "0.2.0" diff --git a/ethcore/blockchain/src/blockchain.rs b/ethcore/blockchain/src/blockchain.rs index ad2429cd781..d4868e1b0a4 100644 --- a/ethcore/blockchain/src/blockchain.rs +++ b/ethcore/blockchain/src/blockchain.rs @@ -628,8 +628,8 @@ impl BlockChain { let best_block_number = bc.best_block.read().header.number(); // Fetch first and best ancient block details let raw_first = bc.db.key_value().get(db::COL_EXTRA, b"first") - .expect("Low level database error when fetching 'first' block. Some issue with disk?") - .map(|v| v.into_vec()); + .expect("Low level database error when fetching 'first' block. Some issue with disk?"); +// .map(|v| v.into_vec()); let mut best_ancient = bc.db.key_value().get(db::COL_EXTRA, b"ancient") .expect("Low level database error when fetching 'best ancient' block. Some issue with disk?") .map(|h| H256::from_slice(&h)); diff --git a/ethcore/client-traits/Cargo.toml b/ethcore/client-traits/Cargo.toml index 611d00bed59..ceeb331e7ea 100644 --- a/ethcore/client-traits/Cargo.toml +++ b/ethcore/client-traits/Cargo.toml @@ -15,7 +15,7 @@ common-types = { path = "../types" } ethcore-db = { path = "../db" } ethcore-miner = { path = "../../miner" } ethereum-types = "0.8.0" -kvdb = "0.1" +kvdb = "0.2" registrar = { path = "../../util/registrar" } stats = { path = "../../util/stats" } trace = { path = "../trace" } diff --git a/ethcore/client-traits/src/lib.rs b/ethcore/client-traits/src/lib.rs index 3683730b07a..eca608c21d9 100644 --- a/ethcore/client-traits/src/lib.rs +++ b/ethcore/client-traits/src/lib.rs @@ -42,7 +42,7 @@ use common_types::{ pruning_info::PruningInfo, receipt::LocalizedReceipt, trace_filter::Filter as TraceFilter, - transaction::{self, LocalizedTransaction, CallError, SignedTransaction, UnverifiedTransaction}, + transaction::{self, Action, LocalizedTransaction, CallError, SignedTransaction, UnverifiedTransaction}, tree_route::TreeRoute, verification::{VerificationQueueInfo, Unverified}, }; @@ -395,8 +395,66 @@ pub trait BlockChainClient: /// Returns information about pruning/data availability. fn pruning_info(&self) -> PruningInfo; - /// Schedule state-altering transaction to be executed on the next pending block. - fn transact_contract(&self, address: Address, data: Bytes) -> Result<(), transaction::Error>; + /// Returns a transaction signed with the key configured in the engine signer. + fn create_transaction(&self, tx_request: TransactionRequest) -> Result; + + /// Schedule state-altering transaction to be executed on the next pending + /// block with the given gas and nonce parameters. + fn transact(&self, tx_request: TransactionRequest) -> Result<(), transaction::Error>; +} + +/// The data required for a `Client` to create a transaction. +/// +/// Gas limit, gas price, or nonce can be set explicitly, e.g. to create service +/// transactions with zero gas price, or sequences of transactions with consecutive nonces. +pub struct TransactionRequest { + pub action: Action, + pub data: Bytes, + pub gas: Option, + pub gas_price: Option, + pub nonce: Option, +} + +impl TransactionRequest { + /// Creates a request to call a contract at `address` with the specified call data. + pub fn call(address: Address, data: Bytes) -> TransactionRequest { + TransactionRequest { + action: Action::Call(address), + data, + gas: None, + gas_price: None, + nonce: None, + } + } + + /// Creates a request to create a new contract, with the specified bytecode. + pub fn create(data: Bytes) -> TransactionRequest { + TransactionRequest { + action: Action::Create, + data, + gas: None, + gas_price: None, + nonce: None, + } + } + + /// Sets a gas limit. If this is not specified, a sensible default is used. + pub fn gas(mut self, gas: U256) -> TransactionRequest { + self.gas = Some(gas); + self + } + + /// Sets a gas price. If this is not specified, a sensible default is used. + pub fn gas_price(mut self, gas_price: U256) -> TransactionRequest { + self.gas_price = Some(gas_price); + self + } + + /// Sets a nonce. If this is not specified, the appropriate latest nonce for the author is used. + pub fn nonce(mut self, nonce: U256) -> TransactionRequest { + self.nonce = Some(nonce); + self + } } /// resets the blockchain diff --git a/ethcore/db/Cargo.toml b/ethcore/db/Cargo.toml index b66d411a903..201422e3fe1 100644 --- a/ethcore/db/Cargo.toml +++ b/ethcore/db/Cargo.toml @@ -10,8 +10,8 @@ edition = "2018" [dependencies] common-types = { path = "../types" } ethereum-types = "0.8.0" -kvdb = "0.1" -parity-util-mem = "0.2.1" +kvdb = "0.2" +parity-util-mem = "0.3.0" parking_lot = "0.9" rlp = "0.4.0" rlp_derive = { path = "../../util/rlp-derive" } diff --git a/ethcore/engine/src/engine.rs b/ethcore/engine/src/engine.rs index 44f76624a35..a25ab4a2771 100644 --- a/ethcore/engine/src/engine.rs +++ b/ethcore/engine/src/engine.rs @@ -32,7 +32,7 @@ use common_types::{ }, errors::{EthcoreError as Error, EngineError}, snapshot::Snapshotting, - transaction::{self, UnverifiedTransaction}, + transaction::{self, SignedTransaction, UnverifiedTransaction}, }; use client_traits::EngineClient; @@ -185,6 +185,14 @@ pub trait Engine: Sync + Send { /// Allow mutating the header during seal generation. Currently only used by Clique. fn on_seal_block(&self, _block: &mut ExecutedBlock) -> Result<(), Error> { Ok(()) } + /// Returns a list of transactions for a new block if we are the author. + /// + /// This is called when the miner prepares a new block that this node will author and seal. It returns a list of + /// transactions that will be added to the block before any other transactions from the queue. + fn generate_engine_transactions(&self, _block: &ExecutedBlock) -> Result, Error> { + Ok(Vec::new()) + } + /// Returns the engine's current sealing state. fn sealing_state(&self) -> SealingState { SealingState::External } diff --git a/ethcore/engine/src/signer.rs b/ethcore/engine/src/signer.rs index baacf7c0984..6cd5ddbde23 100644 --- a/ethcore/engine/src/signer.rs +++ b/ethcore/engine/src/signer.rs @@ -17,7 +17,7 @@ //! A signer used by Engines which need to sign messages. use ethereum_types::{H256, Address}; -use parity_crypto::publickey::{Signature, KeyPair, Error}; +use parity_crypto::publickey::{ecies, Public, Signature, KeyPair, Error}; /// Everything that an Engine needs to sign messages. pub trait EngineSigner: Send + Sync { @@ -26,6 +26,12 @@ pub trait EngineSigner: Send + Sync { /// Signing address fn address(&self) -> Address; + + /// Decrypt a message that was encrypted to this signer's key. + fn decrypt(&self, auth_data: &[u8], cipher: &[u8]) -> Result, Error>; + + /// The signer's public key, if available. + fn public(&self) -> Option; } /// Creates a new `EngineSigner` from given key pair. @@ -40,7 +46,15 @@ impl EngineSigner for Signer { parity_crypto::publickey::sign(self.0.secret(), &hash) } + fn decrypt(&self, auth_data: &[u8], cipher: &[u8]) -> Result, Error> { + ecies::decrypt(self.0.secret(), auth_data, cipher) + } + fn address(&self) -> Address { self.0.address() } + + fn public(&self) -> Option { + Some(*self.0.public()) + } } diff --git a/ethcore/engine/src/test_helpers.rs b/ethcore/engine/src/test_helpers.rs index 6423590b3a3..127025b593f 100644 --- a/ethcore/engine/src/test_helpers.rs +++ b/ethcore/engine/src/test_helpers.rs @@ -20,7 +20,7 @@ use std::sync::Arc; use ethereum_types::{Address, H256}; use ethkey::Password; -use parity_crypto::publickey::{Signature, Error}; +use parity_crypto::publickey::{Public, Signature, Error}; use log::warn; use accounts::{self, AccountProvider, SignError}; @@ -44,7 +44,18 @@ impl EngineSigner for (Arc, Address, Password) { } } + fn decrypt(&self, auth_data: &[u8], cipher: &[u8]) -> Result, Error> { + self.0.decrypt(self.1, None, auth_data, cipher).map_err(|e| { + warn!("Unable to decrypt message: {:?}", e); + Error::InvalidMessage + }) + } + fn address(&self) -> Address { self.1 } + + fn public(&self) -> Option { + self.0.account_public(self.1, &self.2).ok() + } } diff --git a/ethcore/engines/authority-round/Cargo.toml b/ethcore/engines/authority-round/Cargo.toml index 5bca87fb806..9e3011eb6c7 100644 --- a/ethcore/engines/authority-round/Cargo.toml +++ b/ethcore/engines/authority-round/Cargo.toml @@ -10,6 +10,10 @@ license = "GPL-3.0" block-reward = { path = "../../block-reward" } client-traits = { path = "../../client-traits" } common-types = { path = "../../types" } +derive_more = "0.15.0" +ethabi = "9.0.1" +ethabi-contract = "9.0.0" +ethabi-derive = "9.0.1" ethereum-types = "0.8.0" ethjson = { path = "../../../json" } parity-crypto = { version = "0.4.2", features = ["publickey"] } @@ -22,7 +26,9 @@ log = "0.4" lru-cache = "0.1" machine = { path = "../../machine" } macros = { path = "../../../util/macros" } +parity-bytes = "0.1" parking_lot = "0.9" +rand = "0.7" rlp = "0.4.0" time-utils = { path = "../../../util/time-utils" } unexpected = { path = "../../../util/unexpected" } diff --git a/ethcore/engines/authority-round/src/lib.rs b/ethcore/engines/authority-round/src/lib.rs index 14654bc95f8..2a9ee7eea5f 100644 --- a/ethcore/engines/authority-round/src/lib.rs +++ b/ethcore/engines/authority-round/src/lib.rs @@ -40,7 +40,7 @@ use std::sync::{Weak, Arc}; use std::time::{UNIX_EPOCH, Duration}; use std::u64; -use client_traits::{EngineClient, ForceUpdateSealing}; +use client_traits::{EngineClient, ForceUpdateSealing, TransactionRequest}; use engine::{Engine, ConstructedVerifier}; use block_reward::{self, BlockRewardContract, RewardKind}; use ethjson; @@ -55,6 +55,7 @@ use engine::signer::EngineSigner; use parity_crypto::publickey::Signature; use io::{IoContext, IoHandler, TimerToken, IoService}; use itertools::{self, Itertools}; +use rand::rngs::OsRng; use rlp::{encode, Decodable, DecoderError, Encodable, RlpStream, Rlp}; use ethereum_types::{H256, H520, Address, U128, U256}; use parking_lot::{Mutex, RwLock}; @@ -72,13 +73,17 @@ use common_types::{ machine::{Call, AuxiliaryData}, }, errors::{BlockError, EthcoreError as Error, EngineError}, + ids::BlockId, snapshot::Snapshotting, + transaction::SignedTransaction, }; use unexpected::{Mismatch, OutOfBounds}; use validator_set::{ValidatorSet, SimpleList, new_validator_set}; mod finality; +mod randomness; +pub(crate) mod util; use self::finality::RollingFinality; @@ -117,6 +122,8 @@ pub struct AuthorityRoundParams { pub maximum_empty_steps: usize, /// Transition block to strict empty steps validation. pub strict_empty_steps_transition: u64, + /// If set, enables random number contract integration. It maps the transition block to the contract address. + pub randomness_contract_address: BTreeMap, } const U16_MAX: usize = ::std::u16::MAX as usize; @@ -168,6 +175,11 @@ impl From for AuthorityRoundParams { BlockRewardContract::new_from_address(address.into()) ); } + let randomness_contract_address = p.randomness_contract_address.map_or_else(BTreeMap::new, |transitions| { + transitions.into_iter().map(|(ethjson::uint::Uint(block), addr)| { + (block.as_u64(), addr.into()) + }).collect() + }); AuthorityRoundParams { step_durations, validators: new_validator_set(p.validators), @@ -183,6 +195,7 @@ impl From for AuthorityRoundParams { maximum_empty_steps: p.maximum_empty_steps.map_or(0, Into::into), two_thirds_majority_transition: p.two_thirds_majority_transition.map_or_else(BlockNumber::max_value, Into::into), strict_empty_steps_transition: p.strict_empty_steps_transition.map_or(0, Into::into), + randomness_contract_address, } } } @@ -550,6 +563,8 @@ pub struct AuthorityRound { machine: Machine, /// History of step hashes recently received from peers. received_step_hashes: RwLock>, + /// If set, enables random number contract integration. It maps the transition block to the contract address. + randomness_contract_address: BTreeMap, } // header-chain validator. @@ -851,6 +866,7 @@ impl AuthorityRound { strict_empty_steps_transition: our_params.strict_empty_steps_transition, machine, received_step_hashes: RwLock::new(Default::default()), + randomness_contract_address: our_params.randomness_contract_address, }); // Do not initialize timeouts for tests. @@ -1045,6 +1061,41 @@ impl AuthorityRound { fn address(&self) -> Option
{ self.signer.read().as_ref().map(|s| s.address() ) } + + /// Make calls to the randomness contract. + fn run_randomness_phase(&self, block: &ExecutedBlock) -> Result, Error> { + let contract_addr = match self.randomness_contract_address.range(..=block.header.number()).last() { + Some((_, &contract_addr)) => contract_addr, + None => return Ok(Vec::new()), // No randomness contract. + }; + + let opt_signer = self.signer.read(); + let signer = match opt_signer.as_ref() { + Some(signer) => signer, + None => return Ok(Vec::new()), // We are not a validator, so we shouldn't call the contracts. + }; + let our_addr = signer.address(); + let client = self.client.read().as_ref().and_then(|weak| weak.upgrade()).ok_or_else(|| { + debug!(target: "engine", "Unable to prepare block: missing client ref."); + EngineError::RequiresClient + })?; + let full_client = client.as_full_client() + .ok_or_else(|| EngineError::FailedSystemCall("Failed to upgrade to BlockchainClient.".to_string()))?; + + // Random number generation + let contract = util::BoundContract::new(&*client, BlockId::Latest, contract_addr); + let phase = randomness::RandomnessPhase::load(&contract, our_addr) + .map_err(|err| EngineError::Custom(format!("Randomness error in load(): {:?}", err)))?; + let data = match phase.advance(&contract, &mut OsRng, signer.as_ref()) + .map_err(|err| EngineError::Custom(format!("Randomness error in advance(): {:?}", err)))? { + Some(data) => data, + None => return Ok(Vec::new()), // Nothing to commit or reveal at the moment. + }; + + let nonce = block.state.nonce(&our_addr)?; + let tx_request = TransactionRequest::call(contract_addr, data).gas_price(U256::zero()).nonce(nonce); + Ok(vec![full_client.create_transaction(tx_request)?]) + } } fn unix_now() -> Duration { @@ -1326,7 +1377,6 @@ impl Engine for AuthorityRound { // report any skipped primaries between the parent block and // the block we're sealing, unless we have empty steps enabled if header.number() < self.empty_steps_transition { - trace!(target: "engine", "generate_seal: reporting misbehaviour for step={}, block=#{}", step, header.number()); self.report_skipped(header, step, parent_step, &*validators, epoch_transition_number); } @@ -1430,6 +1480,10 @@ impl Engine for AuthorityRound { block_reward::apply_block_rewards(&rewards, block, &self.machine) } + fn generate_engine_transactions(&self, block: &ExecutedBlock) -> Result, Error> { + self.run_randomness_phase(block) + } + /// Check the number of seal fields. fn verify_block_basic(&self, header: &Header) -> Result<(), Error> { if header.number() >= self.validate_score_transition && *header.difficulty() >= U256::from(U128::max_value()) { @@ -1805,19 +1859,22 @@ mod tests { use std::time::Duration; use keccak_hash::keccak; use accounts::AccountProvider; + use ethabi_contract::use_contract; use ethereum_types::{Address, H520, H256, U256}; use parity_crypto::publickey::Signature; use common_types::{ header::Header, engines::{Seal, params::CommonParams}, + ids::BlockId, errors::{EthcoreError as Error, EngineError}, transaction::{Action, Transaction}, }; use rlp::encode; use ethcore::{ block::*, + miner::{Author, MinerService}, test_helpers::{ - generate_dummy_client_with_spec, get_temp_state_db, + generate_dummy_client_with_spec, generate_dummy_client_with_spec_and_data, get_temp_state_db, TestNotify }, }; @@ -1831,7 +1888,7 @@ mod tests { use super::{ AuthorityRoundParams, AuthorityRound, EmptyStep, SealedEmptyStep, StepDurationInfo, - calculate_score, + calculate_score, util::BoundContract, }; fn build_aura(f: F) -> Arc where @@ -1852,6 +1909,7 @@ mod tests { block_reward_contract_transitions: Default::default(), strict_empty_steps_transition: 0, two_thirds_majority_transition: 0, + randomness_contract_address: BTreeMap::new(), }; // mutate aura params @@ -2578,6 +2636,54 @@ mod tests { ) } + #[test] + fn randomness_contract() -> Result<(), super::util::CallError> { + use_contract!(rand_contract, "../../res/contracts/test_authority_round_random.json"); + + env_logger::init(); + + let contract_addr = Address::from_str("0000000000000000000000000000000000000042").unwrap(); + let client = generate_dummy_client_with_spec_and_data( + spec::new_test_round_randomness_contract, 0, 0, &[], true + ); + + let tap = Arc::new(AccountProvider::transient_provider()); + + let addr1 = tap.insert_account(keccak("1").into(), &"1".into()).unwrap(); + // Unlock account so that the engine can decrypt the secret. + tap.unlock_account_permanently(addr1, "1".into()).expect("unlock"); + + let signer = Box::new((tap.clone(), addr1, "1".into())); + client.miner().set_author(Author::Sealer(signer.clone())); + client.miner().set_gas_range_target((U256::from(1000000), U256::from(1000000))); + + let engine = client.engine(); + engine.set_signer(Some(signer)); + engine.register_client(Arc::downgrade(&client) as _); + let bc = BoundContract::new(&*client, BlockId::Latest, contract_addr); + + // First the contract is in the commit phase, and we haven't committed yet. + assert!(bc.call_const(rand_contract::functions::is_commit_phase::call())?); + assert!(!bc.call_const(rand_contract::functions::is_committed::call(0, addr1))?); + + // We produce a block and commit. + engine.step(); + assert!(bc.call_const(rand_contract::functions::is_committed::call(0, addr1))?); + + // After two more blocks we are in the reveal phase... + engine.step(); + engine.step(); + assert!(bc.call_const(rand_contract::functions::is_reveal_phase::call())?); + assert!(!bc.call_const(rand_contract::functions::sent_reveal::call(0, addr1))?); + assert!(bc.call_const(rand_contract::functions::get_value::call())?.is_zero()); + + // ...so in the next step, we reveal our random value, and the contract's random value is not zero anymore. + engine.step(); + assert!(bc.call_const(rand_contract::functions::sent_reveal::call(0, addr1))?); + assert!(!bc.call_const(rand_contract::functions::get_value::call())?.is_zero()); + Ok(()) + } + #[test] fn extra_info_from_seal() { let (spec, tap, accounts) = setup_empty_steps(); @@ -2734,7 +2840,7 @@ mod tests { "validators": { "list" : ["0x1000000000000000000000000000000000000001"] }, - "blockRewardContractTransition": "0", + "blockRewardContractTransition": "0", "blockRewardContractAddress": "0x2000000000000000000000000000000000000002", "blockRewardContractTransitions": { "7": "0x3000000000000000000000000000000000000003", @@ -2765,7 +2871,7 @@ mod tests { "validators": { "list" : ["0x1000000000000000000000000000000000000001"] }, - "blockRewardContractTransition": "7", + "blockRewardContractTransition": "7", "blockRewardContractAddress": "0x2000000000000000000000000000000000000002", "blockRewardContractTransitions": { "0": "0x3000000000000000000000000000000000000003", diff --git a/ethcore/engines/authority-round/src/randomness.rs b/ethcore/engines/authority-round/src/randomness.rs new file mode 100644 index 00000000000..8efc45d538f --- /dev/null +++ b/ethcore/engines/authority-round/src/randomness.rs @@ -0,0 +1,257 @@ +// Copyright 2015-2019 Parity Technologies (UK) Ltd. +// This file is part of Parity Ethereum. + +// Parity Ethereum 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 Ethereum 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 Ethereum. If not, see . + +//! On-chain randomness generation for authority round +//! +//! This module contains the support code for the on-chain randomness generation used by AuRa. Its +//! core is the finite state machine `RandomnessPhase`, which can be loaded from the blockchain +//! state, then asked to perform potentially necessary transaction afterwards using the `advance()` +//! method. +//! +//! No additional state is kept inside the `RandomnessPhase`, it must be passed in each time. +//! +//! The process of generating random numbers is a simple finite state machine: +//! +//! ```text +//! + +//! | +//! | +//! | +//! +--------------+ +-------v-------+ +//! | | | | +//! | BeforeCommit <------------------------------+ Waiting | +//! | | enter commit phase | | +//! +------+-------+ +-------^-------+ +//! | | +//! | call | +//! | `commitHash()` | call +//! | | `revealNumber()` +//! | | +//! +------v-------+ +-------+-------+ +//! | | | | +//! | Committed +------------------------------> Reveal | +//! | | enter reveal phase | | +//! +--------------+ +---------------+ +//! ``` +//! +//! Phase transitions are performed by the smart contract and simply queried by the engine. +//! +//! Randomness generation works as follows: +//! * During the commit phase, all validators locally generate a random number, and commit that number's hash to the +//! contract. +//! * During the reveal phase, all validators reveal their local random number to the contract. The contract should +//! verify that it matches the committed hash. +//! * Finally, the XOR of all revealed numbers is used as an on-chain random number. +//! +//! An adversary can only influence that number by either controlling _all_ validators who committed, or, to a lesser +//! extent, by not revealing committed numbers. +//! The length of the commit and reveal phases, as well as any penalties for failure to reveal, are defined by the +//! contract. +//! +//! A typical case of using `RandomnessPhase` is: +//! +//! 1. `RandomnessPhase::load()` the phase from the blockchain data. +//! 2. Call `RandomnessPhase::advance()`. +//! +//! A production implementation of a randomness contract can be found here: +//! https://github.com/poanetwork/posdao-contracts/blob/4fddb108993d4962951717b49222327f3d94275b/contracts/RandomAuRa.sol + +use derive_more::Display; +use ethabi::Hash; +use ethabi_contract::use_contract; +use ethereum_types::{Address, H256, U256}; +use keccak_hash::keccak; +use log::{debug, error}; +use parity_crypto::publickey::{ecies, Error as CryptoError}; +use parity_bytes::Bytes; +use rand::Rng; +use engine::signer::EngineSigner; + +use crate::util::{BoundContract, CallError}; + +/// Random number type expected by the contract: This is generated locally, kept secret during the commit phase, and +/// published in the reveal phase. +pub type RandNumber = H256; + +use_contract!(aura_random, "../../res/contracts/authority_round_random.json"); + +/// Validated randomness phase state. +#[derive(Debug)] +pub enum RandomnessPhase { + // NOTE: Some states include information already gathered during `load` (e.g. `our_address`, + // `round`) for efficiency reasons. + /// Waiting for the next phase. + /// + /// This state indicates either the successful revelation in this round or having missed the + /// window to make a commitment, i.e. having failed to commit during the commit phase. + Waiting, + /// Indicates a commitment is possible, but still missing. + BeforeCommit, + /// Indicates a successful commitment, waiting for the commit phase to end. + Committed, + /// Indicates revealing is expected as the next step. + Reveal { our_address: Address, round: U256 }, +} + +/// Phase loading error for randomness generation state machine. +/// +/// This error usually indicates a bug in either the smart contract, the phase loading function or +/// some state being lost. +/// +/// `BadRandNumber` will usually result in punishment by the contract or the other validators. +#[derive(Debug, Display)] +pub enum PhaseError { + /// The smart contract reported that we already revealed something while still being in the + /// commit phase. + #[display(fmt = "Revealed during commit phase")] + RevealedInCommit, + /// Failed to load contract information. + #[display(fmt = "Error loading randomness contract information: {:?}", _0)] + LoadFailed(CallError), + /// Failed to load the stored encrypted random number. + #[display(fmt = "Failed to load random number from the randomness contract")] + BadRandNumber, + /// Failed to encrypt random number. + #[display(fmt = "Failed to encrypt random number: {}", _0)] + Crypto(CryptoError), + /// Failed to get the engine signer's public key. + #[display(fmt = "Failed to get the engine signer's public key")] + MissingPublicKey, +} + +impl From for PhaseError { + fn from(err: CryptoError) -> PhaseError { + PhaseError::Crypto(err) + } +} + +impl RandomnessPhase { + /// Determine randomness generation state from the contract. + /// + /// Calls various constant contract functions to determine the precise state that needs to be + /// handled (that is, the phase and whether or not the current validator still needs to send + /// commitments or reveal random numbers). + pub fn load( + contract: &BoundContract, + our_address: Address, + ) -> Result { + // Determine the current round and which phase we are in. + let round = contract + .call_const(aura_random::functions::current_collect_round::call()) + .map_err(PhaseError::LoadFailed)?; + let is_commit_phase = contract + .call_const(aura_random::functions::is_commit_phase::call()) + .map_err(PhaseError::LoadFailed)?; + + // Ensure we are not committing or revealing twice. + let committed = contract + .call_const(aura_random::functions::is_committed::call( + round, + our_address, + )) + .map_err(PhaseError::LoadFailed)?; + let revealed: bool = contract + .call_const(aura_random::functions::sent_reveal::call( + round, + our_address, + )) + .map_err(PhaseError::LoadFailed)?; + + // With all the information known, we can determine the actual state we are in. + if is_commit_phase { + if revealed { + return Err(PhaseError::RevealedInCommit); + } + + if !committed { + Ok(RandomnessPhase::BeforeCommit) + } else { + Ok(RandomnessPhase::Committed) + } + } else { + if !committed { + // We apparently entered too late to make a commitment, wait until we get a chance again. + return Ok(RandomnessPhase::Waiting); + } + + if !revealed { + Ok(RandomnessPhase::Reveal { our_address, round }) + } else { + Ok(RandomnessPhase::Waiting) + } + } + } + + /// Advance the random seed construction process as far as possible. + /// + /// Returns the encoded contract call necessary to advance the randomness contract's state. + /// + /// **Warning**: After calling the `advance()` function, wait until the returned transaction has been included in + /// a block before calling it again; otherwise spurious transactions resulting in punishments might be executed. + pub fn advance( + self, + contract: &BoundContract, + rng: &mut R, + signer: &dyn EngineSigner, + ) -> Result, PhaseError> { + match self { + RandomnessPhase::Waiting | RandomnessPhase::Committed => Ok(None), + RandomnessPhase::BeforeCommit => { + // Generate a new random number, but don't reveal it yet. Instead, we publish its hash to the + // randomness contract, together with the number encrypted to ourselves. That way we will later be + // able to decrypt and reveal it, and other parties are able to verify it against the hash. + let number: RandNumber = rng.gen(); + let number_hash: Hash = keccak(number.as_bytes()); + let public = signer.public().ok_or(PhaseError::MissingPublicKey)?; + let cipher = ecies::encrypt(&public, &number_hash.0, number.as_bytes())?; + + debug!(target: "engine", "Randomness contract: committing {}.", number_hash); + // Return the call data for the transaction that commits the hash and the encrypted number. + let (data, _decoder) = aura_random::functions::commit_hash::call(number_hash, cipher); + Ok(Some(data)) + } + RandomnessPhase::Reveal { round, our_address } => { + // Load the hash and encrypted number that we stored in the commit phase. + let call = aura_random::functions::get_commit_and_cipher::call(round, our_address); + let (committed_hash, cipher) = contract + .call_const(call) + .map_err(PhaseError::LoadFailed)?; + + // Decrypt the number and check against the hash. + let number_bytes = signer.decrypt(&committed_hash.0, &cipher)?; + let number = if number_bytes.len() == 32 { + RandNumber::from_slice(&number_bytes) + } else { + // This can only happen if there is a bug in the smart contract, + // or if the entire network goes awry. + error!(target: "engine", "Decrypted random number has the wrong length."); + return Err(PhaseError::BadRandNumber); + }; + let number_hash: Hash = keccak(number.as_bytes()); + if number_hash != committed_hash { + error!(target: "engine", "Decrypted random number doesn't agree with the hash."); + return Err(PhaseError::BadRandNumber); + } + + debug!(target: "engine", "Randomness contract: scheduling tx to reveal our random number {} (round={}, our_address={}).", number_hash, round, our_address); + // We are now sure that we have the correct secret and can reveal it. So we return the call data for the + // transaction that stores the revealed random bytes on the contract. + let (data, _decoder) = aura_random::functions::reveal_number::call(number.as_bytes()); + Ok(Some(data)) + } + } + } +} diff --git a/ethcore/engines/authority-round/src/util.rs b/ethcore/engines/authority-round/src/util.rs new file mode 100644 index 00000000000..8f07acbe74a --- /dev/null +++ b/ethcore/engines/authority-round/src/util.rs @@ -0,0 +1,94 @@ +// Copyright 2015-2019 Parity Technologies (UK) Ltd. +// This file is part of Parity Ethereum. + +// Parity Ethereum 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 Ethereum 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 Ethereum. If not, see . + +//! Utility functions. +//! +//! Contains small functions used by the AuRa engine that are not strictly limited to that scope. + +use std::fmt; + +use client_traits::EngineClient; +use common_types::ids::BlockId; +use ethabi; +use ethereum_types::Address; + +/// A contract bound to a client and block number. +/// +/// A bound contract is a combination of a `Client` reference, a `BlockId` and a contract `Address`. +/// These three parts are enough to call a contract's function; return values are automatically +/// decoded. +pub struct BoundContract<'a> { + client: &'a dyn EngineClient, + block_id: BlockId, + contract_addr: Address, +} + +/// Contract call failed error. +#[derive(Debug)] +pub enum CallError { + /// The call itself failed. + CallFailed(String), + /// Decoding the return value failed or the decoded value was a failure. + DecodeFailed(ethabi::Error), + /// The passed in client reference could not be upgraded to a `BlockchainClient`. + NotFullClient, +} + +impl<'a> fmt::Debug for BoundContract<'a> { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.debug_struct("BoundContract") + .field("client", &(self.client as *const dyn EngineClient)) + .field("block_id", &self.block_id) + .field("contract_addr", &self.contract_addr) + .finish() + } +} + +impl<'a> BoundContract<'a> { + /// Create a new `BoundContract`. + pub fn new(client: &dyn EngineClient, block_id: BlockId, contract_addr: Address) -> BoundContract { + BoundContract { + client, + block_id, + contract_addr, + } + } + + /// Perform a function call to an Ethereum machine that doesn't create a transaction or change the state. + /// + /// Runs a constant function call on `client`. The `call` value can be serialized by calling any + /// api function generated by the `use_contract!` macro. This does not create any transactions, it only produces a + /// result based on the state at the current block: It is constant in the sense that it does not alter the EVM + /// state. + pub fn call_const(&self, call: (ethabi::Bytes, D)) -> Result + where + D: ethabi::FunctionOutputDecoder, + { + let (data, output_decoder) = call; + + let call_return = self + .client + .as_full_client() + .ok_or(CallError::NotFullClient)? + .call_contract(self.block_id, self.contract_addr, data) + .map_err(CallError::CallFailed)?; + + // Decode the result and return it. + output_decoder + .decode(call_return.as_slice()) + .map_err(CallError::DecodeFailed) + } +} diff --git a/ethcore/engines/validator-set/Cargo.toml b/ethcore/engines/validator-set/Cargo.toml index 6d87f5a2390..8840e61a016 100644 --- a/ethcore/engines/validator-set/Cargo.toml +++ b/ethcore/engines/validator-set/Cargo.toml @@ -17,13 +17,13 @@ ethereum-types = "0.8.0" ethjson = { path = "../../../json" } executive-state = { path = "../../executive-state" } keccak-hash = "0.4.0" -kvdb = "0.1" +kvdb = "0.2" lazy_static = "1.3.0" log = "0.4.8" machine = { path = "../../machine" } memory-cache = { path = "../../../util/memory-cache" } parity-bytes = "0.1.0" -parity-util-mem = "0.2.1" +parity-util-mem = "0.3.0" parking_lot = "0.9" rlp = "0.4.2" triehash = { package = "triehash-ethereum", version = "0.2", path = "../../../util/triehash-ethereum" } diff --git a/ethcore/engines/validator-set/src/contract.rs b/ethcore/engines/validator-set/src/contract.rs index e05e6c4521c..e235125a208 100644 --- a/ethcore/engines/validator-set/src/contract.rs +++ b/ethcore/engines/validator-set/src/contract.rs @@ -33,7 +33,7 @@ use common_types::{ engines::machine::{Call, AuxiliaryData}, }; -use client_traits::EngineClient; +use client_traits::{EngineClient, TransactionRequest}; use engine::SystemCall; use crate::{ @@ -68,7 +68,7 @@ impl ValidatorContract { match client.as_full_client() { Some(c) => { - c.transact_contract(self.contract_address, data) + c.transact(TransactionRequest::call(self.contract_address, data)) .map_err(|e| format!("Transaction import error: {}", e))?; Ok(()) }, @@ -149,7 +149,7 @@ mod tests { use accounts::AccountProvider; use call_contract::CallContract; use common_types::{header::Header, ids::BlockId}; - use client_traits::{BlockChainClient, ChainInfo, BlockInfo}; + use client_traits::{BlockChainClient, ChainInfo, BlockInfo, TransactionRequest}; use ethcore::{ miner::{self, MinerService}, test_helpers::generate_dummy_client_with_spec, @@ -225,7 +225,7 @@ mod tests { assert_eq!(client.chain_info().best_block_number, 2); // Check if misbehaving validator was removed. - client.transact_contract(Default::default(), Default::default()).unwrap(); + client.transact(TransactionRequest::call(Default::default(), Default::default())).unwrap(); client.engine().step(); client.engine().step(); assert_eq!(client.chain_info().best_block_number, 2); diff --git a/ethcore/engines/validator-set/src/multi.rs b/ethcore/engines/validator-set/src/multi.rs index 9e790cb52c7..1114047b417 100644 --- a/ethcore/engines/validator-set/src/multi.rs +++ b/ethcore/engines/validator-set/src/multi.rs @@ -161,11 +161,13 @@ mod tests { ids::BlockId, verification::Unverified, }; - use client_traits::{BlockChainClient, BlockInfo, ChainInfo, ImportBlock, EngineClient, ForceUpdateSealing}; + use client_traits::{ + BlockChainClient, BlockInfo, ChainInfo, ImportBlock, EngineClient, ForceUpdateSealing, TransactionRequest + }; use engine::EpochChange; use ethcore::{ miner::{self, MinerService}, - test_helpers::{generate_dummy_client_with_spec, generate_dummy_client_with_spec_and_data}, + test_helpers::generate_dummy_client_with_spec, }; use ethereum_types::Address; use parity_crypto::publickey::Secret; @@ -190,7 +192,7 @@ mod tests { // Wrong signer for the first block. let signer = Box::new((tap.clone(), v1, "".into())); client.miner().set_author(miner::Author::Sealer(signer)); - client.transact_contract(Default::default(), Default::default()).unwrap(); + client.transact(TransactionRequest::call(Default::default(), Default::default())).unwrap(); EngineClient::update_sealing(&*client, ForceUpdateSealing::No); assert_eq!(client.chain_info().best_block_number, 0); // Right signer for the first block. @@ -199,7 +201,7 @@ mod tests { EngineClient::update_sealing(&*client, ForceUpdateSealing::No); assert_eq!(client.chain_info().best_block_number, 1); // This time v0 is wrong. - client.transact_contract(Default::default(), Default::default()).unwrap(); + client.transact(TransactionRequest::call(Default::default(), Default::default())).unwrap(); EngineClient::update_sealing(&*client, ForceUpdateSealing::No); assert_eq!(client.chain_info().best_block_number, 1); let signer = Box::new((tap.clone(), v1, "".into())); @@ -207,12 +209,12 @@ mod tests { EngineClient::update_sealing(&*client, ForceUpdateSealing::No); assert_eq!(client.chain_info().best_block_number, 2); // v1 is still good. - client.transact_contract(Default::default(), Default::default()).unwrap(); + client.transact(TransactionRequest::call(Default::default(), Default::default())).unwrap(); EngineClient::update_sealing(&*client, ForceUpdateSealing::No); assert_eq!(client.chain_info().best_block_number, 3); // Check syncing. - let sync_client = generate_dummy_client_with_spec_and_data(spec::new_validator_multi, 0, 0, &[]); + let sync_client = generate_dummy_client_with_spec(spec::new_validator_multi); sync_client.engine().register_client(Arc::downgrade(&sync_client) as _); for i in 1..4 { sync_client.import_block(Unverified::from_rlp(client.block(BlockId::Number(i)).unwrap().into_inner()).unwrap()).unwrap(); diff --git a/ethcore/engines/validator-set/src/safe_contract.rs b/ethcore/engines/validator-set/src/safe_contract.rs index bcc6bba63fb..4211808339d 100644 --- a/ethcore/engines/validator-set/src/safe_contract.rs +++ b/ethcore/engines/validator-set/src/safe_contract.rs @@ -154,11 +154,10 @@ fn check_first_proof(machine: &Machine, contract_address: Address, old_header: H fn decode_first_proof(rlp: &Rlp) -> Result<(Header, Vec), EthcoreError> { let header = rlp.val_at(0)?; - let state_items = rlp.at(1)?.iter().map(|x| { - let mut val = DBValue::new(); - val.append_slice(x.data()?); - Ok(val) - }).collect::>()?; + let state_items = rlp.at(1)? + .iter() + .map(|x| Ok(x.data()?.to_vec()) ) + .collect::>()?; Ok((header, state_items)) } @@ -468,7 +467,7 @@ mod tests { use engine::{EpochChange, Proof}; use ethcore::{ miner::{self, MinerService}, - test_helpers::{generate_dummy_client_with_spec, generate_dummy_client_with_spec_and_data} + test_helpers::generate_dummy_client_with_spec }; use parity_crypto::publickey::Secret; use ethereum_types::Address; @@ -551,7 +550,7 @@ mod tests { assert_eq!(client.chain_info().best_block_number, 3); // Check syncing. - let sync_client = generate_dummy_client_with_spec_and_data(spec::new_validator_safe_contract, 0, 0, &[]); + let sync_client = generate_dummy_client_with_spec(spec::new_validator_safe_contract); sync_client.engine().register_client(Arc::downgrade(&sync_client) as _); for i in 1..4 { sync_client.import_block(Unverified::from_rlp(client.block(BlockId::Number(i)).unwrap().into_inner()).unwrap()).unwrap(); diff --git a/ethcore/evm/Cargo.toml b/ethcore/evm/Cargo.toml index 333cb4e2060..31aeadd0260 100644 --- a/ethcore/evm/Cargo.toml +++ b/ethcore/evm/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Parity Technologies "] bit-set = "0.4" parity-bytes = "0.1" ethereum-types = "0.8.0" -parity-util-mem = "0.2.1" +parity-util-mem = "0.3.0" lazy_static = "1.0" log = "0.4" vm = { path = "../vm" } diff --git a/ethcore/executive-state/Cargo.toml b/ethcore/executive-state/Cargo.toml index 2b8dfe10c6d..83e90564ef6 100644 --- a/ethcore/executive-state/Cargo.toml +++ b/ethcore/executive-state/Cargo.toml @@ -14,7 +14,7 @@ common-types = { path = "../types" } ethereum-types = "0.8.0" hash-db = "0.15.0" keccak-hasher = { path = "../../util/keccak-hasher" } -kvdb = "0.1" +kvdb = "0.2" log = "0.4.8" machine = { path = "../machine" } trace = { path = "../trace" } @@ -30,5 +30,5 @@ keccak-hash = "0.4.0" pod = { path = "../pod" } rustc-hex = "1.0" spec = { path = "../spec" } -trie-db = "0.16.0" +trie-db = "0.18.0" ethtrie = { package = "patricia-trie-ethereum", path = "../../util/patricia-trie-ethereum" } diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index a3057dccce0..6308bb31f84 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -18,14 +18,14 @@ ethcore-blockchain = { path = "../blockchain" } ethereum-types = "0.8.0" executive-state = { path = "../executive-state" } machine = { path = "../machine" } -memory-db = "0.15.0" -trie-db = "0.16.0" +memory-db = "0.18.0" +trie-db = "0.18.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } ethcore-network = { path = "../../util/network" } ethcore-miner = { path = "../../miner" } ethcore-io = { path = "../../util/io" } hash-db = "0.15.0" -parity-util-mem = "0.2.1" +parity-util-mem = "0.3.0" vm = { path = "../vm" } fastmap = { path = "../../util/fastmap" } failsafe = { version = "0.3.0", default-features = false, features = ["parking_lot_mutex"] } @@ -43,14 +43,14 @@ stats = { path = "../../util/stats" } keccak-hash = "0.4.0" keccak-hasher = { path = "../../util/keccak-hasher" } triehash-ethereum = { version = "0.2", path = "../../util/triehash-ethereum" } -kvdb = "0.1" +kvdb = "0.2" memory-cache = { path = "../../util/memory-cache" } journaldb = { path = "../../util/journaldb" } verification = { path = "../verification" } [dev-dependencies] ethcore = { path = "..", features = ["test-helpers"] } -kvdb-memorydb = "0.1.2" +kvdb-memorydb = "0.2.0" tempdir = "0.3" [features] diff --git a/ethcore/light/src/client/header_chain.rs b/ethcore/light/src/client/header_chain.rs index 0e2100e6433..f04898f8829 100644 --- a/ethcore/light/src/client/header_chain.rs +++ b/ethcore/light/src/client/header_chain.rs @@ -259,7 +259,7 @@ impl HeaderChain { live_epoch_proofs.insert(c.hash, EpochTransition { block_hash: c.hash, block_number: cur_number, - proof: proof.into_vec(), + proof, }); } } @@ -667,7 +667,8 @@ impl HeaderChain { None => { match self.db.get(self.col, hash.as_bytes()) { Ok(db_value) => { - db_value.map(|x| x.into_vec()).map(encoded::Header::new) + db_value + .map(encoded::Header::new) .and_then(|header| { cache.insert_block_header(hash, header.clone()); Some(header) diff --git a/ethcore/light/src/types/request/mod.rs b/ethcore/light/src/types/request/mod.rs index 685c3ba3010..7cd85484e85 100644 --- a/ethcore/light/src/types/request/mod.rs +++ b/ethcore/light/src/types/request/mod.rs @@ -1507,9 +1507,7 @@ pub mod execution { fn decode(rlp: &Rlp) -> Result { let mut items = Vec::new(); for raw_item in rlp.iter() { - let mut item = DBValue::new(); - item.append_slice(raw_item.data()?); - items.push(item); + items.push(raw_item.data()?.to_vec()); } Ok(Response { items }) @@ -1839,8 +1837,6 @@ mod tests { #[test] fn execution_roundtrip() { - use kvdb::DBValue; - let req = IncompleteExecutionRequest { block_hash: Field::Scalar(Default::default()), from: Default::default(), @@ -1852,13 +1848,7 @@ mod tests { }; let full_req = Request::Execution(req.clone()); - let res = ExecutionResponse { - items: vec![DBValue::new(), { - let mut value = DBValue::new(); - value.append_slice(&[1, 1, 1, 2, 3]); - value - }], - }; + let res = ExecutionResponse { items: vec![vec![], vec![1, 1, 1, 2, 3]] }; let full_res = Response::Execution(res.clone()); check_roundtrip(req); diff --git a/ethcore/node-filter/Cargo.toml b/ethcore/node-filter/Cargo.toml index 358189f0a8b..a619deb91f0 100644 --- a/ethcore/node-filter/Cargo.toml +++ b/ethcore/node-filter/Cargo.toml @@ -22,7 +22,7 @@ lru-cache = "0.1" [dev-dependencies] ethcore = { path = "..", features = ["test-helpers"] } -kvdb-memorydb = "0.1.2" +kvdb-memorydb = "0.2.0" ethcore-io = { path = "../../util/io" } spec = { path = "../spec" } tempdir = "0.3" diff --git a/ethcore/pod/Cargo.toml b/ethcore/pod/Cargo.toml index a22453f5a92..2602dbcd41c 100644 --- a/ethcore/pod/Cargo.toml +++ b/ethcore/pod/Cargo.toml @@ -15,13 +15,13 @@ hash-db = "0.15.0" itertools = "0.8" keccak-hash = "0.4.0" keccak-hasher = { path = "../../util/keccak-hasher" } -kvdb = "0.1" +kvdb = "0.2" log = "0.4" parity-bytes = "0.1.0" rlp = "0.4" rustc-hex = "1" serde = { version = "1.0", features = ["derive"] } -trie-db = "0.16.0" +trie-db = "0.18.0" triehash = { package = "triehash-ethereum", version = "0.2", path = "../../util/triehash-ethereum" } [dev-dependencies] diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index fc433059eeb..2db031f3f63 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -22,18 +22,18 @@ ethereum-types = "0.8.0" ethjson = { path = "../../json" } fetch = { path = "../../util/fetch" } futures = "0.1" -parity-util-mem = "0.2.1" +parity-util-mem = "0.3.0" hash-db = "0.15.0" keccak-hash = "0.4.0" keccak-hasher = { path = "../../util/keccak-hasher" } -kvdb = "0.1" +kvdb = "0.2" log = "0.4" machine = { path = "../machine" } journaldb = { path = "../../util/journaldb" } parity-bytes = "0.1" parity-crypto = { version = "0.4.2", features = ["publickey"] } parking_lot = "0.9" -trie-db = "0.16.0" +trie-db = "0.18.0" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } registrar = { path = "../../util/registrar" } rlp = "0.4.0" diff --git a/ethcore/res/authority_round_randomness_contract.json b/ethcore/res/authority_round_randomness_contract.json new file mode 100644 index 00000000000..a93d1e6c116 --- /dev/null +++ b/ethcore/res/authority_round_randomness_contract.json @@ -0,0 +1,100 @@ +{ + "name": "TestAuthorityRoundRandomnessContract", + "engine": { + "authorityRound": { + "params": { + "stepDuration": 1, + "startStep": 2, + "validators": { + "list": [ + "0x7d577a597b2742b498cb5cf0c26cdcd726d39e6e" + ] + }, + "immediateTransitions": true, + "maximumEmptySteps": "2", + "randomnessContractAddress": { + "0": "0x0000000000000000000000000000000000000042" + } + } + } + }, + "params": { + "gasLimitBoundDivisor": "0x0400", + "accountStartNonce": "0x0", + "maximumExtraDataSize": "0x20", + "minGasLimit": "0x1388", + "networkID" : "0x69", + "eip140Transition": "0x0", + "eip211Transition": "0x0", + "eip214Transition": "0x0", + "eip658Transition": "0x0" + }, + "genesis": { + "seal": { + "authorityRound": { + "step": "0x0", + "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + }, + "difficulty": "0x20000", + "author": "0x0000000000000000000000000000000000000000", + "timestamp": "0x00", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "extraData": "0x", + "gasLimit": "0x222222" + }, + "accounts": { + "0x7d577a597b2742b498cb5cf0c26cdcd726d39e6e": { "balance": "100000000000" }, + "0000000000000000000000000000000000000001": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }, + "0000000000000000000000000000000000000002": { "balance": "1", "nonce": "1048576", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, + "0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, + "0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, + "0000000000000000000000000000000000000005": { "balance": "1", "builtin": { "name": "modexp", "activate_at": 0, "pricing": { "modexp": { "divisor": 20 } } } }, + "0000000000000000000000000000000000000006": { + "balance": "1", + "builtin": { + "name": "alt_bn128_add", + "pricing": { + "0x0": { + "price": { "linear": { "base": 500, "word": 0 }} + }, + "0x7fffffffffffff": { + "price": { "linear": { "base": 150, "word": 0 }} + } + } + } + }, + "0000000000000000000000000000000000000007": { + "balance": "1", + "builtin": { + "name": "alt_bn128_mul", + "pricing": { + "0x0": { + "price": { "linear": { "base": 40000, "word": 0 }} + }, + "0x7fffffffffffff": { + "price": { "linear": { "base": 6000, "word": 0 }} + } + } + } + }, + "0000000000000000000000000000000000000008": { + "balance": "1", + "builtin": { + "name": "alt_bn128_pairing", + "pricing": { + "0x0": { + "price": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 }} + }, + "0x7fffffffffffff": { + "price": { "alt_bn128_pairing": { "base": 45000, "pair": 34000 }} + } + } + } + }, + "0000000000000000000000000000000000000042": { + "balance": "1", + "constructor": "608060405234801561001057600080fd5b50610820806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ec576000357c01000000000000000000000000000000000000000000000000000000009004806363f160e6116100a95780637a3e286b116100835780637a3e286b14610378578063baf11cab14610380578063c358ced0146103ac578063fe7d567d146103b4576100ec565b806363f160e614610285578063695e89f6146102c557806374ce906714610370576100ec565b806304fdb016146100f15780630b61ba8514610192578063209652551461020b5780632e8a8dd5146102255780633fa4f245146102515780635580e58b14610259575b600080fd5b61011d6004803603604081101561010757600080fd5b5080359060200135600160a060020a03166103d1565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015757818101518382015260200161013f565b50505050905090810190601f1680156101845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610209600480360360408110156101a857600080fd5b813591908101906040810160208201356401000000008111156101ca57600080fd5b8201836020820111156101dc57600080fd5b803590602001918460018302840111640100000000831117156101fe57600080fd5b509092509050610475565b005b6102136104fa565b60408051918252519081900360200190f35b6102136004803603604081101561023b57600080fd5b5080359060200135600160a060020a0316610501565b61021361051b565b6102136004803603604081101561026f57600080fd5b5080359060200135600160a060020a0316610521565b6102b16004803603604081101561029b57600080fd5b5080359060200135600160a060020a031661053e565b604080519115158252519081900360200190f35b6102f1600480360360408110156102db57600080fd5b5080359060200135600160a060020a0316610568565b6040518083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561033457818101518382015260200161031c565b50505050905090810190601f1680156103615780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b6102b1610639565b610213610649565b6102b16004803603604081101561039657600080fd5b5080359060200135600160a060020a0316610654565b6102b161067c565b610209600480360360208110156103ca57600080fd5b5035610687565b600160208181526000938452604080852082529284529282902080548351600293821615610100026000190190911692909204601f8101859004850283018501909352828252909290919083018282801561046d5780601f106104425761010080835404028352916020019161046d565b820191906000526020600020905b81548152906001019060200180831161045057829003601f168201915b505050505081565b41331461048157600080fd5b61048d60014303610735565b61049657600080fd5b60006104a460014303610740565b90506104b08133610654565b156104ba57600080fd5b600081815260208181526040808320338085529083528184208890558484526001835281842090845290915290206104f3908484610753565b5050505050565b6003545b90565b600060208181529281526040808220909352908152205481565b60035481565b600260209081526000928352604080842090915290825290205481565b6000918252600260209081526040808420600160a060020a03939093168452919052902054151590565b600082815260208181526040808320600160a060020a03851680855290835281842054868552600180855283862092865291845282852080548451600294821615610100026000190190911693909304601f810186900486028401860190945283835260609491939092918391908301828280156106275780601f106105fc57610100808354040283529160200191610627565b820191906000526020600020905b81548152906001019060200180831161060a57829003601f168201915b50505050509050915091509250929050565b600061064443610735565b905090565b600061064443610740565b600091825260208281526040808420600160a060020a03939093168452919052902054151590565b600061064443610747565b41331461069357600080fd5b61069f60014303610747565b6106a857600080fd5b60006106b660014303610740565b90506106c2813361053e565b156106cc57600080fd5b60408051602080820185905282518083038201815291830183528151918101919091206000848152808352838120338252909252919020541461070e57600080fd5b60009081526002602090815260408083203384529091529020819055600380549091189055565b600360069091061090565b6006900490565b60036006909106101590565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106107945782800160ff198235161785556107c1565b828001600101855582156107c1579182015b828111156107c15782358255916020019190600101906107a6565b506107cd9291506107d1565b5090565b6104fe91905b808211156107cd57600081556001016107d756fea265627a7a7230582008bb7311af9026bd70ddb998741333d414a366275b9b433a2943bbd6bedc27ae64736f6c634300050a0032" + } + } +} diff --git a/ethcore/res/contracts/authority_round_random.json b/ethcore/res/contracts/authority_round_random.json new file mode 100644 index 00000000000..2ac5440c818 --- /dev/null +++ b/ethcore/res/contracts/authority_round_random.json @@ -0,0 +1,133 @@ +[{ + "constant": false, + "inputs": [{ + "name": "_secretHash", + "type": "bytes32" + }, + { + "name": "_cipher", + "type": "bytes" + } + ], + "name": "commitHash", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ + "name": "_number", + "type": "uint256" + }], + "name": "revealNumber", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "currentCollectRound", + "outputs": [{ + "name": "", + "type": "uint256" + }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_collectRound", + "type": "uint256" + }, + { + "name": "_miningAddress", + "type": "address" + } + ], + "name": "getCommitAndCipher", + "outputs": [ + { + "name": "", + "type": "bytes32" + }, + { + "name": "", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [{ + "name": "_collectRound", + "type": "uint256" + }, + { + "name": "_validator", + "type": "address" + } + ], + "name": "isCommitted", + "outputs": [{ + "name": "", + "type": "bool" + }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isCommitPhase", + "outputs": [{ + "name": "", + "type": "bool" + }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isRevealPhase", + "outputs": [{ + "name": "", + "type": "bool" + }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [{ + "name": "_collectRound", + "type": "uint256" + }, + { + "name": "_validator", + "type": "address" + } + ], + "name": "sentReveal", + "outputs": [{ + "name": "", + "type": "bool" + }], + "payable": false, + "stateMutability": "view", + "type": "function" + } +] diff --git a/ethcore/res/contracts/test_authority_round_random.json b/ethcore/res/contracts/test_authority_round_random.json new file mode 100644 index 00000000000..3961986057b --- /dev/null +++ b/ethcore/res/contracts/test_authority_round_random.json @@ -0,0 +1,265 @@ +[ + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "uint256" + }, + { + "name": "", + "type": "address" + } + ], + "name": "ciphers", + "outputs": [ + { + "name": "", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_collectRound", + "type": "uint256" + }, + { + "name": "_miningAddress", + "type": "address" + } + ], + "name": "getCipher", + "outputs": [ + { + "name": "", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_secretHash", + "type": "bytes32" + }, + { + "name": "_cipher", + "type": "bytes" + } + ], + "name": "commitHash", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getValue", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "uint256" + }, + { + "name": "", + "type": "address" + } + ], + "name": "hashes", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "value", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "uint256" + }, + { + "name": "", + "type": "address" + } + ], + "name": "secrets", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_collectRound", + "type": "uint256" + }, + { + "name": "_miningAddress", + "type": "address" + } + ], + "name": "sentReveal", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isCommitPhase", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_number", + "type": "uint256" + } + ], + "name": "revealNumber", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getRound", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_collectRound", + "type": "uint256" + }, + { + "name": "_miningAddress", + "type": "address" + } + ], + "name": "isCommitted", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isRevealPhase", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_collectRound", + "type": "uint256" + }, + { + "name": "_miningAddress", + "type": "address" + } + ], + "name": "getCommit", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } +] diff --git a/ethcore/res/contracts/test_authority_round_random.sol b/ethcore/res/contracts/test_authority_round_random.sol new file mode 100644 index 00000000000..e1dfde0134e --- /dev/null +++ b/ethcore/res/contracts/test_authority_round_random.sol @@ -0,0 +1,102 @@ +pragma solidity 0.5.10; + +/// @dev Randomness test contract based on https://github.com/poanetwork/posdao-contracts. +/// Generates and stores random numbers in a RANDAO manner and accumulates a random seed. +contract Random { + mapping(uint256 => mapping(address => bytes32)) public hashes; + mapping(uint256 => mapping(address => bytes)) public ciphers; + mapping(uint256 => mapping(address => uint256)) public secrets; + uint256 public value; + + /// @dev Called by the validator's node to store a hash and a cipher of the validator's secret on each collection + /// round. The validator's node must use its mining address to call this function. + /// This function can only be called once per collection round (during the `commits phase`). + /// @param _secretHash The Keccak-256 hash of the validator's secret. + /// @param _cipher The cipher of the validator's secret. Can be used by the node to decrypt and reveal. + function commitHash(bytes32 _secretHash, bytes calldata _cipher) external { + require(block.coinbase == msg.sender); + require(_isCommitPhase(block.number - 1)); + uint256 round = _collectRound(block.number - 1); + require(!isCommitted(round, msg.sender)); + hashes[round][msg.sender] = _secretHash; + ciphers[round][msg.sender] = _cipher; + } + + /// @dev Called by the validator's node to XOR its secret with the current random seed. + /// The validator's node must use its mining address to call this function. + /// This function can only be called once per collection round (during the `reveals phase`). + /// @param _number The validator's secret. + function revealNumber(uint256 _number) external { + require(block.coinbase == msg.sender); + require(_isRevealPhase(block.number - 1)); + uint256 round = _collectRound(block.number - 1); + require(!sentReveal(round, msg.sender)); + require(hashes[round][msg.sender] == keccak256(abi.encodePacked(_number))); + secrets[round][msg.sender] = _number; + value ^= _number; + } + + /// @dev Returns the Keccak-256 hash and cipher of the validator's secret for the specified collection round + /// and the specified validator stored by the validator through the `commitHash` function. + /// @param _collectRound The serial number of the collection round for which hash and cipher should be retrieved. + /// @param _miningAddress The mining address of validator. + function getCommitAndCipher( + uint256 _collectRound, + address _miningAddress + ) public view returns(bytes32, bytes memory) { + return (hashes[_collectRound][_miningAddress], ciphers[_collectRound][_miningAddress]); + } + + /// @dev Returns a boolean flag indicating whether the specified validator has committed their secret's hash for the + /// specified collection round. + /// @param _collectRound The serial number of the collection round for which the checkup should be done. + /// @param _miningAddress The mining address of the validator. + function isCommitted(uint256 _collectRound, address _miningAddress) public view returns(bool) { + return hashes[_collectRound][_miningAddress] != bytes32(0); + } + + /// @dev Returns a boolean flag indicating whether the current phase of the current collection round + /// is a `commits phase`. Used by the validator's node to determine if it should commit the hash of + /// the secret during the current collection round. + function isCommitPhase() public view returns(bool) { + return _isCommitPhase(block.number); + } + + /// @dev Returns a boolean flag indicating whether the current phase of the current collection round + /// is a `reveals phase`. Used by the validator's node to determine if it should reveal the secret during + /// the current collection round. + function isRevealPhase() public view returns(bool) { + return _isRevealPhase(block.number); + } + + /// @dev Returns a boolean flag of whether the specified validator has revealed their secret for the + /// specified collection round. + /// @param _collectRound The serial number of the collection round for which the checkup should be done. + /// @param _miningAddress The mining address of the validator. + function sentReveal(uint256 _collectRound, address _miningAddress) public view returns(bool) { + return secrets[_collectRound][_miningAddress] != uint256(0); + } + + /// @dev Returns the current collect round number. + function currentCollectRound() public view returns(uint256) { + return _collectRound(block.number); + } + + /// @dev Returns the current random value. + function getValue() public view returns(uint256) { + return value; + } + + function _collectRound(uint256 blockNumber) private pure returns(uint256) { + return blockNumber / 6; + } + + function _isCommitPhase(uint256 blockNumber) private pure returns(bool) { + return blockNumber % 6 < 3; + } + + function _isRevealPhase(uint256 blockNumber) private pure returns(bool) { + return blockNumber % 6 >= 3; + } +} + diff --git a/ethcore/res/ethereum/kotti.json b/ethcore/res/ethereum/kotti.json index 7876fe8cd2b..25ba6196185 100644 --- a/ethcore/res/ethereum/kotti.json +++ b/ethcore/res/ethereum/kotti.json @@ -24,6 +24,10 @@ "eip658Transition": "0xaef49", "eip1014Transition": "0x1a064d", "eip1052Transition": "0x1a064d", + "eip1283Transition": "0x1f67cf", + "eip1344Transition": "0x1f67cf", + "eip1706Transition": "0x1f67cf", + "eip2028Transition": "0x1f67cf", "gasLimitBoundDivisor": "0x400", "maxCodeSize": "0x6000", "maxCodeSizeTransition": "0xaef49", @@ -123,7 +127,7 @@ "0xaef49": { "price": { "alt_bn128_const_operations": { "price": 500 }} }, - "0x7fffffffffffff": { + "0x1f67cf": { "info": "EIP 1108 transition", "price": { "alt_bn128_const_operations": { "price": 150 }} } @@ -138,7 +142,7 @@ "0xaef49": { "price": { "alt_bn128_const_operations": { "price": 40000 }} }, - "0x7fffffffffffff": { + "0x1f67cf": { "info": "EIP 1108 transition", "price": { "alt_bn128_const_operations": { "price": 6000 }} } @@ -153,7 +157,7 @@ "0xaef49": { "price": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 }} }, - "0x7fffffffffffff": { + "0x1f67cf": { "info": "EIP 1108 transition", "price": { "alt_bn128_pairing": { "base": 45000, "pair": 34000 }} } @@ -161,7 +165,16 @@ } }, "0x0000000000000000000000000000000000000009": { - "balance": "0x1" + "balance": "0x1", + "builtin": { + "name": "blake2_f", + "activate_at": "0x1f67cf", + "pricing": { + "blake2_f": { + "gas_per_round": 1 + } + } + } }, "0x000000000000000000000000000000000000000a": { "balance": "0x1" diff --git a/ethcore/res/ethereum/mordor.json b/ethcore/res/ethereum/mordor.json index ceaa9de6d51..c5ae911f067 100644 --- a/ethcore/res/ethereum/mordor.json +++ b/ethcore/res/ethereum/mordor.json @@ -37,7 +37,11 @@ "eip658Transition":"0x0", "eip145Transition":"0x498bb", "eip1014Transition":"0x498bb", - "eip1052Transition":"0x498bb" + "eip1052Transition":"0x498bb", + "eip1283Transition":"0xbe10b", + "eip1344Transition":"0xbe10b", + "eip1706Transition":"0xbe10b", + "eip2028Transition":"0xbe10b" }, "genesis":{ "seal":{ @@ -59,7 +63,9 @@ "enode://1813e90a0afdd7c1e4892c5376960e3577a9e6c5a4f86fa405a405c7421a4a1608248d77cc90333842f13d8954d82113dec480cfb76b4fef8cb475157cf4d5f2@10.28.224.3:30000", "enode://2b69a3926f36a7748c9021c34050be5e0b64346225e477fe7377070f6289bd363b2be73a06010fd516e6ea3ee90778dd0399bc007bb1281923a79374f842675a@51.15.116.226:30303", "enode://621e28e529146fd501709194885f50540c494f1a2985d1fb4ec8769226b5cb0b0d1a11545926077821474c2767cdd87888ead8a2509a2c9069dd5584e4b1c3b8@10.28.223.8:30000", - "enode://a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd@51.15.116.226:30303" + "enode://a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd@51.15.116.226:30303", + "enode://f840b007500f50c98ea6f9c9e56dabf4690bbbbb7036d43682c531204341aff8315013547e5bee54117eb22bd3603585ae6bf713d9fa710659533fcab65d5b84@35.238.101.58:30000", + "enode://19eda672030ad5debb98c9069b3e99d12438b96506325d9f3f82d76c5f8ce4942d345f41700a5223900e75ad48e76713b74c1b694d67a10c2112540035922256@35.238.101.58:30000" ], "accounts":{ "0x0000000000000000000000000000000000000001":{ @@ -128,7 +134,7 @@ } } }, - "0x7fffffffffffff":{ + "0xbe10b":{ "info":"EIP 1108 transition", "price":{ "alt_bn128_const_operations":{ @@ -150,7 +156,7 @@ } } }, - "0x7fffffffffffff":{ + "0xbe10b":{ "info":"EIP 1108 transition", "price":{ "alt_bn128_const_operations":{ @@ -173,7 +179,7 @@ } } }, - "0x7fffffffffffff":{ + "0xbe10b":{ "info":"EIP 1108 transition", "price":{ "alt_bn128_pairing":{ @@ -184,6 +190,17 @@ } } } + }, + "0x0000000000000000000000000000000000000009": { + "builtin": { + "name": "blake2_f", + "activate_at": "0xbe10b", + "pricing": { + "blake2_f": { + "gas_per_round": 1 + } + } + } } } } diff --git a/ethcore/service/Cargo.toml b/ethcore/service/Cargo.toml index d39af202c82..6a45b6c59f7 100644 --- a/ethcore/service/Cargo.toml +++ b/ethcore/service/Cargo.toml @@ -14,7 +14,7 @@ ethcore-io = { path = "../../util/io" } ethcore-private-tx = { path = "../private-tx" } ethcore-sync = { path = "../sync" } ethereum-types = "0.8.0" -kvdb = "0.1" +kvdb = "0.2" log = "0.4" snapshot = { path = "../snapshot" } spec = { path = "../spec" } @@ -23,5 +23,5 @@ trace-time = "0.1" [dev-dependencies] ethcore = { path = "..", features = ["test-helpers"] } ethcore-db = { path = "../db" } -kvdb-rocksdb = "0.2.0" +kvdb-rocksdb = "0.3.0" tempdir = "0.3" diff --git a/ethcore/snapshot/Cargo.toml b/ethcore/snapshot/Cargo.toml index 1c89f971d12..0619a93c661 100644 --- a/ethcore/snapshot/Cargo.toml +++ b/ethcore/snapshot/Cargo.toml @@ -29,7 +29,7 @@ itertools = "0.5" journaldb = { path = "../../util/journaldb" } keccak-hash = "0.4.0" keccak-hasher = { path = "../../util/keccak-hasher" } -kvdb = "0.1" +kvdb = "0.2" log = "0.4.8" num_cpus = "1.10.1" rand = "0.7" @@ -40,7 +40,7 @@ rlp_derive = { path = "../../util/rlp-derive" } scopeguard = "1.0.0" snappy = { package = "parity-snappy", version ="0.1.0" } state-db = { path = "../state-db" } -trie-db = "0.16.0" +trie-db = "0.18.0" triehash = { package = "triehash-ethereum", version = "0.2", path = "../../util/triehash-ethereum" } [dev-dependencies] @@ -53,7 +53,7 @@ ethabi-contract = "9.0.0" ethabi-derive = "9.0.1" ethcore = { path = "..", features = ["test-helpers"] } ethkey = { path = "../../accounts/ethkey" } -kvdb-rocksdb = "0.2.0" +kvdb-rocksdb = "0.3.0" lazy_static = { version = "1.3" } spec = { path = "../spec" } tempdir = "0.3" diff --git a/ethcore/snapshot/snapshot-tests/Cargo.toml b/ethcore/snapshot/snapshot-tests/Cargo.toml index ffa41dc74e7..585447f22df 100644 --- a/ethcore/snapshot/snapshot-tests/Cargo.toml +++ b/ethcore/snapshot/snapshot-tests/Cargo.toml @@ -23,8 +23,8 @@ hash-db = "0.15.0" journaldb = { path = "../../../util/journaldb" } keccak-hash = "0.4.0" keccak-hasher = { path = "../../../util/keccak-hasher" } -kvdb = "0.1" -kvdb-rocksdb = "0.2.0" +kvdb = "0.2" +kvdb-rocksdb = "0.3.0" log = "0.4.8" parking_lot = "0.9" parity-crypto = { version = "0.4.2", features = ["publickey"] } @@ -35,7 +35,7 @@ snappy = { package = "parity-snappy", version ="0.1.0" } snapshot = { path = "../../snapshot", features = ["test-helpers"] } spec = { path = "../../spec" } tempdir = "0.3" -trie-db = "0.16.0" +trie-db = "0.18.0" trie-standardmap = "0.15.0" ethabi = "9.0.1" ethabi-contract = "9.0.0" diff --git a/ethcore/snapshot/snapshot-tests/src/account.rs b/ethcore/snapshot/snapshot-tests/src/account.rs index 7e3b10a8eb9..9ba476ba315 100644 --- a/ethcore/snapshot/snapshot-tests/src/account.rs +++ b/ethcore/snapshot/snapshot-tests/src/account.rs @@ -27,7 +27,6 @@ use ethcore::test_helpers::get_temp_state_db; use ethereum_types::{H256, Address}; use hash_db::{HashDB, EMPTY_PREFIX}; use keccak_hash::{KECCAK_EMPTY, KECCAK_NULL_RLP, keccak}; -use kvdb::DBValue; use parking_lot::RwLock; use rlp::Rlp; use snapshot::test_helpers::{ACC_EMPTY, to_fat_rlps, from_fat_rlp}; @@ -151,7 +150,7 @@ fn encoding_code() { { let mut acct_db = AccountDBMut::from_hash(db.as_hash_db_mut(), keccak(addr2)); - acct_db.emplace(code_hash.clone(), EMPTY_PREFIX, DBValue::from_slice(b"this is definitely code")); + acct_db.emplace(code_hash.clone(), EMPTY_PREFIX, b"this is definitely code".to_vec()); } let account1 = BasicAccount { diff --git a/ethcore/snapshot/snapshot-tests/src/helpers.rs b/ethcore/snapshot/snapshot-tests/src/helpers.rs index c83e14da69f..12f9580478f 100644 --- a/ethcore/snapshot/snapshot-tests/src/helpers.rs +++ b/ethcore/snapshot/snapshot-tests/src/helpers.rs @@ -91,7 +91,7 @@ impl StateProducer { let mut account: BasicAccount = rlp::decode(&*account_data).expect("error decoding basic account"); let acct_db = AccountDBMut::from_hash(db, *address_hash); fill_storage(acct_db, &mut account.storage_root, &mut self.storage_seed); - *account_data = DBValue::from_vec(rlp::encode(&account)); + *account_data = rlp::encode(&account); } // sweep again to alter account trie. diff --git a/ethcore/snapshot/snapshot-tests/src/service.rs b/ethcore/snapshot/snapshot-tests/src/service.rs index 9b85f324f57..003aeee90b8 100644 --- a/ethcore/snapshot/snapshot-tests/src/service.rs +++ b/ethcore/snapshot/snapshot-tests/src/service.rs @@ -50,7 +50,7 @@ use journaldb::Algorithm; #[test] fn sends_async_messages() { let gas_prices = vec![1.into(), 2.into(), 3.into(), 999.into()]; - let client = generate_dummy_client_with_spec_and_data(spec::new_null, 400, 5, &gas_prices); + let client = generate_dummy_client_with_spec_and_data(spec::new_null, 400, 5, &gas_prices, false); let service = IoService::>::start().unwrap(); let spec = spec::new_test(); @@ -143,7 +143,7 @@ fn restored_is_equivalent() { const TX_PER: usize = 5; let gas_prices = vec![1.into(), 2.into(), 3.into(), 999.into()]; - let client = generate_dummy_client_with_spec_and_data(spec::new_null, NUM_BLOCKS, TX_PER, &gas_prices); + let client = generate_dummy_client_with_spec_and_data(spec::new_null, NUM_BLOCKS, TX_PER, &gas_prices, false); let tempdir = TempDir::new("").unwrap(); let client_db = tempdir.path().join("client_db"); @@ -207,7 +207,7 @@ fn restored_is_equivalent() { #[test] fn guards_delete_folders() { let gas_prices = vec![1.into(), 2.into(), 3.into(), 999.into()]; - let client = generate_dummy_client_with_spec_and_data(spec::new_null, 400, 5, &gas_prices); + let client = generate_dummy_client_with_spec_and_data(spec::new_null, 400, 5, &gas_prices, false); let spec = spec::new_null(); let tempdir = TempDir::new("").unwrap(); @@ -266,7 +266,7 @@ fn keep_ancient_blocks() { let gas_prices = vec![1.into(), 2.into(), 3.into(), 999.into()]; let spec_f = spec::new_null; let spec = spec_f(); - let client = generate_dummy_client_with_spec_and_data(spec_f, NUM_BLOCKS as u32, 5, &gas_prices); + let client = generate_dummy_client_with_spec_and_data(spec_f, NUM_BLOCKS as u32, 5, &gas_prices, false); let bc = client.chain(); @@ -374,7 +374,7 @@ fn recover_aborted_recovery() { const NUM_BLOCKS: u32 = 400; let gas_prices = vec![1.into(), 2.into(), 3.into(), 999.into()]; - let client = generate_dummy_client_with_spec_and_data(spec::new_null, NUM_BLOCKS, 5, &gas_prices); + let client = generate_dummy_client_with_spec_and_data(spec::new_null, NUM_BLOCKS, 5, &gas_prices, false); let spec = spec::new_null(); let tempdir = TempDir::new("").unwrap(); diff --git a/ethcore/snapshot/src/lib.rs b/ethcore/snapshot/src/lib.rs index 22c7a58ded0..ef36f9978b2 100644 --- a/ethcore/snapshot/src/lib.rs +++ b/ethcore/snapshot/src/lib.rs @@ -421,7 +421,7 @@ impl StateRebuilder { for (code_hash, code, first_with) in status.new_code { for addr_hash in self.missing_code.remove(&code_hash).unwrap_or_else(Vec::new) { let mut db = AccountDBMut::from_hash(self.db.as_hash_db_mut(), addr_hash); - db.emplace(code_hash, hash_db::EMPTY_PREFIX, DBValue::from_slice(&code)); + db.emplace(code_hash, hash_db::EMPTY_PREFIX, code.to_vec()); } self.known_code.insert(code_hash, first_with); diff --git a/ethcore/spec/Cargo.toml b/ethcore/spec/Cargo.toml index 32840c9a99d..ea8f08fe342 100644 --- a/ethcore/spec/Cargo.toml +++ b/ethcore/spec/Cargo.toml @@ -25,7 +25,7 @@ hash-db = "0.15.0" instant-seal = { path = "../engines/instant-seal" } journaldb = { path = "../../util/journaldb" } keccak-hash = "0.4.0" -kvdb-memorydb = "0.1.2" +kvdb-memorydb = "0.2.0" log = "0.4.8" machine = { path = "../machine" } null-engine = { path = "../engines/null-engine" } diff --git a/ethcore/spec/src/chain.rs b/ethcore/spec/src/chain.rs index 5d0950914d2..bb171abd5eb 100644 --- a/ethcore/spec/src/chain.rs +++ b/ethcore/spec/src/chain.rs @@ -86,6 +86,7 @@ bundle_test_spec! { "authority_round" => new_test_round, "authority_round_block_reward_contract" => new_test_round_block_reward_contract, "authority_round_empty_steps" => new_test_round_empty_steps, + "authority_round_randomness_contract" => new_test_round_randomness_contract, "constructor" => new_test_constructor, "ethereum/byzantium_test" => new_byzantium_test, "ethereum/constantinople_test" => new_constantinople_test, diff --git a/ethcore/spec/src/spec.rs b/ethcore/spec/src/spec.rs index 07bb9f682ce..3327346972e 100644 --- a/ethcore/spec/src/spec.rs +++ b/ethcore/spec/src/spec.rs @@ -540,18 +540,14 @@ impl Spec { data: d, }.fake_sign(from); - let res = executive_state::prove_transaction_virtual( + executive_state::prove_transaction_virtual( db.as_hash_db_mut(), *genesis.state_root(), &tx, self.engine.machine(), &env_info, factories.clone(), - ); - - res.map(|(out, proof)| { - (out, proof.into_iter().map(|x| x.into_vec()).collect()) - }).ok_or_else(|| "Failed to prove call: insufficient state".into()) + ).ok_or_else(|| "Failed to prove call: insufficient state".into()) }; self.engine.genesis_epoch_data(&genesis, &call) diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 5db0a193a91..ef2deca311e 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -79,6 +79,7 @@ use client_traits::{ StateOrBlock, Tick, TransactionInfo, + TransactionRequest, ForceUpdateSealing }; use db::{keys::BlockDetails, Readable, Writable}; @@ -646,15 +647,13 @@ impl Importer { let res = Executive::new(&mut state, &env_info, &machine, &schedule) .transact(&transaction, options); - let res = match res { + match res { Err(e) => { trace!(target: "client", "Proved call failed: {}", e); Err(e.to_string()) } Ok(res) => Ok((res.output, state.drop().1.extract_proof())), - }; - - res.map(|(output, proof)| (output, proof.into_iter().map(|x| x.into_vec()).collect())) + } }; match with_state.generate_proof(&call) { @@ -2154,29 +2153,35 @@ impl BlockChainClient for Client { } } - fn transact_contract(&self, address: Address, data: Bytes) -> Result<(), transaction::Error> { + fn create_transaction(&self, TransactionRequest { action, data, gas, gas_price, nonce }: TransactionRequest) + -> Result + { let authoring_params = self.importer.miner.authoring_params(); let service_transaction_checker = self.importer.miner.service_transaction_checker(); let gas_price = if let Some(checker) = service_transaction_checker { match checker.check_address(self, authoring_params.author) { Ok(true) => U256::zero(), - _ => self.importer.miner.sensible_gas_price(), + _ => gas_price.unwrap_or_else(|| self.importer.miner.sensible_gas_price()), } } else { self.importer.miner.sensible_gas_price() }; let transaction = transaction::Transaction { - nonce: self.latest_nonce(&authoring_params.author), - action: Action::Call(address), - gas: self.importer.miner.sensible_gas_limit(), + nonce: nonce.unwrap_or_else(|| self.latest_nonce(&authoring_params.author)), + action, + gas: gas.unwrap_or_else(|| self.importer.miner.sensible_gas_limit()), gas_price, value: U256::zero(), - data: data, + data, }; let chain_id = self.engine.signing_chain_id(&self.latest_env_info()); let signature = self.engine.sign(transaction.hash(chain_id)) .map_err(|e| transaction::Error::InvalidSignature(e.to_string()))?; - let signed = SignedTransaction::new(transaction.with_signature(signature, chain_id))?; + Ok(SignedTransaction::new(transaction.with_signature(signature, chain_id))?) + } + + fn transact(&self, tx_request: TransactionRequest) -> Result<(), transaction::Error> { + let signed = self.create_transaction(tx_request)?; self.importer.miner.import_own_transaction(self, signed.into()) } } @@ -2978,7 +2983,7 @@ mod tests { #[test] fn should_mark_finalization_correctly_for_parent() { - let client = generate_dummy_client_with_spec_and_data(spec::new_test_with_finality, 2, 0, &[]); + let client = generate_dummy_client_with_spec_and_data(spec::new_test_with_finality, 2, 0, &[], false); let chain = client.chain(); let block1_details = chain.block_hash(1).and_then(|h| chain.block_details(&h)); diff --git a/ethcore/src/miner/miner.rs b/ethcore/src/miner/miner.rs index e3d3e04425f..755e7ba89f1 100644 --- a/ethcore/src/miner/miner.rs +++ b/ethcore/src/miner/miner.rs @@ -327,6 +327,13 @@ impl Miner { /// /// NOTE This should be only used for tests. pub fn new_for_tests(spec: &Spec, accounts: Option>) -> Miner { + Miner::new_for_tests_force_sealing(spec, accounts, false) + } + + /// Creates new instance of miner with given spec and accounts. + /// + /// NOTE This should be only used for tests. + pub fn new_for_tests_force_sealing(spec: &Spec, accounts: Option>, force_sealing: bool) -> Miner { let minimal_gas_price = 0.into(); Miner::new(MinerOptions { pool_verification_options: pool::verifier::Options { @@ -336,6 +343,7 @@ impl Miner { no_early_reject: false, }, reseal_min_period: Duration::from_secs(0), + force_sealing, ..Default::default() }, GasPricer::new_fixed(minimal_gas_price), spec, accounts.unwrap_or_default()) } @@ -422,7 +430,8 @@ impl Miner { let chain_info = chain.chain_info(); // Open block - let (mut open_block, original_work_hash) = { + // Some engines add transactions to the block for their own purposes, e.g. AuthorityRound RANDAO. + let (mut open_block, original_work_hash, engine_txs) = { let mut sealing = self.sealing.lock(); let last_work_hash = sealing.queue.peek_last_ref().map(|pb| pb.header.hash()); let best_hash = chain_info.best_block_hash; @@ -433,38 +442,48 @@ impl Miner { // if at least one was pushed successfully, close and enqueue new ClosedBlock; // otherwise, leave everything alone. // otherwise, author a fresh block. - let mut open_block = match sealing.queue.get_pending_if(|b| b.header.parent_hash() == &best_hash) { + match sealing.queue.get_pending_if(|b| b.header.parent_hash() == &best_hash) { Some(old_block) => { trace!(target: "miner", "prepare_block: Already have previous work; updating and returning"); // add transactions to old_block - chain.reopen_block(old_block) + (chain.reopen_block(old_block), last_work_hash, Vec::new()) } None => { // block not found - create it. trace!(target: "miner", "prepare_block: No existing work - making new block"); let params = self.params.read().clone(); - match chain.prepare_open_block( + let block = match chain.prepare_open_block( params.author, params.gas_range_target, params.extra_data, ) { Ok(block) => block, Err(err) => { - warn!(target: "miner", "Open new block failed with error {:?}. This is likely an error in chain specificiations or on-chain consensus smart contracts.", err); + warn!(target: "miner", "Open new block failed with error {:?}. This is likely an error in \ + chain specification or on-chain consensus smart contracts.", err); + return None; + } + }; + + // Before adding from the queue to the new block, give the engine a chance to add transactions. + match self.engine.generate_engine_transactions(&block) { + Ok(transactions) => (block, last_work_hash, transactions), + Err(err) => { + error!(target: "miner", "Failed to prepare engine transactions for new block: {:?}. \ + This is likely an error in chain specification or on-chain consensus smart \ + contracts.", err); return None; } } } - }; - - if self.options.infinite_pending_block { - open_block.remove_gas_limit(); } - - (open_block, last_work_hash) }; + if self.options.infinite_pending_block { + open_block.remove_gas_limit(); + } + let mut invalid_transactions = HashSet::new(); let mut not_allowed_transactions = HashSet::new(); let mut senders_to_penalize = HashSet::new(); @@ -488,13 +507,13 @@ impl Miner { MAX_SKIPPED_TRANSACTIONS.saturating_add(cmp::min(*open_block.header.gas_limit() / min_tx_gas, u64::max_value().into()).as_u64() as usize) }; - let pending: Vec> = self.transaction_queue.pending( + let queue_txs: Vec> = self.transaction_queue.pending( client.clone(), pool::PendingSettings { block_number: chain_info.best_block_number, current_timestamp: chain_info.best_block_timestamp, nonce_cap, - max_len: max_transactions, + max_len: max_transactions.saturating_sub(engine_txs.len()), ordering: miner::PendingOrdering::Priority, } ); @@ -504,12 +523,11 @@ impl Miner { }; let block_start = Instant::now(); - debug!(target: "miner", "Attempting to push {} transactions.", pending.len()); + debug!(target: "miner", "Attempting to push {} transactions.", engine_txs.len() + queue_txs.len()); - for tx in pending { + for transaction in engine_txs.into_iter().chain(queue_txs.into_iter().map(|tx| tx.signed().clone())) { let start = Instant::now(); - let transaction = tx.signed().clone(); let hash = transaction.hash(); let sender = transaction.sender(); diff --git a/ethcore/src/test_helpers/mod.rs b/ethcore/src/test_helpers/mod.rs index 17e3b2af4e7..f824fe564dd 100644 --- a/ethcore/src/test_helpers/mod.rs +++ b/ethcore/src/test_helpers/mod.rs @@ -118,31 +118,35 @@ pub fn create_test_block_with_data(header: &Header, transactions: &[SignedTransa /// Generates dummy client (not test client) with corresponding amount of blocks pub fn generate_dummy_client(block_number: u32) -> Arc { - generate_dummy_client_with_spec_and_data(spec::new_test, block_number, 0, &[]) + generate_dummy_client_with_spec_and_data(spec::new_test, block_number, 0, &[], false) } /// Generates dummy client (not test client) with corresponding amount of blocks and txs per every block pub fn generate_dummy_client_with_data(block_number: u32, txs_per_block: usize, tx_gas_prices: &[U256]) -> Arc { - generate_dummy_client_with_spec_and_data(spec::new_null, block_number, txs_per_block, tx_gas_prices) + generate_dummy_client_with_spec_and_data(spec::new_null, block_number, txs_per_block, tx_gas_prices, false) } /// Generates dummy client (not test client) with corresponding spec and accounts pub fn generate_dummy_client_with_spec(test_spec: F) -> Arc where F: Fn() -> Spec { - generate_dummy_client_with_spec_and_data(test_spec, 0, 0, &[]) + generate_dummy_client_with_spec_and_data(test_spec, 0, 0, &[], false) } /// Generates dummy client (not test client) with corresponding amount of blocks, txs per block and spec -pub fn generate_dummy_client_with_spec_and_data(test_spec: F, block_number: u32, txs_per_block: usize, tx_gas_prices: &[U256]) -> Arc where +pub fn generate_dummy_client_with_spec_and_data( + test_spec: F, block_number: u32, txs_per_block: usize, tx_gas_prices: &[U256], force_sealing: bool, +) -> Arc where F: Fn() -> Spec { let test_spec = test_spec(); let client_db = new_db(); + let miner = Miner::new_for_tests_force_sealing(&test_spec, None, force_sealing); + let client = Client::new( ClientConfig::default(), &test_spec, client_db, - Arc::new(Miner::new_for_tests(&test_spec, None)), + Arc::new(miner), IoChannel::disconnected(), ).unwrap(); let test_engine = &*test_spec.engine; diff --git a/ethcore/src/test_helpers/test_client.rs b/ethcore/src/test_helpers/test_client.rs index 77a0237b462..888533297d6 100644 --- a/ethcore/src/test_helpers/test_client.rs +++ b/ethcore/src/test_helpers/test_client.rs @@ -72,7 +72,7 @@ use client::{ use client_traits::{ BlockInfo, Nonce, Balance, ChainInfo, TransactionInfo, BlockChainClient, ImportBlock, AccountData, BlockChain, IoClient, BadBlocks, ScheduleInfo, StateClient, ProvingBlockChainClient, - StateOrBlock, ForceUpdateSealing + StateOrBlock, ForceUpdateSealing, TransactionRequest }; use engine::Engine; use machine::executed::Executed; @@ -912,18 +912,24 @@ impl BlockChainClient for TestBlockChainClient { } } - fn transact_contract(&self, address: Address, data: Bytes) -> Result<(), transaction::Error> { + fn create_transaction(&self, TransactionRequest { action, data, gas, gas_price, nonce }: TransactionRequest) + -> Result + { let transaction = Transaction { - nonce: self.latest_nonce(&self.miner.authoring_params().author), - action: Action::Call(address), - gas: self.spec.gas_limit, - gas_price: U256::zero(), + nonce: nonce.unwrap_or_else(|| self.latest_nonce(&self.miner.authoring_params().author)), + action, + gas: gas.unwrap_or(self.spec.gas_limit), + gas_price: gas_price.unwrap_or_else(U256::zero), value: U256::default(), data: data, }; let chain_id = Some(self.spec.chain_id()); let sig = self.spec.engine.sign(transaction.hash(chain_id)).unwrap(); - let signed = SignedTransaction::new(transaction.with_signature(sig, chain_id)).unwrap(); + Ok(SignedTransaction::new(transaction.with_signature(sig, chain_id)).unwrap()) + } + + fn transact(&self, tx_request: TransactionRequest) -> Result<(), transaction::Error> { + let signed = self.create_transaction(tx_request)?; self.miner.import_own_transaction(self, signed.into()) } } diff --git a/ethcore/state-db/Cargo.toml b/ethcore/state-db/Cargo.toml index 64d173210be..d23eafcec47 100644 --- a/ethcore/state-db/Cargo.toml +++ b/ethcore/state-db/Cargo.toml @@ -16,7 +16,7 @@ hash-db = "0.15.0" keccak-hash = "0.4.0" keccak-hasher = { path = "../../util/keccak-hasher" } journaldb = { path = "../../util/journaldb" } -kvdb = "0.1" +kvdb = "0.2" log = "0.4.6" lru-cache = "0.1.2" memory-cache = { path = "../../util/memory-cache" } diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index be448ac12fc..3e458ced835 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -27,7 +27,7 @@ macros = { path = "../../util/macros" } network = { package = "ethcore-network", path = "../../util/network" } parity-runtime = { path = "../../util/runtime" } parity-crypto = { version = "0.4.2", features = ["publickey"] } -parity-util-mem = "0.2.1" +parity-util-mem = "0.3.0" rand = "0.7" parking_lot = "0.9" rlp = "0.4.0" @@ -40,7 +40,7 @@ env_logger = "0.5" engine = { path = "../engine" } ethcore = { path = "..", features = ["test-helpers"] } ethcore-io = { path = "../../util/io", features = ["mio"] } -kvdb-memorydb = "0.1.2" +kvdb-memorydb = "0.2.0" machine = { path = "../machine" } rand_xorshift = "0.2" rustc-hex = "1.0" diff --git a/ethcore/sync/src/api.rs b/ethcore/sync/src/api.rs index a8a7a99fc3c..3565ac0731e 100644 --- a/ethcore/sync/src/api.rs +++ b/ethcore/sync/src/api.rs @@ -54,7 +54,7 @@ use network::{ client_version::ClientVersion, NetworkProtocolHandler, NetworkContext, PeerId, ProtocolId, NetworkConfiguration as BasicNetworkConfiguration, NonReservedPeerMode, Error, - ConnectionFilter, IpFilter + ConnectionFilter, IpFilter, NatType }; use snapshot::SnapshotService; use parking_lot::{RwLock, Mutex}; @@ -742,6 +742,8 @@ pub struct NetworkConfiguration { pub udp_port: Option, /// Enable NAT configuration pub nat_enabled: bool, + /// Nat type + pub nat_type: NatType, /// Enable discovery pub discovery_enabled: bool, /// List of initial node addresses @@ -786,6 +788,7 @@ impl NetworkConfiguration { public_address: match self.public_address { None => None, Some(addr) => Some(SocketAddr::from_str(&addr)?) }, udp_port: self.udp_port, nat_enabled: self.nat_enabled, + nat_type: self.nat_type, discovery_enabled: self.discovery_enabled, boot_nodes: self.boot_nodes, use_secret: self.use_secret, @@ -810,6 +813,7 @@ impl From for NetworkConfiguration { public_address: other.public_address.and_then(|addr| Some(format!("{}", addr))), udp_port: other.udp_port, nat_enabled: other.nat_enabled, + nat_type: other.nat_type, discovery_enabled: other.discovery_enabled, boot_nodes: other.boot_nodes, use_secret: other.use_secret, diff --git a/ethcore/trace/Cargo.toml b/ethcore/trace/Cargo.toml index 2337058a99e..656070c99d4 100644 --- a/ethcore/trace/Cargo.toml +++ b/ethcore/trace/Cargo.toml @@ -11,10 +11,10 @@ ethcore-blockchain = { path = "../blockchain" } ethcore-db = { path = "../db" } ethereum-types = "0.8.0" evm = { path = "../evm" } -kvdb = "0.1" +kvdb = "0.2" log = "0.4" parity-bytes = "0.1.0" -parity-util-mem = "0.2.1" +parity-util-mem = "0.3.0" parking_lot = "0.9" rlp = "0.4.0" rlp_derive = { path = "../../util/rlp-derive" } diff --git a/ethcore/trie-vm-factories/Cargo.toml b/ethcore/trie-vm-factories/Cargo.toml index 8e81a9c02a4..b8d337094f0 100644 --- a/ethcore/trie-vm-factories/Cargo.toml +++ b/ethcore/trie-vm-factories/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -trie-db = "0.16.0" +trie-db = "0.18.0" ethtrie = { package = "patricia-trie-ethereum", path = "../../util/patricia-trie-ethereum" } account-db = { path = "../account-db" } evm = { path = "../evm" } diff --git a/ethcore/types/Cargo.toml b/ethcore/types/Cargo.toml index e16646c92fc..376fe34072a 100644 --- a/ethcore/types/Cargo.toml +++ b/ethcore/types/Cargo.toml @@ -13,7 +13,7 @@ ethjson = { path = "../../json" } keccak-hash = "0.4.0" parity-bytes = "0.1" parity-crypto = { version = "0.4.2", features = ["publickey"] } -parity-util-mem = "0.2.1" +parity-util-mem = "0.3.0" parity-snappy = "0.1" patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } rlp = "0.4.0" diff --git a/ethcore/types/src/errors/engine_error.rs b/ethcore/types/src/errors/engine_error.rs index 02cdd066b36..d5168875e61 100644 --- a/ethcore/types/src/errors/engine_error.rs +++ b/ethcore/types/src/errors/engine_error.rs @@ -37,6 +37,10 @@ pub enum EngineError { InsufficientProof(String), /// Failed system call. FailedSystemCall(String), + /// Failed to decode the result of a system call. + SystemCallResultDecoding(String), + /// The result of a system call is invalid. + SystemCallResultInvalid(String), /// Malformed consensus message. MalformedMessage(String), /// Requires client ref, but none registered. @@ -91,6 +95,8 @@ impl fmt::Display for EngineError { BadSealFieldSize(ref oob) => format!("Seal field has an unexpected length: {}", oob), InsufficientProof(ref msg) => format!("Insufficient validation proof: {}", msg), FailedSystemCall(ref msg) => format!("Failed to make system call: {}", msg), + SystemCallResultDecoding(ref msg) => format!("Failed to decode the result of a system call: {}", msg), + SystemCallResultInvalid(ref msg) => format!("The result of a system call is invalid: {}", msg), MalformedMessage(ref msg) => format!("Received malformed consensus message: {}", msg), RequiresClient => format!("Call requires client but none registered"), RequiresSigner => format!("Call requires signer but none registered"), diff --git a/ethcore/verification/Cargo.toml b/ethcore/verification/Cargo.toml index e3cffaf912b..3943413ab0e 100644 --- a/ethcore/verification/Cargo.toml +++ b/ethcore/verification/Cargo.toml @@ -24,7 +24,7 @@ len-caching-lock = { path = "../../util/len-caching-lock" } log = "0.4" num_cpus = "1.2" parity-bytes = "0.1.0" -parity-util-mem = "0.2.1" +parity-util-mem = "0.3.0" parking_lot = "0.9" rlp = "0.4.2" time-utils = { path = "../../util/time-utils" } diff --git a/json/src/spec/authority_round.rs b/json/src/spec/authority_round.rs index ba5ad63b39b..69780009dd7 100644 --- a/json/src/spec/authority_round.rs +++ b/json/src/spec/authority_round.rs @@ -95,6 +95,8 @@ pub struct AuthorityRoundParams { pub strict_empty_steps_transition: Option, /// First block for which a 2/3 quorum (instead of 1/2) is required. pub two_thirds_majority_transition: Option, + /// The random number contract's address, or a map of contract transitions. + pub randomness_contract_address: Option>, } /// Authority engine deserialization. @@ -124,7 +126,11 @@ mod tests { "validateStepTransition": 150, "blockReward": 5000000, "maximumUncleCountTransition": 10000000, - "maximumUncleCount": 5 + "maximumUncleCount": 5, + "randomnessContractAddress": { + "10": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "20": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + } } }"#; @@ -138,6 +144,10 @@ mod tests { assert_eq!(deserialized.params.immediate_transitions, None); assert_eq!(deserialized.params.maximum_uncle_count_transition, Some(Uint(10_000_000.into()))); assert_eq!(deserialized.params.maximum_uncle_count, Some(Uint(5.into()))); - + assert_eq!(deserialized.params.randomness_contract_address.unwrap(), + vec![ + (Uint(10.into()), Address(H160::from_str("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").unwrap())), + (Uint(20.into()), Address(H160::from_str("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb").unwrap())), + ].into_iter().collect()); } } diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 62a44abbe41..43fc1e4d4a4 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -22,7 +22,7 @@ ethabi-contract = "9.0.0" ethcore-call-contract = { path = "../ethcore/call-contract" } ethereum-types = "0.8.0" futures = "0.1" -parity-util-mem = "0.2.1" +parity-util-mem = "0.3.0" keccak-hash = "0.4.0" linked-hash-map = "0.5" log = "0.4" diff --git a/miner/local-store/Cargo.toml b/miner/local-store/Cargo.toml index 6af34096696..806926ef0ef 100644 --- a/miner/local-store/Cargo.toml +++ b/miner/local-store/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" [dependencies] common-types = { path = "../../ethcore/types" } ethcore-io = { path = "../../util/io" } -kvdb = "0.1" +kvdb = "0.2" log = "0.4" rlp = "0.4.0" serde = "1.0" @@ -18,4 +18,4 @@ serde_json = "1.0" [dev-dependencies] ethkey = { path = "../../accounts/ethkey" } parity-crypto = { version = "0.4.2", features = ["publickey"] } -kvdb-memorydb = "0.1.2" +kvdb-memorydb = "0.2.0" diff --git a/parity/configuration.rs b/parity/configuration.rs index 69987fc69bb..d6e6931fbd0 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -53,7 +53,7 @@ use export_hardcoded_sync::ExportHsyncCmd; use presale::ImportWallet; use account::{AccountCmd, NewAccount, ListAccounts, ImportAccounts, ImportFromGethAccounts}; use snapshot_cmd::{self, SnapshotCommand}; -use network::{IpFilter}; +use network::{IpFilter, NatType}; const DEFAULT_MAX_PEERS: u16 = 50; const DEFAULT_MIN_PEERS: u16 = 25; @@ -743,7 +743,13 @@ impl Configuration { fn net_config(&self) -> Result { let mut ret = NetworkConfiguration::new(); - ret.nat_enabled = self.args.arg_nat == "any" || self.args.arg_nat == "upnp"; + ret.nat_enabled = self.args.arg_nat == "any" || self.args.arg_nat == "upnp" || self.args.arg_nat == "natpmp"; + ret.nat_type = match &self.args.arg_nat[..] { + "any" => NatType::Any, + "upnp" => NatType::UPnP, + "natpmp" => NatType::NatPMP, + _ => NatType::Nothing, + }; ret.boot_nodes = to_bootnodes(&self.args.arg_bootnodes)?; let (listen, public) = self.net_addresses()?; ret.listen_address = Some(format!("{}", listen)); diff --git a/parity/helpers.rs b/parity/helpers.rs index 67ae0ed0912..f987fede4b2 100644 --- a/parity/helpers.rs +++ b/parity/helpers.rs @@ -202,6 +202,7 @@ pub fn to_bootnodes(bootnodes: &Option) -> Result, String> { #[cfg(test)] pub fn default_network_config() -> ::sync::NetworkConfiguration { + use network::NatType; use sync::{NetworkConfiguration}; use super::network::IpFilter; NetworkConfiguration { @@ -211,6 +212,7 @@ pub fn default_network_config() -> ::sync::NetworkConfiguration { public_address: None, udp_port: None, nat_enabled: true, + nat_type: NatType::Any, discovery_enabled: true, boot_nodes: Vec::new(), use_secret: None, diff --git a/rpc/src/v1/helpers/engine_signer.rs b/rpc/src/v1/helpers/engine_signer.rs index c6b86a01a79..a6f90f6a7f2 100644 --- a/rpc/src/v1/helpers/engine_signer.rs +++ b/rpc/src/v1/helpers/engine_signer.rs @@ -18,7 +18,7 @@ use std::sync::Arc; use accounts::AccountProvider; use ethkey::Password; -use crypto::publickey::{Address, Message, Signature, Error}; +use crypto::publickey::{Address, Message, Public, Signature, Error}; /// An implementation of EngineSigner using internal account management. pub struct EngineSigner { @@ -42,8 +42,19 @@ impl engine::signer::EngineSigner for EngineSigner { } } + fn decrypt(&self, auth_data: &[u8], cipher: &[u8]) -> Result, Error> { + self.accounts.decrypt(self.address, None, auth_data, cipher).map_err(|e| { + warn!("Unable to decrypt message: {:?}", e); + Error::InvalidMessage + }) + } + fn address(&self) -> Address { self.address } + + fn public(&self) -> Option { + self.accounts.account_public(self.address, &self.password).ok() + } } diff --git a/secret-store/Cargo.toml b/secret-store/Cargo.toml index 7751e966980..11cad8ba211 100644 --- a/secret-store/Cargo.toml +++ b/secret-store/Cargo.toml @@ -21,8 +21,8 @@ ethkey = { path = "../accounts/ethkey", optional = true } futures = "0.1" hyper = { version = "0.12", default-features = false } keccak-hash = "0.4.0" -kvdb = "0.1" -kvdb-rocksdb = "0.2.0" +kvdb = "0.2" +kvdb-rocksdb = "0.3.0" lazy_static = "1.0" log = "0.4" parity-bytes = "0.1" @@ -47,7 +47,7 @@ env_logger = "0.5" ethkey = { path = "../accounts/ethkey" } ethcore = { path = "../ethcore", features = ["test-helpers"] } tempdir = "0.3" -kvdb-rocksdb = "0.2.0" +kvdb-rocksdb = "0.3.0" [features] accounts = ["ethcore-accounts", "ethkey"] diff --git a/util/journaldb/Cargo.toml b/util/journaldb/Cargo.toml index d4ba964a2b9..59d2d13973d 100644 --- a/util/journaldb/Cargo.toml +++ b/util/journaldb/Cargo.toml @@ -10,11 +10,11 @@ edition = "2018" parity-bytes = "0.1" ethereum-types = "0.8.0" hash-db = "0.15.0" -malloc_size_of = { version = "0.2", package = "parity-util-mem" } +malloc_size_of = { version = "0.3.0", package = "parity-util-mem" } keccak-hasher = { path = "../keccak-hasher" } -kvdb = "0.1" +kvdb = "0.2" log = "0.4" -memory-db = "0.15.0" +memory-db = "0.18.0" parking_lot = "0.9" fastmap = { path = "../../util/fastmap" } rlp = "0.4.0" @@ -22,4 +22,4 @@ rlp = "0.4.0" [dev-dependencies] env_logger = "0.5" keccak-hash = "0.4.0" -kvdb-memorydb = "0.1.2" +kvdb-memorydb = "0.2.0" diff --git a/util/journaldb/src/archivedb.rs b/util/journaldb/src/archivedb.rs index a141f6f4624..70bd5656ced 100644 --- a/util/journaldb/src/archivedb.rs +++ b/util/journaldb/src/archivedb.rs @@ -368,7 +368,7 @@ mod tests { let mut jdb = ArchiveDB::new(shared_db.clone(), 0); // history is 1 let foo = jdb.insert(EMPTY_PREFIX, b"foo"); - jdb.emplace(bar.clone(), EMPTY_PREFIX, DBValue::from_slice(b"bar")); + jdb.emplace(bar.clone(), EMPTY_PREFIX, b"bar".to_vec()); commit_batch(&mut jdb, 0, &keccak(b"0"), None).unwrap(); foo }; @@ -465,7 +465,7 @@ mod tests { let key = jdb.insert(EMPTY_PREFIX, b"dog"); inject_batch(&mut jdb).unwrap(); - assert_eq!(jdb.get(&key, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"dog")); + assert_eq!(jdb.get(&key, EMPTY_PREFIX).unwrap(), b"dog".to_vec()); jdb.remove(&key, EMPTY_PREFIX); inject_batch(&mut jdb).unwrap(); diff --git a/util/journaldb/src/earlymergedb.rs b/util/journaldb/src/earlymergedb.rs index 659b03eed46..ad3b3ea43ae 100644 --- a/util/journaldb/src/earlymergedb.rs +++ b/util/journaldb/src/earlymergedb.rs @@ -801,7 +801,7 @@ mod tests { let mut jdb = EarlyMergeDB::new(shared_db.clone(), 0); // history is 1 let foo = jdb.insert(EMPTY_PREFIX, b"foo"); - jdb.emplace(bar.clone(), EMPTY_PREFIX, DBValue::from_slice(b"bar")); + jdb.emplace(bar.clone(), EMPTY_PREFIX, b"bar".to_vec()); commit_batch(&mut jdb, 0, &keccak(b"0"), None).unwrap(); assert!(jdb.can_reconstruct_refs()); foo @@ -1053,7 +1053,7 @@ mod tests { let key = jdb.insert(EMPTY_PREFIX, b"dog"); inject_batch(&mut jdb).unwrap(); - assert_eq!(jdb.get(&key, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"dog")); + assert_eq!(jdb.get(&key, EMPTY_PREFIX).unwrap(), b"dog".to_vec()); jdb.remove(&key, EMPTY_PREFIX); inject_batch(&mut jdb).unwrap(); diff --git a/util/journaldb/src/overlaydb.rs b/util/journaldb/src/overlaydb.rs index 620d8c9fd5c..8953043329a 100644 --- a/util/journaldb/src/overlaydb.rs +++ b/util/journaldb/src/overlaydb.rs @@ -72,7 +72,7 @@ impl Decodable for Payload { fn decode(rlp: &Rlp) -> Result { let payload = Payload { count: rlp.val_at(0)?, - value: DBValue::from_slice(rlp.at(1)?.data()?), + value: rlp.at(1)?.data()?.to_vec(), }; Ok(payload) @@ -251,7 +251,7 @@ mod tests { fn overlaydb_overlay_insert_and_remove() { let mut trie = OverlayDB::new_temp(); let h = trie.insert(EMPTY_PREFIX, b"hello world"); - assert_eq!(trie.get(&h, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"hello world")); + assert_eq!(trie.get(&h, EMPTY_PREFIX).unwrap(), b"hello world".to_vec()); trie.remove(&h, EMPTY_PREFIX); assert_eq!(trie.get(&h, EMPTY_PREFIX), None); } @@ -260,9 +260,9 @@ mod tests { fn overlaydb_backing_insert_revert() { let mut trie = OverlayDB::new_temp(); let h = trie.insert(EMPTY_PREFIX, b"hello world"); - assert_eq!(trie.get(&h, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"hello world")); + assert_eq!(trie.get(&h, EMPTY_PREFIX).unwrap(), b"hello world".to_vec()); trie.commit().unwrap(); - assert_eq!(trie.get(&h, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"hello world")); + assert_eq!(trie.get(&h, EMPTY_PREFIX).unwrap(), b"hello world".to_vec()); } #[test] @@ -300,29 +300,29 @@ mod tests { fn overlaydb_complex() { let mut trie = OverlayDB::new_temp(); let hfoo = trie.insert(EMPTY_PREFIX, b"foo"); - assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"foo")); + assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), b"foo".to_vec()); let hbar = trie.insert(EMPTY_PREFIX, b"bar"); - assert_eq!(trie.get(&hbar, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"bar")); + assert_eq!(trie.get(&hbar, EMPTY_PREFIX).unwrap(), b"bar".to_vec()); trie.commit().unwrap(); - assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"foo")); - assert_eq!(trie.get(&hbar, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"bar")); + assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), b"foo".to_vec()); + assert_eq!(trie.get(&hbar, EMPTY_PREFIX).unwrap(), b"bar".to_vec()); trie.insert(EMPTY_PREFIX, b"foo"); // two refs - assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"foo")); + assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), b"foo".to_vec()); trie.commit().unwrap(); - assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"foo")); - assert_eq!(trie.get(&hbar, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"bar")); + assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), b"foo".to_vec()); + assert_eq!(trie.get(&hbar, EMPTY_PREFIX).unwrap(), b"bar".to_vec()); trie.remove(&hbar, EMPTY_PREFIX); // zero refs - delete assert_eq!(trie.get(&hbar, EMPTY_PREFIX), None); trie.remove(&hfoo, EMPTY_PREFIX); // one ref - keep - assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"foo")); + assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), b"foo".to_vec()); trie.commit().unwrap(); - assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"foo")); + assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), b"foo".to_vec()); trie.remove(&hfoo, EMPTY_PREFIX); // zero ref - would delete, but... assert_eq!(trie.get(&hfoo, EMPTY_PREFIX), None); trie.insert(EMPTY_PREFIX, b"foo"); // one ref - keep after all. - assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"foo")); + assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), b"foo".to_vec()); trie.commit().unwrap(); - assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"foo")); + assert_eq!(trie.get(&hfoo, EMPTY_PREFIX).unwrap(), b"foo".to_vec()); trie.remove(&hfoo, EMPTY_PREFIX); // zero ref - delete assert_eq!(trie.get(&hfoo, EMPTY_PREFIX), None); trie.commit().unwrap(); // diff --git a/util/journaldb/src/overlayrecentdb.rs b/util/journaldb/src/overlayrecentdb.rs index 696b3958e52..119a776e8e4 100644 --- a/util/journaldb/src/overlayrecentdb.rs +++ b/util/journaldb/src/overlayrecentdb.rs @@ -88,7 +88,7 @@ impl Decodable for DatabaseValue { let id = rlp.val_at(0)?; let inserts = rlp.at(1)?.iter().map(|r| { let k = r.val_at(0)?; - let v = DBValue::from_slice(r.at(1)?.data()?); + let v = r.at(1)?.data()?.to_vec(); Ok((k, v)) }).collect::, _>>()?; let deletes = rlp.list_at(2)?; @@ -281,9 +281,10 @@ impl JournalDB for OverlayRecentDB { fn state(&self, key: &H256) -> Option { let journal_overlay = self.journal_overlay.read(); let key = to_short_key(key); - journal_overlay.backing_overlay.get(&key, EMPTY_PREFIX).map(|v| v.into_vec()) - .or_else(|| journal_overlay.pending_overlay.get(&key).map(|d| d.clone().into_vec())) - .or_else(|| self.backing.get_by_prefix(self.column, &key[0..DB_PREFIX_LEN]).map(|b| b.into_vec())) + // todo[dvdplm] check that this is right + journal_overlay.backing_overlay.get(&key, EMPTY_PREFIX) //.map(|v| v.into_vec()) + .or_else(|| journal_overlay.pending_overlay.get(&key).map(|d| d.clone())) + .or_else(|| self.backing.get_by_prefix(self.column, &key[0..DB_PREFIX_LEN]).map(|b| b.to_vec())) } fn journal_under(&mut self, batch: &mut DBTransaction, now: u64, id: &H256) -> io::Result { @@ -749,7 +750,7 @@ mod tests { let mut jdb = OverlayRecentDB::new(shared_db.clone(), 0); // history is 1 let foo = jdb.insert(EMPTY_PREFIX, b"foo"); - jdb.emplace(bar.clone(), EMPTY_PREFIX, DBValue::from_slice(b"bar")); + jdb.emplace(bar.clone(), EMPTY_PREFIX, b"bar".to_vec()); commit_batch(&mut jdb, 0, &keccak(b"0"), None).unwrap(); assert!(jdb.can_reconstruct_refs()); foo @@ -1018,7 +1019,7 @@ mod tests { let key = jdb.insert(EMPTY_PREFIX, b"dog"); inject_batch(&mut jdb).unwrap(); - assert_eq!(jdb.get(&key, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"dog")); + assert_eq!(jdb.get(&key, EMPTY_PREFIX).unwrap(), b"dog".to_vec()); jdb.remove(&key, EMPTY_PREFIX); inject_batch(&mut jdb).unwrap(); diff --git a/util/journaldb/src/refcounteddb.rs b/util/journaldb/src/refcounteddb.rs index c6dec7aa89e..71197458606 100644 --- a/util/journaldb/src/refcounteddb.rs +++ b/util/journaldb/src/refcounteddb.rs @@ -342,7 +342,7 @@ mod tests { let key = jdb.insert(EMPTY_PREFIX, b"dog"); inject_batch(&mut jdb).unwrap(); - assert_eq!(jdb.get(&key, EMPTY_PREFIX).unwrap(), DBValue::from_slice(b"dog")); + assert_eq!(jdb.get(&key, EMPTY_PREFIX).unwrap(), b"dog".to_vec()); jdb.remove(&key, EMPTY_PREFIX); inject_batch(&mut jdb).unwrap(); diff --git a/util/memory-cache/Cargo.toml b/util/memory-cache/Cargo.toml index cfa4d3073b7..a5bc356f314 100644 --- a/util/memory-cache/Cargo.toml +++ b/util/memory-cache/Cargo.toml @@ -6,5 +6,5 @@ description = "An LRU-cache which operates on memory used" license = "GPL3" [dependencies] -parity-util-mem = "0.2.1" +parity-util-mem = "0.3.0" lru-cache = "0.1" diff --git a/util/migration-rocksdb/Cargo.toml b/util/migration-rocksdb/Cargo.toml index b88f6c137de..a6d3c3c620b 100644 --- a/util/migration-rocksdb/Cargo.toml +++ b/util/migration-rocksdb/Cargo.toml @@ -6,8 +6,8 @@ authors = ["Parity Technologies "] [dependencies] log = "0.4" macros = { path = "../macros" } -kvdb = "0.1" -kvdb-rocksdb = "0.2.0" +kvdb = "0.2" +kvdb-rocksdb = "0.3.0" [dev-dependencies] tempdir = "0.3" diff --git a/util/network-devp2p/Cargo.toml b/util/network-devp2p/Cargo.toml index f019334b97b..e5d49217892 100644 --- a/util/network-devp2p/Cargo.toml +++ b/util/network-devp2p/Cargo.toml @@ -32,6 +32,7 @@ parity-snappy = "0.1" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" lru-cache = "0.1" +natpmp = "0.2" [dev-dependencies] env_logger = "0.5" diff --git a/util/network-devp2p/src/host.rs b/util/network-devp2p/src/host.rs index 47c2d5321c9..bc8242ca094 100644 --- a/util/network-devp2p/src/host.rs +++ b/util/network-devp2p/src/host.rs @@ -461,7 +461,7 @@ impl Host { let public_address = select_public_address(local_endpoint.address.port()); let public_endpoint = NodeEndpoint { address: public_address, udp_port: local_endpoint.udp_port }; if self.info.read().config.nat_enabled { - match map_external_address(&local_endpoint) { + match map_external_address(&local_endpoint, &self.info.read().config.nat_type) { Some(endpoint) => { info!("NAT mapped to external address {}", endpoint.address); endpoint diff --git a/util/network-devp2p/src/ip_utils.rs b/util/network-devp2p/src/ip_utils.rs index 0a599155d32..dbed727879e 100644 --- a/util/network-devp2p/src/ip_utils.rs +++ b/util/network-devp2p/src/ip_utils.rs @@ -22,10 +22,17 @@ use std::time::Duration; use igd::{PortMappingProtocol, search_gateway, SearchOptions}; use ipnetwork::IpNetwork; -use log::debug; +use log::{trace, debug}; +use natpmp::{Natpmp, Protocol, Response}; +use network::NatType; use crate::node_table::NodeEndpoint; +const NAT_PMP_PORT_MAPPING_LIFETIME: u32 = 30; +// Waiting duration in milliseconds for response from router after sending port mapping request. +// 50 milliseconds might be enough for low RTT. +const NAT_PMP_PORT_MAPPING_WAITING_DURATION: u64 = 50; + /// Socket address extension for rustc beta. To be replaces with now unstable API pub trait SocketAddrExt { /// Returns true if the address appears to be globally routable. @@ -310,20 +317,20 @@ pub fn select_public_address(port: u16) -> SocketAddr { SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), port)) } -pub fn map_external_address(local: &NodeEndpoint) -> Option { +fn search_upnp(local: &NodeEndpoint) -> Option { if let SocketAddr::V4(ref local_addr) = local.address { let local_ip = *local_addr.ip(); let local_port = local_addr.port(); let local_udp_port = local.udp_port; + let search_options = SearchOptions { + timeout: Some(Duration::new(5, 0)), + // igd 0.7 used port 0 by default. + // Let's not change this behaviour + bind_addr: SocketAddr::V4(SocketAddrV4::new(local_ip, 0)), + ..Default::default() + }; let search_gateway_child = ::std::thread::spawn(move || { - let search_options = SearchOptions { - timeout: Some(Duration::new(5, 0)), - // igd 0.7 used port 0 by default. - // Let's not change this behaviour - bind_addr: SocketAddr::V4(SocketAddrV4::new(local_ip, 0)), - ..Default::default() - }; match search_gateway(search_options) { Err(ref err) => debug!("Gateway search error: {}", err), Ok(gateway) => { @@ -358,6 +365,82 @@ pub fn map_external_address(local: &NodeEndpoint) -> Option { None } +fn search_natpmp(local: &NodeEndpoint) -> Option { + if let SocketAddr::V4(ref local_addr) = local.address { + let local_port = local_addr.port(); + let local_udp_port = local.udp_port; + + let search_gateway_child = ::std::thread::spawn(move || { + let mut n = Natpmp::new()?; + + // this function call want to receive `Response::Gateway` response from router, if other then it is an Error. + n.send_public_address_request()?; + ::std::thread::sleep(Duration::from_millis(NAT_PMP_PORT_MAPPING_WAITING_DURATION)); + let gw = match n.read_response_or_retry() { + Ok(Response::Gateway(gw)) => Ok(gw), + Err(e) => { + debug!(target: "network", "IP request error: {}", e); + Err(e) + }, + _ => Err(natpmp::Error::NATPMP_ERR_UNDEFINEDERROR.into()) + }?; + + // this function call want to receive `Response::TCP` response from router, if other then it is an Error. + n.send_port_mapping_request(Protocol::TCP, local_port, local_port, NAT_PMP_PORT_MAPPING_LIFETIME)?; + ::std::thread::sleep(Duration::from_millis(NAT_PMP_PORT_MAPPING_WAITING_DURATION)); + let tcp_r = match n.read_response_or_retry() { + Ok(Response::TCP(tcp)) => Ok(tcp), + Err(e) => { + debug!(target: "network", "Port mapping for TCP error: {}", e); + Err(e) + }, + _ => Err(natpmp::Error::NATPMP_ERR_UNDEFINEDERROR.into()) + }?; + + // this function call want to receive `Response::UDP` response from router, if other then it is an Error. + n.send_port_mapping_request(Protocol::UDP, local_udp_port, local_udp_port, NAT_PMP_PORT_MAPPING_LIFETIME)?; + ::std::thread::sleep(Duration::from_millis(NAT_PMP_PORT_MAPPING_WAITING_DURATION)); + let udp_r = match n.read_response_or_retry() { + Ok(Response::UDP(udp)) => Ok(udp), + Err(e) => { + debug!(target: "network", "Port mapping for UDP error: {}", e); + Err(e) + }, + _ => Err(natpmp::Error::NATPMP_ERR_UNDEFINEDERROR.into()) + }?; + + Ok(NodeEndpoint { + address: SocketAddr::V4(SocketAddrV4::new(*gw.public_address(), tcp_r.public_port())), + udp_port: udp_r.public_port() + }) + }); + + return search_gateway_child.join().ok()? + .map_err(|e: natpmp::Error| debug!(target: "network", "NAT PMP port mapping error: {:?}", e)) + .ok(); + } + None +} + +/// Port mapping using ether UPnP or Nat-PMP. +/// NAT PMP has higher priority than UPnP. +pub fn map_external_address(local: &NodeEndpoint, nat_type: &NatType) -> Option { + match *nat_type { + NatType::Any => { + match search_natpmp(local) { + Some(end_point) => Some(end_point), + None => search_upnp(local), + } + }, + NatType::NatPMP => search_natpmp(local), + NatType::UPnP => search_upnp(local), + _ => { + trace!(target: "network", "Can't map external address using NAT"); + None + } + } +} + #[test] fn can_select_public_address() { let pub_address = select_public_address(40477); @@ -366,9 +449,16 @@ fn can_select_public_address() { #[ignore] #[test] -fn can_map_external_address_or_fail() { +fn can_map_external_address_upnp_or_fail() { let pub_address = select_public_address(40478); - let _ = map_external_address(&NodeEndpoint { address: pub_address, udp_port: 40478 }); + let _ = map_external_address(&NodeEndpoint { address: pub_address, udp_port: 40478 }, &NatType::UPnP); +} + +#[ignore] +#[test] +fn can_map_external_address_natpmp_or_fail() { + let pub_address = select_public_address(40479); + let _ = map_external_address(&NodeEndpoint { address: pub_address, udp_port: 40479 }, &NatType::NatPMP); } #[test] diff --git a/util/network/src/lib.rs b/util/network/src/lib.rs index e8ec1cf75a7..67ab4f5818c 100644 --- a/util/network/src/lib.rs +++ b/util/network/src/lib.rs @@ -174,6 +174,15 @@ impl Ord for SessionCapabilityInfo { } } +/// Type of NAT resolving method +#[derive(Debug, PartialEq, Eq, Clone)] +pub enum NatType { + Nothing, + Any, + UPnP, + NatPMP, +} + /// Network service configuration #[derive(Debug, PartialEq, Clone)] pub struct NetworkConfiguration { @@ -189,6 +198,8 @@ pub struct NetworkConfiguration { pub udp_port: Option, /// Enable NAT configuration pub nat_enabled: bool, + /// Nat type + pub nat_type: NatType, /// Enable discovery pub discovery_enabled: bool, /// List of initial node addresses @@ -229,6 +240,7 @@ impl NetworkConfiguration { public_address: None, udp_port: None, nat_enabled: true, + nat_type: NatType::Any, discovery_enabled: true, boot_nodes: Vec::new(), use_secret: None, diff --git a/util/patricia-trie-ethereum/Cargo.toml b/util/patricia-trie-ethereum/Cargo.toml index cc7e8ce8fe2..6979a7bfc88 100644 --- a/util/patricia-trie-ethereum/Cargo.toml +++ b/util/patricia-trie-ethereum/Cargo.toml @@ -6,7 +6,7 @@ description = "Merkle-Patricia Trie (Ethereum Style)" license = "GPL-3.0" [dependencies] -trie-db = "0.16.0" +trie-db = "0.18.0" keccak-hasher = { version = "0.1.1", path = "../keccak-hasher" } hash-db = "0.15.0" rlp = "0.4.4" @@ -15,7 +15,7 @@ ethereum-types = "0.8.0" elastic-array = "0.10" [dev-dependencies] -memory-db = "0.15.0" +memory-db = "0.18.0" keccak-hash = "0.4.0" journaldb = { path = "../journaldb" } criterion = "0.3" diff --git a/util/patricia-trie-ethereum/src/lib.rs b/util/patricia-trie-ethereum/src/lib.rs index 0ed733283c5..c2a4f87471b 100644 --- a/util/patricia-trie-ethereum/src/lib.rs +++ b/util/patricia-trie-ethereum/src/lib.rs @@ -78,7 +78,7 @@ impl trie_db::TrieLayout for Layout { /// TrieDBMut::new(&mut memdb, &mut root).insert(b"foo", b"bar").unwrap(); /// let t = TrieDB::new(&memdb, &root).unwrap(); /// assert!(t.contains(b"foo").unwrap()); -/// assert_eq!(t.get(b"foo").unwrap().unwrap(), DBValue::from_slice(b"bar")); +/// assert_eq!(t.get(b"foo").unwrap().unwrap(), b"bar".to_vec()); /// } /// ``` pub type TrieDB<'db> = trie::TrieDB<'db, Layout>; @@ -125,7 +125,7 @@ pub type FatDB<'db> = trie::FatDB<'db, Layout>; /// assert_eq!(*t.root(), KECCAK_NULL_RLP); /// t.insert(b"foo", b"bar").unwrap(); /// assert!(t.contains(b"foo").unwrap()); -/// assert_eq!(t.get(b"foo").unwrap().unwrap(), DBValue::from_slice(b"bar")); +/// assert_eq!(t.get(b"foo").unwrap().unwrap(), b"bar".to_vec()); /// t.remove(b"foo").unwrap(); /// assert!(!t.contains(b"foo").unwrap()); /// }