diff --git a/.travis.yml b/.travis.yml
index b2859589b..6ab9a08b9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,10 +9,14 @@ branches:
- /^beta$/
- /^stable$/
matrix:
- fast_finish: true
- include:
+ fast_finish: false
+ allow_failures:
- rust: nightly
- env: FEATURES="--features ethcore/json-tests" KCOV_FEATURES="" TARGETS="-p ethash -p ethcore-util -p ethcore -p ethsync -p ethcore-rpc -p parity" ARCHIVE_SUFFIX="-${TRAVIS_OS_NAME}-${TRAVIS_TAG}"
+ include:
+ - rust: beta
+ env: FEATURES="--features travis-beta" KCOV_FEATURES="" TARGETS="-p ethash -p ethcore-util -p ethcore -p ethsync -p ethcore-rpc -p parity" ARCHIVE_SUFFIX="-${TRAVIS_OS_NAME}-${TRAVIS_TAG}"
+ - rust: nightly
+ env: FEATURES="--features travis-nightly" KCOV_FEATURES="" TARGETS="-p ethash -p ethcore-util -p ethcore -p ethsync -p ethcore-rpc -p parity" ARCHIVE_SUFFIX="-${TRAVIS_OS_NAME}-${TRAVIS_TAG}"
cache:
apt: true
directories:
@@ -20,6 +24,7 @@ cache:
- target/debug/build
- target/release/deps
- target/release/build
+ - $HOME/.cargo
addons:
apt:
packages:
@@ -33,7 +38,7 @@ before_script: |
script:
- cargo build --release --verbose ${FEATURES}
- cargo test --release --verbose ${FEATURES} ${TARGETS}
-- cargo bench --no-run ${FEATURES} ${TARGETS}
+#- cargo bench --no-run ${FEATURES} ${TARGETS}
- tar cvzf parity${ARCHIVE_SUFFIX}.tar.gz -C target/release parity
after_success: |
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
@@ -47,7 +52,7 @@ after_success: |
./kcov-master/tmp/usr/local/bin/kcov --coveralls-id=${TRAVIS_JOB_ID} --exclude-pattern /.cargo,/root/.multirust target/kcov target/debug/parity-* &&
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
- [ $TRAVIS_RUST_VERSION = nightly ] &&
+ [ $TRAVIS_RUST_VERSION = beta ] &&
cargo doc --no-deps --verbose ${KCOV_FEATURES} ${TARGETS} &&
echo '' > target/doc/index.html &&
pip install --user ghp-import &&
diff --git a/Cargo.lock b/Cargo.lock
index 1e9f57900..b69736c2e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2,10 +2,10 @@
name = "parity"
version = "0.9.99"
dependencies = [
- "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
"ctrlc 1.0.1 (git+https://github.com/tomusdrw/rust-ctrlc.git)",
+ "daemonize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"docopt 0.6.78 (registry+https://github.com/rust-lang/crates.io-index)",
- "docopt_macros 0.6.81 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 0.9.99",
"ethcore-rpc 0.9.99",
@@ -19,7 +19,7 @@ dependencies = [
[[package]]
name = "aho-corasick"
-version = "0.5.0"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"memchr 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -36,8 +36,11 @@ dependencies = [
[[package]]
name = "aster"
-version = "0.12.0"
+version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "syntex_syntax 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "bitflags"
@@ -61,11 +64,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "clippy"
-version = "0.0.41"
+version = "0.0.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"regex-syntax 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "semver 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -108,6 +111,14 @@ dependencies = [
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
+[[package]]
+name = "daemonize"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
[[package]]
name = "docopt"
version = "0.6.78"
@@ -118,14 +129,6 @@ dependencies = [
"strsim 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "docopt_macros"
-version = "0.6.81"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "docopt 0.6.78 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "elastic-array"
version = "0.4.0"
@@ -143,14 +146,14 @@ dependencies = [
[[package]]
name = "eth-secp256k1"
version = "0.5.4"
-source = "git+https://github.com/arkpar/rust-secp256k1.git#321e6c22a83606d1875f89cb61c9cb37c7d249ae"
+source = "git+https://github.com/arkpar/rust-secp256k1.git#45503e1de68d909b1862e3f2bdb9e1cdfdff3f1e"
dependencies = [
"arrayvec 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"gcc 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -159,7 +162,6 @@ name = "ethash"
version = "0.9.99"
dependencies = [
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "lru-cache 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"sha3 0.1.0",
]
@@ -167,12 +169,12 @@ dependencies = [
name = "ethcore"
version = "0.9.99"
dependencies = [
- "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ethash 0.9.99",
"ethcore-util 0.9.99",
- "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "heapsize 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -186,16 +188,17 @@ dependencies = [
name = "ethcore-rpc"
version = "0.9.99"
dependencies = [
- "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 0.9.99",
"ethcore-util 0.9.99",
"ethsync 0.9.99",
- "jsonrpc-core 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "jsonrpc-core 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonrpc-http-server 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_codegen 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_macros 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
"target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -204,12 +207,12 @@ name = "ethcore-util"
version = "0.9.99"
dependencies = [
"arrayvec 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"elastic-array 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"eth-secp256k1 0.5.4 (git+https://github.com/arkpar/rust-secp256k1.git)",
- "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "heapsize 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"igd 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"json-tests 0.1.0",
@@ -220,7 +223,7 @@ dependencies = [
"rocksdb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
"sha3 0.1.0",
"slab 0.1.4 (git+https://github.com/arkpar/slab.git)",
"target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -232,7 +235,7 @@ dependencies = [
name = "ethsync"
version = "0.9.99"
dependencies = [
- "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 0.9.99",
"ethcore-util 0.9.99",
@@ -260,11 +263,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "heapsize"
-version = "0.2.5"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
-]
[[package]]
name = "hpack"
@@ -346,12 +346,13 @@ dependencies = [
[[package]]
name = "jsonrpc-core"
-version = "1.1.2"
+version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "serde 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_codegen 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_macros 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -360,7 +361,7 @@ version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"hyper 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "jsonrpc-core 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "jsonrpc-core 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -397,11 +398,6 @@ name = "libc"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-[[package]]
-name = "linked-hash-map"
-version = "0.0.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
[[package]]
name = "log"
version = "0.3.5"
@@ -410,14 +406,6 @@ dependencies = [
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "lru-cache"
-version = "0.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "linked-hash-map 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "matches"
version = "0.1.2"
@@ -437,7 +425,7 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -503,7 +491,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "num"
-version = "0.1.30"
+version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -527,23 +515,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "quasi"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "quasi_codegen"
-version = "0.6.0"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "aster 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syntex_syntax 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
-name = "quasi_macros"
-version = "0.6.0"
+name = "quasi_codegen"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "quasi_codegen 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "aster 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syntex_syntax 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -559,7 +544,7 @@ name = "regex"
version = "0.1.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "aho-corasick 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "aho-corasick 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -597,7 +582,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc_version"
-version = "0.1.6"
+version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -610,7 +595,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "semver"
-version = "0.2.2"
+version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"nom 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -618,20 +603,22 @@ dependencies = [
[[package]]
name = "serde"
-version = "0.6.13"
+version = "0.6.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "num 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde_codegen"
-version = "0.6.13"
+version = "0.6.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "aster 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "quasi 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "quasi_macros 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "aster 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quasi_codegen 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syntex_syntax 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -639,16 +626,8 @@ name = "serde_json"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "num 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "serde_macros"
-version = "0.6.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "serde_codegen 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -682,11 +661,41 @@ name = "strsim"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+[[package]]
+name = "syntex"
+version = "0.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "syntex_syntax 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "syntex_syntax"
+version = "0.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
[[package]]
name = "target_info"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+[[package]]
+name = "term"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
[[package]]
name = "time"
version = "0.1.34"
@@ -717,7 +726,7 @@ name = "unicase"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "rustc_version 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -733,6 +742,11 @@ name = "unicode-normalization"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+[[package]]
+name = "unicode-xid"
+version = "0.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
[[package]]
name = "url"
version = "0.2.38"
diff --git a/Cargo.toml b/Cargo.toml
index c58cacf0d..5b59b26f1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,19 +10,22 @@ log = "0.3"
env_logger = "0.3"
rustc-serialize = "0.3"
docopt = "0.6"
-docopt_macros = "0.6"
ctrlc = { git = "https://github.com/tomusdrw/rust-ctrlc.git" }
-clippy = "0.0.41"
+clippy = { version = "0.0.42", optional = true }
ethcore-util = { path = "util" }
ethcore = { path = "ethcore" }
ethsync = { path = "sync" }
ethcore-rpc = { path = "rpc", optional = true }
fdlimit = { path = "util/fdlimit" }
target_info = "0.1"
+daemonize = "0.2"
[features]
default = ["rpc"]
rpc = ["ethcore-rpc"]
+dev = ["clippy", "ethcore/dev", "ethcore-util/dev", "ethsync/dev", "ethcore-rpc/dev"]
+travis-beta = ["ethcore/json-tests"]
+travis-nightly = ["ethcore/json-tests", "dev"]
[[bin]]
path = "parity/main.rs"
diff --git a/README.md b/README.md
index 2ffb28f45..b840195d8 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# ethcore
-[![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Join the chat at https://gitter.im/trogdoro/xiki][gitter-image]][gitter-url]
+[![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Join the chat at https://gitter.im/trogdoro/xiki][gitter-image]][gitter-url] [![GPLv3][license-image]][license-url]
[travis-image]: https://travis-ci.org/ethcore/parity.svg?branch=master
[travis-url]: https://travis-ci.org/ethcore/parity
@@ -8,6 +8,8 @@
[coveralls-url]: https://coveralls.io/github/ethcore/parity?branch=master
[gitter-image]: https://badges.gitter.im/Join%20Chat.svg
[gitter-url]: https://gitter.im/ethcore/parity?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
+[license-image]: https://img.shields.io/badge/license-GPL%20v3-green.svg
+[license-url]: http://www.gnu.org/licenses/gpl-3.0.en.html
[Documentation](http://ethcore.github.io/parity/ethcore/index.html)
@@ -24,9 +26,8 @@ apt-get install -y --force-yes librocksdb-dev
# install multirust
curl -sf https://raw.githubusercontent.com/brson/multirust/master/blastoff.sh | sh -s -- --yes
-# install nightly and make it default
-multirust update nightly
-multirust default nightly
+# install beta and make it default
+multirust default beta
# download and build parity
git clone https://github.com/ethcore/parity
@@ -45,12 +46,11 @@ sudo cp -a librocksdb.so* /usr/lib
sudo ldconfig
cd ..
-# install rust nightly
+# install rust beta
curl -sf https://raw.githubusercontent.com/brson/multirust/master/blastoff.sh | sudo sh -s -- --yes
-# install nightly and make it default
-sudo multirust update nightly
-sudo multirust default nightly
+# install beta and make it default
+sudo multirust default beta
# download and build parity
git clone https://github.com/ethcore/parity
@@ -66,8 +66,8 @@ brew update
brew install rocksdb
brew install multirust
-# install nightly and make it default
-multirust update nightly && multirust default nightly
+# install beta and make it default
+multirust default beta
# download and build parity
git clone https://github.com/ethcore/parity
diff --git a/ethash/Cargo.toml b/ethash/Cargo.toml
index 4bba71a14..da08b9f92 100644
--- a/ethash/Cargo.toml
+++ b/ethash/Cargo.toml
@@ -7,5 +7,4 @@ authors = ["arkpar ,
+ recent: Option>,
+ prev_epoch: Option,
+ prev: Option>,
+}
+
/// Lighy/Full cache manager
pub struct EthashManager {
- lights: Mutex>>
+ cache: Mutex,
}
impl EthashManager {
/// Create a new new instance of ethash manager
pub fn new() -> EthashManager {
EthashManager {
- lights: Mutex::new(LruCache::new(2))
+ cache: Mutex::new(LightCache {
+ recent_epoch: None,
+ recent: None,
+ prev_epoch: None,
+ prev: None,
+ }),
}
}
@@ -50,8 +61,24 @@ impl EthashManager {
pub fn compute_light(&self, block_number: u64, header_hash: &H256, nonce: u64) -> ProofOfWork {
let epoch = block_number / ETHASH_EPOCH_LENGTH;
let light = {
- let mut lights = self.lights.lock().unwrap();
- match lights.get_mut(&epoch).map(|l| l.clone()) {
+ let mut lights = self.cache.lock().unwrap();
+ let light = match lights.recent_epoch.clone() {
+ Some(ref e) if *e == epoch => lights.recent.clone(),
+ _ => match lights.prev_epoch.clone() {
+ Some(e) if e == epoch => {
+ // swap
+ let t = lights.prev_epoch;
+ lights.prev_epoch = lights.recent_epoch;
+ lights.recent_epoch = t;
+ let t = lights.prev.clone();
+ lights.prev = lights.recent.clone();
+ lights.recent = t;
+ lights.recent.clone()
+ }
+ _ => None,
+ }
+ };
+ match light {
None => {
let light = match Light::from_file(block_number) {
Ok(light) => Arc::new(light),
@@ -64,7 +91,8 @@ impl EthashManager {
Arc::new(light)
}
};
- lights.insert(epoch, light.clone());
+ lights.prev_epoch = mem::replace(&mut lights.recent_epoch, Some(epoch));
+ lights.prev = mem::replace(&mut lights.recent, Some(light.clone()));
light
}
Some(light) => light
@@ -73,3 +101,19 @@ impl EthashManager {
light.compute(header_hash, nonce)
}
}
+
+#[test]
+fn test_lru() {
+ let ethash = EthashManager::new();
+ let hash = [0u8; 32];
+ ethash.compute_light(1, &hash, 1);
+ ethash.compute_light(50000, &hash, 1);
+ assert_eq!(ethash.cache.lock().unwrap().recent_epoch.unwrap(), 1);
+ assert_eq!(ethash.cache.lock().unwrap().prev_epoch.unwrap(), 0);
+ ethash.compute_light(1, &hash, 1);
+ assert_eq!(ethash.cache.lock().unwrap().recent_epoch.unwrap(), 0);
+ assert_eq!(ethash.cache.lock().unwrap().prev_epoch.unwrap(), 1);
+ ethash.compute_light(70000, &hash, 1);
+ assert_eq!(ethash.cache.lock().unwrap().recent_epoch.unwrap(), 2);
+ assert_eq!(ethash.cache.lock().unwrap().prev_epoch.unwrap(), 0);
+}
diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml
index 3d4d27520..090280cae 100644
--- a/ethcore/Cargo.toml
+++ b/ethcore/Cargo.toml
@@ -11,14 +11,14 @@ log = "0.3"
env_logger = "0.3"
rustc-serialize = "0.3"
rocksdb = "0.3"
-heapsize = "0.2.0"
+heapsize = "0.3"
rust-crypto = "0.2.34"
time = "0.1"
ethcore-util = { path = "../util" }
evmjit = { path = "../evmjit", optional = true }
ethash = { path = "../ethash" }
num_cpus = "0.2"
-clippy = "0.0.41"
+clippy = { version = "0.0.42", optional = true }
crossbeam = "0.1.5"
lazy_static = "0.1"
@@ -27,3 +27,5 @@ jit = ["evmjit"]
evm-debug = []
json-tests = []
test-heavy = []
+dev = ["clippy"]
+default = []
diff --git a/ethcore/src/block.rs b/ethcore/src/block.rs
index c03417dc1..d72fbd1ae 100644
--- a/ethcore/src/block.rs
+++ b/ethcore/src/block.rs
@@ -267,7 +267,7 @@ impl<'x, 'y> OpenBlock<'x, 'y> {
s.block.base.header.uncles_hash = uncle_bytes.sha3();
s.block.base.header.state_root = s.block.state.root().clone();
s.block.base.header.receipts_root = ordered_trie_root(s.block.receipts.iter().map(|ref r| r.rlp_bytes().to_vec()).collect());
- s.block.base.header.log_bloom = s.block.receipts.iter().fold(LogBloom::zero(), |mut b, r| {b |= &r.log_bloom; b});
+ s.block.base.header.log_bloom = s.block.receipts.iter().fold(LogBloom::zero(), |mut b, r| {b = &b | &r.log_bloom; b}); //TODO: use |= operator
s.block.base.header.gas_used = s.block.receipts.last().map_or(U256::zero(), |r| r.gas_used);
s.block.base.header.note_dirty();
diff --git a/ethcore/src/client.rs b/ethcore/src/client.rs
index ba34d9a5e..cc51bf1c3 100644
--- a/ethcore/src/client.rs
+++ b/ethcore/src/client.rs
@@ -170,7 +170,7 @@ impl ClientReport {
pub fn accrue_block(&mut self, block: &PreVerifiedBlock) {
self.blocks_imported += 1;
self.transactions_applied += block.transactions.len();
- self.gas_processed += block.header.gas_used;
+ self.gas_processed = self.gas_processed + block.header.gas_used;
}
}
diff --git a/ethcore/src/evm/interpreter.rs b/ethcore/src/evm/interpreter.rs
index 50c0377ac..7efd79d00 100644
--- a/ethcore/src/evm/interpreter.rs
+++ b/ethcore/src/evm/interpreter.rs
@@ -299,7 +299,7 @@ impl evm::Evm for Interpreter {
let (gas_cost, mem_size) = try!(self.get_gas_cost_mem(ext, instruction, &mut mem, &stack));
try!(self.verify_gas(¤t_gas, &gas_cost));
mem.expand(mem_size);
- current_gas -= gas_cost;
+ current_gas = current_gas - gas_cost; //TODO: use operator -=
evm_debug!({
println!("[0x{:x}][{}(0x{:x}) Gas: {:x}\n Gas Before: {:x}",
@@ -320,7 +320,7 @@ impl evm::Evm for Interpreter {
match result {
InstructionResult::Ok => {},
InstructionResult::UnusedGas(gas) => {
- current_gas += gas;
+ current_gas = current_gas + gas; //TODO: use operator +=
},
InstructionResult::UseAllGas => {
current_gas = U256::zero();
diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs
index ab3378d7f..83529ecf9 100644
--- a/ethcore/src/lib.rs
+++ b/ethcore/src/lib.rs
@@ -15,11 +15,8 @@
// along with Parity. If not, see .
#![warn(missing_docs)]
-#![feature(cell_extras)]
-#![feature(augmented_assignments)]
-#![feature(plugin)]
-// Clippy
-#![plugin(clippy)]
+#![cfg_attr(feature="dev", feature(plugin))]
+#![cfg_attr(feature="dev", plugin(clippy))]
// TODO [todr] not really sure
#![allow(needless_range_loop)]
// Shorter than if-else
@@ -27,7 +24,6 @@
// Keeps consistency (all lines with `.clone()`) and helpful when changing ref to non-ref.
#![allow(clone_on_copy)]
-
//! Ethcore library
//!
//! ### Rust version:
diff --git a/ethcore/src/receipt.rs b/ethcore/src/receipt.rs
index 1ec52c592..ae83a174a 100644
--- a/ethcore/src/receipt.rs
+++ b/ethcore/src/receipt.rs
@@ -39,7 +39,7 @@ impl Receipt {
Receipt {
state_root: state_root,
gas_used: gas_used,
- log_bloom: logs.iter().fold(LogBloom::new(), |mut b, l| { b |= &l.bloom(); b }),
+ log_bloom: logs.iter().fold(LogBloom::new(), |mut b, l| { b = &b | &l.bloom(); b }), //TODO: use |= operator
logs: logs,
}
}
diff --git a/ethcore/src/service.rs b/ethcore/src/service.rs
index 5e68efae9..2fc246025 100644
--- a/ethcore/src/service.rs
+++ b/ethcore/src/service.rs
@@ -124,6 +124,8 @@ impl IoHandler for ClientIoHandler {
}
}
+// TODO: rewrite into something that doesn't dependent on the testing environment having a particular port ready for use.
+/*
#[cfg(test)]
mod tests {
use super::*;
@@ -138,3 +140,4 @@ mod tests {
assert!(service.is_ok());
}
}
+*/
\ No newline at end of file
diff --git a/ethcore/src/state.rs b/ethcore/src/state.rs
index 00886b89c..3eaedb9bf 100644
--- a/ethcore/src/state.rs
+++ b/ethcore/src/state.rs
@@ -282,7 +282,7 @@ impl State {
/// Pull account `a` in our cache from the trie DB and return it.
/// `require_code` requires that the code be cached, too.
- fn get(&self, a: &Address, require_code: bool) -> Ref