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

Deneb Support #564

Merged
merged 32 commits into from
Jan 30, 2024
Merged

Deneb Support #564

merged 32 commits into from
Jan 30, 2024

Conversation

avalonche
Copy link
Collaborator

@avalonche avalonche commented Jan 4, 2024

📝 Summary

mev-boost-relay changes for the deneb upgrade. See #489 for changes included in this branch. Summary:

  • Clean up of custom types in common/types.go and use attestant types instead
  • Default to PublishBlockV2 endpoint for block publishing
  • Deneb types and blob validation

📚 References

Specs


✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

@avalonche avalonche changed the title Deneb Deneb Support Jan 4, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2024

Codecov Report

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

Comparison is base (930f084) 33.24% compared to head (1ffdc1a) 35.66%.

Files Patch % Lines
common/types_spec.go 21.81% 211 Missing and 4 partials ⚠️
services/api/service.go 42.02% 136 Missing and 13 partials ⚠️
common/test_utils.go 8.52% 118 Missing ⚠️
common/utils.go 42.10% 51 Missing and 15 partials ⚠️
services/api/utils.go 18.64% 41 Missing and 7 partials ⚠️
datastore/redis.go 59.55% 29 Missing and 7 partials ⚠️
beaconclient/util.go 3.33% 28 Missing and 1 partial ⚠️
common/types.go 33.33% 16 Missing ⚠️
beaconclient/multi_beacon_client.go 0.00% 15 Missing ⚠️
beaconclient/prod_beacon_instance.go 11.76% 14 Missing and 1 partial ⚠️
... and 10 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #564      +/-   ##
==========================================
+ Coverage   33.24%   35.66%   +2.41%     
==========================================
  Files          24       24              
  Lines        5087     5227     +140     
==========================================
+ Hits         1691     1864     +173     
+ Misses       3177     3106      -71     
- Partials      219      257      +38     
Flag Coverage Δ
unittests 35.66% <31.27%> (+2.41%) ⬆️

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.

@avalonche avalonche requested review from michaelneuder, metachris and jtraglia and removed request for metachris January 18, 2024 17:50
@metachris metachris added help wanted Extra attention is needed PSA labels Jan 19, 2024
beaconclient/multi_beacon_client.go Show resolved Hide resolved
beaconclient/prod_beacon_instance.go Outdated Show resolved Hide resolved
beaconclient/prod_beacon_instance.go Outdated Show resolved Hide resolved
common/test_utils.go Show resolved Hide resolved
common/test_utils.go Outdated Show resolved Hide resolved
common/types_spec.go Outdated Show resolved Hide resolved
Value: value,
PrevRandao: prevRandao,
BlockNumber: blockNumber,
Withdrawals: withdrawals,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about BlobGasUsed and ExcessBlobGas? The type doesn't have those fields.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not needed as those fields are validated at the builder, this is just an helper struct that grabs the common fields needed for validation at the relay

datastore/memcached_test.go Show resolved Hide resolved
datastore/memcached_test.go Show resolved Hide resolved
services/api/types_test.go Show resolved Hide resolved
database/database_test.go Outdated Show resolved Hide resolved
datastore/redis.go Outdated Show resolved Hide resolved
Comment on lines +243 to 247
type BuilderBlockValidationRequest struct {
*VersionedSubmitBlockRequest
RegisteredGasLimit uint64 `json:"registered_gas_limit,string"`
ParentBeaconBlockRoot *phase0.Root `json:"parent_beacon_block_root,omitempty"`
}
Copy link
Collaborator

@jtraglia jtraglia Jan 19, 2024

Choose a reason for hiding this comment

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

Will the validator function allow ParentBeaconBlockRoot to be missing? It doesn't appear to be an optional field in the builder's BuilderBlockValidationRequestV3 struct. Should BuilderBlockValidationRequest (here in the relay) have the omitempty qualifier?

image

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 think the builder's BuilderBlockValidationRequestV3 struct will unmashal to a zero value (0 hash) as it does not validate that it is a required field.

README.md Show resolved Hide resolved
beaconclient/util.go Outdated Show resolved Hide resolved
services/api/service.go Outdated Show resolved Hide resolved
services/api/service.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@michaelneuder michaelneuder left a comment

Choose a reason for hiding this comment

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

tiny nits, still wrapping my head around it. will take another pass when im more fresh tomorrow

common/types_spec.go Outdated Show resolved Hide resolved
common/types_spec.go Outdated Show resolved Hide resolved
@jtraglia
Copy link
Collaborator

@avalonche I didn't realize that switch statement pattern (falllthrough) was used to appease exhaustive.

avalonche and others added 2 commits January 25, 2024 19:39
* backwards compatibility if no deneb schedule

* Update services/api/service.go

Co-authored-by: Chris Hager <chris@linuxuser.at>

---------

Co-authored-by: Chris Hager <chris@linuxuser.at>
@avalonche
Copy link
Collaborator Author

@jtraglia yeah I didn't like having to list every version as the code only supports a small subset of the versions, so disabled the linter

@metachris
Copy link
Collaborator

metachris commented Jan 25, 2024

PSA: We've deployed this PR (tip of deneb branch 1ffdc1a) to Flashbots mainnet relay.

metachris
metachris previously approved these changes Jan 30, 2024
* add test vectors

* linting
@avalonche avalonche merged commit 72fab1a into main Jan 30, 2024
4 checks passed
@avalonche avalonche deleted the deneb branch January 30, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed PSA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants