Skip to content

Add EnsRainbowBeam app with endpoint for submitting labels#2015

Open
djstrong wants to merge 36 commits into
mainfrom
2003-add-new-app-with-endpoint-for-submitting-labels
Open

Add EnsRainbowBeam app with endpoint for submitting labels#2015
djstrong wants to merge 36 commits into
mainfrom
2003-add-new-app-with-endpoint-for-submitting-labels

Conversation

@djstrong

@djstrong djstrong commented Apr 29, 2026

Copy link
Copy Markdown
Member

Lite PR

Tip: Review docs on the ENSNode PR process

Summary

  • Add EnsRainbowBeam (apps/ensrainbowbeam): Hono service with GET /health and POST /api/discover that labelhashes submitted label literals, classifies them against ENSNode’s Omnigraph labels index (unknown_in_index / healed_in_index / absent_from_index), skips unnormalizable labels, and emits one structured JSON line per submission to stdout (sink/storage deferred).
  • Extend ENSApi Omnigraph with Query.labels(by: LabelsByLabelHashesInput!): LabelHash scalar, stricter validation, deduped batch lookup (cap 100 distinct hashes per request), plus codegen/SDK updates (enssdk, ensrainbow-sdk).
  • Ship EnsRainbowBeamClient (@ensnode/ensrainbow-sdk/ensrainbowbeam-client), Docker/Compose (docker/services/ensrainbowbeam.yml), Terraform module (terraform/modules/ensrainbowbeam), broad CORS for browser use, and a Beam-it UI on docs/ensrainbow.io calling beam.ensrainbow.io.

Why

  • External callers need a small HTTP surface to submit label discoveries. Closes #2003.
  • Batch labels lookup in ENSApi keeps Beam’s per-request Omnigraph traffic bounded and typed end-to-end.
  • SDK + marketing-site UI make the endpoint usable from browsers and local dev immediately; JSONL stdout preserves a stable row shape for a future persistent/on-chain pipeline.

Testing

  • pnpm -F ensrainbowbeam test — 27 tests (labels.test.ts, submissions.test.ts: validation, classification, skipped unnormalized labels, Omnigraph timeout/error paths, JSONL logging).

Notes for Reviewer (Optional)

  • No persistence yet—stdout JSONL only; leaderboard/on-chain emission are follow-ups on Add new app with endpoint for submitting labels #2003.
  • Per-request cap: 100 raw labels; each may expand to up to 2 distinct LabelHashes (raw + normalized). Omnigraph chunking uses LABELS_BY_LABELHASH_MAX (100).
  • POST /api/discover body: { labels: string[], callerAddress: Address }; response includes per-label status, label, optional labelHash / normalizedLabel.
  • CORS is origin: "*" (same pattern as other public ENSNode HTTP services)—not an env allowlist.
  • Handler file is still named submissions.ts internally; public route is /api/discover.

Pre-Review Checklist (Blocking)

  • This PR does not introduce significant changes and is low-risk to review quickly.
  • Relevant changesets are included (or are not required)

Loading
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.

Add new app with endpoint for submitting labels

4 participants