Skip to content

feat: CLL non-EVM jsonrpc passthrough (combine #20+#21+#23) - #24

Open
snowkide wants to merge 9 commits into
feat/websocket-supportfrom
feat/cll-jsonrpc-passthrough
Open

feat: CLL non-EVM jsonrpc passthrough (combine #20+#21+#23)#24
snowkide wants to merge 9 commits into
feat/websocket-supportfrom
feat/cll-jsonrpc-passthrough

Conversation

@snowkide

Copy link
Copy Markdown

Summary

Combines the stacked CLL / non-EVM erpc work into one PR against feat/websocket-support:

Was What
#20 forwardedClientId, path/secret auth aliases, WS event metrics + transport http|ws on request_received
#21 architecture / type: jsonrpc passthrough (no EVM probe/poller)
#23 treat "error": null as success; omit empty params (BTC-family / Stellar)

Rebased onto current feat/websocket-support (already linear / 0 behind).

Shipped in prod as ghcr.io/linkpoolio/docker-images/erpc:jsonrpc-passthrough-4 (chainlink-erpc).

Test plan

  • go test ./auth/ ./common/
  • Live CLL smoke: non-EVM HTTPS + WSS (incl. BTC-family / stellar / doge-testnet) after passthrough-4
  • Review diff vs feat/websocket-support (9 commits)

Supersedes #20, #21, #23.

Made with Cursor

snowkide and others added 9 commits August 4, 2026 14:35
Add AuthTypeForwardedClientId so a trusted gateway-injected X-Client-Id
(Envoy apiKeyAuth.forwardClientIDHeader) becomes User.Id for per-client
Prometheus labels. Emit erpc_ws_subscription_events_total (and dropped)
on client notification write/overflow for third-party RPC observability.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use Network.Label() (alias when set) on ws_subscription_events_* so
metrics match HTTP counters without a PromQL chain-id map.

Co-authored-by: Cursor <cursoragent@cursor.com>
…dge Lua

Domain-aliased hosts can keep a single path segment as the secret so
clients use https://host/<KEY> without Envoy Lua/WASM path extractors.

Co-authored-by: Cursor <cursoragent@cursor.com>
Reject empty secrets, require secret.id, cover path reserved segments,
and dedupe subscription event counter increments.

Co-authored-by: Cursor <cursoragent@cursor.com>
CLL rpc_ws_event_count_total must count JSON-RPC calls over WebSocket,
not subscription push notifications. Mark WS ingress on NormalizedRequest
and expose transport on erpc_network_request_received_total.

Co-authored-by: Cursor <cursoragent@cursor.com>
Passthrough JSON-RPC networks (jsonrpc:<slug>) skip EVM chainId/state
poller/hooks while keeping HTTP/WS forwarding and metrics — including
forwardedClientId from #20. Point upstreams at HAProxy/direct endpoints.

Co-authored-by: Cursor <cursoragent@cursor.com>
Chart emits failsafe as a single object, so UnmarshalYAML uses
oldNetworkConfig. That struct lacked JsonRpc, so architecture: jsonrpc
networks crashed config load (chainlink-erpc CrashLoopBackOff).

Co-authored-by: Cursor <cursoragent@cursor.com>
clients/registry only accepted type=evm, so every non-EVM upstream
failed with "unsupported upstream type: jsonrpc" and networks never
left ErrNetworkInitializing.

Co-authored-by: Cursor <cursoragent@cursor.com>
Bitcoin-family nodes emit "error": null on success; ParseError("null")
was inventing a server-side exception and exhausting upstreams
(dogecoin/litecoin/mutiny via erpc).

Omit empty params on the wire so Stellar (and similar) accept
getHealth/getLatestLedger — they reject "params":[].

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
File Lines Key changes Risk
🟠 strategy_forwarded_client_id.go +40/-0 ForwardedClientIdStrategy, NewForwardedClientIdStrategy, Supports, ... ⚠ ErrAuthUnauthorized
🟠 authorizer.go +5/-0 ⚠ ErrInvalidConfig
🟠 strategy_secret.go +9/-0 ⚠ ErrAuthUnauthorized
🟠 registry.go +7/-1 ⚠ = fmt.Errorf
🟠 networks.go +11/-0 ⚠ ErrJsonRpcExceptionInternal
🔵 adapter.go +50/-2 SubscriptionLabels, AddSubscription, subscriptionNetworkLabel, ...
🔵 http.go +57/-1 NewPayloadFromHttp, singlePathSegmentSecret, firstNonEmptyHeader
🟢 architecture_jsonrpc.go +12/-0 JsonRpcNetworkConfig, JsonRpcNetworkConfig
🔵 config.go +43/-13 ForwardedClientIdStrategyConfig, ForwardedClientIdStrategyConfig
🔵 request.go +25/-0 SetTransport, Transport
🔵 payload.go +12/-5 ForwardedClientIdPayload
🔵 defaults.go +38/-4 SetDefaults
🔵 validation.go +39/-2 Validate
🔵 ids.go +8/-0 JsonRpcNetworkId
4 test files +196

xray — see through AI slop with deterministic architecture PR diff reviews

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