-
Notifications
You must be signed in to change notification settings - Fork 747
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
Compute recent lightclient updates #4969
Conversation
beacon_node/beacon_chain/src/light_client_optimistic_update_verification.rs
Show resolved
Hide resolved
Hey @dapplion thanks for this PR. I haven't got a chance to look at the gossip verification changes yet - will continue tomorrow, but overall looks great so far! |
beacon_node/beacon_chain/src/light_client_finality_update_verification.rs
Show resolved
Hide resolved
beacon_node/beacon_chain/src/light_client_optimistic_update_verification.rs
Show resolved
Hide resolved
Nice updates, thanks I've got a few more things in mind, but happy to address these in a separate PRS:
|
Adding a test in lighthouse/beacon_node/client/src/builder.rs Line 860 in 31acd0c
The chain instance inside the harness has None as light_client_server_tx so no update is ever produced. Is there a way to recreate the more "complete" beacon node setup without repeating code in the harness? |
@dapplion and I got a passing test in the simulator, which shows that it's constantly producing optimistic updates and finality updates as the chain progresses! 🎉 I haven't looked at the metrics yet on how efficient the caching is, but I think we'll be able to start running some tests on a testnet once we have #4946 (Capella & Deneb light client support) merged as well. Ready for a final review! |
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.
I've re-reviewed the PR again - I think there's no changes to the regular code path when ligth-client-server
is disabled, and we've got altair light client updates available according to the simulator tests, so I'm happy with the changes now 👍 thanks @dapplion!
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.
Can't approve my own PR, but the last string of commits from @jimmygchen look great https://github.com/sigp/lighthouse/pull/4969/files/b41ed0759964990bec486e223cc3a25ae2c93377..a63a4886d140d19506c73ee54c4f6971654db9ad
thanks for nailing the tests!
@Mergifyio queue |
🛑 The pull request has been removed from the queue
|
@Mergifyio requeue |
✅ This pull request will be re-embarked automaticallyThe followup |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at b035638 |
* Compute recent lightclient updates * Review PR * Merge remote-tracking branch 'upstream/unstable' into lc-prod-recent-updates * Review PR * consistent naming * add metrics * revert dropping reprocessing queue * Update light client optimistic update re-processing logic. (sigp#7) * Add light client server simulator tests. Co-authored by @dapplion. * Merge branch 'unstable' into fork/dapplion/lc-prod-recent-updates * Fix lint * Enable light client server in simulator test. * Fix test for light client optimistic updates and finality updates.
Current lightclient implementation is reactive, it produces updates in response to external queries.
This PR allows the beacon node to eagerly produce lightclient updates immediately after processing each block. This approach reduces the overall cost to serve lightclient data since each update is computed at most once. Lightclient updates need access to full states to compute proofs, by computing the updates immediately after block production block replay is never necessary in normal network conditions.
In summary lightclient updates are produced in two steps:
to not delay the import_block routine, the second step in done in a separate thread with access to the network senders to push gossip updates in a latter PR.
Since this PR only produces recent updates, it's not necessary to persist them to disk. Gossip validation rules are simplified significantly since now you just need an equality check with the most recently produced update.
Issue Addressed
BeaconChain
to support fast gossip validation and RPC processing #4926Closes #4926
Next steps