-
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
[Merged by Bors] - Reconstruct Payloads using Payload Bodies Methods #4028
Conversation
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.
Looking good overall. I'm still in the process of understanding the block streamer and will come back for a more thorough review next week.
Some thoughts on complexity:
- The current impl handles a graceful conversion from BlocksByRoot requests to PayloadsByRange. I initially thought this might not be necessary and we could always convert BlocksByRoot to PayloadsByRoot, but the non-finality requirement for using PayloadsByRoot makes that impossible.
- I'd suggested we could avoid ever using PayloadsByRoot because all unfinalized payloads should be present in the hot database. This works OK in the case where the EL's view of finality is up-to-date or ahead of the CL, but not in the case where the EL's view is behind. In practice I think handling the case where the EL is behind might be important, because the CL can sync ahead using optimistic sync. In this case however the CL's view of the finalized slot is irrelevant to whether or not we should use PayloadsByRoot, so perhaps we should refactor to always use PayloadsByRange and treat PayloadsByRoot as a fallback (like getBlockByHash).
0c41a7e
to
6409839
Compare
Co-authored-by: Michael Sproul <micsproul@gmail.com>
6409839
to
0dac21b
Compare
I've added some more descriptive logging to the streamer (perhaps we should add metrics?). Looks like most requests are for ~64 blocks. I monitored the logs for ~5 hours. In that time, every single block requested was returned. The overwhelming majority of requests require either
here's a random section of continuous logs over the course of ~5 minutes:
|
In my previous review I wrote:
Having thought about it more I'm quite certain we should action this. The current approach of trying to use lighthouse/beacon_node/beacon_chain/src/beacon_block_streamer.rs Lines 643 to 652 in 9a7d32f
The fundamental reason for this is that we always store full payloads for all blocks in the hot part of the database (with I think there are two approaches we could take to remedy this:
I started trying to implement (2) with fallback logic at this point but switched to (1) when I encountered the
One option would be to take approach (1) for now, and come back for (2) at a later date. |
Looks good to me! I've merged your changes in :) |
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'm happy to merge this to unstable
!
I've added some metrics and this PR is running on both Sepolia + Goerli without issue 👌
I've seen no issues running this on our testnet infra, merging! 🎉 |
bors r+ |
## Issue Addressed * #3895 Co-authored-by: ethDreamer <37123614+ethDreamer@users.noreply.github.com> Co-authored-by: Michael Sproul <michael@sigmaprime.io>
## Proposed Changes Builds on #4028 to use the new payload bodies methods in the HTTP API as well. ## Caveats The payloads by range method only works for the finalized chain, so it can't be used in the execution engine integration tests because we try to reconstruct unfinalized payloads there.
## Proposed Changes Builds on sigp#4028 to use the new payload bodies methods in the HTTP API as well. ## Caveats The payloads by range method only works for the finalized chain, so it can't be used in the execution engine integration tests because we try to reconstruct unfinalized payloads there.
## Proposed Changes Builds on sigp#4028 to use the new payload bodies methods in the HTTP API as well. ## Caveats The payloads by range method only works for the finalized chain, so it can't be used in the execution engine integration tests because we try to reconstruct unfinalized payloads there.
* sigp#3895 Co-authored-by: ethDreamer <37123614+ethDreamer@users.noreply.github.com> Co-authored-by: Michael Sproul <michael@sigmaprime.io>
Builds on sigp#4028 to use the new payload bodies methods in the HTTP API as well. The payloads by range method only works for the finalized chain, so it can't be used in the execution engine integration tests because we try to reconstruct unfinalized payloads there.
Issue Addressed