feat: implement epbs block production#8838
Conversation
Summary of ChangesHello @nflaig, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces the foundational changes required to support block production for the upcoming 'Gloas' fork. The core change involves a shift from directly embedding execution payloads in beacon blocks to a system where beacon blocks contain bids, and the full execution payload is published in a separate envelope. This architectural change is crucial for enabling a more flexible and potentially more decentralized block building process, allowing for external builders to participate more effectively. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces the initial implementation for enshrined proposer-builder separation (EPBS) through the new 'gloas' fork. It adds new API endpoints (produceBlockV4, getExecutionPayloadEnvelope, publishExecutionPayloadEnvelope) and modifies existing ones to support the new block production flow. The changes span across API definitions, beacon node implementation, and validator logic. The overall structure is sound, with a clear separation of concerns for the new gloas flow. However, as a work-in-progress, several critical components are marked with TODOs, such as signature verification for envelopes, state transition logic, and correct inclusion proof generation. I've provided specific feedback on a couple of areas: an incorrect type cast in the API route definitions and a logic improvement for retrieving cached block production data.
Performance Report✔️ no performance regression detected Full benchmark results
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ddd4339d1e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for the Gloas fork and Enshrined Proposer-Builder Separation (EPBS). It adds new API endpoints for the new block production flow, updates existing logic to be fork-aware, and implements the core changes in the beacon node and validator for producing and handling blocks under EPBS. The changes are extensive and well-structured. I've found one critical issue in the gossip handler for data_column_sidecar that will cause a runtime error on the Gloas fork. My review includes a suggestion to address this.
| } | ||
|
|
||
| const delaySec = seenTimestampSec - computeTimeAtSlot(config, slot, chain.genesisTime); | ||
| metrics?.gossipExecutionPayloadEnvelope.elapsedTimeTillReceived.observe({source: OpSource.api}, delaySec); |
There was a problem hiding this comment.
Review if we can combine OpSource with other similar types
There was a problem hiding this comment.
haven't found an obvious type with which we could combine it, seems fine to me as is
| * This is the state root after running `processExecutionPayloadEnvelope` on the | ||
| * post-block state, and later used to construct the `ExecutionPayloadEnvelope`. | ||
| */ | ||
| envelopeStateRoot: Root; |
There was a problem hiding this comment.
discussion idea to figure out: store a reference to the post-block, pre-payload state instead of the post-payload state root
| return ssz.deneb.BlobSidecar; | ||
| case GossipType.data_column_sidecar: | ||
| return ssz.fulu.DataColumnSidecar; | ||
| return isForkPostFulu(fork) ? sszTypesFor(fork).DataColumnSidecar : ssz.fulu.DataColumnSidecar; |
There was a problem hiding this comment.
can be simplified to just use sszTypesFor?
There was a problem hiding this comment.
No, it's not possible because DataColumnSidecar doesn't exist pre-fulu, we used the same pattern for light client types in altair, we could think about updating sszTypesFor to have a default value to avoid having to handle this explicitly but this is rarely needed
wemeetagain
left a comment
There was a problem hiding this comment.
generally lgtm
we reviewed on a video meeting, all comments are minor nits and discussion points.
matthewkeil
left a comment
There was a problem hiding this comment.
LGTM!!! 🚀
Did team review via Google Meet. Comments left by @wemeetagain. Approving assuming all the comments he documented from the call get resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #8838 +/- ##
=========================================
Coverage 52.33% 52.34%
=========================================
Files 848 848
Lines 63429 63380 -49
Branches 4702 4697 -5
=========================================
- Hits 33195 33175 -20
+ Misses 30165 30136 -29
Partials 69 69 🚀 New features to boost your workflow:
|
Notable changes
GET /eth/v4/validator/blocks/{slot}addedGET /eth/v1/validator/execution_payload_envelope/{slot}/{beacon_block_root}addedPOST /eth/v1/beacon/execution_payload_envelopeaddedPOST /eth/v2/beacon/blocksupdatedv5.0.0-alpha.0see ethereum/beacon-APIs#580 for reference