-
Notifications
You must be signed in to change notification settings - Fork 215
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
Add Deneb Types and Flow #553
Conversation
9ced871
to
b46d453
Compare
Codecov ReportAttention:
β Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #553 +/- ##
===========================================
- Coverage 68.85% 68.24% -0.62%
===========================================
Files 7 7
Lines 1111 1203 +92
===========================================
+ Hits 765 821 +56
- Misses 299 328 +29
- Partials 47 54 +7
Flags with carried forward coverage won't be shown. Click here to find out more. β View full report in Codecov by Sentry. |
49b6f07
to
7f8ccad
Compare
81fd59e
to
890dd7e
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.
Here's an initial review with some things to fix. Will continue reviewing.
Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com>
e8be0fd
to
4aba68e
Compare
applied suggestions from @jtraglia and rebased |
@@ -646,6 +651,143 @@ func (m *BoostService) processCapellaPayload(w http.ResponseWriter, req *http.Re | |||
m.respondOK(w, result) | |||
} | |||
|
|||
func (m *BoostService) processDenebPayload(w http.ResponseWriter, req *http.Request, log *logrus.Entry, blindedBlock *eth2ApiV1Deneb.SignedBlindedBeaconBlock) { |
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.
would it be worth making a generic processPayload function that works with both deneb and capella blocks? just in terms of reducing code copying for ease of review? maybe not if we plan on stripping out the capella payload processing function immediately after the fork. just a thought as its hard to tell what logic is new with deneb and which is just copied from capella.
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 think we should strip Capella shortly afterwards.
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 thought about this approach but there are issues as the process payload function accepts different types. We would need to have a custom interface to extract the common fields and process them which leads to more potential bugs.w/ versioning. There is code duplication but less prone to issues with version handling.
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.
good point @avalonche, agree. this is a space with high potential for critical bugs, better be safe with some duplication
jsonFile, err := os.Open("../testdata/zhejiang-execution-payload-capella.json") | ||
require.NoError(t, err) | ||
defer jsonFile.Close() | ||
func TestGetPayloadResponseIsEmpty(t *testing.T) { |
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.
could this be written as a table driven test to improve readability ?
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.
will do as follow up PR
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 π₯
π Summary
Part of #554
β± Motivation and Context
π References
β I have run these commands
make lint
make test-race
go mod tidy