This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
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
When the pivot block header has been downloaded, store it to disk. Currently this is always removed on shutdown because the world state downloader can't currently handle resuming. However, once that is complete and we stop deleting the stored header on shutdown:
FastSyncActions
will use that same pivot block when restartingNote that the validation which disabled fast sync when the chain wasn't empty has been moved out of
SynchronizerConfiguration
into the newFastSynchronizer
. The validation therefore happens later than previously and theEthProtocolManager
will requireEth63
if fast sync is requested, even if it is disallowed due to the chain not being empty. Given how rareEth62
-only clients are these days and that we expect to be able to findEth63
clients on the first run when fast sync is used this seems like a reasonable trade off. The code is now simpler and the decision to use fast sync is all in one place now.The introduction of
FastSynchronizer
moves a lot of fast-sync specific code out ofDefaultSynchronizer
, keeping it simple and providing better isolation of concerns.