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]
|
[root]
|
||||||
name = "parity"
|
name = "parity"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clippy 0.0.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"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)",
|
"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 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)",
|
"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-devtools 1.0.0",
|
||||||
"ethcore-rpc 1.0.1",
|
"ethcore-rpc 1.0.2",
|
||||||
"ethcore-util 1.0.1",
|
"ethcore-util 1.0.2",
|
||||||
"ethminer 1.0.0",
|
"ethminer 1.0.0",
|
||||||
"ethsync 1.0.1",
|
"ethsync 1.0.2",
|
||||||
"fdlimit 0.1.0",
|
"fdlimit 0.1.0",
|
||||||
"log 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)",
|
||||||
"num_cpus 0.2.11 (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]]
|
[[package]]
|
||||||
name = "ethcore"
|
name = "ethcore"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clippy 0.0.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"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)",
|
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ethash 1.0.0",
|
"ethash 1.0.0",
|
||||||
"ethcore-devtools 1.0.0",
|
"ethcore-devtools 1.0.0",
|
||||||
"ethcore-util 1.0.1",
|
"ethcore-util 1.0.2",
|
||||||
"ethjson 0.1.0",
|
"ethjson 0.1.0",
|
||||||
"heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -235,14 +235,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ethcore-rpc"
|
name = "ethcore-rpc"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clippy 0.0.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clippy 0.0.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ethash 1.0.0",
|
"ethash 1.0.0",
|
||||||
"ethcore 1.0.1",
|
"ethcore 1.0.2",
|
||||||
"ethcore-util 1.0.1",
|
"ethcore-util 1.0.2",
|
||||||
"ethminer 1.0.0",
|
"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-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)",
|
"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)",
|
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -256,7 +256,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ethcore-util"
|
name = "ethcore-util"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
"arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"bigint 0.1.0",
|
"bigint 0.1.0",
|
||||||
@ -293,7 +293,7 @@ dependencies = [
|
|||||||
name = "ethjson"
|
name = "ethjson"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
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)",
|
"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 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)",
|
"serde_codegen 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -307,8 +307,8 @@ version = "1.0.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"clippy 0.0.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ethcore 1.0.1",
|
"ethcore 1.0.2",
|
||||||
"ethcore-util 1.0.1",
|
"ethcore-util 1.0.2",
|
||||||
"log 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)",
|
||||||
"rayon 0.3.1 (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)",
|
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -317,12 +317,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ethsync"
|
name = "ethsync"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clippy 0.0.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ethcore 1.0.1",
|
"ethcore 1.0.2",
|
||||||
"ethcore-util 1.0.1",
|
"ethcore-util 1.0.2",
|
||||||
"ethminer 1.0.0",
|
"ethminer 1.0.0",
|
||||||
"heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
description = "Ethcore client."
|
description = "Ethcore client."
|
||||||
name = "parity"
|
name = "parity"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
authors = ["Ethcore <admin@ethcore.io>"]
|
authors = ["Ethcore <admin@ethcore.io>"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
@ -3,7 +3,7 @@ description = "Ethcore library"
|
|||||||
homepage = "http://ethcore.io"
|
homepage = "http://ethcore.io"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
name = "ethcore"
|
name = "ethcore"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
authors = ["Ethcore <admin@ethcore.io>"]
|
authors = ["Ethcore <admin@ethcore.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
description = "Ethcore jsonrpc"
|
description = "Ethcore jsonrpc"
|
||||||
name = "ethcore-rpc"
|
name = "ethcore-rpc"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
authors = ["Ethcore <admin@ethcore.io"]
|
authors = ["Ethcore <admin@ethcore.io"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
description = "Ethcore blockchain sync"
|
description = "Ethcore blockchain sync"
|
||||||
name = "ethsync"
|
name = "ethsync"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
authors = ["Ethcore <admin@ethcore.io"]
|
authors = ["Ethcore <admin@ethcore.io"]
|
||||||
|
|
||||||
|
@ -392,7 +392,10 @@ impl ChainSync {
|
|||||||
self.have_common_block = true;
|
self.have_common_block = true;
|
||||||
trace!(target: "sync", "Found common header {} ({})", number, hash);
|
trace!(target: "sync", "Found common header {} ({})", number, hash);
|
||||||
} else {
|
} 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");
|
trace!(target: "sync", "Ignored block bodies while waiting");
|
||||||
return Ok(());
|
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 {
|
for i in 0..item_count {
|
||||||
let body = try!(r.at(i));
|
let body = try!(r.at(i));
|
||||||
let tx = try!(body.at(0));
|
let tx = try!(body.at(0));
|
||||||
@ -1350,6 +1359,10 @@ impl ChainSync {
|
|||||||
// Propagate latests blocks
|
// Propagate latests blocks
|
||||||
self.propagate_latest_blocks(io);
|
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?
|
// TODO [todr] propagate transactions?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ description = "Ethcore utility library"
|
|||||||
homepage = "http://ethcore.io"
|
homepage = "http://ethcore.io"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
name = "ethcore-util"
|
name = "ethcore-util"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
authors = ["Ethcore <admin@ethcore.io>"]
|
authors = ["Ethcore <admin@ethcore.io>"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user