Introducing a new way to review your PRs.

Read the announcement

celestiaorg / celestia-node

Celestia Data Availability Nodes

View on GitHub

22 documents · Updated Nov 23, 2026

docs / blobstream-integration

Blobstream node integration

Blobstream is the node service that turns an ordered range of Celestia block headers into a data-root commitment or an inclusion proof. Nodebuilder gives it the shared header store, exposes it through the node's RPC boundary, and manages it with the same start and stop lifecycle as the other node services.

Blobstream service

The Blobstream service provides two read operations over block data roots. It uses the ordered header view as its source, so the result reflects the chain data that the node has locally available.

Commitment outputs

The service encodes each block's height and data root as one data-root tuple. It then combines the ordered tuples into a Merkle root. A second operation returns a Merkle inclusion proof for one height in that same half-open block range.

The range uses start as the first included height and end as the first excluded height. This makes the returned root and proof refer to one exact ordered set of blocks.

OperationInputResult
Data-root tuple rootstart, endA root for every tuple in [start, end)
Data-root tuple inclusion proofheight, start, endA proof that height belongs to the tuple root for [start, end)

References: nodebuilder/…/blobstream.go• L9-47 nodebuilder/…/service.go• L27-76 nodebuilder/…/data_root_tuple_root.go• L17-23 nodebuilder/…/data_root_tuple_root.go• L167-177

Range rules

The service checks a request before it reads headers. The first height must be non-zero. The range must be ascending and no larger than 10,000 blocks. The end must not exceed the local head plus one, and a proof height must be inside the requested range.

These checks protect the RPC service from unbounded work and prevent it from producing a result for headers that the node has not yet reached. A missing or future header therefore remains a range or header-read error instead of becoming an incomplete commitment.

References: nodebuilder/…/data_root_tuple_root.go• L100-133 nodebuilder/…/data_root_tuple_root.go• L146-164 nodebuilder/…/data_root_tuple_root.go• L180-207

Nodebuilder integration

Nodebuilder creates Blobstream as a shared service for every supported node type. The service has no separate Blobstream configuration block because its behavior comes from the header store and the node's existing chain and RPC settings.

Header dependency

Blobstream depends on the header module's store rather than on consensus or peer access directly. The header module supplies the ordered local view and its lifecycle. This keeps Blobstream's chain reads consistent with the headers used by the rest of the node.

The dependency relationship is simple: node construction creates the header store, Blobstream receives it as a header getter, and each request reads the needed range before it builds a root or proof.

This diagram shows how the node assembles the Blobstream path.

flowchart LR
    Config[Node configuration] --> Assembly[Nodebuilder assembly]
    Store[Node store] --> Header[Header module]
    Network[Node and peer context] --> Header
    Assembly --> Blobstream[Blobstream service]
    Header --> Blobstream
    Blobstream --> Root[Tuple root]
    Blobstream --> Proof[Inclusion proof]
    Blobstream --> RPC[blobstream RPC namespace]

References: nodebuilder/module.go• L43-57 nodebuilder/…/module.go• L7-13 nodebuilder/…/service.go• L17-24 nodebuilder/…/module.go• L52-63 nodebuilder/…/data_root_tuple_root.go• L183-207

Node modes

Blobstream is wired into both Bridge and Light nodes because both modes assemble a header service and a common RPC surface. The node type changes how headers become available, but it does not change the Blobstream API or its range rules.

Node modeHeader source used by BlobstreamProduct effect
BridgeThe bridge's locally synced header storeBuilds roots and proofs from the bridge's chain view
LightThe light node's locally synced header storeBuilds roots and proofs from the light node's available chain view

The service does not fetch missing headers through its own network path. A caller must use a node whose header state covers the requested range. See Node assembly and service lifecycle for the broader mode and dependency model.

References: nodebuilder/…/type.go• L21-29 nodebuilder/…/module.go• L117-137 nodebuilder/module.go• L46-57 nodebuilder/…/data_root_tuple_root.go• L120-131

RPC exposure

The blobstream namespace is the external read boundary for the service. Nodebuilder pairs the Blobstream module with its API wrapper during RPC registration, so clients can call the two proof-related operations without accessing the internal service graph.

