This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Support resuming fast-sync downloads #848
Merged
ajsutton
merged 5 commits into
PegaSysEng:master
from
ajsutton:skip-requesting-existing-data
Feb 13, 2019
Merged
Support resuming fast-sync downloads #848
ajsutton
merged 5 commits into
PegaSysEng:master
from
ajsutton:skip-requesting-existing-data
Feb 13, 2019
Conversation
This file contains 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
… ensure we have all child nodes.
ajsutton
changed the title
Skip requesting world state data we already
Support resuming fast-sync downloads
Feb 13, 2019
mbaxter
approved these changes
Feb 13, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice simple update! Just left a few comments to address before merging.
@@ -25,7 +25,7 @@ | |||
// TODO: Determine reasonable defaults here | |||
public static final int DEFAULT_PIVOT_DISTANCE_FROM_HEAD = 500; | |||
public static final float DEFAULT_FULL_VALIDATION_RATE = .1f; | |||
public static final int DEFAULT_FAST_SYNC_MINIMUM_PEERS = 5; | |||
public static final int DEFAULT_FAST_SYNC_MINIMUM_PEERS = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this might've been a change for debugging?
if (existingData.isPresent()) { | ||
pendingRequest.setData(existingData.get()); | ||
queueChildRequests(pendingRequest); | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you may need to change the containing for
loop to a while
loop so that we don't send out smaller than intended requests when we run into known nodes.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
PR description
Support resuming fast sync downloads.
When download world state data, skip requesting data that we already have in our local store. To ensure we have all the child nodes continue traversing the trie. Net result is that we still walk the entire trie but only download data we don't already have.
When shutting down Pantheon, don't delete the fast sync data
When starting up, don't fail if the world state pending nodes queue exists. The way we use that RocksDB database, it will actually be treated as empty on reload regardless of existing content. This is due to it using two fields to track the head and tail of the queue - when a new queue is created those are both set to 0 so the queue is empty regardless of what's on disk. Since we're walking the entire trie anyway now we'll identify all the nodes we need anyway.