Commit graph

8 commits

Author SHA1 Message Date
Felix Lange
5339c79b54
eth/downloader: improve state node error handling and retry check 2017-06-19 13:15:39 +03:00
Felix Lange
44b8cb852c
eth/downloader: limit state node retries 2017-06-19 13:15:38 +03:00
Felix Lange
4c6040c334
eth/downloader: move pivot block splitting to processContent
This change also ensures that pivot block receipts aren't imported
before the pivot block itself.
2017-06-19 13:15:38 +03:00
Felix Lange
465acb2eec
eth/downloader: mark peers idle when state sync is done 2017-06-19 13:15:37 +03:00
Felix Lange
ac085e02a2
eth/downloader: improve comment 2017-06-19 13:15:36 +03:00
Felix Lange
420935469d
eth/downloader: retry state requests on timeout 2017-06-19 13:15:35 +03:00
Felix Lange
c7e5270c70
eth/downloader: remove cancelTimeout channel 2017-06-19 13:15:35 +03:00
Felix Lange
1b19b21cb2
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 ;)
2017-06-19 13:15:27 +03:00