-
Notifications
You must be signed in to change notification settings - Fork 781
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] - Block v3 endpoint #4629
Conversation
PrefaceUp until this point, i've sort of just "cloned" the existing block fetching flow and added the ability to return either a full or blinded payload. I've added several enums and structs to make this possible. Note that there is some additional refactoring/consolidation that needs to happen here. Theres some code on both the old flow and new flow that can be extracted and shared between the two. The code at this point can be viewed as a starting point for some additional refactoring. It's also important to mention that the old flow is technically deprecated post deneb fork. So a lot of the refactoring here may technically be a waste of time? I guess it depends how the Lighthouse team/Ethereum foundation treats deprecated code. If we expect the old block fetching flow to exist forever, then maybe its worth it to put significant effort here into really cleaning this up. |
Naming ConventionEnumswhere it made sense I added enums with the suffix "Type" i.e. New structsAdded the v3 suffix to new structs. Most of the new structs I created were clones of existing structs without the AbstractExecPayload generic type param Function namesWhere it made sense I affixed 'determine' to the function names. These functions are mostly copy/paste jobs from existing functions without the |
I'm not up to date with this endpoint, but should this be targeting deneb branch? Is there any discussion on when to switch over? |
I think targeting |
Looks like you've got it so far!
We will need to support both the new and old endpoints for some amount of time so people have a chance to migrate. Some users update bn + vc separately. And other clients may not release these changes at the same time as us, so running a teku VC with a lighthouse BN might stop working for a period if we deprecate the old flow. I think the concrete flow you have here could replace the abstract flow entirely without too many changes. We would need to pass into the block production flow something like this (feel free to improve naming):
We could use information in this enum to replace the info from Then at this line we could return the requested block type if we have one of the v2 variants of otherwise, always return the full payload I'm not positive this will work as expected but might be a decent route to explore to reduce the code duplication |
@realbigsean thanks for the feedback and additional info. I think the |
I resolved the merge conflicts, however there still might be a few opportunities to refactor/clean up the code |
I pushed up a small refactor, this should be ready for another review EDIT: Theres a few tests failing, will fix soon |
resolved the failing tests |
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 great on the whole! I just had a few minor comments and suggestions
Thanks for the feedback, I pushed up the relevant changes |
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.
Nice! Looks great just had a couple tiny comments but looks good to me
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.
Approved!
bors r+ |
## Issue Addressed #4582 ## Proposed Changes Add a new v3 block fetching flow that can decide to return a Full OR Blinded payload ## Additional Info Co-authored-by: Michael Sproul <[email protected]>
Pull request successfully merged into unstable. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page.
|
Issue Addressed
#4582
Proposed Changes
Add a new v3 block fetching flow that can decide to return a Full OR Blinded payload
Additional Info