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 comprehensive support for the upcoming Gloas fork's Execution Payload-Based Sharding (ePBS) mechanism. It refactors the core logic for handling block data availability, enabling the beacon node to correctly process and verify blocks where execution payloads and data columns arrive separately. The changes ensure that the system can assemble and validate all necessary components for Gloas blocks, maintaining compatibility with the new ePBS architecture. 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 support for the new 'Gloas' fork, specifically for Execution Payload Bid (ePBS) and its associated data columns. The changes involve adding a new BlockInputEpbs class to manage the distinct states of Gloas blocks, payloads, and data columns. The SeenBlockInput cache has been updated to handle Gloas-specific block inputs and payload envelopes, and the dataColumnMatrixRecovery utility now supports both Fulu and Gloas data column types. Overall, the implementation is well-structured and integrates smoothly with the existing data availability (DA) handling mechanisms.
| // TODO: Add metrics for payload envelope creation | ||
| // this.metrics?.seenCache.blockInput.createdByPayload.inc(); |
| // TODO GLOAS: Address all data column side car types in the codebase | ||
| sidecarsToPublish.push(columnSidecar as fulu.DataColumnSidecar); |
There was a problem hiding this comment.
The TODO GLOAS comment here suggests that the handling of data column sidecar types in the sidecarsToPublish array might be incomplete for Gloas. Currently, it's explicitly cast to fulu.DataColumnSidecar. This could lead to issues if publishDataColumns expects a generic or gloas.DataColumnSidecar type, or if there are specific properties of gloas.DataColumnSidecar that need to be preserved during publishing. It's important to ensure that all data column sidecar types are correctly addressed throughout the codebase to maintain data integrity and compatibility.
| blockInput.addBlock({ | ||
| block: block as SignedBeaconBlock<ForkPostFulu & ForkPreGloas>, | ||
| block: block as any, |
There was a problem hiding this comment.
Using as any and disabling the no-unsafe-assignment ESLint rule, even in a test file, can reduce type safety and make the code harder to maintain or refactor in the future. While it might be a pragmatic workaround for complex type intersections in tests, consider if there's a more type-safe way to achieve the same testing goal, perhaps by creating a mock object that strictly adheres to the expected interface or by narrowing the type more precisely.
Performance Report✔️ no performance regression detected Full benchmark results
|
In Gloas, blocks, execution payloads, and data columns arrive separately and must be assembled correctly to verify data availability.
Key Changes
1. New
BlockInputEpbsClass (~540 lines)Added
packages/beacon-node/src/chain/blocks/blockInput/blockInput.ts:Features:
hasBlock × hasAllDatacombinationscreateFromBlock(),createFromPayload(),createFromColumn()addPayloadEnvelope()- Add execution payload envelopeaddColumn()- Add data column sidecarsmarkPayloadUnavailable()- Mark payload as unavailable based on PTC votesgetPayloadEnvelope()/getSampledColumns()/getCustodyColumns()2. SeenBlockInput Cache Updates
Modified
packages/beacon-node/src/chain/seenCache/seenGossipBlockInput.ts:getByPayloadEnvelope()- Cache and retrieve BlockInputEpbs by payload envelopegetByColumn()- Now dispatches to fork-specific handlers:getByColumnFulu()- Handles Fulu data columns (unchanged logic)getByColumnGloas()- Handles Gloas data columns (new)getByBlock()- CreatesBlockInputEpbsfor Gloas blocksGOSSIP_PAYLOAD_ALREADY_KNOWNfor duplicate payloads3. Type System Updates
New types (
packages/beacon-node/src/chain/blocks/blockInput/types.ts):New error codes (
packages/beacon-node/src/chain/blocks/blockInput/errors.ts):PAYLOAD_ENVELOPE_ALREADY_SETPAYLOAD_UNAVAILABLE_MARKED4. Utility Updates
packages/beacon-node/src/util/blobs.ts:isGloasDataColumnSidecar()type guarddataColumnMatrixRecovery()to support both Fulu and Gloas columnspackages/beacon-node/src/util/dataColumns.ts:recoverDataColumnSidecars()signature to acceptBlockInputColumns | BlockInputEpbs5. Integration Points
BlockInputColumnsandBlockInputEpbscomputeSubnetForDataColumnSidecar()works with both fork typesTesting
Added unit tests in
packages/beacon-node/test/unit/chain/seenCache/seenBlockInput.test.ts:BlockInputEpbsviagetByBlock()isBlockInputEpbs())