-
Notifications
You must be signed in to change notification settings - Fork 0
Add GetBlobByCommitment endpoint (retrieve without height) #22
Copy link
Copy link
Closed
Description
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:
- Track height externally
- 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
- Implement Celestia node JSON-RPC compatibility layer #2 — JSON-RPC compatibility layer
- Add gRPC API alongside JSON-RPC #3 — gRPC API
- SQLite storage layer implementation #10 — SQLite storage layer (schema change needed)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels