Skip to content

archive API: query blob info by CL version - #524

Merged
syntrust merged 5 commits into
mainfrom
gloas-beacon-api
Oct 28, 2026
Merged

syntrust merged 5 commits into
mainfrom
gloas-beacon-api

Conversation

@syntrust

@syntrust syntrust commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Background

Beacon API response structure changed as ePBS introduced by the Gloas fork.

A beacon block is now decoded by its consensus version

  • deneb/electra/fulu through the execution payload:
body.execution_payload.block_number
body.blob_kzg_commitments
body.signed_execution_payload_bid.message.block_hash
body.signed_execution_payload_bid.message.blob_kzg_commitments

Both yield the execution block number/hash plus the blob commitments in block order.

What

  • Blob lookup no longer needs an execution block number: PutBlob events are fetched for the execution block hash directly, so gloas blocks (whose bid carries no block number) work.
  • Returned blobs follow the block's commitment order regardless of request order or event order.
  • Failures are distinguishable: unknown slot, or a blob the node hasn't stored, are 404; beacon unreachable/timeout/invalid response, or a block version the archiver cannot decode, are 502; an execution block L1 has not seen yet is a retryable 503. A block that exists but cannot be decoded is never reported as "not found".
  • Upstream beacon requests carry the caller's deadline and a response size cap.

Test

  • Parser driven by fixtures for every supported version, including a gloas block with no execution payload and one with no blobs; missing fields, bad hash/commitment lengths, bad JSON and unknown versions are asserted to surface as upstream errors, never 404.
  • End-to-end: the API runs against a fake beacon node, a fake execution client and a real shard file. Three blobs stored at shuffled kv indices, reported by the execution client in a third order, come back in commitment order and filtered to the requested hashes; the getLogs request is asserted to carry blockHash with no fromBlock/toBlock.
  • Error paths covered end-to-end: blob not stored 404, execution block unknown to L1 503, beacon 404, unsupported version 502.
  • go test ./... -tags ci green; go build -v ./cmd/... clean; golangci-lint run --config=./golangci.yml clean on the touched packages.
  • Manual test: set up a local es-node with new blobs uploaded, request the same blob from the CL and local Archiver, then compares their raw bytes.
INFO [10-12|17:48:43.723] Blob archiver API request                from=127.0.0.1:61526 url="/eth/v1/beacon/blobs/11338222?versioned_hashes=0x015e3a80cfd2299cb42eea242685b17fb35eabfb6c7b9f0a453b14b4d689fd0e"
INFO [10-12|17:48:44.200] BeaconID to execution block              beaconID=11338222 version=gloas                       slot=11,338,222 elBlockHash=905050..e590d9 blobsInBlock=18
INFO [10-12|17:48:44.568] Parsing event                            blobHash=015e3a..89fd0e event="0 of 6"
INFO [10-12|17:48:44.568] Blobhash matched                         blobhash=015e3a..89fd0e index=0 kvIndex=0
INFO [10-12|17:48:44.604] Parsing event                            blobHash=01b2e3..799f8e event="1 of 6"
INFO [10-12|17:48:44.604] Parsing event                            blobHash=0188a5..990db9 event="2 of 6"
INFO [10-12|17:48:44.604] Parsing event                            blobHash=017085..73ca85 event="3 of 6"
INFO [10-12|17:48:44.604] Parsing event                            blobHash=01c793..80d6f5 event="4 of 6"
INFO [10-12|17:48:44.604] Parsing event                            blobHash=01216a..000aab event="5 of 6"
INFO [10-12|17:48:44.604] Query blobs done                         beaconID=11338222 blobs=1

- decode /eth/v2/beacon/blocks/{id} per consensus version: deneb, electra
  and fulu through the execution payload, gloas through the signed
  execution payload bid. Both paths yield the execution block hash and the
  KZG commitments in block order; the execution block number is dropped
  because a gloas bid does not carry one.
- find PutBlob events with an eth_getLogs blockHash query instead of a
  fromBlock/toBlock range.
- classify failures explicitly: beacon 404 and a blob missing from local
  storage are 404, upstream beacon errors and undecodable block versions
  are 502, and an execution block L1 has not seen yet is a retryable 503.
…eout

blob_kzg_commitments is required by the beacon API schema: a block without
blobs serves an explicit empty array. A missing or null field is now an
upstream error instead of being read as 'no blobs', which used to surface as
a misleading 404 even when the blob is stored locally.

Revert the BeaconClient HTTP client change: DownloadBlobs is also used by the
regular node downloader, and a fixed 30s client timeout would fail downloads
that previously completed later. fetchBeaconBlock already bounds its own
request with a context timeout.
@syntrust
syntrust marked this pull request as ready for review October 12, 2026 09:49
@syntrust syntrust changed the title archiver: read blobs from the beacon block's execution block hash archive API: query blob info by CL version Oct 12, 2026
Comment thread ethstorage/archiver/api.go
@syntrust
syntrust requested a review from qzhodl October 28, 2026 07:50
@syntrust
syntrust merged commit d0d8d3c into main Oct 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants