-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(node/syncer)!: Implement backwards header sync (#279)
Store Relaxed rules around header insertion. Previously Store enforced storing a single contiguous range from genesis to store head, with appends allowed in a single slot right after the head. Now Store holds possibly multiple non-overlapping header ranges starting and ending at arbitrary heights. Append is allowed as long as it extends an existing range, or creates a new head range (creating a new range at the front is needed for syncing from the front). Fundamental unit for inserting headers is now a Vec of headers and single header insert is expressed in terms of that (previously it was other way around). Header sync Syncer starts up, queries store for headers already present and swarm for the network head Using above, it calculates header ranges which are already published, but absent from store Taking 512 highest missing headers it starts new header session Session starts 8 jobs, each taking up to 64 contiguous heights from the missing list and requesting them from the network Each time job finishes its work, next up to 64 headers are requested. If less than 64 headers are received, remaining range is re-requested again. After fetching all the requested ranges, they are sorted into contiguous ranges. Each range is verified internally. Each range is inserted into the store, veryfing the range edges against headers in store, if they exist. (If they don't exist yet, syncer will fetch them eventually, at which point this they'll be verified). Co-authored-by: Yiannis Marangos <[email protected]>
- Loading branch information
Showing
28 changed files
with
2,096 additions
and
727 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.