Skip to content

feat(tools): celestia-node-backed Fibre DA adapter#3279

Merged
julienrbrt merged 1 commit intoevstack:julien/fiberfrom
walldiss:feat/fibre-adapter-celestia-node
Apr 23, 2026
Merged

feat(tools): celestia-node-backed Fibre DA adapter#3279
julienrbrt merged 1 commit intoevstack:julien/fiberfrom
walldiss:feat/fibre-adapter-celestia-node

Conversation

@walldiss
Copy link
Copy Markdown

Summary

Adds `tools/celestia-node-fiber`, a new Go sub-module implementing the `fiber.DA` interface (`block/internal/da/fiber.DA`, re-exported as `block.FiberClient`) on top of a celestia-node `api/client.Client`.

  • Upload — `client.Fibre.Upload`. Off-chain row upload + validator sig aggregation + background `MsgPayForFibre` broadcast. Runs directly against consensus gRPC + FSPs using the self-sufficient client from celestia-node #4961. No bridge hop.
  • Download — `client.Fibre.Download`. Reads reconstructed blobs directly from FSPs. No bridge hop.
  • Listen — `client.Blob.Subscribe` on a bridge node, filtered to share-version-2 blobs. Per ADR-013 those are the on-chain reflection of `MsgPayForFibre` settlements, so only Fibre-settled blobs reach consumers. BlobEvent is reconstructed from `Blob.FibreBlobVersion()` + `Blob.FibreCommitment()`.

Design notes

  • Separate sub-module. Lives at `tools/celestia-node-fiber/` with its own `go.mod` (mirrors `tools/local-fiber/` isolation). celestia-node's replace soup (celestia-core, cosmos-sdk forks, boxo, etc.) stays out of ev-node core. Parent module is pulled in via a local `replace github.com/evstack/ev-node => ../../.`.
  • Constructors.
    • `New(ctx, cfg, kr)` — builds the underlying `api/client.Client` and owns its lifecycle; must be `Close()`d.
    • `FromModules(fibre, blob, listenChannelSize)` — accepts the `fibreapi.Module` and `blobapi.Module` interfaces directly so callers can inject mocks or reuse a pre-built client.
  • Namespace format. Adapter expects the 10-byte v0 ID (matches `datypes.NamespaceFromString` output). Wraps into `libshare.NewV0Namespace`; length mismatch surfaces a clear error.
  • ExpiresAt. Hardcoded to `now + 24h` with a TODO. Matches the placeholder used by `tools/local-fiber`. Real retention will come once celestia-node exposes it from `x/fibre` params.
  • Listen filter. Share-version-0/1 blobs that share the namespace (plain PFB) are dropped. A future adapter can opt-in to a mixed view if needed.

What this does not change

  • `tools/local-fiber/` stays as-is.
  • `block/internal/da/fiber` types and `block/public.go` Fiber re-exports are untouched.
  • No changes to sequencer / submitter / DA retry logic.

Follow-ups out of scope

  • celestia-node's `fibre.Service.Upload` currently uses the sync `SubmitMessage` path in its background goroutine (still blocks the goroutine until chain inclusion). The design conversation with @vgonkivs flagged this as a temp solution pending `QueuedTxClient`; that follow-up is already tracked on celestia-node and does not block this adapter.
  • Integration testing against a live fibre network is intentionally not included — it requires running FSPs and an x/fibre-enabled chain, which don't exist in the ev-node test harness today.

Test plan

  • `go build ./...` in `tools/celestia-node-fiber/`
  • `go vet ./...` in `tools/celestia-node-fiber/` — clean
  • `go test -count=1 ./...` — 7 tests, all pass
    • `TestAdapterSatisfiesDA` — compile-time DA interface assertion
    • `TestUpload_ForwardsNamespaceDataAndBlobID`
    • `TestUpload_RejectsWrongNamespaceLength`
    • `TestUpload_PropagatesFibreError`
    • `TestDownload_ReturnsResultData`
    • `TestListen_FiltersFibreOnlyAndEmitsEvent` — exercises filter + BlobID reconstruction
    • `TestListen_CancelledContextClosesOutput`

🤖 Generated with Claude Code

Adds tools/celestia-node-fiber, a new Go sub-module that implements the
ev-node fiber.DA interface by delegating Upload, Download and Listen to a
celestia-node api/client.Client.

Upload and Download run locally against a Celestia consensus node (gRPC)
and Fibre Storage Providers (Fibre gRPC) — no bridge-node hop — using
celestia-node's self-sufficient client (celestiaorg/celestia-node#4961).
Listen subscribes to blob.Subscribe on a bridge node and forwards only
share-version-2 blobs, which is how Fibre blobs settle on-chain via
MsgPayForFibre.

The package lives in its own go.mod, parallel to tools/local-fiber, so
ev-node core does not inherit celestia-app / cosmos-sdk replace-directive
soup. A FromModules constructor accepts the Fibre and Blob Module
interfaces directly so callers can inject mocks or share an existing
*api/client.Client.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: d6090b01-fc72-4abe-8b9d-edb68da4da53

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

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.

Copy link
Copy Markdown
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@julienrbrt julienrbrt merged commit a7b3859 into evstack:julien/fiber Apr 23, 2026
17 of 25 checks passed
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.

2 participants