The API marks both operations as read calls. Authentication and transport policy come from the shared RPC server. The namespace exists alongside the header namespace because Blobstream consumes headers but returns a distinct commitment and proof contract.

The read client opens a dedicated blobstream connection to the bridge RPC address and closes it with the other read-service connections. The general RPC client also includes the namespace when it creates its typed service set. See Node RPC service wiring for the shared endpoint and access model.

References: nodebuilder/…/blobstream.go• L28-47 nodebuilder/…/constructors.go• L19-40 nodebuilder/…/module.go• L12-36 api/…/read_client.go• L66-87 api/…/read_client.go• L111-127 api/…/client.go• L28-39 api/…/client.go• L88-100

Lifecycle management

Blobstream is a request service with no independent background worker. Its construction is part of the node dependency graph, and its usable lifetime follows the header store and the RPC server that expose it.

Construction and startup

During node construction, ConstructModule registers the Blobstream service and makes it available as the shared Module interface. The RPC module then receives that interface and registers the blobstream namespace. Construction can fail if the surrounding node graph cannot create its required store or configuration.

When the node starts, the header module starts the store and header synchronization path. The RPC server starts as part of the same lifecycle. Blobstream becomes useful when those dependencies are ready; it does not have a separate readiness signal.

References: nodebuilder/module.go• L24-62 nodebuilder/…/module.go• L7-13 nodebuilder/…/constructors.go• L19-40 nodebuilder/…/module.go• L64-85 nodebuilder/…/module.go• L16-27

Shutdown and client close

When the node stops, nodebuilder closes services through the shared lifecycle boundary. Blobstream releases no separate worker or store, so its effective shutdown is the shutdown of the header and RPC dependencies.

Clients have a matching close responsibility. A read client closes its Blobstream RPC connection with the other service connections, while a general RPC client closes all namespace connections together. A caller that keeps using a client after close can no longer rely on the Blobstream endpoint.

References: nodebuilder/node.go• L145-163 nodebuilder/…/module.go• L79-85 nodebuilder/…/module.go• L19-27 api/…/read_client.go• L111-133 api/…/client.go• L42-61

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the half-open range contract aligned across the service methods, validation rules, proof indexing, and client-facing API types.
  • Keep the maximum range guard aligned with the expected RPC work limit and any caller assumptions about block windows.
  • Keep Blobstream's header-store dependency compatible with both bridge and light header assembly.
  • Keep the blobstream namespace aligned across server registration, generated API discovery, typed clients, and permission tags.
  • Keep client close paths aligned when a new Blobstream method or connection setup is added.
  • Keep header retention and sync changes compatible with requests that need older or newly synced block ranges.

Important failure modes

TriggerConsequenceGuard
The range starts at height zeroRoot or proof generation fails before header readsUse a positive start height
start is greater than or equal to endNo valid ordered tuple set existsUse a non-empty half-open range
The range exceeds 10,000 blocksThe request is rejected to limit local workSplit the request into smaller ranges
end is above the local head plus oneThe node cannot build a complete resultWait for header sync or use a node with the needed headers
A proof height is outside [start, end)The proof cannot be tied to the requested rootKeep the proof height inside the same range
The Blobstream namespace is missing from one RPC or client mapTyped clients cannot call the service or generated API output is incompleteUpdate server registration and client discovery together

Key files

FileWhy to read it
nodebuilder/…/blobstream.goDefines the service and RPC-facing Blobstream contract
nodebuilder/…/service.goShows how requests move from validation to tuple collection and proof output
nodebuilder/…/data_root_tuple_root.goDefines tuple-root data, range guards, and header-range reads
nodebuilder/…/module.goShows how Blobstream joins nodebuilder's dependency graph
nodebuilder/module.goShows where Blobstream is assembled with the other node services
nodebuilder/…/constructors.goShows the blobstream namespace registration
nodebuilder/…/module.goShows the header store and sync lifecycle that Blobstream depends on
api/…/read_client.goShows the dedicated client connection and close path
api/…/client.goShows the general typed RPC namespace contract