aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/peer.go
Commit message (Collapse)AuthorAgeFilesLines
* Rebrand as tangerine-network/go-tangerineWei-Ning Huang2019-09-171-3/+3
|
* Change import go github.com/dexon-foundation/dexonWei-Ning Huang2019-06-121-3/+3
|
* eth/downloader: SetBlocksIdle is not used (#17962)Wenbiao Zheng2018-10-241-7/+0
| | | | | | __ <(o )___ ( ._> / `---'
* eth: fix typos (#16414)Yusup2018-04-041-1/+1
|
* all: fix code comment typos (#15547)Ricardo Domingos2017-11-241-1/+1
| | | | | | | | | | | | * console: fix typo in comment * contracts/release: fix typo in comment * core: fix typo in comment * eth: fix typo in comment * miner: fix typo in comment
* eth/downloader: track peer drops and deassign state sync tasksPéter Szilágyi2017-09-121-6/+16
|
* eth/downloader: Doc fixesNick Johnson2017-07-051-2/+4
|
* eth/downloader, les, light: Changes in response to reviewNick Johnson2017-07-031-4/+28
|
* eth, les: Refactor downloader peer to use structsNick Johnson2017-06-291-72/+58
|
* eth/downloader: separate state sync from queue (#14460)Felix Lange2017-06-221-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * eth/downloader: separate state sync from queue Scheduling of state node downloads hogged the downloader queue lock when new requests were scheduled. This caused timeouts for other requests. With this change, state sync is fully independent of all other downloads and doesn't involve the queue at all. State sync is started and checked on in processContent. This is slightly awkward because processContent doesn't have a select loop. Instead, the queue is closed by an auxiliary goroutine when state sync fails. We tried several alternatives to this but settled on the current approach because it's the least amount of change overall. Handling of the pivot block has changed slightly: the queue previously prevented import of pivot block receipts before the state of the pivot block was available. In this commit, the receipt will be imported before the state. This causes an annoyance where the pivot block is committed as fast block head even when state downloads fail. Stay tuned for more updates in this area ;) * eth/downloader: remove cancelTimeout channel * eth/downloader: retry state requests on timeout * eth/downloader: improve comment * eth/downloader: mark peers idle when state sync is done * eth/downloader: move pivot block splitting to processContent This change also ensures that pivot block receipts aren't imported before the pivot block itself. * eth/downloader: limit state node retries * eth/downloader: improve state node error handling and retry check * eth/downloader: remove maxStateNodeRetries It fails the sync too much. * eth/downloader: remove last use of cancelCh in statesync.go Fixes TestDeliverHeadersHang*Fast and (hopefully) the weird cancellation behaviour at the end of fast sync. * eth/downloader: fix leak in runStateSync * eth/downloader: don't run processFullSyncContent in LightSync mode * eth/downloader: improve comments * eth/downloader: fix vet, megacheck * eth/downloader: remove unrequested tasks anyway * eth/downloader, trie: various polishes around duplicate items This commit explicitly tracks duplicate and unexpected state delieveries done against a trie Sync structure, also adding there to import info logs. The commit moves the db batch used to commit trie changes one level deeper so its flushed after every node insertion. This is needed to avoid a lot of duplicate retrievals caused by inconsistencies between Sync internals and database. A better approach is to track not-yet-written states in trie.Sync and flush on commit, but I'm focuing on correctness first now. The commit fixes a regression around pivot block fail count. The counter previously was reset to 1 if and only if a sync cycle progressed (inserted at least 1 entry to the database). The current code reset it already if a node was delivered, which is not stong enough, because unless it ends up written to disk, an attacker can just loop and attack ad infinitum. The commit also fixes a regression around state deliveries and timeouts. The old downloader tracked if a delivery is stale (none of the deliveries were requestedt), in which case it didn't mark the node idle and did not send further requests, since it signals a past timeout. The current code did mark it idle even on stale deliveries, which eventually caused two requests to be in flight at the same time, making the deliveries always stale and mass duplicating retrievals between multiple peers. * eth/downloader: fix state request leak This commit fixes the hang seen sometimes while doing the state sync. The cause of the hang was a rare combination of events: request state data from peer, peer drops and reconnects almost immediately. This caused a new download task to be assigned to the peer, overwriting the old one still waiting for a timeout, which in turned leaked the requests out, never to be retried. The fix is to ensure that a task assignment moves any pending one back into the retry queue. The commit also fixes a regression with peer dropping due to stalls. The current code considered a peer stalling if they timed out delivering 1 item. However, the downloader never requests only one, the minimum is 2 (attempt to fine tune estimated latency/bandwidth). The fix is simply to drop if a timeout is detected at 2 items. Apart from the above bugfixes, the commit contains some code polishes I made while debugging the hang. * core, eth, trie: support batched trie sync db writes * trie: rename SyncMemCache to syncMemBatch
* Logger updates 3 (#3730)Péter Szilágyi2017-03-021-3/+3
| | | | | | | | * accounts, cmd, eth, ethdb: port logs over to new system * ethdb: drop concept of cache distribution between dbs * eth: fix some log nitpicks to make them nicer
* eth/downloader: port over old logs from glog to log15Péter Szilágyi2017-02-271-18/+11
|
* all: gofmt -w -sFelix Lange2017-01-061-2/+2
|
* eth, eth/downloader: better remote head trackingPéter Szilágyi2016-07-251-4/+9
|
* eth, eth/downloader, eth/fetcher: delete eth/61 codeFelix Lange2016-07-221-50/+0
| | | | | The eth/61 protocol was disabled in #2776, this commit removes its message handlers and hash-chain sync logic.
* eth/downloader: adaptive quality of service tuningPéter Szilágyi2016-06-061-19/+62
|
* eth/downloader: implement concurrent header downloadsPéter Szilágyi2016-05-171-5/+61
|
* eth/downloader: fix a throughput estimation data racePéter Szilágyi2016-03-101-2/+2
|
* eth/downloader: fetch data proportionally to peer capacityPéter Szilágyi2015-11-191-106/+125
|
* eth/downloader: fix dysfunctional ignore list hidden by generic setPéter Szilágyi2015-11-041-5/+40
|
* core, eth, trie: fix data races and merge/review issuesPéter Szilágyi2015-10-211-6/+22
|
* core, eth, trie: direct state trie synchronizationPéter Szilágyi2015-10-191-28/+79
|
* eth/downloader: add fast and light sync strategiesPéter Szilágyi2015-10-191-69/+123
|
* eth/downloader: match capabilities when querying idle peersPéter Szilágyi2015-10-021-3/+5
|
* eth: port the synchronisation algo to eth/62Péter Szilágyi2015-08-251-13/+79
|
* all: fix license headers one more timeFelix Lange2015-07-241-1/+1
| | | | I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-231-4/+4
| | | | | All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library".
* all: update license informationFelix Lange2015-07-071-0/+16
|
* eth, eth/downloader: transition to eth 61Péter Szilágyi2015-07-011-11/+14
|
* eth, eth/downloader: pass the eth protocol version throughPéter Szilágyi2015-07-011-1/+4
|
* eth, eth/downloader: do async block fetches, add dl testsPéter Szilágyi2015-06-151-1/+1
|
* eth/downloader: cap the hash ban set, add test for itPéter Szilágyi2015-06-081-1/+1
|
* eth/downloader: log hard timeouts and reset capacityPéter Szilágyi2015-06-051-0/+3
|
* eth/downloader: drop log entry from peer, it's covered alreadyPéter Szilágyi2015-06-041-5/+0
|
* eth/downloader: fix #1178, don't request blocks beyond the cache boundsPéter Szilágyi2015-06-041-0/+10
|
* eth/downloader: demote peers if they exceed the soft limits at 1 blocks alreadyPéter Szilágyi2015-06-031-3/+8
|
* eth/downloader: add a basic block download congestion controlPéter Szilágyi2015-06-031-5/+40
|
* eth/downloader: use count instead of peers, clearerPéter Szilágyi2015-05-111-2/+2
|
* eth/downloader: revert to demotion, use harsher penaltyPéter Szilágyi2015-05-111-5/+10
|
* eth/downloader: fix #910, thread safe peers & polishesPéter Szilágyi2015-05-111-76/+143
|
* eth/downloader: prioritize block fetch based on chain position, cap memory usePéter Szilágyi2015-05-071-8/+7
|
* eth/downloader: removed peer td management and best peer selectionobscuren2015-04-241-14/+1
|
* downloader: moved chunk ignoring. Fixes issue with catching upobscuren2015-04-191-5/+3
|
* downloader: defer peer reset after downloadobscuren2015-04-191-0/+1
|
* typoobscuren2015-04-191-1/+1
|
* downloader: free up peers from work when the downloader resetsobscuren2015-04-191-0/+10
|
* downloader: improved downloading and synchronisationobscuren2015-04-191-1/+14
| | | | | | * 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
* downloader: added demotion / promotion in prep. for rep. systemobscuren2015-04-161-0/+20
|
* downloader: added missing blocks catchup functionalityobscuren2015-04-131-1/+43
| | | | | When a parent is missing in the block list an attempt should be made to fetch the missing parent and grandparents.
* downloader: return an error for peer.fetch and return chunk to queueobscuren2015-04-121-1/+8
| | | | | If a peer was somehow already fetching and somehow managed to end up in the `available` pool it should return it's work.
* downloader: implemented new downloaderobscuren2015-04-121-0/+48