-
Notifications
You must be signed in to change notification settings - Fork 74
feat: migrate to beacon blobs endpoint for Fusaka #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implements support for the new /eth/v1/beacon/blobs/{block_id} endpoint
with automatic fallback to the legacy blob_sidecars endpoint.
Key changes:
- Archiver: Prefer blobs endpoint, compute KZG commitments/proofs from
blob data, fall back to blob_sidecars on failure
- API: Add /eth/v1/beacon/blobs/{id} endpoint with versioned_hashes
filtering support using kzg4844.CalcBlobHashV1
- Test data: Generate valid BLS12-381 field elements by reducing random
data modulo the field modulus to ensure KZG operations succeed
- Test helpers: Consolidate blob generation into NewBlobSidecars with
proper header support for consistent test comparisons
All tests now use the blobs endpoint (except one that explicitly tests
the fallback behavior). The archiver stores complete blob sidecars with
derived KZG commitments and proofs, maintaining backward compatibility
with existing storage format.
Technical notes:
- Each 32-byte chunk in blob data must be < BLS12-381 field modulus
- KZG commitments/proofs are computed using gokzg4844 library
- Versioned hashes use ethereum/go-ethereum's kzg4844.CalcBlobHashV1
- Test data includes valid headers to match reconstructed sidecars
Collaborator
✅ Heimdall Review Status
|
Switch to prioritizing /eth/v1/beacon/blob_sidecars over /eth/v1/beacon/blobs since the sidecars endpoint provides KZG commitments and proofs directly, avoiding unnecessary computation.
The go-kzg-4844 package is now directly used in the codebase after migrating to the beacon blobs endpoint, so it should be listed as a direct dependency rather than an indirect one.
meyer9
previously approved these changes
Oct 16, 2025
meyer9
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG!
Replaced custom field modulus constant with gokzg4844.BlsModulus, which is the canonical BLS12-381 scalar field modulus from our existing dependency. This fixes an incorrect modulus value and provides a single source of truth for the BLS_MODULUS constant as specified in EIP-4844. The go-kzg-4844 library already exports this value as BlsModulus, so there's no need to duplicate it.
Approved review 3346878513 from meyer9 is now dismissed due to new commit. Re-request for approval.
meyer9
approved these changes
Oct 16, 2025
Collaborator
|
Review Error for meyer9 @ 2025-10-16 20:47:07 UTC |
meyer9
approved these changes
Oct 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements support for the new /eth/v1/beacon/blobs/{block_id} endpoint
as an automatic fallback from the deprecated blob_sidecars endpoint when
it fails.
Key changes:
on failure and compute KZG commitments/proofs from blob data
filtering support using kzg4844.CalcBlobHashV1
data modulo the field modulus to ensure KZG operations succeed
proper header support for consistent test comparisons
Even when the blobs endpoint is used, the archiver stores complete blob
sidecars with derived KZG commitments and proofs, maintaining backward
compatibility with existing storage format.
NOTE: This code relies on attestantio/go-eth2-client#273, which has not yet
been merged. An unreleased branch is used for this dependency for now.