You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P1] Verifier: remove duplicate ev-node call and cache Celestia lookups per DA height #40
Per verification attempt (verifier.go:verifyAttempt):
evnodeClient.GetBlock is called, then GetBlockWithBlobs, which calls GetBlock again (internal/clients/evnode/client.go:68). That's two identical ev-node RPCs.
celestiaClient.GetBlockTimestamp(daHeight) runs once per block. ev-node batches many blocks into one DA height, so the same timestamp is fetched N times.
Data path: GetBlobsAtHeight downloads all blobs at (daHeight, dataNS) once per block, so a 100-block batch downloads the same blobs 100 times. Header path: GetIDs once per block.
Proposed fix
Pass the already-fetched *GetBlockResponse into the blob-marshalling helper, or call only GetBlockWithBlobs. This saves one RPC per attempt.
Add a small memoization map in celestia.Client keyed by (daHeight, ns) for the timestamp, IDs and blobs, protected by a mutex and with a ~2 min TTL that's checked on insert. Use golang.org/x/sync/singleflight (already in go.mod) so concurrent workers share one in-flight fetch. Add a simplify: comment noting there's no LRU and the upgrade path.
Pros / Cons
✅ Cuts Celestia load and bandwidth by roughly the batch size (often 10-100×), lowers latency, and reduces timeouts on public nodes.
⚠️ Memory for cached blobs (up to ~2MB each), so keep the TTL short. Never cache negative or "not found" results; otherwise blocks that land later would fail.
Acceptance criteria
Test: N blocks at the same DA height cause exactly one blob fetch.
Header path is mostly solved by fix(deps): upgrade ev-node to v1.0.0 and fix broken metrics #33. The commitment is now computed locally (jsonrpc.NewBlobV0) and checked with a single Blob.Get(height, ns, commitment), replacing the remote DA.Commit + GetIDs.
Still valid: the duplicate ev-node GetBlock call, GetBlockTimestamp once per block, and the data path downloading every blob at the DA height once per block (Blob.GetAll).
Activity
auricom commentedon Oct 20, 2026
Scope update after #33 (ev-node v1.0.0 upgrade):
jsonrpc.NewBlobV0) and checked with a singleBlob.Get(height, ns, commitment), replacing the remoteDA.Commit+GetIDs.GetBlockcall,GetBlockTimestamponce per block, and the data path downloading every blob at the DA height once per block (Blob.GetAll).Implement this on top of #33.