-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
feat: forward blinded block ssz bytes to submitBlindedBlock api #7185
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #7185 +/- ##
=========================================
Coverage 49.21% 49.21%
=========================================
Files 598 598
Lines 39794 39796 +2
Branches 2093 2090 -3
=========================================
+ Hits 19584 19586 +2
Misses 20170 20170
Partials 40 40 |
Performance Report✔️ no performance regression detected 🚀🚀 Significant benchmark improvement detected
Full benchmark results
|
0073c2a
to
9e06567
Compare
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.
This approach makes sense. I guess we need to put a comment somewhere to emphasize blockBytes
is the ssz representation of signedBlindedBlock
and not another block replacing the latter cuz this line looks kinda like that to me.
lodestar/packages/api/src/builder/routes.ts
Line 144 in 9e06567
body: blockBytes ?? getExecutionForkTypes(fork).SignedBlindedBeaconBlock.serialize(signedBlindedBlock), |
we may have the same demand for future flow and we have |
I have refactored it in the last commit to use that, it feels more self-contained which I like, let me know what you think, can always revert the last commit |
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.
lgtm, WithBytes
should be stayed in types
package too but we can do it later
|
Motivation
Follow up on #7180 to forward blinded block bytes directly to
submitBlindedBlock
to save an extra serialization step.Description
Forwards the raw ssz bytes of blinded block and use those when submitting blinded block to the builder.
I went with an optional extra argument as this seemed the least complicated / messy in terms of handling.
From a simple function signature point of view, something like
might be cleaner but this causes bunch of issues such as having to extract slot from bytes or handling bytes in JSON serialization case.
We always have to deserialize the
SignedBlindedBeaconBlock
to reconstruct the full block, so there would be no benefit there.