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

feat: implement produceBlockV3 #107

Closed
wants to merge 6 commits into from

Conversation

y0sher
Copy link

@y0sher y0sher commented Feb 25, 2024

Description

Implements produceBlockV3 according to the ethereum beacon spec.

Why

produceBlockV2 is deprecated according to the ethereum beacon specs. the only correct way to get full blocks right now is using produceBlockV3.

Open questions

  • Should we leave the deprecated produceBlockV2 to support legacy api endpoint? (I did for now)
  • How to name the new V3 endpoint? I used V3Proposal for now, but I thought it's best to consult with you. (prysm for example called it GenericVersionedBlock

@mcdee your review appreciated

@pinebit
Copy link
Contributor

pinebit commented Feb 27, 2024

It turned out we worked simultaneously on the same problem :)
Still, I pushed my PR #108 to show an alternative solution.
Feel free to discard if you want to proceed with yours. But we need this to be merged as soon as possible, as it blocks our work on Charon.

import "github.com/attestantio/go-eth2-client/spec/phase0"

// V3ProposalOpts are the options for obtaining v3 proposals.
type V3ProposalOpts struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems missing builder_boost_factor param.

Copy link
Author

Choose a reason for hiding this comment

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

thanks, it was actually added yesterday to the spec ethereum/beacon-APIs#431, after I did the PR. will do the changes soon.

// VersionedV3Proposal contains a versioned generic beacon block.
type VersionedV3Proposal struct {
Version spec.DataVersion
ExecutionPayloadBlinded bool
Copy link
Contributor

Choose a reason for hiding this comment

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

These should be automatically reflected in Metadata. Maybe we don't need to make them first-class citizens?

Copy link
Author

Choose a reason for hiding this comment

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

Version is also in metadata but it is showed up in the struct, I took the example of how @mcdee did it with version. anyway lets wait for his review.

@mcdee
Copy link
Contributor

mcdee commented Mar 2, 2024

Hi thanks for the PR. Internally we have been working on unifying the underlying blinded and non-blinded proposal flows, and have an alternate pr #116

Please could you take a look at this and let me know if it meets your requirements? Thank you.

@mcdee
Copy link
Contributor

mcdee commented Mar 25, 2024

Functionality now available in the library.

@mcdee mcdee closed this Mar 25, 2024
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.

3 participants