Open MaanavKhaitan opened 1 day ago
The pull request introduces significant modifications across multiple files to enhance the handling of blob sidecars within the application. Key changes include the reordering of type parameters in function calls, the addition of new methods and interfaces for blob sidecars, and updates to existing method signatures to accommodate new generic structures. Notably, a new BlobBackend
interface is introduced, and several methods are added to improve data retrieval and processing related to blob sidecars. These changes collectively enhance the type safety and functionality of the backend components.
File Path | Change Summary |
---|---|
beacond/cmd/defaults.go | Modified DefaultComponents function to reorder type parameters in components.ProvideNodeAPIBackend . |
beacond/cmd/types.go | Updated NodeAPIBackend type alias to include *BlobSidecar . |
mod/beacon/blockchain/types.go | Corrected comment for BlobSidecars interface from "blobs sidecars" to "blob sidecars". |
mod/da/pkg/store/store.go | Added constant SLOT_COMMITMENTS_KEY and modified Persist method for parallel processing; introduced GetBlobsFromStore method. |
mod/da/pkg/store/types.go | Added Get method to IndexDB interface for data retrieval. |
mod/da/pkg/types/commitments.go | Introduced SlotCommitments type with associated methods for KZG commitments. |
mod/da/pkg/types/sidecar.go | Added GetIndex and GetInclusionProof methods to BlobSidecar struct. |
mod/node-api/backend/backend.go | Updated type parameters for BlobSidecarsT and BlobSidecarT in Backend struct and related methods. |
mod/node-api/backend/blob.go | Introduced BlobSidecarsAtSlot method to retrieve blob sidecars by slot. |
mod/node-api/backend/block.go | Updated method signatures for BlockHeaderAtSlot , BlockRootAtSlot , and BlockRewardsAtSlot with additional type parameters. |
mod/node-api/backend/genesis.go | Updated GenesisValidatorsRoot method signature to include an extra underscore in type parameters. |
mod/node-api/backend/randao.go | Modified RandaoAtEpoch method signature to reflect new type parameters. |
mod/node-api/backend/state.go | Updated StateFromSlotForProof , StateRootAtSlot , and StateForkAtSlot method signatures with additional underscores. |
mod/node-api/backend/types.go | Added new interfaces and methods for blob sidecars, including BlobSidecar and BlobSidecars . |
mod/node-api/backend/validator.go | Updated method signatures for ValidatorByID , ValidatorsByIDs , and ValidatorBalancesByIDs to include new type parameters. |
mod/node-api/handlers/beacon/backend.go | Introduced BlobBackend interface and updated Backend interface to include it. |
mod/node-api/handlers/beacon/blob.go | Added GetBlobSidecars method to handle requests for blob sidecars. |
mod/node-api/handlers/beacon/routes.go | Changed handler for /eth/v1/beacon/blob_sidecars/:block_id from h.NotImplemented to h.GetBlobSidecars . |
mod/node-api/handlers/beacon/types/request.go | Updated validation rules for Indices field in GetBlobSidecarsRequest and removed BlobSidecarRequest type. |
mod/node-api/handlers/beacon/types/response.go | Added BlobSidecarData and BlobSidecarsResponse types for handling blob sidecar data in responses. |
mod/node-core/pkg/components/api.go | Updated ProvideNodeAPIBackend function to reflect new type parameters for blob sidecars. |
mod/node-core/pkg/components/interfaces.go | Updated AvailabilityStore interface and added new methods for blob sidecars. |
BlobSidecar
type and its usage in the ProvideNodeAPIBackend
function.🐇 In the code, we hop and play,
With blob sidecars, bright as day.
New methods here, and types anew,
Enhancing all we strive to do!
So let’s rejoice, both near and far,
For every change, a shining star! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
What
getBlobSidecars()
route in the beacon API (https://ethereum.github.io/beacon-APIs/#/Beacon/getBlobSidecars)GetBlobsFromStore()
function to the DA store and adds aBlobBackend
which fetches the blob sidecars and filters based on indexTesting
make start
make start-reth
go run main.go
in https://github.com/colinlyguo/EIP-4844-dev-usage to send a blob txcurl -X 'GET' \ 'http://localhost:3500/eth/v1/beacon/blob_sidecars/{slot}?indices=0' \ -H 'accept: application/json'
Verified that the correct blob sidecar is returned
Summary by CodeRabbit
Release Notes
New Features
BlobBackend
interface for handling blob sidecars.BlobSidecarsAtSlot
method for retrieving blob sidecars by slot and indices.GetBlobsFromStore
method inAvailabilityStore
to fetch blob sidecars.Improvements
BlobSidecar
interface for improved data access.Bug Fixes
Documentation