Commit Graph

106 Commits

Author SHA1 Message Date
Felix Lange
35a7dcb162 all: gofmt -w -s 2017-01-06 15:52:03 +01:00
Felix Lange
d3b751e4d9 trie: remove dependency on ethdb
This removes the core/types -> leveldb dependency.
2017-01-06 14:15:22 +01:00
Péter Szilágyi
e1b4acfb6e
eth/downloader: clear pending requests when switching trie root 2016-11-01 12:53:33 +02:00
Péter Szilágyi
90b16a3e85
core/state, eth/downloader, trie: reset fast-failure on progress 2016-10-31 14:19:14 +02:00
Felix Lange
016007bd25 eth, eth/downloader, eth/fetcher: delete eth/61 code
The eth/61 protocol was disabled in #2776, this commit removes its
message handlers and hash-chain sync logic.
2016-07-22 13:17:19 +02:00
Péter Szilágyi
4f1d92b332 eth/downloader, trie: pull head state concurrently with chain 2016-05-27 14:26:00 +03:00
Péter Szilágyi
8906b2fe09 eth/downloader: fix reviewer comments 2016-05-20 10:56:01 +03:00
Péter Szilágyi
e86619e75d eth/downloader: stream partial skeleton filling to processor 2016-05-17 10:03:34 +03:00
Péter Szilágyi
b40dc8a1da eth/downloader: implement concurrent header downloads 2016-05-17 10:03:34 +03:00
Felix Lange
6fdd0893c3 all: fix go vet warnings 2016-04-15 11:17:27 +02:00
Leif Jurvetson
bbbe2360d0 eth: various typos 2016-03-15 11:27:49 -07:00
Péter Szilágyi
66b148dd8f Merge pull request #2251 from karalabe/increase-downlaoder-queue
eth/downloader: bump the download queue size to prevent starvation
2016-02-24 15:55:21 +02:00
Péter Szilágyi
93c0012000 eth/downloader: bump the download queue size to prevent starvation 2016-02-23 13:12:11 +02:00
Ricardo Catalinas Jiménez
436fc8d76a all: Rename crypto.Sha3{,Hash}() to crypto.Keccak256{,Hash}()
As we aren't really using the standarized SHA-3
2016-02-21 22:34:34 +00:00
Péter Szilágyi
f1ec226d80 eth/downloader: raise pending state limit that prevented concurrency 2016-02-08 14:57:02 +02:00
Péter Szilágyi
b6f5523bdc eth/downloader: fetch data proportionally to peer capacity 2015-11-19 17:01:39 +02:00
Felix Lange
900da3d800 eth/downloader: don't hang for spurious deliveries
Unexpected deliveries could block indefinitely if they arrived at the
right time. The fix is to ensure that the cancellation channel is
always closed when the sync ends, unblocking any deliveries. Also remove
the atomic check for whether a sync is currently running because it
doesn't help and can be misleading.

