Skip to content

feat: add DA inclusion status tracking from ev-node#24

Draft
pthmas wants to merge 11 commits intomainfrom
pierrick/da-inclusion
Draft

feat: add DA inclusion status tracking from ev-node#24
pthmas wants to merge 11 commits intomainfrom
pierrick/da-inclusion

Conversation

@pthmas
Copy link
Collaborator

@pthmas pthmas commented Mar 15, 2026

Summary

Adds Data Availability (DA) inclusion tracking to Atlas by querying ev-node's Connect RPC StoreService to determine at which Celestia height each block's header and data were submitted.

Backend

  • ev-node client (evnode.rs): Connect RPC client with auto-detection of protobuf/JSON mode, 2s timeout, and fast-fail retries (3 attempts with ms-level backoff)
  • DA worker (da_worker.rs): Background task with two-phase design — backfill (newest blocks first) and update-pending (re-check blocks with height=0). Budget-based scheduling gives backfill priority, loops immediately when work is available, 500ms idle sleep. Sends pg_notify after each batch for real-time SSE propagation
  • Database: New block_da_status table (block_number, header_da_height, data_da_height, updated_at)
  • API: list_blocks includes DA status via batch fetch, /api/status exposes da_tracking feature flag, SSE handler extended with da_batch events via tokio::select! multiplexing block and DA broadcast channels
  • Config: EVNODE_URL enables DA tracking, DA_WORKER_CONCURRENCY (default 50) controls parallelism

Frontend

  • Blocks list: DA column with colored dots — yellow (pending) / green (included) — with pulse animation on live SSE updates
  • Block detail: Header DA and Data DA fields showing Celestia height or "Pending"
  • Feature flag: useFeatures hook checks /api/status for da_tracking, DA UI only renders when enabled
  • Live updates: SSE hook receives da_batch events, applies overrides to visible blocks via daOverrides map

Test plan

  • DA worker backfills blocks and updates pending status
  • ev-node client handles both protobuf and JSON modes
  • SSE streams DA batch updates to connected frontends
  • Blocks list shows DA column with correct dot colors
  • Block detail page shows DA heights with live SSE override
  • DA UI hidden when EVNODE_URL is not configured
  • Unit tests for ev-node client serialization and SSE event formatting

🤖 Generated with Claude Code

pthmas added 4 commits March 15, 2026 16:55
Add L2 Data Availability (DA) inclusion tracking by querying ev-node's
Connect RPC StoreService for Celestia DA heights per block.

- New block_da_status table with background DA worker (backfill + retry)
- ev-node client with auto-detecting proto/JSON Connect RPC modes
- API returns da_status on block responses, features flag on /status
- Frontend shows DA rows on block detail when da_tracking is enabled
- Configurable via EVNODE_URL and DA_WORKER_CONCURRENCY env vars

Closes #4
Protobuf mode was silently decoding DA heights as zeros.
JSON mode is universally supported and verified working.
- Add DA SSE: pg_notify from DA worker -> API broadcast -> SSE da_batch
  events pushed to connected frontends for real-time DA dot updates
- DA worker: split budget between backfill (priority) and pending phases,
  skip sleep when work available, process newest blocks first in both phases
- ev-node client: reduce timeout 10s->2s, retries 10->3 with ms-level backoff
- Bump DA_WORKER_CONCURRENCY default 10->50 for higher throughput
- Frontend: DA dot pulse animation on SSE updates, remove gray "awaiting
  check" state (show yellow pending instead), batch SSE for efficiency
- BlockDetailPage: simplified DA display with live SSE override
@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ebf6f48e-ed83-4bf5-b064-ccff2bf7cbc0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pierrick/da-inclusion
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pthmas pthmas changed the title feat: add live DA status SSE and optimize DA worker feat: add DA inclusion status tracking from ev-node Mar 15, 2026
@pthmas pthmas marked this pull request as draft March 15, 2026 20:53
pthmas added 7 commits March 15, 2026 22:01
Remove protobuf support (prost dependency) from the ev-node client.
ev-node's Connect RPC supports both JSON and protobuf natively, so the
simpler JSON-only path is sufficient. Also removes unused da_to_event.
Remove new_block_event_contains_all_block_fields and
da_update_event_contains_all_fields — they only assert that
#[derive(Serialize)] includes struct fields, adding no real value.
These only verified that #[derive(Serialize)] works on plain structs.
The evnode tests are kept since they cover custom deserializer logic.
- Run cargo fmt on all backend crates
- Fix react-hooks/set-state-in-effect errors by adding subscribeDa
  callback pattern to SSE hook (setState in subscription callbacks
  is allowed, synchronous setState in effect bodies is not)
- Fix react-hooks/refs error by keeping daOverrides/daHighlight as
  state instead of refs
- Fix react-hooks/exhaustive-deps by using drainOneRef indirection
- Fix ref cleanup warning by capturing daHighlightTimeoutsRef.current
  in a local variable before the cleanup function
- Derive daOverride in BlockDetailPage via useMemo instead of
  useState + useEffect
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.

1 participant