feat: add gloas execution payload envelope import pipeline - #8962
Conversation
Summary of ChangesHello @ensi321, 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 infrastructure for handling Gloas execution payload envelopes within the beacon node. It establishes a new data flow that tracks the availability of execution payloads and their associated data columns, ensuring that blocks are only processed once all necessary components are received. This enhancement is crucial for supporting future Gloas-specific functionalities and maintaining data integrity throughout the block processing pipeline. 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. Changelog
Activity
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 import pipeline for Gloas execution payload envelopes, a significant feature for the upcoming Gloas fork. The changes are extensive, touching the API, core chain logic, validation, caching, and fork-choice mechanisms. The introduction of PayloadEnvelopeInput and SeenPayloadEnvelopeInput provides a robust mechanism for handling the asynchronous arrival of different components of a Gloas block. The refactoring to remove Gloas-specific details from ProtoBlock is a good architectural improvement, enhancing separation of concerns. The code is well-structured, and the changes are consistent across the codebase. I've identified one minor latent issue in some commented-out code and provided a suggestion to fix it.
Performance Report✔️ no performance regression detected Full benchmark results
|
Use getBlockSlotState instead of getHeadState for builder pubkey lookup during execution payload envelope validation. This ensures signature verification uses the correct builder registry state at the block's slot, rather than potentially stale head state that could differ due to reorgs or head changes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@lodekeeper can you do a review on this? |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c998d3b70
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
lodekeeper
left a comment
There was a problem hiding this comment.
Did a pass on the latest diff. I agree with the newly raised P1s and think they should be addressed before merge:
-
computeEnvelopeStateRoot currently calls processExecutionPayloadEnvelope with verifyStateRoot=true while deriving the state root from an envelope that still has a placeholder stateRoot. That can self-fail block production in this path. This derivation step should skip state-root verification and only verify after the computed root is populated.
-
PayloadEnvelopeInput.shouldImport sets importClaimed=true before import success and never resets on import failure. If EL import fails transiently (ELERROR / UNAVAILABLE), later envelope/column arrivals cannot retry import and we can stay stuck until pruning/finalization.
Also +1 on the cache-eviction TODO thread (clearByRootAndSlot) — clearing too aggressively can wipe useful pending data paths and likely needs narrower eviction semantics.
|
@ensi321 done — I left a review pass on the latest diff (including the two new P1s and cache-eviction concern): #8962 (review) |
twoeths
left a comment
There was a problem hiding this comment.
did not fully review the PR
the PayloadEnvelopeInput should support having available data if it sees >= 64 columns similar to what we have pre-gloas
I have #8974 to make it easier to transition there and deduplicate persisting DataColumnSidecar to db
twoeths
left a comment
There was a problem hiding this comment.
We need to make it ready for BeaconStateView too, dropped some more minor comments
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
lodekeeper
left a comment
There was a problem hiding this comment.
Thorough review of the full payload envelope import pipeline. Architecture is sound — the PayloadEnvelopeInput state machine, PayloadEnvelopeProcessor queue, and SeenPayloadEnvelopeInput cache mirror the block import pipeline cleanly. Removal of builderIndex/blockHashFromBid from ProtoBlock is a good separation of concerns.
Main concerns are around persistence ordering, error handling edge cases, and two .ts import extensions that will break at runtime. Details inline.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
||
| // 2. Apply backpressure from the write queue early, before doing verification work. | ||
| // The actual DB write is deferred until after verification succeeds. | ||
| await this.unfinalizedPayloadEnvelopeWrites.waitForSpace(); |
There was a problem hiding this comment.
@ensi321 agree that the actual DB write should be deferred until after verification but I don't see why we should delay verification just because the db write queue is full, these seem kinda independent to me, curious about your thoughts why you kept the check here (at the start of the import)
| // TODO GLOAS: Enable when PR #8868 merged (adds processPayloadState) | ||
| // this.regen.processPayloadState(postPayloadState); | ||
| // if epoch boundary also call | ||
| // this.regen.addCheckpointState(cp, checkpointState, true); |
There was a problem hiding this comment.
we could address this now, but fine to do in a follow up
This reverts commit 1cdc693. ah I think this was correct cc @twoeths, it doesn't change much it will be either way treated as `IGNORE` but if we pruned `payloadInput` then we would use code `PAYLOAD_ENVELOPE_INPUT_MISSING` even though it should be `ENVELOPE_ALREADY_KNOWN`, I guess that was the initial concern I raised. So I am reverting this commit.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #8962 +/- ##
=========================================
Coverage 52.28% 52.28%
=========================================
Files 848 848
Lines 62165 62155 -10
Branches 4544 4544
=========================================
- Hits 32503 32498 -5
+ Misses 29597 29592 -5
Partials 65 65 🚀 New features to boost your workflow:
|
|
🎉 This PR is included in v1.42.0 🎉 |
Summary
PayloadEnvelopeInputclass to track payload envelope + data columnsimportExecutionPayloadfunction for EL verification and execution payload state transitionSeenPayloadEnvelopeInputcache for managing payload inputsSeenExecutionPayloadEnvelopesin favour ofSeenPayloadEnvelopeInputBackground
In Gloas (ePBS), beacon blocks and execution payloads have separate validity requirements:
Key Changes
New Files
payloadEnvelopeInput/payloadEnvelopeInput.ts- Tracks bid + envelope + columns with 4-state machineimportExecutionPayload.ts- EL verification, signature check, execution payload state transitionwritePayloadEnvelopeInputToDb.ts- Persists envelope + columns to DBseenPayloadEnvelopeInput.ts- Cache with finalization pruningModified Files
importBlock.ts- CreatesPayloadEnvelopeInputduring Gloas block importgossipHandlers.ts- Handlesexecution_payloadtopic, triggers import on completionextractSlotRootFns.ts- SSZ helpers for payload envelope queueingexecutionPayloadEnvelope.ts- Validation using block post-state (not head state)fork-choice- RemovedbuilderIndex/blockHashHexfrom ProtoBlock (now in PayloadEnvelopeInput)TODO
data_column_sidecargossip handler integration (commented, needs Gloas-specific validation)🤖 Generated with Claude Code