[ETCM-313] and [ETCM-316]: Header skeleton using new branch resolver#892
Merged
[ETCM-313] and [ETCM-316]: Header skeleton using new branch resolver#892
Conversation
robinraju
reviewed
Jan 18, 2021
bdc0dfb to
e2618f6
Compare
30d464b to
b07dbef
Compare
88128d9 to
5c8e0f2
Compare
156eef3 to
5254dfb
Compare
5c8e0f2 to
7608c20
Compare
7608c20 to
d293268
Compare
5254dfb to
111b188
Compare
d293268 to
4c7150e
Compare
There was a problem hiding this comment.
PullRequest Breakdown
Reviewable lines of change
+ 1,784
- 210
56% Scala
43% Scala (tests)
1% Other (tests)
<1% Other
<1% XML (tests)Type of change
Feature - These changes are adding a new feature or improvement to existing code.
| 1 Message | |
|---|---|
| Due to its size, this pull request will likely have a little longer turnaround time and will probably require multiple passes from our reviewers. |
Contributor
|
This PR now also includes the changes from #887 |
added 8 commits
March 10, 2021 09:35
Contributor
|
Wrapping up the work described in the initial PR description. Further work to extract the header skeleton download into a separate actor and get rid of most mutable state variables will be addressed in another PR. |
Contributor
|
Successfully synced with Sagano testnet. |
Contributor
|
and add the following line in |
…t be higher than the default max number of headers returned
robinraju
reviewed
Mar 16, 2021
robinraju
approved these changes
Mar 16, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
See ETCM-313 and ethereum/go-ethereum#2315
Proposed Solution
bestBlockHeaderNumber+ N (i.e. block headersbestBlockHeaderNumber+ kN where 1 <= k <= N). To achieve this, use theskipparameter in theGetBlockHeadersrequest.bestBlockHeaderNumber+ 1 + kN where 0 <= k <= N-1.batchFailuresCount. This is because these validation failures might mean that the master peer is sending us wrong data and that we couldn't find a matching batch from another peer.fastSyncMaxBatchRetriesis reached, start branch resolution.1 N is determined by
blockHeadersPerRequest. Currently set exactly to its value but this is open for discussion.A class called
HeaderSkeletonhandles the logic of the skeleton size, numbers, batches, gap size, and all that is needed from theFastSyncactor. It is kept in memory so if the node goes down everything is recalculated.Pending work
assignBlockchainWorkwe just take the peer with the highest block number.