Add support for new beacon chain /blobs endpoint #3830
Merged
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.
This change adds support for the new beacon chain endpoint
/eth/v1/beacon/blobs/{block_id}
introduced in Fusaka while maintaining backward compatibility with the legacy endpoint/eth/v1/beacon/blob_sidecars/{slot}
. block_id can be a slot so Nitro just uses slot.The new endpoint supports server-side filtering by versioned hash via query parameters. Since the Arbitrum sequencer inbox message contains the versioned hashes of the blobs that were posted, we can include those in the query.
Key changes:
UseLegacyEndpoint
flag to BlobClientConfig to control which endpoint to useGetBlobsBySlot()
public method for direct slot-based blob fetchinggetBlobs()
method for the new endpoint with versioned hash verificationbeaconRequest()
to support query parameters for filteringCreated
blobtool
CLI utility for testing both endpoints:The new endpoint is used by default, with automatic fallback behavior maintained through the existing secondary beacon URL mechanism.
Spec reference: https://github.com/ethereum/beacon-APIs/blob/master/apis/beacon/blobs/blobs.yaml
NIT-3885
Cherry pick of #3826
Testing
To test the new fetching method I added a new tool called
blobtool
. It's intended to be used for testing beacon endpoints, and it can use either the new or old method for fetching blobs. This is even more important after Fusaka where it is even more difficult to configure beacon nodes to have and keep all blobs. In future we may want to add some features like looking up blobs by block number, which is something operators often want to do.