Cancelling always seems to break the tests though. The downloader
spawned d.process whenever new data arrived, making it somewhat hard to
track when block processing was actually done. Fix this by running
d.process in a dedicated goroutine that is tied to the lifecycle of the
sync. d.process gets notified of new work by the queue instead of being
invoked all the time. This removes a ton of weird workaround code,
including a hairy use of atomic CAS.
2015-11-19 14:18:34 +01:00
Péter Szilágyi
b658a73ed5 eth/downloader: fix dysfunctional ignore list hidden by generic set 2015-11-04 13:11:52 +02:00
Péter Szilágyi
5b0ee8ec30 core, eth, trie: fix data races and merge/review issues 2015-10-21 16:49:55 +03:00
Péter Szilágyi
aa0538db0b eth: clean out light node notions from eth 2015-10-19 10:03:10 +03:00
Péter Szilágyi
b97e34a8e4 eth/downloader: concurrent receipt and state processing 2015-10-19 10:03:10 +03:00
Péter Szilágyi
ab27bee25a core, eth, trie: direct state trie synchronization 2015-10-19 10:03:09 +03:00
Péter Szilágyi
f186b39018 eth/downloader: add fast and light sync strategies 2015-10-19 10:03:09 +03:00
Péter Szilágyi
99b62f36b6 eth/downloader: header-chain order and ancestry check 2015-09-15 14:45:53 +03:00
Péter Szilágyi
17f65cd1e5 eth: update metrics collection to handle eth/62 algos 2015-08-25 17:48:47 +03:00
Péter Szilágyi
47a7fe5d22 eth: port the synchronisation algo to eth/62 2015-08-25 17:48:47 +03:00
Felix Lange
bfbcfbe4a9 all: fix license headers one more time
I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
2015-07-23 18:35:11 +02:00
Felix Lange
3f047be5aa all: update license headers to distiguish GPL/LGPL
All code outside of cmd/ is licensed as LGPL. The headers
now reflect this by calling the whole work "the go-ethereum library".
2015-07-22 18:51:45 +02:00
Felix Lange
ea54283b30 all: update license information 2015-07-07 14:12:44 +02:00
Péter Szilágyi
f43c07cb3c eth, eth/downloader: transition to eth 61 2015-06-30 19:05:06 +03:00
Péter Szilágyi
66d3dc8690 eth, eth/downloader: move peer removal into downloader 2015-06-15 09:22:36 +03:00
Péter Szilágyi
63c6cedb14 eth/downloader: cap the hash ban set, add test for it 2015-06-08 14:12:00 +03:00
Péter Szilágyi
2d627995cf eth/downloader: fix another rebase error 2015-06-08 13:23:58 +03:00
Péter Szilágyi
b40c796ff7 eth/downloader: preallocate the block cache 2015-06-08 13:23:58 +03:00
Péter Szilágyi
328ef60b85 eth/downloader: differentiate stale and nonexistent deliveries 2015-06-05 12:37:48 +03:00
Péter Szilágyi
28c32d1b1b eth/downloader: fix #1178, don't request blocks beyond the cache bounds 2015-06-04 14:51:14 +03:00
Péter Szilágyi
c9a546c310 eth/downloader: add a basic block download congestion control 2015-06-03 14:40:11 +03:00
Péter Szilágyi
eafdc1f8e3 eth, eth/downloader: surface downloaded block origin, drop on error 2015-05-26 14:00:21 +03:00
Péter Szilágyi
06a041589f eth, eth/downloader: remove duplicate consts, bump hash fetch to 2K 2015-05-21 18:16:04 +03:00
Péter Szilágyi
83226762c2 eth, eth/downloader: detect and handle madeup hash attacks 2015-05-15 15:01:58 +03:00
Péter Szilágyi
72411eb24c eth/downloader: circumvent hash reordering attacks 2015-05-15 15:01:58 +03:00
Péter Szilágyi
cd2fb09051 eth, eth/downloader: prevent hash repeater attack 2015-05-15 15:01:58 +03:00
Péter Szilágyi
3eda70c64c eth, eth/downloader: remove parent verification from the downlaoder 2015-05-14 15:38:49 +03:00
Péter Szilágyi
685862d2ce eth/downloader: fix #910, thread safe peers & polishes 2015-05-11 14:26:20 +03:00
Péter Szilágyi
9d188f73b5 eth, eth/downloader: make synchronize thread safe 2015-05-07 21:07:20 +03:00
Péter Szilágyi
45f8304f3c eth/downloader: fix expiration not running while fetching 2015-05-07 12:59:19 +03:00
Péter Szilágyi
4800c94392 eth/downloader: prioritize block fetch based on chain position, cap memory use 2015-05-07 10:57:34 +03:00
obscuren
f2a2b2ac70 eth/downloader: put back hashes on block overflow error 2015-05-03 14:11:00 +02:00
obscuren
016f152b36 eth, eth/downloader: Moved block processing & graceful shutdown
The downloader is no longer responsible for processing blocks. The
eth-protocol handler now takes care of this instead.

Added graceful shutdown during block processing. Closes #846
2015-05-01 15:58:44 +02:00
obscuren
bd9c76097d eth/downloader: removed peer td management and best peer selection 2015-04-24 15:37:07 +02:00
obscuren
c58918c84a downloader: moved chunk ignoring. Fixes issue with catching up 2015-04-19 13:30:34 +02:00
obscuren
6830ddb659 downloader: free up peers from work when the downloader resets 2015-04-18 20:25:55 +02:00
obscuren
c2c24b3bb4 downloader: improved downloading and synchronisation
* Downloader's peers keeps track of peer's previously requested hashes
  so that we don't have to re-request
* Changed `AddBlock` to be fully synchronous
2015-04-18 18:55:13 +02:00
obscuren
8244825bbf downloader: reset the queue if a peer response with an empty hash set 2015-04-18 15:14:12 +02:00
obscuren
a8a2b2a488 downloader: added missing blocks catchup functionality
When a parent is missing in the block list an attempt should be made to
fetch the missing parent and grandparents.
2015-04-13 16:38:32 +02:00
obscuren
6efa8db888 downloader: renamed chunks to queue 2015-04-12 13:24:38 +02:00