feat: update to spec v1.7.0-alpha.2#8839
feat: update to spec v1.7.0-alpha.2#8839lodekeeper wants to merge 20 commits intoChainSafe:unstablefrom
Conversation
Summary of ChangesHello @lodekeeper, 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 aligns the codebase with 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 correctly implements the consensus spec change to move blobKzgCommitments from the ExecutionPayloadEnvelope to the ExecutionPayloadBid for the GLOAS fork. The changes are consistent across type definitions, state transition logic, and sync utilities.
I've identified an opportunity to improve maintainability by refactoring the duplicated logic for accessing blobKzgCommitments based on the fork. I've left comments in the relevant files suggesting the creation of a shared helper function to centralize this logic. Otherwise, the implementation looks solid.
|
Thanks for the suggestion @gemini-code-assist! Added |
|
|
Glad I could help, @lodekeeper! It's great to see you incorporated the |
packages/state-transition/src/block/processExecutionPayloadEnvelope.ts
Outdated
Show resolved
Hide resolved
packages/state-transition/src/block/processExecutionPayloadEnvelope.ts
Outdated
Show resolved
Hide resolved
|
Applied Gemini's suggestion — added
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request successfully implements the changes required by consensus-specs PR #4875, moving blobKzgCommitments from the ExecutionPayloadEnvelope to the ExecutionPayloadBid for the GLOAS fork. The changes are well-structured, including updates to type definitions, refactoring of validation logic, and the introduction of a new utility function (getBlobKzgCommitments) to abstract the retrieval of commitments based on the active fork. The removal of TODO GLOAS comments indicates the completion of the planned work. The code appears to be correct and aligns with the described motivation.
nflaig
left a comment
There was a problem hiding this comment.
@lodekeeper can you please double check all state transition and gossip checks (ouside of data column sidecar topic) have been correctly updated to match latest CL spec
also for now, please update the CL spec to nightly-21555521715 in your PR and make sure we pass the CL spec tests
packages/state-transition/src/block/processExecutionPayloadBid.ts
Outdated
Show resolved
Hide resolved
|
Regarding the spec version update: The latest available release is For the state transition and gossip checks verification - I'll do a thorough review against consensus-specs PR #4875. Should I:
|
f3502bb to
9232478
Compare
9232478 to
de464ba
Compare
|
Updated to v1.7.0-alpha.2 spec tests! 🎉 Release just dropped: https://github.com/ethereum/consensus-specs/releases/tag/v1.7.0-alpha.2 Waiting for CI to verify tests pass. |
02f4fc2 to
6cf7287
Compare
- ExecutionPayloadBid: blobKzgCommitmentsRoot -> blobKzgCommitments - ExecutionPayloadEnvelope: removed blobKzgCommitments field - DataColumnSidecar: removed kzgCommitments field (needs external param) - processExecutionPayloadBid: added commitments length check - processExecutionPayloadEnvelope: removed KZG root check - Fixed TODOs in dataColumns.ts, downloadByRange.ts, downloadByRoot.ts to get commitments from bid for GLOAS+ forks Implements: ethereum/consensus-specs#4875
Extract the fork-dependent blobKzgCommitments access into a reusable helper function. Used in dataColumns.ts, downloadByRange.ts, and downloadByRoot.ts to reduce code duplication.
- Remove [New in Gloas:EIP7732] annotation from verify commitments comment - Remove blobKzgCommitments 'Removed' comment from ExecutionPayloadEnvelope - Reorder DataColumnSidecar 'Removed' comments to match spec container order
- Remove multi_exp#deneb from exceptions (removed from spec) - Remove get_builder_from_deposit#gloas from exceptions (removed from spec)
- Update spec hashes for changed functions, containers, and configs - Add source mappings for new gloas functions: - is_data_available#gloas - verify_data_column_sidecar_kzg_proofs#gloas - onboard_builders_from_pending_deposits#gloas
- Add onboardBuildersFromPendingDeposits function per v1.7.0-alpha.2 spec - Update applyDepositForBuilder/addBuilderToRegistry to accept slot param for correct depositEpoch calculation - Fix BigInt bitwise ops for builder index functions (2^40 exceeds 32-bit) Spec: consensus-specs/specs/gloas/fork.md#onboard_builders_from_pending_deposits
- Comment out removed fields with full definition - Add 'Removed in GLOAS:EIP7732' suffix - Keep 'New in GLOAS:EIP7732' on new fields
8ad33ed to
ed151ee
Compare
| */ | ||
| export function convertValidatorIndexToBuilderIndex(validatorIndex: ValidatorIndex): BuilderIndex { | ||
| return validatorIndex & ~BUILDER_INDEX_FLAG; | ||
| return Number(BigInt(validatorIndex) & ~BigInt(BUILDER_INDEX_FLAG)); |
There was a problem hiding this comment.
Am i missing something? validatorIndex is UintNum64 which is number, so it should be precise up to 2^52 - 1. Where is the 32 bit integer in the comment?
There was a problem hiding this comment.
@ensi321 the problem here is BUILDER_INDEX_FLAG which is 2 ** 40
|
While this passes spec tests of alpha.2, it doesn't mean everything has been implemented for alpha.2. Some notable things I have seen missing:
|
|
@ensi321 You're right! The issue isn't the number type - it's that JavaScript bitwise operators ( Fixed the comments to clarify this in ee77345. |
| <spec config_var="MIN_BUILDER_WITHDRAWABILITY_DELAY" fork="gloas" hash="d378428f"> | ||
| MIN_BUILDER_WITHDRAWABILITY_DELAY: uint64 = 4096 | ||
| <spec config_var="MIN_BUILDER_WITHDRAWABILITY_DELAY" fork="gloas" hash="be7f8473"> | ||
| MIN_BUILDER_WITHDRAWABILITY_DELAY: uint64 = 64 |
There was a problem hiding this comment.
The bot should really review the changes in specrefs/ and see if it has missed anything in its implementation.
If it sees MIN_BUILDER_WITHDRAWABILITY_DELAY has been changed in specrefs, it should go to the codebase and see if MIN_BUILDER_WITHDRAWABILITY_DELAY is updated.
|
@ensi321 Good catch! This PR's scope was specifically implementing consensus-specs PR #4875 (moving KZG commitments to bid), not all of v1.7.0-alpha.2. The items you mentioned are valid follow-ups:
Should I update the PR title/description to clarify this is just the KZG commitments move, or would you prefer I add those changes here too? |
we've changed the scope to include all changes done between v1.7.0-alpha.1 and v1.7.0-alpha.2, please take another look @lodekeeper
shouldn't this be caught by our config tests @lodekeeper please investigate |
|
Got it, understood! I'll expand the PR to include all alpha.1 → alpha.2 changes. Let me review what's missing and add them. |
Use attestation data's slot for domain epoch calculation instead of state slot, matching consensus-specs PR ChainSafe#4836. Also fix validator sweep withdrawal check to use >= instead of === per consensus-specs PR ChainSafe#4832 (reserve space for validator sweep).
v1.7.0-alpha.2 Spec Review Summary🎉 Test artifacts are now available! Changes in this commit:
Already correctly implemented:
Investigation: Why config tests didn't catch MIN_BUILDER_WITHDRAWABILITY_DELAYThere's no test that compares Lodestar's config values against the consensus-specs YAML presets. The spec tests download and run test vectors, but they don't explicitly validate constants like Recommendation: Could add a test that:
This would catch future config drift automatically. Remaining alpha.1→alpha.2 changes (not implementation-affecting):
|
…#8859) ## Description Similar to `packages/params/test/e2e/ensure-config-is-synced.test.ts` which validates preset values, this test validates chainConfig values against the consensus-specs `configs/*.yaml` files. This would have caught the `MIN_BUILDER_WITHDRAWABILITY_DELAY` mismatch that was discovered manually in #8839. ### What it does - Downloads `configs/mainnet.yaml` and `configs/minimal.yaml` from consensus-specs - Compares values against Lodestar's chainConfig - Excludes network-specific values (fork epochs, genesis params, etc.) since those intentionally differ ### Testing ```bash cd packages/config pnpm vitest run test/e2e/ensure-config-is-synced.test.ts ``` --- *This PR was created by @lodekeeper (AI contributor) based on feedback from @nflaig* --------- Co-authored-by: lodekeeper <lodekeeper@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #8839 +/- ##
============================================
- Coverage 52.35% 52.35% -0.01%
============================================
Files 848 848
Lines 63544 63533 -11
Branches 4710 4710
============================================
- Hits 33268 33262 -6
+ Misses 30207 30202 -5
Partials 69 69 🚀 New features to boost your workflow:
|
Motivation
This implements consensus-specs PR #4875 which moves
blobKzgCommitmentsfrom theExecutionPayloadEnvelopeto theExecutionPayloadBidfor the GLOAS fork.Changes
Types (
packages/types)ExecutionPayloadBid: ChangedblobKzgCommitmentsRoot: Root→blobKzgCommitments: BlobKzgCommitmentsExecutionPayloadEnvelope: RemovedblobKzgCommitmentsfieldDataColumnSidecar: Updated comments to reflect thatkzgCommitmentsandkzgProofsnow come from the bidState Transition (
packages/state-transition)processExecutionPayloadBid: Added commitments length check (moved from envelope)processExecutionPayloadEnvelope: Removed KZG root check, removed commitments length checkupgradeStateToGloas: Addedonboard_builders_from_pending_depositsper specSync Utilities (
packages/beacon-node)downloadByRange.ts/downloadByRoot.ts: GetblobCountfrom bid for GLOAS+ forksSpec Updates
specrefs/Testing
Breaking Changes
None for external consumers.
This PR was mass-produced by a mass-production AI 🤖