Merge pull request #905 from ethcore/sync-beta
Imporved sync error handling
This commit is contained in:
commit
9b5bd37dc5
36
Cargo.lock
generated
36
Cargo.lock
generated
@ -1,18 +1,18 @@
|
||||
[root]
|
||||
name = "parity"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
dependencies = [
|
||||
"clippy 0.0.54 (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 1.0.1",
|
||||
"ethcore 1.0.2",
|
||||
"ethcore-devtools 1.0.0",
|
||||
"ethcore-rpc 1.0.1",
|
||||
"ethcore-util 1.0.1",
|
||||
"ethcore-rpc 1.0.2",
|
||||
"ethcore-util 1.0.2",
|
||||
"ethminer 1.0.0",
|
||||
"ethsync 1.0.1",
|
||||
"ethsync 1.0.2",
|
||||
"fdlimit 0.1.0",
|
||||
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num_cpus 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -208,14 +208,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ethcore"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
dependencies = [
|
||||
"clippy 0.0.54 (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 1.0.0",
|
||||
"ethcore-devtools 1.0.0",
|
||||
"ethcore-util 1.0.1",
|
||||
"ethcore-util 1.0.2",
|
||||
"ethjson 0.1.0",
|
||||
"heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -235,14 +235,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ethcore-rpc"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
dependencies = [
|
||||
"clippy 0.0.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethash 1.0.0",
|
||||
"ethcore 1.0.1",
|
||||
"ethcore-util 1.0.1",
|
||||
"ethcore 1.0.2",
|
||||
"ethcore-util 1.0.2",
|
||||
"ethminer 1.0.0",
|
||||
"ethsync 1.0.1",
|
||||
"ethsync 1.0.2",
|
||||
"jsonrpc-core 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jsonrpc-http-server 3.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -256,7 +256,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ethcore-util"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
dependencies = [
|
||||
"arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bigint 0.1.0",
|
||||
@ -293,7 +293,7 @@ dependencies = [
|
||||
name = "ethjson"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"ethcore-util 1.0.1",
|
||||
"ethcore-util 1.0.2",
|
||||
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_codegen 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -307,8 +307,8 @@ version = "1.0.0"
|
||||
dependencies = [
|
||||
"clippy 0.0.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethcore 1.0.1",
|
||||
"ethcore-util 1.0.1",
|
||||
"ethcore 1.0.2",
|
||||
"ethcore-util 1.0.2",
|
||||
"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)",
|
||||
@ -317,12 +317,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ethsync"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
dependencies = [
|
||||
"clippy 0.0.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethcore 1.0.1",
|
||||
"ethcore-util 1.0.1",
|
||||
"ethcore 1.0.2",
|
||||
"ethcore-util 1.0.2",
|
||||
"ethminer 1.0.0",
|
||||
"heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
description = "Ethcore client."
|
||||
name = "parity"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
license = "GPL-3.0"
|
||||
authors = ["Ethcore <admin@ethcore.io>"]
|
||||
build = "build.rs"
|
||||
|
@ -3,7 +3,7 @@ description = "Ethcore library"
|
||||
homepage = "http://ethcore.io"
|
||||
license = "GPL-3.0"
|
||||
name = "ethcore"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
authors = ["Ethcore <admin@ethcore.io>"]
|
||||
|
||||
[dependencies]
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
description = "Ethcore jsonrpc"
|
||||
name = "ethcore-rpc"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
license = "GPL-3.0"
|
||||
authors = ["Ethcore <admin@ethcore.io"]
|
||||
build = "build.rs"
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
description = "Ethcore blockchain sync"
|
||||
name = "ethsync"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
license = "GPL-3.0"
|
||||
authors = ["Ethcore <admin@ethcore.io"]
|
||||
|
||||
|
@ -392,7 +392,10 @@ impl ChainSync {
|
||||
self.have_common_block = true;
|
||||
trace!(target: "sync", "Found common header {} ({})", number, hash);
|
||||
} else {
|
||||
trace!(target: "sync", "Header already in chain {} ({})", number, hash);
|
||||
trace!(target: "sync", "Header already in chain {} ({}), restarting", number, hash);
|
||||
self.restart(io);
|
||||
self.continue_sync(io);
|
||||
return Ok(());
|
||||
}
|
||||
},
|
||||
_ => {
|
||||
@ -467,6 +470,12 @@ impl ChainSync {
|
||||
trace!(target: "sync", "Ignored block bodies while waiting");
|
||||
return Ok(());
|
||||
}
|
||||
if item_count == 0 {
|
||||
trace!(target: "sync", "No bodies returned, restarting");
|
||||
self.restart(io);
|
||||
self.continue_sync(io);
|
||||
return Ok(());
|
||||
}
|
||||
for i in 0..item_count {
|
||||
let body = try!(r.at(i));
|
||||
let tx = try!(body.at(0));
|
||||
@ -1350,6 +1359,10 @@ impl ChainSync {
|
||||
// Propagate latests blocks
|
||||
self.propagate_latest_blocks(io);
|
||||
}
|
||||
if !invalid.is_empty() {
|
||||
trace!(target: "sync", "Bad blocks in the queue, restarting");
|
||||
self.restart_on_bad_block(io);
|
||||
}
|
||||
// TODO [todr] propagate transactions?
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ description = "Ethcore utility library"
|
||||
homepage = "http://ethcore.io"
|
||||
license = "GPL-3.0"
|
||||
name = "ethcore-util"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
authors = ["Ethcore <admin@ethcore.io>"]
|
||||
build = "build.rs"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user