[Merged by Bors] - Implement checkpoint sync#2244
[Merged by Bors] - Implement checkpoint sync#2244michaelsproul wants to merge 49 commits intounstablefrom
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 <michael@sigmaprime.io>
|
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
paulhauner
left a comment
There was a problem hiding this comment.
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-syncflag 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-checkpointflag 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:
|
paulhauner
left a comment
There was a problem hiding this comment.
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 <divma@protonmail.com>
|
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.rsor the calling module)Considered out of scope for this PR:
--checkpoint-block(this would require some pretty heavy refactoring of block verification)