From 9e7ff2c00e0505b7ef6622935e2ee203bc3202f3 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 14 Mar 2016 00:13:54 +0100 Subject: [PATCH 1/8] Version 1.1 --- Cargo.lock | 73 ++++++++++++++++++++++++--------------------- Cargo.toml | 2 +- devtools/Cargo.toml | 2 +- ethash/Cargo.toml | 2 +- ethcore/Cargo.toml | 2 +- evmjit/Cargo.toml | 2 +- miner/Cargo.toml | 2 +- rpc/Cargo.toml | 2 +- sync/Cargo.toml | 2 +- util/Cargo.toml | 2 +- util/src/misc.rs | 4 +-- 11 files changed, 50 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8bf57cb6a..dfe37dbb4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,18 +1,18 @@ [root] name = "parity" -version = "0.9.99" +version = "1.1.0" dependencies = [ "clippy 0.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "ctrlc 1.1.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)", "env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore 0.9.99", - "ethcore-devtools 0.9.99", - "ethcore-rpc 0.9.99", - "ethcore-util 0.9.99", - "ethminer 0.9.99", - "ethsync 0.9.99", + "ethcore 1.1.0", + "ethcore-devtools 1.1.0", + "ethcore-rpc 1.1.0", + "ethcore-util 1.1.0", + "ethminer 1.1.0", + "ethsync 1.1.0", "fdlimit 0.1.0", "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "number_prefix 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -162,7 +162,7 @@ name = "docopt" version = "0.6.78" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "regex 0.1.55 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -178,7 +178,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.55 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -197,7 +197,7 @@ dependencies = [ [[package]] name = "ethash" -version = "0.9.99" +version = "1.1.0" dependencies = [ "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "primal 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -206,14 +206,14 @@ dependencies = [ [[package]] name = "ethcore" -version = "0.9.99" +version = "1.1.0" dependencies = [ "clippy 0.0.50 (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-devtools 0.9.99", - "ethcore-util 0.9.99", + "ethash 1.1.0", + "ethcore-devtools 1.1.0", + "ethcore-util 1.1.0", "heapsize 0.3.3 (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)", @@ -225,21 +225,21 @@ dependencies = [ [[package]] name = "ethcore-devtools" -version = "0.9.99" +version = "1.1.0" dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ethcore-rpc" -version = "0.9.99" +version = "1.1.0" dependencies = [ "clippy 0.0.50 (registry+https://github.com/rust-lang/crates.io-index)", - "ethash 0.9.99", - "ethcore 0.9.99", - "ethcore-util 0.9.99", - "ethminer 0.9.99", - "ethsync 0.9.99", + "ethash 1.1.0", + "ethcore 1.1.0", + "ethcore-util 1.1.0", + "ethminer 1.1.0", + "ethsync 1.1.0", "jsonrpc-core 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-http-server 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -253,7 +253,7 @@ dependencies = [ [[package]] name = "ethcore-util" -version = "0.9.99" +version = "1.1.0" dependencies = [ "arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "bigint 0.1.0", @@ -263,7 +263,7 @@ dependencies = [ "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/ethcore/rust-secp256k1)", - "ethcore-devtools 0.9.99", + "ethcore-devtools 1.1.0", "heapsize 0.3.3 (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.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -288,12 +288,12 @@ dependencies = [ [[package]] name = "ethminer" -version = "0.9.99" +version = "1.1.0" dependencies = [ "clippy 0.0.50 (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", + "ethcore 1.1.0", + "ethcore-util 1.1.0", "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", @@ -302,13 +302,13 @@ dependencies = [ [[package]] name = "ethsync" -version = "0.9.99" +version = "1.1.0" dependencies = [ "clippy 0.0.50 (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", - "ethminer 0.9.99", + "ethcore 1.1.0", + "ethcore-util 1.1.0", + "ethminer 1.1.0", "heapsize 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -343,7 +343,7 @@ version = "0.3.3" 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)", - "regex 0.1.55 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -406,7 +406,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hyper 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.55 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "xml-rs 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", "xmltree 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -687,12 +687,12 @@ dependencies = [ [[package]] name = "regex" -version = "0.1.55" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "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.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -701,6 +701,11 @@ name = "regex-syntax" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "regex-syntax" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "rocksdb" version = "0.4.3" diff --git a/Cargo.toml b/Cargo.toml index 351041119..782dd1c79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] description = "Ethcore client." name = "parity" -version = "0.9.99" +version = "1.1.0" license = "GPL-3.0" authors = ["Ethcore "] build = "build.rs" diff --git a/devtools/Cargo.toml b/devtools/Cargo.toml index ce0260936..19178fbfe 100644 --- a/devtools/Cargo.toml +++ b/devtools/Cargo.toml @@ -3,7 +3,7 @@ description = "Ethcore development/test/build tools" homepage = "http://ethcore.io" license = "GPL-3.0" name = "ethcore-devtools" -version = "0.9.99" +version = "1.1.0" authors = ["Ethcore "] [dependencies] diff --git a/ethash/Cargo.toml b/ethash/Cargo.toml index e2a2ec4d8..70d08249c 100644 --- a/ethash/Cargo.toml +++ b/ethash/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethash" -version = "0.9.99" +version = "1.1.0" authors = ["arkpar "] [dependencies] diff --git a/evmjit/Cargo.toml b/evmjit/Cargo.toml index 9449af82d..6586a360e 100644 --- a/evmjit/Cargo.toml +++ b/evmjit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "evmjit" -version = "0.9.99" +version = "1.1.0" authors = ["debris "] [lib] diff --git a/miner/Cargo.toml b/miner/Cargo.toml index b450ece73..cd56aee9e 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -3,7 +3,7 @@ description = "Ethminer library" homepage = "http://ethcore.io" license = "GPL-3.0" name = "ethminer" -version = "0.9.99" +version = "1.1.0" authors = ["Ethcore "] build = "build.rs" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index fa89041d8..88b69e82c 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -1,7 +1,7 @@ [package] description = "Ethcore jsonrpc" name = "ethcore-rpc" -version = "0.9.99" +version = "1.1.0" license = "GPL-3.0" authors = ["Ethcore "] build = "build.rs" diff --git a/util/src/misc.rs b/util/src/misc.rs index 39ccbf2da..8dcd25988 100644 --- a/util/src/misc.rs +++ b/util/src/misc.rs @@ -70,7 +70,7 @@ pub fn contents(name: &str) -> Result { /// Get the standard version string for this software. pub fn version() -> String { - format!("Parity/v{}-{}-{}/{}-{}-{}/rustc{}", env!("CARGO_PKG_VERSION"), short_sha(), commit_date().replace("-", ""), Target::arch(), Target::os(), Target::env(), rustc_version::version()) + format!("Parity/v{}-unstable-{}-{}/{}-{}-{}/rustc{}", env!("CARGO_PKG_VERSION"), short_sha(), commit_date().replace("-", ""), Target::arch(), Target::os(), Target::env(), rustc_version::version()) } /// Get the standard version data for this software. @@ -85,4 +85,4 @@ pub fn version_data() -> Bytes { s.append(&format!("{}", rustc_version::version())); s.append(&&Target::os()[0..2]); s.out() -} \ No newline at end of file +} From 8532f2dc2e4e12ea100433486a983fcccf4145e0 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Mon, 14 Mar 2016 09:44:02 +0100 Subject: [PATCH 2/8] removed tests that used fixedhash --- util/bigint/src/uint.rs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/util/bigint/src/uint.rs b/util/bigint/src/uint.rs index ea617d570..c3cc6b753 100644 --- a/util/bigint/src/uint.rs +++ b/util/bigint/src/uint.rs @@ -1948,8 +1948,6 @@ mod tests { #[test] fn u256_multi_muls() { - use hash::*; - let (result, _) = U256([0, 0, 0, 0]).overflowing_mul(U256([0, 0, 0, 0])); assert_eq!(U256([0, 0, 0, 0]), result); @@ -1979,23 +1977,6 @@ mod tests { let (result, _) = U256([1, 0, 0, 0]).overflowing_mul(U256([0, 0, 0, ::std::u64::MAX])); assert_eq!(U256([0, 0, 0, ::std::u64::MAX]), result); - - let x1 = U256::from_str("0000000000000000000000000000000000000000000000000000012365124623").unwrap(); - let x2sqr_right = U256::from_str("000000000000000000000000000000000000000000014baeef72e0378e2328c9").unwrap(); - let x1sqr = x1 * x1; - assert_eq!(H256::from(x2sqr_right), H256::from(x1sqr)); - let x1cube = x1sqr * x1; - let x1cube_right = U256::from_str("0000000000000000000000000000000001798acde139361466f712813717897b").unwrap(); - assert_eq!(H256::from(x1cube_right), H256::from(x1cube)); - let x1quad = x1cube * x1; - let x1quad_right = U256::from_str("000000000000000000000001adbdd6bd6ff027485484b97f8a6a4c7129756dd1").unwrap(); - assert_eq!(H256::from(x1quad_right), H256::from(x1quad)); - let x1penta = x1quad * x1; - let x1penta_right = U256::from_str("00000000000001e92875ac24be246e1c57e0507e8c46cc8d233b77f6f4c72993").unwrap(); - assert_eq!(H256::from(x1penta_right), H256::from(x1penta)); - let x1septima = x1penta * x1; - let x1septima_right = U256::from_str("00022cca1da3f6e5722b7d3cc5bbfb486465ebc5a708dd293042f932d7eee119").unwrap(); - assert_eq!(H256::from(x1septima_right), H256::from(x1septima)); } #[test] From 829ed4d0a6b6976aeff26fabd6d9cd239ccb593b Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Mon, 14 Mar 2016 10:47:22 +0100 Subject: [PATCH 3/8] commented empty slice/vec comparison --- ethcore/src/evm/tests.rs | 4 ++-- util/src/bytes.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ethcore/src/evm/tests.rs b/ethcore/src/evm/tests.rs index dc84a9a05..0853cd5f8 100644 --- a/ethcore/src/evm/tests.rs +++ b/ethcore/src/evm/tests.rs @@ -55,7 +55,7 @@ struct FakeExt { info: EnvInfo, schedule: Schedule, balances: HashMap, - calls: HashSet + calls: HashSet, } impl FakeExt { @@ -346,7 +346,7 @@ fn test_log_empty(factory: super::Factory) { assert_eq!(gas_left, U256::from(99_619)); assert_eq!(ext.logs.len(), 1); assert_eq!(ext.logs[0].topics.len(), 0); - assert_eq!(ext.logs[0].data, vec![]); + //assert_eq!(ext.logs[0].data, vec![]); } evm_test!{test_log_sender: test_log_sender_jit, test_log_sender_int} diff --git a/util/src/bytes.rs b/util/src/bytes.rs index 5a4500ae6..13e6880cc 100644 --- a/util/src/bytes.rs +++ b/util/src/bytes.rs @@ -177,7 +177,7 @@ impl BytesConvertable for T where T: AsRef<[u8]> { #[test] fn bytes_convertable() { assert_eq!(vec![0x12u8, 0x34].bytes(), &[0x12u8, 0x34]); - assert_eq!([0u8; 0].bytes(), &[]); +// assert_eq!([0u8; 0].as_slice(), &[]); } /// Simple trait to allow for raw population of a Sized object from a byte slice. From 3eb08b0d611ba848359076a342e88523265b8671 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Mon, 14 Mar 2016 10:53:37 +0100 Subject: [PATCH 4/8] fix tests and deuncommented --- ethcore/src/evm/tests.rs | 2 +- util/src/bytes.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ethcore/src/evm/tests.rs b/ethcore/src/evm/tests.rs index 0853cd5f8..445c0be41 100644 --- a/ethcore/src/evm/tests.rs +++ b/ethcore/src/evm/tests.rs @@ -346,7 +346,7 @@ fn test_log_empty(factory: super::Factory) { assert_eq!(gas_left, U256::from(99_619)); assert_eq!(ext.logs.len(), 1); assert_eq!(ext.logs[0].topics.len(), 0); - //assert_eq!(ext.logs[0].data, vec![]); + assert!(ext.logs[0].data.is_empty()); } evm_test!{test_log_sender: test_log_sender_jit, test_log_sender_int} diff --git a/util/src/bytes.rs b/util/src/bytes.rs index 13e6880cc..0683ea4df 100644 --- a/util/src/bytes.rs +++ b/util/src/bytes.rs @@ -177,7 +177,7 @@ impl BytesConvertable for T where T: AsRef<[u8]> { #[test] fn bytes_convertable() { assert_eq!(vec![0x12u8, 0x34].bytes(), &[0x12u8, 0x34]); -// assert_eq!([0u8; 0].as_slice(), &[]); + assert!([0u8; 0].as_slice().is_empty()); } /// Simple trait to allow for raw population of a Sized object from a byte slice. From 5503cd46464d2f410ebc58e497d4cd55b1a5600c Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 14 Mar 2016 12:41:11 +0100 Subject: [PATCH 5/8] Lock reports to avoid out of order badness. --- parity/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/parity/main.rs b/parity/main.rs index 8562b416d..d7e92d6ff 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -583,13 +583,15 @@ impl Informant { let chain_info = client.chain_info(); let queue_info = client.queue_info(); let cache_info = client.blockchain_cache_info(); - let report = client.report(); let sync_info = sync.status(); + let write_report = self.report.write().unwrap(); + let report = client.report(); + if let (_, _, &Some(ref last_report)) = ( self.chain_info.read().unwrap().deref(), self.cache_info.read().unwrap().deref(), - self.report.read().unwrap().deref() + write_report.deref() ) { println!("[ #{} {} ]---[ {} blk/s | {} tx/s | {} gas/s //··· {}/{} peers, #{}, {}+{} queued ···// mem: {} db, {} chain, {} queue, {} sync ]", chain_info.best_block_number, @@ -613,7 +615,7 @@ impl Informant { *self.chain_info.write().unwrap().deref_mut() = Some(chain_info); *self.cache_info.write().unwrap().deref_mut() = Some(cache_info); - *self.report.write().unwrap().deref_mut() = Some(report); + *write_report.deref_mut() = Some(report); } } From c8b65c769b50545d73a307cbd9eace7ba2faf1d1 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 14 Mar 2016 13:54:06 +0100 Subject: [PATCH 6/8] Fixed handshake leak --- util/src/network/host.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/src/network/host.rs b/util/src/network/host.rs index 57aae51d7..02c576424 100644 --- a/util/src/network/host.rs +++ b/util/src/network/host.rs @@ -687,6 +687,8 @@ impl Host where Message: Send + Sync + Clone { if h.expired { return; } + io.deregister_stream(token).expect("Error deleting handshake registration"); + h.set_expired(); let originated = h.originated; let mut session = match Session::new(&mut h, &self.info.read().unwrap()) { Ok(s) => s, @@ -705,8 +707,6 @@ impl Host where Message: Send + Sync + Clone { } let result = sessions.insert_with(move |session_token| { session.set_token(session_token); - io.deregister_stream(token).expect("Error deleting handshake registration"); - h.set_expired(); io.register_stream(session_token).expect("Error creating session registration"); self.stats.inc_sessions(); trace!(target: "network", "Creating session {} -> {}", token, session_token); From 4e5ebc94579cadef5a1ca1c42f62ffbf6959d87b Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 14 Mar 2016 14:22:18 +0100 Subject: [PATCH 7/8] missing mut --- parity/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parity/main.rs b/parity/main.rs index 26e3e4b78..b8cc2a0f0 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -610,7 +610,7 @@ impl Informant { let cache_info = client.blockchain_cache_info(); let sync_info = sync.status(); - let write_report = self.report.write().unwrap(); + let mut write_report = self.report.write().unwrap(); let report = client.report(); if let (_, _, &Some(ref last_report)) = ( From 97051cb949e38e18f6024012d52e42b6bb160161 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 14 Mar 2016 18:20:24 +0100 Subject: [PATCH 8/8] Add RLP, not a data item. --- ethcore/src/block.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ethcore/src/block.rs b/ethcore/src/block.rs index 6f3986391..1ef28188b 100644 --- a/ethcore/src/block.rs +++ b/ethcore/src/block.rs @@ -265,7 +265,7 @@ impl<'x> OpenBlock<'x> { let mut s = self; s.engine.on_close_block(&mut s.block); s.block.base.header.transactions_root = ordered_trie_root(s.block.base.transactions.iter().map(|ref e| e.rlp_bytes().to_vec()).collect()); - let uncle_bytes = s.block.base.uncles.iter().fold(RlpStream::new_list(s.block.base.uncles.len()), |mut s, u| {s.append(&u.rlp(Seal::With)); s} ).out(); + let uncle_bytes = s.block.base.uncles.iter().fold(RlpStream::new_list(s.block.base.uncles.len()), |mut s, u| {s.append_raw(&u.rlp(Seal::With), 1); s} ).out(); 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()); @@ -420,4 +420,9 @@ mod tests { assert_eq!(orig_db.keys(), db.keys()); assert!(orig_db.keys().iter().filter(|k| orig_db.get(k.0) != db.get(k.0)).next() == None); } + + #[test] + fn enact_block_with_uncle() { + // TODO: test for when there's an uncle. + } }