Repository navigation
Conversation
snowkide
force-pushed
the
feat/jsonrpc-passthrough-architecture
branch
from
November 3, 2026 10:57
8ca1410 to
e7acd75
Compare
snowkide
force-pushed
the
feat/jsonrpc-passthrough-architecture
branch
from
November 3, 2026 11:23
e7acd75 to
e859e1b
Compare
snowkide
force-pushed
the
feat/jsonrpc-passthrough-architecture
branch
from
November 4, 2026 14:03
e859e1b to
69c766b
Compare
JSON-RPC 1.0 servers always include the "error" member and set it to null on success. The response parser passed the literal null to ParseError, which turned it into a server-side exception, so every successful call to such a node was reported as failed and retried on other upstreams. Skip a null error member in the streaming parser and in NewJsonRpcResponseFromBytes (used by the batch path). ParseError itself is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eRPC serves EVM and SVM chains, each with a chain model (chain id or genesis detection, state poller, method hooks). Many other chains expose a plain JSON-RPC API and only need the generic pipeline: upstream selection, failsafe policies, rate limiting, multiplexing, metrics and healthchecks. Add a third architecture, "jsonrpc", that provides exactly that: - architecture/jsonrpc registers a no-op ArchitectureHandler; its error extractor claims nothing, so errors fall through to the default mapping. - Networks: architecture jsonrpc with jsonRpc.id (defaults to the alias), network id "jsonrpc:<id>". Inferred from a jsonRpc block, never receives networkDefaults.evm, and can be created lazily from /<project>/jsonrpc/<id>. - Upstreams: type jsonrpc with jsonRpc.networkId (type inferred when set). Bootstrap sends nothing to the node. The HTTP and WebSocket JSON-RPC clients are reused; gRPC endpoints are rejected. - Requests are validated as JSON-RPC and forwarded without normalization. Finality is unknown unless set via methods.definitions, there is no cache, and multiplexing keys on the exact (case-preserved) params. - upstreams[].jsonRpc.omitEmptyParams leaves "params" out of outbound requests whose params are empty, for servers that reject "params":[]. It defaults to true for type jsonrpc only; evm and svm upstreams keep their wire format unless it is turned on. - Healthcheck scoping and all:activeUpstreams understand jsonrpc networks. - TypeScript config types and docs updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
snowkide
force-pushed
the
feat/jsonrpc-passthrough-architecture
branch
from
November 5, 2026 13:52
69c766b to
9f5c89c
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
eRPC serves EVM and SVM chains, each with a chain model (chain-id or genesis detection, state poller, method hooks). Many other chains expose a plain JSON-RPC API (Bitcoin-family nodes, Stellar RPC and others) and only need eRPC's generic pipeline: upstream selection, failsafe policies, rate limiting, multiplexing, metrics and healthchecks.
Commits (can be split into two PRs):
fix(json-rpc): treat"error": nullin upstream responses as success. JSON-RPC 1.0-style servers always send theerrormember and set it to null on success; today every successful call to such a node is parsed as a server error and retried elsewhere. A null error member is now skipped inParseFromStream(single HTTP and WebSocket responses) andNewJsonRpcResponseFromBytes(batch responses);ParseErroritself is unchanged. Behaviour change:{"result":null,"error":null}is now a null-result success instead of an error, so the normal empty-result rules apply.feat(architecture):architecture: jsonrpc, providing the generic pipeline and nothing chain-specific.jsonrpc:<id>, wherejsonRpc.iddefaults to the alias; networks can be created lazily from/<project>/jsonrpc/<id>.type: jsonrpcwithjsonRpc.networkId(type inferred when set). Bootstrap sends nothing to the node. HTTP and WebSocket only; gRPC endpoints are rejected.methods.definitions; no cache (no block/slot model). Multiplexing uses a case-preserving key (as SVM), so params that differ only in letter case are not merged.upstreams[].jsonRpc.omitEmptyParamsleavesparamsout when empty instead of sending"params":[]. It defaults totruefortype: jsonrpconly; EVM/SVM upstream configs and wire format are unchanged (a test asserts EVM still sends"params":[]).jsonrpcupstreams fall through to the default (EVM) extractor.config/projects/networks,config/projects/upstreams) and TypeScript config types.Verification
Based on fork
main@ f97c9f6 (erpc/erpc0.5.0 @ 204f98c).go build ./...,go veton touched packages andgofmt -lon touched files are clean.go test ./common/ ./clients/ ./util/ ./architecture/... ./upstream/: ok.go test ./erpc/ -run 'JsonRpc|MultiplexKey|HealthCheck': ok; with-raceonJsonRpcPassthrough|HealthCheckJsonRpc: ok.go test ./common/ -run 'ErrorNull|ParseError': ok.TestJsonRpcResponse_ErrorNullIsSuccess,TestHttpServer_JsonRpcPassthrough,TestHealthCheckJsonRpcNetworkScope,TestJsonRpcPassthrough_MultiplexKeyPreservesCase, plus client, registry, defaults and id tests andjsonrpc.test-d.ts.AI assistance
🤖 Generated with Claude Code