fix(gloas): read blob KZG commitments from the bid post-EIP-7732#702
Conversation
Gloas (EIP-7732) moved blob_kzg_commitments off the BeaconBlockBody onto the execution payload bid (the proposer commits to the blob set via signed_execution_payload_bid). Every read site that still pulled from body.BlobKZGCommitments saw an empty list on Gloas+ blocks: - slot list / epoch totals recorded BlobCount=0 on every blob-bearing block post-fork - the slot detail page didn't render a Blobs tab (BlobsCount=0 → template gate hides it) - /slot/<root>/blob/<index> returned "Blob index out of range" - transaction pages couldn't match versioned-hash to commitment Gate each read site on Version >= DataVersionGloas. Post-gloas reads go through SignedExecutionPayloadBid.Message.BlobKZGCommitments; pre-gloas behavior is unchanged. Sites touched: - indexer/beacon/block.go (BlockBodyIndex.BlobCount) - indexer/beacon/writedb.go (×2) (buildDbBlock + buildDbEpoch) - handlers/slot.go (×2) (single-blob download + slot detail tab) - handlers/transaction.go (versioned-hash → commitment match)
🤖 qu0b-reviewerSummaryThe fix correctly extracts blob KZG commitments from Issues
Suggestions
Reviewed @ |
- block.go + writedb.go: switch from version.DataVersionGloas to spec.DataVersionGloas (re-exported alias, matches the 10+ existing references across the repo); drop the gratuitous `spec/version` import in block.go. - transaction.go: log a warn when a Gloas+ block carrying blob txs has a nil SignedExecutionPayloadBid, so the silent empty-commitments case is observable instead of rendering a transaction page with missing KZGs.
Reverts the var-typed declaration that needed an explicit []deneb.KZGCommitment. Reads body.BlobKZGCommitments unconditionally, then in the Gloas+ branch reassigns to the bid's commitments (or nil when the bid is missing). Same behaviour, no new import, smaller diff.
The Gloas-vs-pre-Gloas blob commitment lookup was open-coded at 6 sites (indexer/block, indexer/writedb ×2, handlers/slot ×2, handlers/transaction). Pull it into utils.BlockBodyBlobCommitments so each caller is a single line and the fork gate lives in one place.
Per pk: the bid container is a required field on the Gloas BeaconBlockBody schema; a structurally-valid post-fork block always carries it. No need for the nil-fallback path or the warn log that guarded an unreachable case.
Summary
EIP-7732 (Gloas) moved
blob_kzg_commitmentsoff theBeaconBlockBodyonto the execution payload bid (signed_execution_payload_bid.message.blob_kzg_commitments). Every read site in dora still pulled from the body, so post-Gloas blocks showed empty blob data everywhere.Symptoms (observed on a Gloas devnet)
BlobCount=0on every blob-bearing blockBlobsCount=0hides it)/slot/<root>/blob/<index>: returnedBlob index out of rangeFix
Single helper
utils.BlockBodyBlobCommitments(body)returns the right commitment list regardless of fork — body field pre-Gloas, bid field post-Gloas. All six call sites now use it.Sites touched:
indexer/beacon/block.go—BlockBodyIndex.BlobCountindexer/beacon/writedb.go(×2) —buildDbBlock+buildDbEpochhandlers/slot.go(×2) — single-blob download + slot detail tab datahandlers/transaction.go— tx page blob-commitment match (with warn log when commitments unavailable on a blob-bearing block)utils/blobs.go— new helperTest plan
Txs / Blobs(e.g.54 / 15)/slot/<root>/blob/0returns blob payload