From 25e2e382eaf566fbdda09360e2377131d6406857 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 11 Feb 2016 10:34:52 +0100 Subject: [PATCH 01/13] Add contributing agreement. --- CONTRIBUTING.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..f679363b8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,12 @@ +# Contributing to Parity + +## License + +By contributing to Parity, you agree that your contributions will be +licensed under the [BSD License](LICENSE). + +At the top of every source code file you alter, after the initial +licence section, please append a second section that reads: + +Portions contributed by YOUR NAME are hereby placed under the BSD licence. + From 439e99d32b90e3bb130911dab316bcb5ff326a22 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 11 Feb 2016 10:46:55 +0100 Subject: [PATCH 02/13] Option for no init nodes. --- parity/main.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/parity/main.rs b/parity/main.rs index 5627f87f0..ef1d1a329 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -55,13 +55,14 @@ Parity. Ethereum Client. Copyright 2015, 2016 Ethcore (UK) Limited Usage: - parity [options] [ ... ] + parity [options] [ --no-bootstrap | ... ] Options: --chain CHAIN Specify the blockchain type. CHAIN may be either a JSON chain specification file or frontier, mainnet, morden, or testnet [default: frontier]. -d --db-path PATH Specify the database & configuration directory path [default: $HOME/.parity] + --no-bootstrap Don't bother trying to connect to any nodes initially. --listen-address URL Specify the IP/port on which to listen for peers [default: 0.0.0.0:30304]. --public-address URL Specify the IP/port on which peers may connect [default: 0.0.0.0:30304]. --address URL Equivalent to --listen-address URL --public-address URL. @@ -144,9 +145,11 @@ impl Configuration { } fn init_nodes(&self, spec: &Spec) -> Vec { - match self.args.arg_enode.len() { - 0 => spec.nodes().clone(), - _ => self.args.arg_enode.clone(), + if self.args.flag_no_bootstrap { Vec::new() } else { + match self.args.arg_enode.len() { + 0 => spec.nodes().clone(), + _ => self.args.arg_enode.clone(), + } } } From 3bfe8bea45dae84a675bcbea2af37e44484ab489 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 11 Feb 2016 11:55:49 +0100 Subject: [PATCH 03/13] Deps script. --- install-deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-deps.sh b/install-deps.sh index 28a442040..774d18720 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -688,7 +688,7 @@ function run_installer() info "- Run tests with:" info " ${b}cargo test --release --features ethcore/json-tests -p ethcore${reset}" info "- Install the client with:" - info " ${b}sudo cp parity/target/release/parity${reset}" + info " ${b}sudo cp parity/target/release/parity${reset} /usr/local/bin" echo } From 0d0441a186d2def4f5497a99557a4eb76f6a5c21 Mon Sep 17 00:00:00 2001 From: arkpar Date: Thu, 11 Feb 2016 13:32:27 +0100 Subject: [PATCH 04/13] Use latest era instead of end era as journal marker --- ethcore/src/client.rs | 2 +- util/src/journaldb.rs | 44 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/ethcore/src/client.rs b/ethcore/src/client.rs index 9b11bd408..2a104aa0c 100644 --- a/ethcore/src/client.rs +++ b/ethcore/src/client.rs @@ -170,7 +170,7 @@ pub struct Client { } const HISTORY: u64 = 1000; -const CLIENT_DB_VER_STR: &'static str = "2.0"; +const CLIENT_DB_VER_STR: &'static str = "2.1"; impl Client { /// Create a new client with given spec and DB path. diff --git a/util/src/journaldb.rs b/util/src/journaldb.rs index d9d7b29cf..7b810639b 100644 --- a/util/src/journaldb.rs +++ b/util/src/journaldb.rs @@ -47,10 +47,10 @@ impl Clone for JournalDB { } } -const LAST_ERA_KEY : [u8; 4] = [ b'l', b'a', b's', b't' ]; +const LATEST_ERA_KEY : [u8; 4] = [ b'l', b'a', b's', b't' ]; const VERSION_KEY : [u8; 4] = [ b'j', b'v', b'e', b'r' ]; -const DB_VERSION: u32 = 1; +const DB_VERSION: u32 = 2; impl JournalDB { /// Create a new instance given a `backing` database. @@ -87,7 +87,7 @@ impl JournalDB { /// Check if this database has any commits pub fn is_empty(&self) -> bool { - self.backing.get(&LAST_ERA_KEY).expect("Low level database error").is_none() + self.backing.get(&LATEST_ERA_KEY).expect("Low level database error").is_none() } /// Commit all recent insert operations and historical removals from the old era @@ -144,6 +144,7 @@ impl JournalDB { r.append(&inserts); r.append(&removes); try!(batch.put(&last, r.as_raw())); + try!(batch.put(&LATEST_ERA_KEY, &encode(&now))); } // apply old commits' details @@ -181,7 +182,6 @@ impl JournalDB { try!(batch.delete(&h)); deletes += 1; } - try!(batch.put(&LAST_ERA_KEY, &encode(&end_era))); trace!("JournalDB: delete journal for time #{}.{}, (canon was {}): {} entries", end_era, index, canon_id, deletes); } @@ -228,8 +228,8 @@ impl JournalDB { fn read_counters(db: &DB) -> HashMap { let mut res = HashMap::new(); - if let Some(val) = db.get(&LAST_ERA_KEY).expect("Low-level database error.") { - let mut era = decode::(&val) + 1; + if let Some(val) = db.get(&LATEST_ERA_KEY).expect("Low-level database error.") { + let mut era = decode::(&val); loop { let mut index = 0usize; while let Some(rlp_data) = db.get({ @@ -245,10 +245,10 @@ impl JournalDB { } index += 1; }; - if index == 0 { + if index == 0 || era == 0 { break; } - era += 1; + era -= 1; } } trace!("Recovered {} counters", res.len()); @@ -426,4 +426,32 @@ mod tests { jdb.commit(2, &b"2a".sha3(), Some((1, b"1a".sha3()))).unwrap(); assert!(jdb.exists(&foo)); } + + #[test] + fn reopen() { + use rocksdb::DB; + let mut dir = ::std::env::temp_dir(); + dir.push(H32::random().hex()); + + let foo = { + let mut jdb = JournalDB::new(DB::open_default(dir.to_str().unwrap()).unwrap()); + // history is 1 + let foo = jdb.insert(b"foo"); + jdb.commit(0, &b"0".sha3(), None).unwrap(); + foo + }; + + { + let mut jdb = JournalDB::new(DB::open_default(dir.to_str().unwrap()).unwrap()); + jdb.remove(&foo); + jdb.commit(1, &b"1".sha3(), Some((0, b"0".sha3()))).unwrap(); + } + + { + let mut jdb = JournalDB::new(DB::open_default(dir.to_str().unwrap()).unwrap()); + assert!(jdb.exists(&foo)); + jdb.commit(2, &b"2".sha3(), Some((1, b"1".sha3()))).unwrap(); + assert!(!jdb.exists(&foo)); + } + } } From 6281d18227804fdeebc3573cd37faf9839fccc32 Mon Sep 17 00:00:00 2001 From: arkpar Date: Thu, 11 Feb 2016 14:08:52 +0100 Subject: [PATCH 05/13] net-key option --- parity/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parity/main.rs b/parity/main.rs index 5627f87f0..b89ff4fe0 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -66,6 +66,7 @@ Options: --public-address URL Specify the IP/port on which peers may connect [default: 0.0.0.0:30304]. --address URL Equivalent to --listen-address URL --public-address URL. --upnp Use UPnP to try to figure out the correct network settings. + --net-key KEY Specify node secret key as hex string. --cache-pref-size BYTES Specify the prefered size of the blockchain cache in bytes [default: 16384]. --cache-max-size BYTES Specify the maximum size of the blockchain cache in bytes [default: 262144]. @@ -76,7 +77,7 @@ Options: -l --logging LOGGING Specify the logging level. -v --version Show information about version. -h --help Show this screen. -", flag_cache_pref_size: usize, flag_cache_max_size: usize, flag_address: Option); +", flag_cache_pref_size: usize, flag_cache_max_size: usize, flag_address: Option, flag_net_key: Option); fn setup_log(init: &str) { let mut builder = LogBuilder::new(); @@ -202,6 +203,7 @@ fn main() { let (listen, public) = conf.net_addresses(); net_settings.listen_address = listen; net_settings.public_address = public; + net_settings.use_secret = conf.args.flag_net_key.as_ref().map(|s| Secret::from_str(&s).expect("Invalid key string")); // Build client let mut service = ClientService::start(spec, net_settings, &Path::new(&conf.path())).unwrap(); From f4d8070bda421e2bfb0763cc5a83c0390f8411ff Mon Sep 17 00:00:00 2001 From: arkpar Date: Thu, 11 Feb 2016 18:36:26 +0100 Subject: [PATCH 06/13] Fixed one extra block/header being requested --- sync/src/chain.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sync/src/chain.rs b/sync/src/chain.rs index 63dc47024..76884a586 100644 --- a/sync/src/chain.rs +++ b/sync/src/chain.rs @@ -607,7 +607,7 @@ impl ChainSync { if self.have_common_block && !self.headers.is_empty() && self.headers.range_iter().next().unwrap().0 == self.current_base_block() + 1 { for (start, ref items) in self.headers.range_iter() { - if needed_bodies.len() > MAX_BODIES_TO_REQUEST { + if needed_bodies.len() >= MAX_BODIES_TO_REQUEST { break; } let mut index: BlockNumber = 0; @@ -654,7 +654,7 @@ impl ChainSync { continue; } let mut block = prev; - while block < next && headers.len() <= MAX_HEADERS_TO_REQUEST { + while block < next && headers.len() < MAX_HEADERS_TO_REQUEST { if !self.downloading_headers.contains(&(block as BlockNumber)) { headers.push(block as BlockNumber); self.downloading_headers.insert(block as BlockNumber); @@ -1478,4 +1478,4 @@ mod tests { let result = sync.on_peer_new_block(&mut io, 0, &UntrustedRlp::new(&data)); assert!(result.is_ok()); } -} \ No newline at end of file +} From 84732d4b941e03d7f413d482b0d7c70657e69f30 Mon Sep 17 00:00:00 2001 From: arkpar Date: Thu, 11 Feb 2016 21:10:41 +0100 Subject: [PATCH 07/13] Sync fixes --- ethcore/src/block_queue.rs | 2 +- ethcore/src/client.rs | 36 +++++++++++++++++++++--------------- sync/src/chain.rs | 4 ++-- util/src/network/host.rs | 2 +- util/src/network/session.rs | 3 ++- 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/ethcore/src/block_queue.rs b/ethcore/src/block_queue.rs index dcfcec1e4..ee77c56a4 100644 --- a/ethcore/src/block_queue.rs +++ b/ethcore/src/block_queue.rs @@ -105,7 +105,7 @@ struct Verification { bad: HashSet, } -const MAX_UNVERIFIED_QUEUE_SIZE: usize = 50000; +const MAX_UNVERIFIED_QUEUE_SIZE: usize = 2000; impl BlockQueue { /// Creates a new queue instance. diff --git a/ethcore/src/client.rs b/ethcore/src/client.rs index 5d6537b24..688b697e4 100644 --- a/ethcore/src/client.rs +++ b/ethcore/src/client.rs @@ -350,24 +350,26 @@ impl Client { self.chain.write().unwrap().configure_cache(pref_cache_size, max_cache_size); } - fn block_hash(&self, id: BlockId) -> Option { + fn block_hash(chain: &BlockChain, id: BlockId) -> Option { match id { BlockId::Hash(hash) => Some(hash), - BlockId::Number(number) => self.chain.read().unwrap().block_hash(number), - BlockId::Earliest => self.chain.read().unwrap().block_hash(0), - BlockId::Latest => Some(self.chain.read().unwrap().best_block_hash()) + BlockId::Number(number) => chain.block_hash(number), + BlockId::Earliest => chain.block_hash(0), + BlockId::Latest => Some(chain.best_block_hash()) } } } impl BlockChainClient for Client { fn block_header(&self, id: BlockId) -> Option { - self.block_hash(id).and_then(|hash| self.chain.read().unwrap().block(&hash).map(|bytes| BlockView::new(&bytes).rlp().at(0).as_raw().to_vec())) + let chain = self.chain.read().unwrap(); + Self::block_hash(&chain, id).and_then(|hash| chain.block(&hash).map(|bytes| BlockView::new(&bytes).rlp().at(0).as_raw().to_vec())) } fn block_body(&self, id: BlockId) -> Option { - self.block_hash(id).and_then(|hash| { - self.chain.read().unwrap().block(&hash).map(|bytes| { + let chain = self.chain.read().unwrap(); + Self::block_hash(&chain, id).and_then(|hash| { + chain.block(&hash).map(|bytes| { let rlp = Rlp::new(&bytes); let mut body = RlpStream::new_list(2); body.append_raw(rlp.at(1).as_raw(), 1); @@ -378,21 +380,24 @@ impl BlockChainClient for Client { } fn block(&self, id: BlockId) -> Option { - self.block_hash(id).and_then(|hash| { - self.chain.read().unwrap().block(&hash) + let chain = self.chain.read().unwrap(); + Self::block_hash(&chain, id).and_then(|hash| { + chain.block(&hash) }) } fn block_status(&self, id: BlockId) -> BlockStatus { - match self.block_hash(id) { - Some(ref hash) if self.chain.read().unwrap().is_known(hash) => BlockStatus::InChain, + let chain = self.chain.read().unwrap(); + match Self::block_hash(&chain, id) { + Some(ref hash) if chain.is_known(hash) => BlockStatus::InChain, Some(hash) => self.block_queue.read().unwrap().block_status(&hash), None => BlockStatus::Unknown } } fn block_total_difficulty(&self, id: BlockId) -> Option { - self.block_hash(id).and_then(|hash| self.chain.read().unwrap().block_details(&hash)).map(|d| d.total_difficulty) + let chain = self.chain.read().unwrap(); + Self::block_hash(&chain, id).and_then(|hash| chain.block_details(&hash)).map(|d| d.total_difficulty) } fn code(&self, address: &Address) -> Option { @@ -400,13 +405,14 @@ impl BlockChainClient for Client { } fn transaction(&self, id: TransactionId) -> Option { + let chain = self.chain.read().unwrap(); match id { - TransactionId::Hash(ref hash) => self.chain.read().unwrap().transaction_address(hash), - TransactionId::Location(id, index) => self.block_hash(id).map(|hash| TransactionAddress { + TransactionId::Hash(ref hash) => chain.transaction_address(hash), + TransactionId::Location(id, index) => Self::block_hash(&chain, id).map(|hash| TransactionAddress { block_hash: hash, index: index }) - }.and_then(|address| self.chain.read().unwrap().transaction(&address)) + }.and_then(|address| chain.transaction(&address)) } fn tree_route(&self, from: &H256, to: &H256) -> Option { diff --git a/sync/src/chain.rs b/sync/src/chain.rs index 5fcbfdf27..f0c0347a9 100644 --- a/sync/src/chain.rs +++ b/sync/src/chain.rs @@ -583,7 +583,7 @@ impl ChainSync { trace!(target: "sync", "Starting sync with better chain"); self.request_headers_by_hash(io, peer_id, &peer_latest, 1, 0, false); } - else if self.state == SyncState::Blocks { + else if self.state == SyncState::Blocks && io.chain().block_status(BlockId::Hash(peer_latest)) == BlockStatus::Unknown { self.request_blocks(io, peer_id); } } @@ -1045,7 +1045,7 @@ impl ChainSync { fn check_resume(&mut self, io: &mut SyncIo) { if !io.chain().queue_info().is_full() && self.state == SyncState::Waiting { - self.state = SyncState::Idle; + self.state = SyncState::Blocks; self.continue_sync(io); } } diff --git a/util/src/network/host.rs b/util/src/network/host.rs index fb1e8e1df..c1423dbb3 100644 --- a/util/src/network/host.rs +++ b/util/src/network/host.rs @@ -412,7 +412,7 @@ impl Host where Message: Send + Sync + Clone { let mut to_kill = Vec::new(); for e in self.connections.write().unwrap().iter_mut() { if let ConnectionEntry::Session(ref mut s) = *e.lock().unwrap().deref_mut() { - if !s.keep_alive() { + if !s.keep_alive(io) { s.disconnect(DisconnectReason::PingTimeout); to_kill.push(s.token()); } diff --git a/util/src/network/session.rs b/util/src/network/session.rs index 8e9a3a9ff..b38807c49 100644 --- a/util/src/network/session.rs +++ b/util/src/network/session.rs @@ -180,7 +180,7 @@ impl Session { } /// Keep this session alive. Returns false if ping timeout happened - pub fn keep_alive(&mut self) -> bool { + pub fn keep_alive(&mut self, io: &IoContext) -> bool where Message: Send + Sync + Clone { let timed_out = if let Some(pong) = self.pong_time_ns { pong - self.ping_time_ns > PING_TIMEOUT_SEC * 1000_000_000 } else { @@ -191,6 +191,7 @@ impl Session { if let Err(e) = self.send_ping() { debug!("Error sending ping message: {:?}", e); } + io.update_registration(self.token()).unwrap_or_else(|e| debug!(target: "net", "Session registration error: {:?}", e)); } !timed_out } From 01d9ffcd9b43632edc6efac3999e520e54812339 Mon Sep 17 00:00:00 2001 From: arkpar Date: Thu, 11 Feb 2016 22:14:06 +0100 Subject: [PATCH 08/13] Minor fixes --- ethcore/src/block_queue.rs | 2 +- ethcore/src/client.rs | 7 +++---- parity/main.rs | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ethcore/src/block_queue.rs b/ethcore/src/block_queue.rs index ee77c56a4..dcfcec1e4 100644 --- a/ethcore/src/block_queue.rs +++ b/ethcore/src/block_queue.rs @@ -105,7 +105,7 @@ struct Verification { bad: HashSet, } -const MAX_UNVERIFIED_QUEUE_SIZE: usize = 2000; +const MAX_UNVERIFIED_QUEUE_SIZE: usize = 50000; impl BlockQueue { /// Creates a new queue instance. diff --git a/ethcore/src/client.rs b/ethcore/src/client.rs index 3582aca6c..09f7417e8 100644 --- a/ethcore/src/client.rs +++ b/ethcore/src/client.rs @@ -316,12 +316,11 @@ impl Client { self.report.write().unwrap().accrue_block(&block); trace!(target: "client", "Imported #{} ({})", header.number(), header.hash()); ret += 1; - - if self.block_queue.read().unwrap().queue_info().is_empty() { - io.send(NetworkIoMessage::User(SyncMessage::BlockVerified)).unwrap(); - } } self.block_queue.write().unwrap().mark_as_good(&good_blocks); + if !good_blocks.is_empty() && self.block_queue.read().unwrap().queue_info().is_empty() { + io.send(NetworkIoMessage::User(SyncMessage::BlockVerified)).unwrap(); + } ret } diff --git a/parity/main.rs b/parity/main.rs index 6fdbaf82c..28e448705 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -261,7 +261,7 @@ impl Informant { let sync_info = sync.status(); if let (_, &Some(ref last_cache_info), &Some(ref last_report)) = (self.chain_info.read().unwrap().deref(), self.cache_info.read().unwrap().deref(), self.report.read().unwrap().deref()) { - println!("[ {} {} ]---[ {} blk/s | {} tx/s | {} gas/s //··· {}/{} peers, {} downloaded, {}+{} queued ···// {} ({}) bl {} ({}) ex ]", + println!("[ #{} {} ]---[ {} blk/s | {} tx/s | {} gas/s //··· {}/{} peers, #{}, {}+{} queued ···// {} ({}) bl {} ({}) ex ]", chain_info.best_block_number, chain_info.best_block_hash, (report.blocks_imported - last_report.blocks_imported) / dur, @@ -270,7 +270,7 @@ impl Informant { sync_info.num_active_peers, sync_info.num_peers, - sync_info.blocks_received, + sync_info.last_imported_block_number.unwrap_or(chain_info.best_block_number), queue_info.unverified_queue_size, queue_info.verified_queue_size, From 3575e6bbc13f7b3987e7633e782734e794682769 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 12 Feb 2016 00:24:10 +0100 Subject: [PATCH 09/13] Update main.rs --- parity/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parity/main.rs b/parity/main.rs index 28e448705..62b73ca47 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -67,7 +67,7 @@ Options: --public-address URL Specify the IP/port on which peers may connect [default: 0.0.0.0:30304]. --address URL Equivalent to --listen-address URL --public-address URL. --upnp Use UPnP to try to figure out the correct network settings. - --net-key KEY Specify node secret key as hex string. + --node-key KEY Specify node secret key as hex string. --cache-pref-size BYTES Specify the prefered size of the blockchain cache in bytes [default: 16384]. --cache-max-size BYTES Specify the maximum size of the blockchain cache in bytes [default: 262144]. @@ -78,7 +78,7 @@ Options: -l --logging LOGGING Specify the logging level. -v --version Show information about version. -h --help Show this screen. -", flag_cache_pref_size: usize, flag_cache_max_size: usize, flag_address: Option, flag_net_key: Option); +", flag_cache_pref_size: usize, flag_cache_max_size: usize, flag_address: Option, flag_node_key: Option); fn setup_log(init: &str) { let mut builder = LogBuilder::new(); @@ -206,7 +206,7 @@ fn main() { let (listen, public) = conf.net_addresses(); net_settings.listen_address = listen; net_settings.public_address = public; - net_settings.use_secret = conf.args.flag_net_key.as_ref().map(|s| Secret::from_str(&s).expect("Invalid key string")); + net_settings.use_secret = conf.args.flag_node_key.as_ref().map(|s| Secret::from_str(&s).expect("Invalid key string")); // Build client let mut service = ClientService::start(spec, net_settings, &Path::new(&conf.path())).unwrap(); From 84c752583a06a98830d8e139401558945b84882f Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Sat, 13 Feb 2016 13:17:16 +0300 Subject: [PATCH 10/13] clippy version update, docopt-macro moving to fork --- Cargo.toml | 6 +++--- ethcore/Cargo.toml | 2 +- rpc/Cargo.toml | 2 +- sync/Cargo.toml | 2 +- util/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fb52d14d5..ef368543b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,10 +9,10 @@ authors = ["Ethcore "] log = "0.3" env_logger = "0.3" rustc-serialize = "0.3" -docopt = "0.6" -docopt_macros = "0.6" +docopt = { git = "https://github.com/NikVolf/docopt.rs.git" } +docopt_macros = { git = "https://github.com/NikVolf/docopt.rs.git", path = "docopt_macros" } ctrlc = { git = "https://github.com/tomusdrw/rust-ctrlc.git" } -clippy = "0.0.37" +clippy = "0.0.39" ethcore-util = { path = "util" } ethcore = { path = "ethcore" } ethsync = { path = "sync" } diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index be7652e17..7f8259e96 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -18,7 +18,7 @@ ethcore-util = { path = "../util" } evmjit = { path = "../evmjit", optional = true } ethash = { path = "../ethash" } num_cpus = "0.2" -clippy = "0.0.37" +clippy = "0.0.39" crossbeam = "0.1.5" lazy_static = "0.1" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 66688466c..e5b5bb797 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -16,6 +16,6 @@ jsonrpc-http-server = "1.1" ethcore-util = { path = "../util" } ethcore = { path = "../ethcore" } ethsync = { path = "../sync" } -clippy = "0.0.37" +clippy = "0.0.39" target_info = "0.1.0" rustc-serialize = "0.3" diff --git a/sync/Cargo.toml b/sync/Cargo.toml index 75853e0ab..eb060cf90 100644 --- a/sync/Cargo.toml +++ b/sync/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Ethcore Date: Sat, 13 Feb 2016 13:15:46 +0100 Subject: [PATCH 11/13] fixed build --- ethcore/src/ethereum/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/src/ethereum/mod.rs b/ethcore/src/ethereum/mod.rs index 11c20ddbe..0d1dcd8d5 100644 --- a/ethcore/src/ethereum/mod.rs +++ b/ethcore/src/ethereum/mod.rs @@ -24,7 +24,7 @@ pub mod ethash; /// Export the denominations module. pub mod denominations; -pub use self::ethash::*; +pub use self::ethash::{Ethash}; pub use self::denominations::*; use super::spec::*; From 2205b80703d49f395919f34d7dc4c3512f926c17 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Sat, 13 Feb 2016 18:11:46 +0300 Subject: [PATCH 12/13] trigger build --- sync/src/range_collection.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sync/src/range_collection.rs b/sync/src/range_collection.rs index c70bac4ca..a07f85a7f 100644 --- a/sync/src/range_collection.rs +++ b/sync/src/range_collection.rs @@ -40,7 +40,7 @@ pub trait RangeCollection { fn get_tail(&mut self, key: &K) -> Range; /// Remove all elements < `start` in the range that contains `start` - 1 fn remove_head(&mut self, start: &K); - /// Remove all elements >= `start` in the range that contains `start` + /// Remove all elements >= `start` in the range that contains `start` fn remove_tail(&mut self, start: &K); /// Remove all elements >= `tail` fn insert_item(&mut self, key: K, value: V); @@ -168,6 +168,7 @@ impl RangeCollection for Vec<(K, Vec)> where K: Ord + PartialEq + fn insert_item(&mut self, key: K, value: V) { assert!(!self.have_item(&key)); + // todo: fix warning let lower = match self.binary_search_by(|&(k, _)| k.cmp(&key).reverse()) { Ok(index) => index, Err(index) => index, From 9ff3155a64cf267a019c284d70eb83bf41208741 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Sun, 14 Feb 2016 00:58:41 +0300 Subject: [PATCH 13/13] clippy, returing docopt --- Cargo.toml | 6 +++--- ethcore/Cargo.toml | 2 +- rpc/Cargo.toml | 2 +- sync/Cargo.toml | 2 +- util/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ef368543b..ca2ad9c6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,10 +9,10 @@ authors = ["Ethcore "] log = "0.3" env_logger = "0.3" rustc-serialize = "0.3" -docopt = { git = "https://github.com/NikVolf/docopt.rs.git" } -docopt_macros = { git = "https://github.com/NikVolf/docopt.rs.git", path = "docopt_macros" } +docopt = "0.6" +docopt_macros = "0.6" ctrlc = { git = "https://github.com/tomusdrw/rust-ctrlc.git" } -clippy = "0.0.39" +clippy = "0.0.41" ethcore-util = { path = "util" } ethcore = { path = "ethcore" } ethsync = { path = "sync" } diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 7f8259e96..90d147a02 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -18,7 +18,7 @@ ethcore-util = { path = "../util" } evmjit = { path = "../evmjit", optional = true } ethash = { path = "../ethash" } num_cpus = "0.2" -clippy = "0.0.39" +clippy = "0.0.41" crossbeam = "0.1.5" lazy_static = "0.1" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index e5b5bb797..34da585f7 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -16,6 +16,6 @@ jsonrpc-http-server = "1.1" ethcore-util = { path = "../util" } ethcore = { path = "../ethcore" } ethsync = { path = "../sync" } -clippy = "0.0.39" +clippy = "0.0.41" target_info = "0.1.0" rustc-serialize = "0.3" diff --git a/sync/Cargo.toml b/sync/Cargo.toml index eb060cf90..8eb6a1bee 100644 --- a/sync/Cargo.toml +++ b/sync/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Ethcore