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 support for Electra #651

Merged
merged 28 commits into from
Jan 30, 2025
Merged

Add support for Electra #651

merged 28 commits into from
Jan 30, 2025

Conversation

jtraglia
Copy link
Collaborator

@jtraglia jtraglia commented Apr 29, 2024

πŸ“ Summary

This PR adds support for Electra payloads.

β›± Motivation and Context


βœ… I have run these commands

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

@jtraglia jtraglia marked this pull request as ready for review May 9, 2024 14:31
avalonche
avalonche previously approved these changes May 15, 2024
Copy link
Collaborator

@avalonche avalonche left a comment

Choose a reason for hiding this comment

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

LGTM, are tests for this going to be a follow up PR?

@jtraglia
Copy link
Collaborator Author

LGTM, are tests for this going to be a follow up PR?

Yes, I'm planning to add tests later. Please hold off on merging this for a little bit. We're working on getting the whole Electra builder stack working in Kurtosis this week. Thank you for reviewing though πŸ˜„

I'm fairly confident in these mev-boost changes, but mev-boost-relay will need some more work.

metachris
metachris previously approved these changes Jul 24, 2024
Copy link
Collaborator

@metachris metachris left a comment

Choose a reason for hiding this comment

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

types are out of date by now

@MariusVanDerWijden
Copy link
Collaborator

Waiting for attestantio/go-eth2-client#163
Once thats merged, we can update this

@jtraglia jtraglia changed the title Add support for Electra payloads Add support for Electra Oct 14, 2024
@jtraglia jtraglia marked this pull request as draft October 14, 2024 22:04
@jtraglia jtraglia marked this pull request as ready for review January 29, 2025 19:53
Copy link

@ryanschneider ryanschneider left a comment

Choose a reason for hiding this comment

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

lgtm!


require (
github.com/ethereum/go-ethereum v1.14.7
github.com/flashbots/go-boost-utils v1.8.1
github.com/ethereum/go-ethereum v1.14.9

Choose a reason for hiding this comment

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

minor: I'd suggest bumping to 1.14.13 while we're updating.

Copy link
Collaborator

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

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

Generally LGTM, two thinks that needs changing, otherwise I think the test would be moot. Also shouldn't this be caught at some point? Or is mev-boost not checking the header at all

@@ -125,6 +126,41 @@ func blindedBlockContentsToPayloadDeneb(signedBlindedBlockContents *eth2ApiV1Den
}
}

func blindedBlockContentsToPayloadElectra(signedBlindedBlockContents *eth2ApiV1Electra.SignedBlindedBeaconBlock) *builderApiDeneb.ExecutionPayloadAndBlobsBundle {
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't this return *builderApiElectra instead of builderApiDeneb?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nah because there is no new ExecutionPayloadAndBlobsBundle in Electra.

"transactions_root": "0xb1fcd304d8ba402be6e76346395ea7641fbb4c83663b697a0e88ab115d859d3f",
"withdrawals_root": "0x792930bbd5baac43bcc798ee49aa8185ef76bb3b44ba62b91d86ae569e4bb535",
"blob_gas_used": "0",
"excess_blob_gas": "0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this missing ParentBeaconRoot and RequestHash ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm I don't think so. I believe you're thinking of NewPayloadRequest.

func (m *BoostService) processElectraPayload(w http.ResponseWriter, req *http.Request, log *logrus.Entry, blindedBlock *eth2ApiV1Electra.SignedBlindedBeaconBlock) {
// Get the currentSlotUID for this slot
currentSlotUID := ""
m.slotUIDLock.Lock()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can get away with an RLock here

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or make SlotUID an atomic

Copy link
Collaborator

Choose a reason for hiding this comment

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

I will do this in a follow-up

@MariusVanDerWijden MariusVanDerWijden merged commit aed849e into develop Jan 30, 2025
4 checks passed
@MariusVanDerWijden MariusVanDerWijden deleted the electra branch January 30, 2025 21:33
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.

6 participants