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
ensi321
left a comment
There was a problem hiding this comment.
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
|
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 |
twoeths
left a comment
There was a problem hiding this comment.
lgtm, WithBytes should be stayed in types package too but we can do it later
|
|
🎉 This PR is included in v1.23.0 🎉 |
Motivation
Follow up on #7180 to forward blinded block bytes directly to
submitBlindedBlockto 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
SignedBlindedBeaconBlockto reconstruct the full block, so there would be no benefit there.