Skip to content
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

Merged
merged 15 commits into from
Jan 19, 2024
Merged

Add Deneb Types and Flow #553

merged 15 commits into from
Jan 19, 2024

Conversation

avalonche
Copy link
Collaborator

@avalonche avalonche commented Jul 28, 2023

πŸ“ Summary

Part of #554

β›± Motivation and Context

πŸ“š References


βœ… I have run these commands

  • make lint
  • make test-race
  • go mod tidy

@avalonche avalonche mentioned this pull request Jul 28, 2023
3 tasks
@avalonche avalonche force-pushed the develop-deneb branch 3 times, most recently from 9ced871 to b46d453 Compare August 11, 2023 21:11
@avalonche avalonche requested review from michaelneuder and metachris and removed request for michaelneuder August 14, 2023 18:15
@codecov-commenter
Copy link

codecov-commenter commented Aug 18, 2023

Codecov Report

Attention: 52 lines in your changes are missing coverage. Please review.

Comparison is base (bcfd1db) 68.85% compared to head (25adf46) 68.24%.

Files Patch % Lines
server/service.go 63.57% 40 Missing and 11 partials ⚠️
server/mock_relay.go 96.29% 1 Missing ⚠️

❗ 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     
Flag Coverage Ξ”
unittests 68.24% <71.73%> (-0.62%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

Copy link
Collaborator

@jtraglia jtraglia left a 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.

server/service.go Outdated Show resolved Hide resolved
server/service.go Outdated Show resolved Hide resolved
server/service.go Show resolved Hide resolved
server/service.go Outdated Show resolved Hide resolved
server/service.go Outdated Show resolved Hide resolved
server/utils.go Outdated Show resolved Hide resolved
server/service.go Outdated Show resolved Hide resolved
server/service.go Outdated Show resolved Hide resolved
@metachris
Copy link
Collaborator

metachris commented Jan 11, 2024

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) {
Copy link
Collaborator

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.

Copy link
Collaborator

@jtraglia jtraglia Jan 11, 2024

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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) {
Copy link
Collaborator

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 ?

Copy link
Collaborator Author

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

Copy link
Collaborator

@jtraglia jtraglia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM πŸ₯‡

@metachris metachris merged commit 4ff4d89 into develop Jan 19, 2024
4 checks passed
@metachris metachris deleted the develop-deneb branch January 19, 2024 10:40
@avalonche avalonche mentioned this pull request Jan 19, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants