feat: add payload envelope reqresp - #9050
Conversation
Summary of ChangesHello, 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 new peer-to-peer (P2P) protocols to enable the retrieval of execution payload envelopes within the beacon node network. These additions are critical for supporting upcoming network requirements, likely associated with a new Ethereum fork, by allowing nodes to efficiently request and serve execution payload data either by block root or by a specified slot range. 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 support for ExecutionPayloadEnvelopes request-response protocols, which is a key feature for the upcoming gloas fork. The changes are well-structured and follow the existing patterns for adding new network protocols. I've identified one minor omission related to peer scoring on request timeouts that should be addressed for consistency.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e20f2b08a
ℹ️ 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".
| } | ||
|
|
||
| // TODO GLOAS: Use chain.getSerializedExecutionPayloadEnvelope() to check in-memory caches before hitting the db when the method is available | ||
| const envelopeBytes = await db.executionPayloadEnvelope.getBinary(root); |
There was a problem hiding this comment.
Read finalized envelopes when serving by-root requests
This handler accepts roots from the MIN_EPOCHS_FOR_BLOCK_REQUESTS window but only reads from db.executionPayloadEnvelope (hot/unfinalized storage), so valid finalized roots in that window are silently skipped once data is archived/pruned from hot DB. In practice, peers requesting older-but-still-allowed roots will get empty responses even when the node has the envelope in archive, so this needs a finalized fallback path before continuing.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
We probably can. But onBeaconBlocksByRoot currently doesn't serve blocks from cold db. A TODO was added in #8784. We probably want to wait until that is resolved before we serve finalized payloads
There was a problem hiding this comment.
this looks like a regression to me, I am pretty sure we previously served these, and it's now also required by spec ethereum/consensus-specs#4950
There was a problem hiding this comment.
@ensi321 can you add a TODO for this, or even better, address this for payloads in this PR, this is just a bug and not compliant with the spec
There was a problem hiding this comment.
We probably can. But
onBeaconBlocksByRootcurrently doesn't serve blocks from cold db. A TODO was added in #8784. We probably want to wait until that is resolved before we serve finalized payloads
@ensi321 this doesn't seem true, I looked at the code today and it seems good to me, the TODO is something else and I am not even sure it's real (or at most just a very unlikely race condition)
see #9108 (comment)
There was a problem hiding this comment.
@ensi321 can you add a TODO for this, or even better, address this for payloads in this PR, this is just a bug and not compliant with the spec
also already resolved, see #9111 (comment)
Performance Report✔️ no performance regression detected Full benchmark results
|
nflaig
left a comment
There was a problem hiding this comment.
this PR needs to be reworked once payload input PR is merged, let's hold off on it for now
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
to quickly summarize how I think we should deal with orphaned payloads by range
by root
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #9050 +/- ##
=========================================
Coverage 52.42% 52.42%
=========================================
Files 848 848
Lines 61674 61674
Branches 4529 4529
=========================================
Hits 32334 32334
Misses 29275 29275
Partials 65 65 🚀 New features to boost your workflow:
|
|
🎉 This PR is included in v1.42.0 🎉 |
**Motivation** Port of an outstanding fix from the `glamsterdam-devnet-7` branch (#9587) that never landed on `unstable`. #9050 added the `ExecutionPayloadEnvelopesByRange` req/resp method with a `byPeer` quota of `MAX_REQUEST_BLOCKS_DENEB` (128), while the spec caps envelope range requests at `MAX_REQUEST_PAYLOADS` per https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.12/specs/gloas/p2p-interface.md#executionpayloadenvelopesbyrange-v1. The `getRequestCount` side already uses `MAX_REQUEST_PAYLOADS`; the `byPeer` quota was left inconsistent. **Description** - Use `config.MAX_REQUEST_PAYLOADS` for the `ExecutionPayloadEnvelopesByRange` `byPeer` quota - Add a unit test asserting the quota matches `MAX_REQUEST_PAYLOADS` Cherry-picked from `glamsterdam-devnet-7` (88b8052, original author @nflaig); applied without conflicts. **AI Assistance Disclosure** - [x] I have read the [contributor guidelines](https://github.com/ChainSafe/lodestar/blob/unstable/CONTRIBUTING.md#ai-assistance-notice) and disclosed my usage of AI below. Cherry-pick selection and verification done with AI assistance (Claude Code); original commit authored by @nflaig on the devnet-7 branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
No description provided.