Skip to content

fix: gRPC appProtocol and EVM WebSocket routing#71

Merged
bdchatham merged 3 commits intomainfrom
fix/networking-validation
Apr 9, 2026
Merged

fix: gRPC appProtocol and EVM WebSocket routing#71
bdchatham merged 3 commits intomainfrom
fix/networking-validation

Conversation

@bdchatham
Copy link
Copy Markdown
Collaborator

@bdchatham bdchatham commented Apr 9, 2026

Summary

Two networking fixes from expert validation of the listener-based routing model.

1. gRPC appProtocol

Without appProtocol: kubernetes.io/h2c on the gRPC ServicePort, Envoy defaults to HTTP/1.1 when proxying to the backend — breaking all gRPC requests. This sets the standard Kubernetes signal for HTTP/2 cleartext backends.

2. EVM WebSocket routing

seid serves JSON-RPC on port 8545 and WebSocket on port 8546 as separate listeners. The EVM HTTPRoute now has two rules:

  • Default rule → port 8545 (HTTP JSON-RPC)
  • Header match Upgrade: websocket → port 8546 (WebSocket)

Both share the same hostname (pacific-1.evm.prod.platform.sei.io), so clients use https:// for JSON-RPC and wss:// for subscriptions on the same URL — matching the industry standard.

Test plan

  • make test passes
  • make lint passes (0 issues)
  • Verify gRPC Service port has appProtocol: kubernetes.io/h2c
  • Verify EVM HTTPRoute has 2 rules (HTTP + WebSocket)
  • Verify non-EVM routes still have 1 rule

🤖 Generated with Claude Code

bdchatham and others added 2 commits April 9, 2026 12:44
Two networking fixes from expert validation:

1. gRPC: set appProtocol "kubernetes.io/h2c" on the gRPC ServicePort
   so Envoy uses HTTP/2 to the backend. Without this, Envoy defaults
   to HTTP/1.1 and gRPC requests fail.

2. EVM WebSocket: add a second rule to the EVM HTTPRoute with a
   header match for "Upgrade: websocket" routing to port 8546. seid
   serves JSON-RPC on 8545 and WebSocket on 8546 as separate ports.
   The first rule (default) routes HTTP to 8545, the second routes
   WebSocket upgrades to 8546. Both share the same hostname, matching
   the industry standard (Alchemy, Infura use one URL for HTTP + WS).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Set appProtocol "kubernetes.io/h2c" on the gRPC port in the headless
per-node Service (servicePorts), matching what's already set on the
shared external Service. Ensures Istio/Envoy uses HTTP/2 for gRPC
when routing directly to individual pods.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add tests for:
- Empty domain produces malformed hostnames (documents the invariant
  that platform.Validate() catches at startup)
- Validator mode produces zero routes
- Non-EVM routes have exactly one rule and zero WSPort

Remove breadcrumb comment in BackendRef test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bdchatham bdchatham merged commit 3b89217 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