Skip to content

test(celestia-node-fiber): in-process Upload/Listen/Download showcase#3280

Merged
julienrbrt merged 2 commits intoevstack:julien/fiberfrom
walldiss:feat/fibre-adapter-showcase-tests
Apr 23, 2026
Merged

test(celestia-node-fiber): in-process Upload/Listen/Download showcase#3280
julienrbrt merged 2 commits intoevstack:julien/fiberfrom
walldiss:feat/fibre-adapter-showcase-tests

Conversation

@walldiss
Copy link
Copy Markdown

Summary

Follow-up to #3279. Adds `tools/celestia-node-fiber/testing/`, a self-contained end-to-end showcase that boots a single-validator Celestia chain, an in-process Fibre server, a celestia-node bridge, and drives the merged adapter through Upload → Listen → Download.

The test suite was developed alongside the adapter PR but pushed after #3279 had already been merged, so it never made it into julien/fiber. This PR lands it.

What it covers

  • `testing/network.go` — testnode boot, in-process `appfibre.Server` with memory store, valaddr registration (using the `dns:///` URI scheme the gRPC resolver requires), escrow funding via `MsgDepositToEscrow`.
  • `testing/bridge.go` — in-process celestia-node bridge with JWT auth (`ws://` endpoint, since `Blob.Subscribe` is a channel-returning method and go-jsonrpc only supports streaming methods over WebSocket).
  • `testing/showcase_test.go` — `TestShowcase`: subscribe first, upload a blob, wait for the share-version-2 BlobEvent after the async `MsgPayForFibre` commits, assert the returned BlobID matches what Listen emitted, Download and diff the payload.

Observations surfaced by the test

Two non-obvious gotchas are embedded in the helpers and documented in comments so any future integrator does not re-learn them:

  1. FSP host must be registered with `dns:///` prefix — the Fibre client's gRPC dialer treats a bare `host:port` as a URL, failing on the colon. Matches how `tools/talis/fibre_setup.go` provisions real networks.
  2. `BridgeDAAddr` must use `ws://` — HTTP-only JSON-RPC rejects `blob.Subscribe` with `method '...' not supported in this mode (no out channel support)`.

Scope boundaries

  • Single-validator (`testnode.NewNetwork` is hardcoded single-val). This is the "fast sanity test" layer — the slow-path 2-validator variant is planned as a separate Docker Compose follow-up that can exercise real 2/3 quorum collection.
  • Build-tagged `fibre`; excluded from default test runs (no change to default CI).

Test plan

  • `go mod tidy` — no drift vs. latest julien/fiber
  • `go build -tags fibre ./...`
  • `go vet -tags fibre ./...` — clean
  • `go test -tags fibre -count=1 -run TestShowcase ./testing/...` — passes in ~7 seconds on a warm cache
  • Full module test (`go test -tags fibre ./...`) — 8 tests pass (7 adapter unit + 1 showcase)
  • Adapter tests still pass without `-tags fibre` — showcase is build-gated

One-liner to run it

```
go test -tags fibre -count=1 -timeout 5m -run TestShowcase ./tools/celestia-node-fiber/testing/...
```

🤖 Generated with Claude Code

Adds tools/celestia-node-fiber/testing/, a single-validator in-process
showcase that boots a fibre-tagged Celestia chain + in-process Fibre
server + celestia-node bridge, registers the validator's FSP via
valaddr (with the dns:/// URI scheme the client's gRPC resolver
expects), funds an escrow account, and drives the full adapter
surface.

TestShowcase proves the round-trip: subscribe via Listen, Upload a
blob, wait for the share-version-2 BlobEvent that lands after the
async MsgPayForFibre commits, assert the BlobID from Listen matches
Upload's return, Download and diff the payload bytes.

The harness is intentionally single-validator — a 2-validator
Docker Compose showcase is planned as a follow-up for exercising real
quorum collection.

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: 74f60d21-16c3-4f62-8fef-b20ce8e7a7e0

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.

…ize gap

Upload 10 distinct-payload blobs through adapter.Upload, collect
BlobEvents via adapter.Listen until every BlobID is accounted for
(order-insensitive, rejects duplicates), then round-trip each blob
through adapter.Download to diff bytes. Catches routing bugs (wrong
blob returned for a BlobID) and duplicate-event bugs that a
single-blob test can't see.

Scaling the test also exposed a semantic issue: the v2 share carries
only (fibre_blob_version + commitment), so b.DataLen() — what
listen.go's fibreBlobToEvent reports today — is always 36, not the
original payload length ev-node's fibermock conveys. The adapter
can't derive the payload size from the subscription stream alone;
surfacing it correctly needs an x/fibre PaymentPromise lookup
(tracked as a TODO on fibreBlobToEvent). The test therefore asserts
DataSize is non-zero rather than matching len(payload).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@julienrbrt julienrbrt merged commit a88b176 into evstack:julien/fiber Apr 23, 2026
14 of 22 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