-
Notifications
You must be signed in to change notification settings - Fork 779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Implement checkpoint sync #2244
Conversation
I've tagged this for |
I've made some tweaks to help with debugging:
My debugging flow (using scripts from
Now to fix the actual problems listed in the PR description 😅 |
There's an issue with the Altair beacon chain tests. Probably something benign, but I haven't had a chance to look into it yet. |
Also realised there are probably issues at skipped slots. If the initial block's slot doesn't match the state's I think we will run into problems. I'll look into the best way to handle this next week. |
* Close to first draft * Further progress to first draft * Further progress, before rebase * First draft * Cleanup and fixes * Notifier updates and bug fixes * Fix off-by-one errors * Remove todo * Increase backfill buffer * Gracefully handle requests during backfill * Improve comments * fmt * Update error handling * Reviewers suggestions * Take historic blocks by ref, avoid clone * Clear batch on pause * Further reviewers suggestions Co-authored-by: Michael Sproul <[email protected]>
This is ready for review! Batteries now included 🎉 |
* Give error when WS sync with existing DB * Give wrong network hint for bad SSZ * Use checkpoint instead of check-point
* Log about backfill less often * Log when backfill complete * Update docs
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.
This is such an awesome feature, I had so much fun using it 🎉
I've left a few rather minor suggestions and comments. I also have a few that don't relate to changes so I can't associate to a specific line:
- The
--shutdown-after-sync
flag will now shutdown after we reach head, but not before we finish back fill. I don't really know what the behaviour should be here, but at the very least we could add a message to the CLI help string flag indicating that this is the case. - We also have the
--wss-checkpoint
flag on the BN. I think it should probably conflict with all the checkpoint-sync flags.
I also noticed we don't have the client-side of the new /lighthouse
API endpoints. It would be fairly painless to add these and some smoke tests. I might pick this up when I get a chance and make a PR to this PR.
consensus/state_processing/src/per_block_processing/block_signature_verifier.rs
Outdated
Show resolved
Hide resolved
Thanks @paulhauner for the review, and thanks @AgeManning for fixing up that sync |
Ah, I didn't address the flag-related suggestions from your main comment. Will do that now. |
Done. Points to note:
|
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.
Awesome, I can't wait to see this in the hands of users!
You have my approval, merge at will capt'n 🎉
😮 😮 😮 bors r+ |
## Issue Addressed Closes #1891 Closes #1784 ## Proposed Changes Implement checkpoint sync for Lighthouse, enabling it to start from a weak subjectivity checkpoint. ## Additional Info - [x] Return unavailable status for out-of-range blocks requested by peers (#2561) - [x] Implement sync daemon for fetching historical blocks (#2561) - [x] Verify chain hashes (either in `historical_blocks.rs` or the calling module) - [x] Consistency check for initial block + state - [x] Fetch the initial state and block from a beacon node HTTP endpoint - [x] Don't crash fetching beacon states by slot from the API - [x] Background service for state reconstruction, triggered by CLI flag or API call. Considered out of scope for this PR: - Drop the requirement to provide the `--checkpoint-block` (this would require some pretty heavy refactoring of block verification) Co-authored-by: Diva M <[email protected]>
Pull request successfully merged into unstable. Build succeeded: |
Issue Addressed
Closes #1891
Closes #1784
Proposed Changes
Implement checkpoint sync for Lighthouse, enabling it to start from a weak subjectivity checkpoint.
Additional Info
historical_blocks.rs
or the calling module)Considered out of scope for this PR:
--checkpoint-block
(this would require some pretty heavy refactoring of block verification)