Skip to content

Add GetBlobByCommitment endpoint (retrieve without height) #22

@tac0turtle

Description

@tac0turtle

Summary

Add a GetBlobByCommitment(namespace, commitment) API method that retrieves a blob without requiring the caller to know the height. This is something celestia-node cannot do today.

Motivation

Rollups with external ordering (not Celestia-native ordering) know the namespace and commitment of their blobs but may not know the DA height. Today they must either:

  1. Track height externally
  2. Scan heights sequentially until they find the blob

celestia-node has an open feature request for this (celestiaorg/celestia-node#4727) but cannot implement it without a new storage index. Apex's SQLite schema makes this trivial.

Implementation

Schema change

Add an index on (namespace, commitment) or just (commitment):

CREATE INDEX idx_blobs_ns_commitment ON blobs(namespace, commitment);

API method

JSON-RPC:

blob.GetByCommitment(namespace, commitment) -> Blob

gRPC:

rpc GetByCommitment(GetByCommitmentRequest) returns (BlobResponse);

Behavior

  • Returns the blob matching the namespace + commitment pair
  • If multiple blobs match (resubmission at different heights), return the first (lowest height) or all matches
  • Returns standard "not found" error if no match

Why this is a differentiator

This positions apex ahead of celestia-node for rollups that:

  • Use external sequencing (sovereign rollups, shared sequencers)
  • Submit blobs and track them by commitment hash rather than DA height
  • Need a simple "do you have this blob?" check

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions