From c0e32bac0e72a97a4feecd4b2add098d8fa105c4 Mon Sep 17 00:00:00 2001 From: arkpar Date: Thu, 12 Oct 2017 18:11:51 +0200 Subject: [PATCH 1/3] v1.7.5 --- Cargo.lock | 50 +++++++++++++++++++++++----------------------- Cargo.toml | 2 +- mac/Parity.pkgproj | 2 +- nsis/installer.nsi | 2 +- util/Cargo.toml | 2 +- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f7d671636..1cbbb8903 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -277,7 +277,7 @@ dependencies = [ name = "common-types" version = "0.1.0" dependencies = [ - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "ethjson 0.1.0", "rlp 0.2.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -476,7 +476,7 @@ dependencies = [ "ethcore-ipc-nano 1.7.0", "ethcore-logger 1.7.0", "ethcore-stratum 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "ethjson 0.1.0", "ethkey 0.2.0", "ethstore 0.1.0", @@ -545,7 +545,7 @@ name = "ethcore-ipc" version = "1.7.0" dependencies = [ "ethcore-devtools 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "nanomsg 0.5.1 (git+https://github.com/paritytech/nanomsg.rs.git?branch=parity-1.7)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -594,7 +594,7 @@ dependencies = [ "ethcore-ipc 1.7.0", "ethcore-ipc-codegen 1.7.0", "ethcore-ipc-nano 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "nanomsg 0.5.1 (git+https://github.com/paritytech/nanomsg.rs.git?branch=parity-1.7)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -611,7 +611,7 @@ dependencies = [ "ethcore-ipc 1.7.0", "ethcore-ipc-codegen 1.7.0", "ethcore-network 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "evm 0.1.0", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -650,7 +650,7 @@ dependencies = [ "ethcore-devtools 1.7.0", "ethcore-io 1.7.0", "ethcore-logger 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "ethcrypto 0.1.0", "ethkey 0.2.0", "igd 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -681,7 +681,7 @@ dependencies = [ "ethcore-ipc-codegen 1.7.0", "ethcore-ipc-nano 1.7.0", "ethcore-logger 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "ethcrypto 0.1.0", "ethkey 0.2.0", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -711,7 +711,7 @@ dependencies = [ "ethcore-ipc-codegen 1.7.0", "ethcore-ipc-nano 1.7.0", "ethcore-logger 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-macros 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", @@ -724,7 +724,7 @@ dependencies = [ [[package]] name = "ethcore-util" -version = "1.7.4" +version = "1.7.5" dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", @@ -774,7 +774,7 @@ name = "ethjson" version = "0.1.0" dependencies = [ "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -855,7 +855,7 @@ dependencies = [ "ethcore-ipc-nano 1.7.0", "ethcore-light 1.7.0", "ethcore-network 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "ethkey 0.2.0", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -874,7 +874,7 @@ dependencies = [ "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "common-types 0.1.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "ethjson 0.1.0", "evmjit 1.7.0", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -891,7 +891,7 @@ version = "0.1.0" dependencies = [ "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "ethjson 0.1.0", "evm 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1136,7 +1136,7 @@ version = "1.7.0" dependencies = [ "ethcore-ipc 1.7.0", "ethcore-ipc-codegen 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1530,7 +1530,7 @@ version = "0.1.0" dependencies = [ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "native-contract-generator 0.1.0", ] @@ -1735,7 +1735,7 @@ dependencies = [ [[package]] name = "parity" -version = "1.7.4" +version = "1.7.5" dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_dirs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1755,7 +1755,7 @@ dependencies = [ "ethcore-logger 1.7.0", "ethcore-secretstore 1.0.0", "ethcore-stratum 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "ethkey 0.2.0", "ethsync 1.7.0", "fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1801,7 +1801,7 @@ dependencies = [ "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-devtools 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "fetch 0.1.0", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", @@ -1845,7 +1845,7 @@ name = "parity-hash-fetch" version = "1.7.0" dependencies = [ "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "fetch 0.1.0", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1863,7 +1863,7 @@ version = "1.7.0" dependencies = [ "cid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "jsonrpc-http-server 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "mime 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "multihash 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1876,7 +1876,7 @@ version = "0.1.0" dependencies = [ "ethcore 1.7.0", "ethcore-io 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "ethkey 0.2.0", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", @@ -1906,7 +1906,7 @@ dependencies = [ "ethcore-ipc 1.7.0", "ethcore-light 1.7.0", "ethcore-logger 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "ethcrypto 0.1.0", "ethjson 0.1.0", "ethkey 0.2.0", @@ -1948,7 +1948,7 @@ dependencies = [ name = "parity-rpc-client" version = "1.4.0" dependencies = [ - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-ws-server 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", @@ -2011,7 +2011,7 @@ dependencies = [ "ethcore 1.7.0", "ethcore-ipc 1.7.0", "ethcore-ipc-codegen 1.7.0", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "ethsync 1.7.0", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-common-types 1.7.0", @@ -2367,7 +2367,7 @@ name = "rpc-cli" version = "1.4.0" dependencies = [ "bigint 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-util 1.7.4", + "ethcore-util 1.7.5", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.7.0", "parity-rpc-client 1.4.0", diff --git a/Cargo.toml b/Cargo.toml index af725249b..ecd83513e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] description = "Parity Ethereum client" name = "parity" -version = "1.7.4" +version = "1.7.5" license = "GPL-3.0" authors = ["Parity Technologies "] build = "build.rs" diff --git a/mac/Parity.pkgproj b/mac/Parity.pkgproj index 0ea72a545..53cd2b871 100755 --- a/mac/Parity.pkgproj +++ b/mac/Parity.pkgproj @@ -462,7 +462,7 @@ OVERWRITE_PERMISSIONS VERSION - 1.7.4 + 1.7.5 UUID 2DCD5B81-7BAF-4DA1-9251-6274B089FD36 diff --git a/nsis/installer.nsi b/nsis/installer.nsi index f60d9d9b4..5ad74534a 100644 --- a/nsis/installer.nsi +++ b/nsis/installer.nsi @@ -10,7 +10,7 @@ !define DESCRIPTION "Fast, light, robust Ethereum implementation" !define VERSIONMAJOR 1 !define VERSIONMINOR 7 -!define VERSIONBUILD 4 +!define VERSIONBUILD 5 !define ARGS "--warp" !define FIRST_START_ARGS "ui --warp --mode=passive" diff --git a/util/Cargo.toml b/util/Cargo.toml index 7cf53a15f..7caed66aa 100644 --- a/util/Cargo.toml +++ b/util/Cargo.toml @@ -3,7 +3,7 @@ description = "Ethcore utility library" homepage = "http://parity.io" license = "GPL-3.0" name = "ethcore-util" -version = "1.7.4" +version = "1.7.5" authors = ["Parity Technologies "] build = "build.rs" From 4e93537e45110ea76f244cfed09f0bcd82404502 Mon Sep 17 00:00:00 2001 From: arkpar Date: Tue, 10 Oct 2017 20:30:11 +0200 Subject: [PATCH 2/3] Prevent going offline when restoring or taking snapshot --- ethcore/src/client/client.rs | 14 ++++++++------ ethcore/src/service.rs | 8 ++++++-- ethcore/src/tests/client.rs | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 06d034897..9d359aef6 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -970,9 +970,11 @@ impl Client { /// Tick the client. // TODO: manage by real events. - pub fn tick(&self) { + pub fn tick(&self, prevent_sleep: bool) { self.check_garbage(); - self.check_snooze(); + if !prevent_sleep { + self.check_snooze(); + } } fn check_garbage(&self) { @@ -1079,7 +1081,7 @@ impl Client { if !self.liveness.load(AtomicOrdering::Relaxed) { self.liveness.store(true, AtomicOrdering::Relaxed); self.notify(|n| n.start()); - trace!(target: "mode", "wake_up: Waking."); + info!(target: "mode", "wake_up: Waking."); } } @@ -1089,11 +1091,11 @@ impl Client { if self.queue_info().total_queue_size() <= MAX_QUEUE_SIZE_TO_SLEEP_ON { self.liveness.store(false, AtomicOrdering::Relaxed); self.notify(|n| n.stop()); - trace!(target: "mode", "sleep: Sleeping."); + info!(target: "mode", "sleep: Sleeping."); } else { - trace!(target: "mode", "sleep: Cannot sleep - syncing ongoing."); + info!(target: "mode", "sleep: Cannot sleep - syncing ongoing."); // TODO: Consider uncommenting. - //*self.last_activity.lock() = Some(Instant::now()); + //(*self.sleep_state.lock()).last_activity = Some(Instant::now()); } } } diff --git a/ethcore/src/service.rs b/ethcore/src/service.rs index e4c3d7519..f004d4680 100644 --- a/ethcore/src/service.rs +++ b/ethcore/src/service.rs @@ -23,7 +23,7 @@ use error::*; use client::{Client, ClientConfig, ChainNotify}; use miner::Miner; -use snapshot::ManifestData; +use snapshot::{ManifestData, RestorationStatus}; use snapshot::service::{Service as SnapshotService, ServiceParams as SnapServiceParams}; use std::sync::atomic::AtomicBool; @@ -175,7 +175,11 @@ impl IoHandler for ClientIoHandler { fn timeout(&self, _io: &IoContext, timer: TimerToken) { match timer { - CLIENT_TICK_TIMER => self.client.tick(), + CLIENT_TICK_TIMER => { + use snapshot::SnapshotService; + let snapshot_restoration = if let RestorationStatus::Ongoing{..} = self.snapshot.status() { true } else { false }; + self.client.tick(snapshot_restoration) + }, SNAPSHOT_TICK_TIMER => self.snapshot.tick(), _ => warn!("IO service triggered unregistered timer '{}'", timer), } diff --git a/ethcore/src/tests/client.rs b/ethcore/src/tests/client.rs index b94ae1fe3..2bcb0b867 100644 --- a/ethcore/src/tests/client.rs +++ b/ethcore/src/tests/client.rs @@ -190,7 +190,7 @@ fn imports_block_sequence() { #[test] fn can_collect_garbage() { let client = generate_dummy_client(100); - client.tick(); + client.tick(true); assert!(client.blockchain_cache_info().blocks < 100 * 1024); } From 83825befeaa298760e01dfb19d5a3c132e50f685 Mon Sep 17 00:00:00 2001 From: arkpar Date: Thu, 12 Oct 2017 11:45:03 +0200 Subject: [PATCH 3/3] Fixed RETURNDATA out of bounds check --- ethcore/evm/src/interpreter/mod.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/ethcore/evm/src/interpreter/mod.rs b/ethcore/evm/src/interpreter/mod.rs index f413fa3fc..24ef0245f 100644 --- a/ethcore/evm/src/interpreter/mod.rs +++ b/ethcore/evm/src/interpreter/mod.rs @@ -565,7 +565,7 @@ impl Interpreter { let source_offset = stack.peek(1); let size = stack.peek(2); let return_data_len = U256::from(self.return_data.len()); - if source_offset.overflow_add(*size).0 > return_data_len { + if source_offset.saturating_add(*size) > return_data_len { return Err(evm::Error::OutOfBounds); } } @@ -931,4 +931,25 @@ mod tests { assert_eq!(ext.calls.len(), 1); assert_eq!(gas_left, 248_212.into()); } + + #[test] + fn should_not_overflow_returndata() { + let code = "6001600160000360003e00".from_hex().unwrap(); + + let mut params = ActionParams::default(); + params.address = 5.into(); + params.gas = 300_000.into(); + params.gas_price = 1.into(); + params.code = Some(Arc::new(code)); + let mut ext = FakeExt::new_byzantium(); + ext.balances.insert(5.into(), 1_000_000_000.into()); + ext.tracing = true; + + let err = { + let mut vm = Factory::new(VMType::Interpreter, 1).create(params.gas); + test_finalize(vm.exec(params, &mut ext)).err().unwrap() + }; + + assert_eq!(err, ::vm::Error::OutOfBounds); + } }