2018-04-10 12:13:49 +02:00
|
|
|
[package]
|
2019-06-25 08:15:13 +02:00
|
|
|
description = "Parity Ethereum (EthCore) Blockchain Synchronization (Strategy, Blockchain Downloader, Blockchain Synchronization Implementation of Ethereum Protocol, Propagating Data to Peers, Requesting Data from Peers, Supplying Data in Response to Peer Requests, Handling Peer Responses, Matching Packet IDs and Protocol, Light Client Synchronization of Header Chain, Header Download State Machine, Light Decoding & Verifying Header Responses, Private Transaction Handling, Synchronization Snapshot Service to Download & Verify Block Chunks, Peer Connection Management and Blockchain Client I/O Interface for Synchronization Handler, Transaction Statistics)"
|
2018-04-10 12:13:49 +02:00
|
|
|
name = "ethcore-sync"
|
2018-04-25 16:25:43 +02:00
|
|
|
version = "1.12.0"
|
2018-04-10 12:13:49 +02:00
|
|
|
license = "GPL-3.0"
|
|
|
|
authors = ["Parity Technologies <admin@parity.io>"]
|
2019-09-19 13:12:07 +02:00
|
|
|
edition = "2018"
|
2018-04-10 12:13:49 +02:00
|
|
|
|
|
|
|
[lib]
|
|
|
|
|
|
|
|
[dependencies]
|
2019-09-19 13:12:07 +02:00
|
|
|
bytes = { package = "parity-bytes", version = "0.1" }
|
2019-08-13 12:33:34 +02:00
|
|
|
client-traits = { path = "../client-traits" }
|
2018-08-13 17:53:19 +02:00
|
|
|
common-types = { path = "../types" }
|
2019-09-19 13:12:07 +02:00
|
|
|
devp2p = { package = "ethcore-network-devp2p", path = "../../util/network-devp2p" }
|
2019-02-13 09:20:33 +01:00
|
|
|
enum_primitive = "0.1.1"
|
2018-04-10 12:13:49 +02:00
|
|
|
ethcore-io = { path = "../../util/io" }
|
2019-08-16 14:45:52 +02:00
|
|
|
ethcore-private-tx = { path = "../private-tx" }
|
2019-10-08 14:18:44 +02:00
|
|
|
ethereum-types = "0.8.0"
|
2018-08-09 09:51:48 +02:00
|
|
|
fastmap = { path = "../../util/fastmap" }
|
2019-09-03 11:29:25 +02:00
|
|
|
futures = "0.1"
|
Snapshot restoration overhaul (#11219)
* Comments and todos
Use `snapshot_sync` as logging target
* fix compilation
* More todos, more logs
* Fix picking snapshot peer: prefer the one with the highest block number
More docs, comments, todos
* Adjust WAIT_PEERS_TIMEOUT to be a multiple of MAINTAIN_SYNC_TIMER to try to fix snapshot startup problems
Docs, todos, comments
* Tabs
* Formatting
* Don't build new rlp::EMPTY_LIST_RLP instances
* Dial down debug logging
* Don't warn about missing hashes in the manifest: it's normal
Log client version on peer connect
* Cleanup
* Do not skip snapshots further away than 30k block from the highest block seen
Currently we look for peers that seed snapshots that are close to the highest block seen on the network (where "close" means withing 30k blocks). When a node starts up we wait for some time (5sec, increased here to 10sec) to let peers connect and if we have found a suitable peer to sync a snapshot from at the end of that delay, we start the download; if none is found and --warp-barrier is used we stall, otherwise we start a slow-sync.
When looking for a suitable snapshot, we use the highest block seen on the network to check if a peer has a snapshot that is within 30k blocks of that highest block number. This means that in a situation where all available snapshots are older than that, we will often fail to start a snapshot at all. What's worse is that the longer we delay starting a snapshot sync (to let more peers connect, in the hope of finding a good snapshot), the more likely we are to have seen a high block and thus the more likely we become to accept a snapshot.
This commit removes this comparison with the highest blocknumber criteria entirely and picks the best snapshot we find in 10sec.
* lockfile
* Add a `ChunkType::Dupe` variant so that we do not disconnect a peer if they happen to send us a duplicate chunk (just ignore the chunk and keep going)
Resolve some documentation todos, add more
* tweak log message
* Don't warp sync twice
Check if our own block is beyond the given warp barrier (can happen after we've completed a warp sync but are not quite yet synced up to the tip) and if so, don't sync.
More docs, resolve todos.
Dial down some `sync` debug level logging to trace
* Avoid iterating over all snapshot block/state hashes to find the next work item
Use a HashSet instead of a Vec and remove items from the set as chunks are processed. Calculate and store the total number of chunks in the `Snapshot` struct instead of counting pending chunks each time.
* Address review grumbles
* Log correct number of bytes written to disk
* Revert ChunkType::Dup change
* whitespace grumble
* Cleanup debugging code
* Fix docs
* Fix import and a typo
* Fix test impl
* Use `indexmap::IndexSet` to ensure chunk hashes are accessed in order
* Revert increased SNAPSHOT_MANIFEST_TIMEOUT: 5sec should be enough
2019-10-31 16:07:21 +01:00
|
|
|
indexmap = "1.3.0"
|
2019-10-08 14:18:44 +02:00
|
|
|
keccak-hash = "0.4.0"
|
2019-09-19 13:12:07 +02:00
|
|
|
light = { package = "ethcore-light", path = "../light" }
|
2018-08-10 01:04:10 +02:00
|
|
|
log = "0.4"
|
2019-01-04 14:05:46 +01:00
|
|
|
macros = { path = "../../util/macros" }
|
2019-09-19 13:12:07 +02:00
|
|
|
network = { package = "ethcore-network", path = "../../util/network" }
|
2019-09-03 11:29:25 +02:00
|
|
|
parity-runtime = { path = "../../util/runtime" }
|
2019-10-23 13:03:46 +02:00
|
|
|
parity-crypto = { version = "0.4.2", features = ["publickey"] }
|
2019-08-15 15:36:48 +02:00
|
|
|
parity-util-mem = "0.2.0"
|
2019-10-18 15:12:16 +02:00
|
|
|
rand = "0.7"
|
2019-09-27 23:29:14 +02:00
|
|
|
parking_lot = "0.9"
|
2019-06-03 15:36:21 +02:00
|
|
|
rlp = "0.4.0"
|
2019-09-03 11:29:25 +02:00
|
|
|
snapshot = { path = "../snapshot" }
|
2018-09-04 20:13:51 +02:00
|
|
|
trace-time = "0.1"
|
2019-09-16 17:12:21 +02:00
|
|
|
triehash-ethereum = { version = "0.2", path = "../../util/triehash-ethereum" }
|
2018-04-10 12:13:49 +02:00
|
|
|
|
|
|
|
[dev-dependencies]
|
2019-01-08 15:07:20 +01:00
|
|
|
env_logger = "0.5"
|
2019-09-16 21:56:53 +02:00
|
|
|
engine = { path = "../engine" }
|
2019-02-07 14:34:24 +01:00
|
|
|
ethcore = { path = "..", features = ["test-helpers"] }
|
2018-05-10 12:34:36 +02:00
|
|
|
ethcore-io = { path = "../../util/io", features = ["mio"] }
|
2019-09-27 23:29:14 +02:00
|
|
|
kvdb-memorydb = "0.1.2"
|
2019-09-16 21:56:53 +02:00
|
|
|
machine = { path = "../machine" }
|
2019-10-18 15:12:16 +02:00
|
|
|
rand_xorshift = "0.2"
|
2019-09-03 11:29:25 +02:00
|
|
|
rustc-hex = "1.0"
|
2019-08-23 15:32:58 +02:00
|
|
|
spec = { path = "../spec" }
|