-
Notifications
You must be signed in to change notification settings - Fork 934
Persist light client bootstrap #5915
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
Persist light client bootstrap #5915
Conversation
…rsist-light-client-updates
…rsist-light-client-updates
…rsist-light-client-updates
|
This PR is in a good spot for another review. The pruning logic has been simplified, the bootstrap tests are passing and I've done a bit of tweaking to the test infra to make light client testing a bit easier in general. I am planning on writing some specific tests related to the pruning logic. I'm also planning on running a mainnet node with light client enabled and compare I/O + disk usage vs a node w/ light client disabled. If its a negligible difference it'd be cool to just enable light clients by default |
| } | ||
|
|
||
| if epoch_boundary_blocks.contains(&block_root) { | ||
| non_checkpoint_block_roots.remove(&block_root); |
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.
Much cleaner <3
The intended logic is:
no skipped slot
- Slot 2/1 root C : Add C to non_checkpoint_block_roots
- Slot 2/0 root B : Add B to epoch_boundary_blocks
- Slot 1/31 root A : Add A to non_checkpoint_block_roots
slot 31 skipped
- Slot 2/1 root C : Add C to non_checkpoint_block_roots
- Slot 2/0 root A : Add A to epoch_boundary_blocks
- Slot 1/31 root A : Add A to non_checkpoint_block_roots, remove A from non_checkpoint_block_roots
slot 0 skipped
- Slot 2/1 root B : Add B to non_checkpoint_block_roots
- Slot 2/0 root B : Add B to epoch_boundary_blocks, remove B from non_checkpoint_block_roots
- Slot 1/31 root A : Add A to non_checkpoint_block_roots
dapplion
left a comment
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.
Good to go! Thank you @eserilev for driving this 🙏
Approve PR now,
Sync and store with no delay,
Light shines on the chain.
…rsist-light-client-bootstrap
|
@mergify queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at a94b12b |
* persist light client updates * update beacon chain to serve light client updates * resolve todos * cache best update * extend cache parts * is better light client update * resolve merge conflict * initial api changes * add lc update db column * fmt * added tests * add sim * Merge branch 'unstable' of https://github.com/sigp/lighthouse into persist-light-client-updates * fix some weird issues with the simulator * tests * Merge branch 'unstable' of https://github.com/sigp/lighthouse into persist-light-client-updates * test changes * merge conflict * testing * started work on ef tests and some code clean up * update tests * linting * noop pre altair, were still failing on electra though * allow for zeroed light client header * Merge branch 'unstable' of https://github.com/sigp/lighthouse into persist-light-client-updates * merge unstable * remove unwraps * remove unwraps * fetch bootstrap without always querying for state * storing bootstrap parts in db * mroe code cleanup * test * prune sync committee branches from dropped chains * Update light_client_update.rs * merge unstable * move functionality to helper methods * refactor is best update fn * refactor is best update fn * improve organization of light client server cache logic * fork diget calc, and only spawn as many blcoks as we need for the lc update test * resovle merge conflict * add electra bootstrap logic, add logic to cache current sync committee * add latest sync committe branch cache * fetch lc update from the cache if it exists * fmt * Fix beacon_chain tests * Add debug code to update ranking_order ef test * Fix compare code * merge conflicts * merge conflict * add better error messaging * resolve merge conflicts * remove lc update from basicsim * rename sync comittte variable and fix persist condition * refactor get_light_client_update logic * add better comments, return helpful error messages over http and rpc * pruning canonical non checkpoint slots * fix test * rerun test * update pruning logic, add tests * fix tests * fix imports * fmt * refactor db code * Refactor db method * Refactor db method * add additional comments * Merge branch 'unstable' of https://github.com/sigp/lighthouse into persist-light-client-bootstrap * fix merge * linting * merge conflict * prevent overflow * enable lc server for http api tests * fix tests * remove prints * remove warning * revert change
Issue Addressed
Which issue # does this PR address?
Partially #3651
Proposed Changes
This doc details how a
LightClientBootstrapobject can be stored in chunks so that it can then be served later on without any expensive computations/db querieshttps://hackmd.io/@dapplion/BkxPbc6eQT
To summarize
LightClientHeadercan be constructed by fetching the full block. Blocks are already stored by root and are available forever. Fetching a single block by root isn't that expensive of a db querySyncCommitteeBranchin the db, keyed off the block rootSyncCommitteewill also be stored in the db, keyed off the sync committee period.LightClientBootstrapfrom the current finalized period, we can construct theSyncCommitteefrom the current state, since fetching the current beacon state is cheapSyncCommitteefrom the db.Additional Info
This PR builds off of #5545.
#5545 should be merged before this PR