Skip to content

refactor: derive Gateway routes from node mode with listener-based hostnames#69

Merged
bdchatham merged 2 commits intomainfrom
refactor/networking-listener-model
Apr 9, 2026
Merged

refactor: derive Gateway routes from node mode with listener-based hostnames#69
bdchatham merged 2 commits intomainfrom
refactor/networking-listener-model

Conversation

@bdchatham
Copy link
Copy Markdown
Collaborator

Summary

Replace baseDomain/hostnames CRD fields with mode-derived route generation. The Gateway owns the protocol topology — deployments just attach to it.

What Changed

CRD simplificationGatewayRouteConfig reduced to just annotations. No more baseDomain or hostnames fields. Gateway config just needs to exist (non-nil) to enable routing.

EVM mergeevm-rpc and evm-ws consolidated into single evm listener. Envoy handles WebSocket upgrade natively. Matches industry standard (Alchemy, Infura, QuickNode all use one URL for HTTP + WS).

Mode-derived routes — listeners determined by NodePortsForMode():

  • Full/Archive → 4 routes: evm, rpc, rest, grpc
  • Validator → 0 routes (no public traffic)

Hostname pattern{deployment}.{protocol}.{domain}:

pacific-1.evm.prod.platform.sei.io   → :8545
pacific-1.rpc.prod.platform.sei.io   → :26657
pacific-1.rest.prod.platform.sei.io  → :1317
pacific-1.grpc.prod.platform.sei.io  → :9090

New platform env varSEI_GATEWAY_DOMAIN (required) for hostname construction.

Why

  • Deployment names (rpc) were conflating with protocol names in subdomains
  • Multiple deployments of the same type would collide on hostnames
  • EVM HTTP/WS split was non-standard (no EVM provider does this)
  • Protocol routing is a Gateway concern, not a per-deployment concern

See design rationale: SeiKnowledgeBase/memories/node-configuration/networking-design-rationale.md

Test plan

  • make test passes
  • make lint passes (0 issues)
  • make manifests generate produces clean CRDs
  • Verify full mode generates 4 HTTPRoutes with correct hostnames
  • Verify validator mode generates 0 HTTPRoutes
  • Verify EVM route covers both HTTP and WebSocket (single hostname)

🤖 Generated with Claude Code

…stname pattern

Replace baseDomain/hostnames CRD fields with mode-derived route
generation. The Gateway owns the protocol topology — deployments
just attach to it.

Key changes:
- Remove Hostnames, BaseDomain from GatewayRouteConfig (CRD simplification)
- Merge evm-rpc + evm-ws into single "evm" listener (industry standard)
- Derive listeners from node mode via NodePortsForMode():
  full/archive → evm, rpc, rest, grpc (4 routes)
  validator → none (no public traffic)
- Hostnames follow {deployment}.{protocol}.{domain} pattern
- Add SEI_GATEWAY_DOMAIN platform env var for hostname construction
- Gateway config on CRD just needs to exist (non-nil) to enable routing

Example: SeiNodeDeployment "pacific-1" with domain "prod.platform.sei.io":
  pacific-1.evm.prod.platform.sei.io  → :8545
  pacific-1.rpc.prod.platform.sei.io  → :26657
  pacific-1.rest.prod.platform.sei.io → :1317
  pacific-1.grpc.prod.platform.sei.io → :9090

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address PR review feedback:
- Routes are now always generated when networking is configured and the
  node mode has public ports. The gateway field is only needed for
  custom annotations on HTTPRoutes.
- Remove CEL validation requiring gateway when service is configured
- Remove gateway: {} from sample manifest (no longer needed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bdchatham bdchatham merged commit 5b28288 into main Apr 9, 2026
2 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.

1 participant