/reference/errors.llms.txt
Error taxonomy
A catalog of all ~73 typed errors eRPC can emit, organized by category. Each entry shows whether the error retries on the same upstream, retries on a different upstream, what HTTP status and JSON-RPC code it produces on the wire, and whether it is live or dead code. Every vendor's idiosyncratic message is normalized into one of these types before retry logic or metrics ever see it.
Agent reference
Copy one of these prompts into your AI agent session (Claude Code, Cursor, …) — each one points the agent at this page's machine-readable reference so it can do the work correctly:
Prompt Example #1: debug why requests are exhausting all upstreams
My eRPC instance frequently returns ErrUpstreamsExhausted to clients and I don't know which upstream error type is dominating. Read the error taxonomy, then inspect my my eRPC config config and tell me which metrics and log fields to check, and how to adjust retry or circuit-breaker settings based on the dominant child error. Reference: https://docs.erpc.cloud/reference/errors.llms.txt
Prompt Example #2: set up production alerting on error severity
I want Prometheus alerts that fire on critical errors only and ignore expected noise like hedge discards and client disconnects. Using the severity classification in the eRPC error taxonomy, write PromQL alert expressions for my eRPC config deployment and explain which error codes map to each severity level. Reference: https://docs.erpc.cloud/reference/errors.llms.txt
Prompt Example #3: trace a -32003 response on eth_sendRawTransaction
Some of my eth_sendRawTransaction calls return JSON-RPC code -32003 even though the transactions go through. Explain which normalizer rules apply to sendRawTransaction, why eRPC may have retried, and how to distinguish already_known from nonce_too_low using the error details fields. Work with my existing eRPC config. Reference: https://docs.erpc.cloud/reference/errors.llms.txt
Error taxonomy — full agent referenceExpand for every option, default, and edge case — or copy this entire section into your AI assistant.
How it works
Two-layer taxonomy. Go errors are BaseError-rooted structs with a string ErrorCode constant. Upstream-attributed errors additionally carry an UpstreamAwareError accessor. ErrJsonRpcExceptionExternal is deliberately NOT a StandardError — it is the raw vendor JSON-RPC object used as input to normalizers only; it never propagates beyond the client layer.
Normalization pipeline. Architecture-specific extractors are composed, and each no-ops on upstreams of the other type. EVM HTTP responses go through ExtractJsonRpcError (architecture/evm/error_normalizer.go), which runs a vendor-specific hook first, then evaluates 22 ordered rules (first match wins). SVM HTTP responses go through architecture/svm/error_normalizer.go, which classifies from the native Solana code and preserves that code and error.data on the wire — see SVM (Solana) error contract. gRPC/BDS responses go through ExtractGrpcErrorFromGrpcStatus (common/grpc_errors.go), which checks BDS error codes first, then standard gRPC codes. All paths produce a typed internal error wrapping ErrJsonRpcExceptionInternal that carries both the original vendor code and the normalized eRPC code.
Retryability is dual-axis. IsRetryableTowardsUpstream returns false if any of 10 specific codes appear anywhere in the cause chain (including joined multi-errors). IsRetryableTowardNetwork defaults to true and returns false only when: (a) ErrUpstreamsExhausted has a nil cause, (b) a multi-error cause has ALL non-retryable children, or (c) a linear cause chain carries Details["retryableTowardNetwork"]=false. The flag walk stops at multi-error wrappers to avoid order-dependent bugs.
Wire translation. TranslateToJsonRpcException converts internal errors to a JSON-RPC numeric code. For ErrUpstreamsExhausted, it selects the "dominant" child error (highest occurrence count, skipping ErrCodeUpstreamRequestSkipped and ErrCodeEndpointUnsupported) over a deterministically ordered cause slice — retryable-toward-network causes first, then by upstream id — so an identical multiset of upstream failures always yields the same wire code, and a retryable cause outranks a terminal one. HTTP status is determined by two identical switch functions in erpc/http_server.go — not by per-type ErrorStatusCode() methods, which are dead code.
Error label for metrics. Both error metrics use common.ErrorFingerprint(err) as the error label value. ErrorFingerprint calls ErrorSummary then redacts hashes/addresses/IPs/numbers and caps at 256 characters. The mode of ErrorSummary is controlled by metrics.errorLabelMode, defaulting to compact (code-only labels, preventing high cardinality). verbose mode is human-readable but creates unbounded time series — use only in development.
Severity classification. ClassifySeverity(err) categorizes errors for the severity Prometheus label: info for nil/client errors/execution exceptions; warning for non-retryable-toward-upstream errors, ErrEndpointRequestCanceled, context.Canceled; critical for everything else.
ErrUpstreamsExhausted aggregation. This is a multi-error aggregator: its Cause is an errors.Join of all per-upstream errors. SummarizeCauses() buckets children into 19 categories and appends a human-readable suffix to the message: "(2 upstream timeout, 1 upstream rateLimit)". When buildErrorResponseBody sees a single-child ErrUpstreamsExhausted, it unwraps it — clients see the real upstream error, not the wrapper.
Error class hierarchy:
StandardError interface
└── BaseError (embedded in all domain errors)
├── UpstreamAwareError (embedded in upstream-attributed errors)
│
├── Server / request lifecycle
│ ├── ErrInvalidRequest, ErrInvalidUrlPath, ErrInvalidConfig
│ ├── ErrRequestTimeout, ErrInternalServerError, ErrNotImplemented
│
├── Auth
│ ├── ErrAuthUnauthorized, ErrAuthRateLimitRuleExceeded
│
├── Project / Network
│ ├── ErrProjectNotFound, ErrProjectAlreadyExists
│ ├── ErrNetworkNotFound, ErrNetworkNotSupported, ErrNetworkInitializing
│ ├── ErrNetworkNoUpstreamsAvailable
│ ├── ErrUnknownNetworkID, ErrUnknownNetworkArchitecture
│ ├── ErrInvalidEvmChainId, ErrFinalizedBlockUnavailable, ErrNetworkRequestTimeout
│
├── Upstream lifecycle
│ ├── ErrUpstreamClientInitialization, ErrUpstreamInitialization
│ ├── ErrNoUpstreamsLeftToSelect, ErrNoUpstreamsDefined, ErrNoUpstreamsFound
│
├── Upstream request routing
│ ├── ErrUpstreamRequest (wrapper), ErrUpstreamRequestSkipped
│ ├── ErrUpstreamBlockUnavailable, ErrUpstreamMethodIgnored
│ ├── ErrUpstreamSyncing, ErrUpstreamShadowing, ErrUpstreamNotAllowed
│ ├── ErrUpstreamHedgeCancelled, ErrUpstreamMalformedResponse
│ ├── ErrUpstreamsExhausted (multi-error aggregator)
│
├── Rate limiting
│ ├── ErrRateLimitBudgetNotFound, ErrProjectRateLimitRuleExceeded
│ ├── ErrNetworkRateLimitRuleExceeded, ErrUpstreamRateLimitRuleExceeded
│
├── Endpoint (upstream HTTP/gRPC responses)
│ ├── ErrEndpointUnauthorized, ErrEndpointUnsupported
│ ├── ErrEndpointClientSideException, ErrEndpointExecutionException
│ ├── ErrEndpointTransportFailure, ErrEndpointServerSideException
│ ├── ErrEndpointRequestTimeout, ErrEndpointRequestCanceled
│ ├── ErrEndpointCapacityExceeded, ErrEndpointBillingIssue
│ ├── ErrEndpointMissingData, ErrEndpointRequestTooLarge
│ ├── ErrEndpointContentValidation, ErrEndpointNonceException
│
├── Failsafe policies
│ ├── ErrFailsafeConfiguration, ErrFailsafeTimeoutExceeded
│ ├── ErrFailsafeRetryExceeded, ErrFailsafeCircuitBreakerOpen
│
├── Consensus
│ ├── ErrConsensusDispute, ErrConsensusLowParticipants
│
├── getLogs / client range errors
│ ├── ErrGetLogsExceededMaxAllowedRange
│ ├── ErrGetLogsExceededMaxAllowedAddresses, ErrGetLogsExceededMaxAllowedTopics
│
├── JSON-RPC (carriers)
│ ├── ErrJsonRpcRequestUnmarshal, ErrJsonRpcRequestUnresolvableMethod
│ ├── ErrJsonRpcRequestPreparation
│ └── ErrJsonRpcExceptionInternal (normalized carrier)
│
└── Store / cache
├── ErrInvalidConnectorDriver, ErrRecordNotFound, ErrRecordExpired
Not StandardError (standalone types):
├── ErrJsonRpcExceptionExternal — raw upstream JSON-RPC error; normalizer input only
├── TaskFatalError — initializer stop signal; IsTaskFatal()=true
└── ErrDynamicTimeoutExceeded — sentinel for context.WithTimeoutCauseConfig schema
| YAML path | Type | Default | Behavior / footguns |
|---|---|---|---|
metrics.errorLabelMode | string | "compact" (common/defaults.go:L762-L764 (opens in a new tab)) | Controls ErrorSummary output format. "compact": code-only labels (low cardinality). "verbose": CodeChain: cleanedDeepestMessage (high cardinality; development only). Only "compact" and "verbose" are accepted (common/validation.go:L147-L148 (opens in a new tab)). Applied globally via common.SetErrorLabelMode. Source: common/config.go:L2536-2550 |
No other error-specific config fields. Vendor normalization is unconditional for any upstream with a matching Vendor().
Complete error-code table
Legend:
- U =
IsRetryableTowardsUpstreamresult - N =
IsRetryableTowardNetworkresult - Wire HTTP = actual wire status from
determineResponseStatusCode/handleErrorResponse(erpc/http_server.go:L1280-1317,erpc/http_server.go:L1457-1491) - JSON-RPC = wire numeric code after
TranslateToJsonRpcException
| # | Error code | U | N | Wire HTTP | JSON-RPC | Notes |
|---|---|---|---|---|---|---|
| 1 | ErrInvalidRequest | yes | yes | 400 | −32602 | invalid body/headers |
| 2 | ErrInvalidUrlPath | yes | yes | 400 | −32602 | malformed URL path |
| 3 | ErrInvalidConfig | yes | yes | 200 | −32603 | startup-only |
| 4 | ErrRequestTimeout | yes | yes | 200 | −32603 | pre-upstream timeout |
| 5 | ErrInternalServerError | yes | yes | 200 | −32603 | internal |
| 6 | ErrAuthUnauthorized | yes | yes | 401 | −32016 | auth strategy rejected |
| 7 | ErrAuthRateLimitRuleExceeded | no (capacity) | yes | 429 | −32005 | auth-level budget |
| 8 | ErrProjectNotFound | yes | yes | 404 | −32603 | project not configured |
| 9 | ErrProjectAlreadyExists | n/a | n/a | — | — | startup duplicate |
| 10 | ErrNetworkNotFound | yes | yes | 404 | −32603 | network not configured |
| 11 | ErrUnknownNetworkID | yes | yes | 200 | −32603 | — |
| 12 | ErrUnknownNetworkArchitecture | yes | yes | 200 | −32603 | — |
| 13 | ErrNotImplemented | yes | yes | 200 | −32601 | stateful method under a multi-upstream pool or served by no targeted upstream, eth_accounts/eth_sign, or subscription over HTTP → method not supported |
| 14 | ErrInvalidEvmChainId | yes | yes | 200 | −32603 | — |
| 15 | ErrFinalizedBlockUnavailable | yes | yes | 200 | −32603 | finality check |
| 16 | ErrUpstreamClientInitialization | yes | yes | — | — | not fatal unless wrapped in TaskFatalError |
| 17 | ErrUpstreamRequest | inherited | inherited | — | inherited | wrapper; carries durationMs/attempts/retries/hedges |
| 18 | ErrUpstreamMalformedResponse | yes | yes | 200 | −32603 | — |
| 19 | ErrUpstreamsExhausted | recursive | recursive | 200 | from dominant child | multi-error aggregator |
| 20 | ErrNoUpstreamsLeftToSelect | yes | yes | 200 | −32603 | per-upstream states in details |
| 21 | ErrNoUpstreamsDefined | yes | yes | 200 | −32603 | Dead code — zero production call sites |
| 22 | ErrNoUpstreamsFound | yes | yes | 200 | −32603 | — |
| 23 | ErrNetworkInitializing | yes | yes | 200 | −32603 | retry shortly; becomes ErrNetworkNoUpstreamsAvailable past the threshold |
| 23b | ErrNetworkNoUpstreamsAvailable | yes | yes | 404 | −32603 | network stuck initializing with zero upstreams for upstream.NoUpstreamsAvailableAfter (5m) |
| 24 | ErrNetworkNotSupported | yes | yes | 404 | −32603 | no provider covers network |
| 25 | ErrUpstreamNetworkNotDetected | yes | yes | — | — | Dead code — zero production call sites |
| 26 | ErrUpstreamInitialization | yes | yes | — | — | — |
| 27 | ErrUpstreamRequestSkipped | no | yes | 200 | −32603 | permanent skip |
| 28 | ErrUpstreamBlockUnavailable | yes | yes | 200 | −32603 | transient lag |
| 29 | ErrUpstreamMethodIgnored | no | yes | 200 | −32601 | ignoreMethods config |
| 30 | ErrUpstreamSyncing | yes | yes | 200 | −32603 | node still syncing |
| 31 | ErrUpstreamShadowing | yes | yes | — | — | shadow mode |
| 32 | ErrUpstreamNotAllowed | yes | yes | — | — | use-upstream directive |
| 33 | ErrUpstreamHedgeCancelled | yes | yes | — | — | hedge discard |
| 34 | ErrResponseWriteLock | yes | yes | — | — | Dead code — superseded by ErrUpstreamHedgeCancelled |
| 35 | ErrJsonRpcRequestUnmarshal | no | no | 400 | −32700 | retryableTowardNetwork=false always |
| 36 | ErrJsonRpcRequestUnresolvableMethod | yes | no | 200 | −32603 | retryableTowardNetwork=false; note: gets −32603, not −32700 |
| 37 | ErrJsonRpcRequestPreparation | yes | no | 200 | −32603 | Dead code — N=false default is caller-overridable (unique in taxonomy) |
| 38 | ErrFailsafeConfiguration | n/a | n/a | — | — | startup |
| 39 | ErrFailsafeTimeoutExceeded | yes | yes | 200 | −32603 | scope in message |
| 40 | ErrFailsafeRetryExceeded | inherited | inherited | — | inherited | scope in message |
| 41 | ErrFailsafeCircuitBreakerOpen | no | yes | 200 | −32603 | — |
| 42 | ErrRateLimitBudgetNotFound | n/a | n/a | — | — | config |
| 43 | ErrRateLimitRuleNotFound | n/a | n/a | — | — | Dead code — zero production call sites |
| 44 | ErrProjectRateLimitRuleExceeded | no (capacity) | yes | 429 | −32005 | — |
| 45 | ErrNetworkRateLimitRuleExceeded | no (capacity) | yes | 429 | −32005 | — |
| 46 | ErrNetworkRequestTimeout | yes | yes | 200 | −32603 | network-scope timeout |
| 47 | ErrUpstreamRateLimitRuleExceeded | no (capacity) | yes | 200 | −32005 | NOT in wire 429 list despite method returning 429 |
| 48 | ErrUpstreamExcludedByPolicy | yes | yes | — | — | Dead code — zero production call sites; exclusion is structural |
| 49 | ErrEndpointUnauthorized | no | yes | 401 | −32016 | provider 401/403 |
| 50 | ErrEndpointUnsupported | no | yes | 200 | −32601 | — |
| 51 | ErrEndpointClientSideException | yes | yes (default) | 200 | from cause | N:no set by some normalizer branches (rules 17, 18d) |
| 52 | ErrEndpointExecutionException | no | no | 200 | 3 or −32003 | N:yes overridden for eth_sendRawTransaction reverts |
| 53 | ErrEndpointTransportFailure | yes | yes | — | −32603 | URL stripped from cause msg (credential hygiene) |
| 54 | ErrEndpointServerSideException | yes | yes | 200 | from cause | originalStatusCode stored in details |
| 55 | ErrEndpointRequestTimeout | yes | yes | 200 | −32015 | — |
| 56 | ErrEndpointRequestCanceled | yes | yes | — | — | severity=warning |
| 57 | ErrEndpointCapacityExceeded | no (capacity) | yes | 429 | −32005 | — |
| 58 | ErrEndpointBillingIssue | no | yes | 200 | −32005 | — |
| 59 | ErrEndpointMissingData | yes | yes | 200 | −32014 | details: latestBlock/finalizedBlock/maxAvailableRecentBlocks |
| 60 | ErrUpstreamNodeTypeMismatch | yes | yes | — | −32603 | archive vs full node |
| 61 | ErrEndpointRequestTooLarge | no | yes | 200 | −32012 | complaint: evm_block_range or evm_addresses |
| 62 | ErrJsonRpcExceptionInternal | wrapper | wrapper | — | normalizedCode field | internal carrier for normalized codes |
| 63 | ErrJsonRpcExceptionExternal | n/a | n/a | — | — | raw upstream JSON-RPC; normalizer input only |
| 64 | ErrInvalidConnectorDriver | n/a | n/a | — | — | config |
| 65 | ErrRecordNotFound | yes | yes | — | — | cache miss |
| 66 | ErrRecordExpired | yes | yes | — | — | cache TTL exceeded |
| 67 | ErrConsensusDispute | multi | multi | 200 | −32603 | retryable if ANY child is retryable |
| 68 | ErrConsensusLowParticipants | multi | multi | 200 | −32603 | same any-child rule |
| 69 | ErrGetLogsExceededMaxAllowedRange | yes | yes | 200 | −32012 | eRPC cap, not upstream |
| 70 | ErrGetLogsExceededMaxAllowedAddresses | yes | yes | 200 | −32012 | — |
| 71 | ErrGetLogsExceededMaxAllowedTopics | yes | yes | 200 | −32012 | — |
| 72 | ErrEndpointContentValidation | no | yes | 200 | −32603 | try different upstream |
| 73 | ErrEndpointNonceException | yes | no | 200 | −32003 | reason: already_known or nonce_too_low; idempotency |
Non-StandardError types: ErrJsonRpcExceptionExternal (normalizer input), TaskFatalError (initializer stop signal), ErrDynamicTimeoutExceeded (sentinel distinguishing failsafe-policy timeout from HTTP server deadline).
JSON-RPC numeric codes
All defined at common/errors.go:L2151-L2174 (opens in a new tab).
| Constant | Value | Category |
|---|---|---|
JsonRpcErrorUnknown | −99999 | eRPC internal — unclassified fallback |
JsonRpcErrorCallException | −32000 | standard — generic call exception |
JsonRpcErrorTransactionRejected | −32003 | standard — transaction rejected; also nonce exceptions |
JsonRpcErrorClientSideException | −32600 | standard — invalid request |
JsonRpcErrorUnsupportedException | −32601 | standard — method not found/unsupported |
JsonRpcErrorInvalidArgument | −32602 | standard — invalid params |
JsonRpcErrorServerSideException | −32603 | standard — internal error; eRPC default for unmapped errors |
JsonRpcErrorParseException | −32700 | standard — JSON parse error |
JsonRpcErrorEvmReverted | 3 | de-facto — EVM execution reverted (positive code) |
JsonRpcErrorCapacityExceeded | −32005 | eRPC-normalized — maps all rate-limit / capacity types |
JsonRpcErrorEvmLargeRange | −32012 | eRPC-normalized — request range too large |
JsonRpcErrorMissingData | −32014 | eRPC-normalized — data not on this node |
JsonRpcErrorNodeTimeout | −32015 | eRPC-normalized — node-level timeout |
JsonRpcErrorUnauthorized | −32016 | eRPC-normalized — unauthorized/forbidden |
Wire HTTP status mapping
| Wire HTTP | Triggered by (HasErrorCode anywhere in chain) |
|---|---|
| 400 | ErrInvalidUrlPath, ErrJsonRpcRequestUnmarshal, ErrInvalidRequest |
| 401 | ErrAuthUnauthorized, ErrEndpointUnauthorized |
| 404 | ErrProjectNotFound, ErrNetworkNotFound, ErrNetworkNotSupported, ErrNetworkNoUpstreamsAvailable |
| 429 | ErrAuthRateLimitRuleExceeded, ErrProjectRateLimitRuleExceeded, ErrNetworkRateLimitRuleExceeded, ErrEndpointCapacityExceeded |
| 200 | everything else |
ErrUpstreamRateLimitRuleExceeded returns 200 on the wire despite its ErrorStatusCode() method returning 429. It is not in the wire 429 switch.
HTTP/JSON-RPC vendor normalization rules
Entry point: architecture/evm/error_normalizer.go:L20. Triggered when jr.Error != nil OR HTTP status > 299. Rules evaluated in order — first match wins. originalCode (vendor numeric) is preserved; normalizedCode is set to the eRPC value.
| # | Trigger | Normalized error | JSON-RPC | U | N |
|---|---|---|---|---|---|
| 0 | Vendor hook returns non-nil | vendor-defined | vendor-defined | — | — |
| 1 | Block-range-too-large strings ("Try with this block range", "max block range", "range too large", "too many results", "try paginating", etc.) | ErrEndpointRequestTooLarge (evm_block_range) | −32012 | no | yes |
| 2 | Address-count strings ("specify less number of address", "addresses or topics per search position", "filters"+"current limit is") | ErrEndpointRequestTooLarge (evm_addresses) | −32012 | no | yes |
| 3 | "sender is over rate limit" (OP sequencer) | ErrEndpointCapacityExceeded | −32005 | no | no (all providers hit same sequencer) |
| 4 | status 402, "reached the free tier", "Monthly capacity limit", "/billing" | ErrEndpointBillingIssue | −32005 | no | yes |
| 5 | status 429, "Too many requests", "rate limit", "has exceeded", "limit exceeded", etc. | ErrEndpointCapacityExceeded | −32005 | no | yes |
| 6 | Block-tag unsupported ("pending block is not available", "safe block not found", "finalized is not a supported", etc.) | ErrEndpointClientSideException | −32600 | yes | yes (deliberately retryable) |
| 7 | Missing-data patterns ("missing trie node", "unknown block", "header not found", "transaction not found", "no historical rpc", etc.) | ErrEndpointMissingData | −32014 | yes | yes |
| 7b | "gas exhausted during precompiled contract execution" (HyperEVM node without HyperCore state for the requested block), any method except eth_sendRawTransaction — must precede rule 14 | ErrEndpointMissingData | −32014 | yes | yes |
| 8 | "execution timeout" | ErrEndpointServerSideException | −32015 | yes | yes |
| 9 | Reverts: "reverted", "VM execution error", "VM Exception", "intrinsic gas too high", reth RevertError { output: Some(0x…) | None } (−32603, no data; the 0x… bytes become data) | ErrEndpointExecutionException | 3 | no | no (yes for eth_sendRawTransaction) |
| 10 | "EVM error: InvalidJump" (Berachain) | ErrEndpointExecutionException | 3 | no | no (yes for eth_sendRawTransaction) |
| 11 | Duplicate-tx: "already known", "tx already in mempool", "transaction already exists", etc. — must precede rule 14 | ErrEndpointNonceException (already_known) | −32003 | yes | no |
| 12 | Nonce conflict: "nonce too low", "nonce has already been used" | ErrEndpointNonceException (nonce_too_low) | −32003 | yes | no |
| 12b | Mempool policy rejections: "existing transaction had higher priority", "newer transaction had higher priority", "transaction fee too low", whole-message "rejected" (Monad EthTxPoolDropReason, surfaced as −32603 with no data); "underpriced" (geth-family "transaction underpriced", "replacement transaction underpriced") | ErrEndpointExecutionException | −32003 | no | no (yes for eth_sendRawTransaction — pool contents are node-local) |
| 13 | "insufficient funds", "insufficient balance" | ErrEndpointExecutionException | −32003 | no | yes (trace_*/debug_*/eth_trace* only — state-reconstruction artifact; non-retried for writes & live simulations) |
| 14 | code == −32003, "out of gas", "gas too low", "gas required exceeds allowance" (eth_estimateGas out of gas at its cap; go-ethereum estimator, seen on Arbitrum nitro), "IntrinsicGas" | ErrEndpointExecutionException | −32003 | no | no (yes for eth_sendRawTransaction) |
| 14b | "invalid chain id" (the transaction's chainId does not match the network) | ErrEndpointExecutionException | −32003 | no | no, including eth_sendRawTransaction |
| 14c | "exceeds block gas limit" (the transaction's gas limit is above the block gas limit) | ErrEndpointExecutionException | −32003 | no | no, including eth_sendRawTransaction |
| 15a | "not found"/"not available" AND ("Method"|"module") | ErrEndpointUnsupported | −32601 | no | yes |
| 15b | same outer AND ("header"|"block"|"transaction"|"state") | ErrEndpointMissingData | −32014 | yes | yes |
| 15c | same outer, neither 15a nor 15b | ErrEndpointClientSideException | −32600 | yes | yes |
| 16 | status 415/405, code −32601/−32004/−32001, "Unsupported method", "not supported", "method is not whitelisted" — must follow "not found" rules | ErrEndpointUnsupported | −32601 | no | yes |
| 17 | Malformed tx: "rlp: expected input list", "typed transaction too short", "invalid transaction" | ErrEndpointClientSideException | −32602 | yes | no |
| 18a | "tx of type", Envio type errors | ErrEndpointClientSideException | −32601 | yes | yes |
| 18b | code == −32600 AND data contains "validation errors in batch" | ErrEndpointClientSideException | −32000 | yes | yes |
| 18c | code == −32602 or −32600 (generic) | ErrEndpointClientSideException | −32602 | yes | yes |
| 18d | "param is required", "Invalid Request", "invalid argument", "invalid params" | ErrEndpointClientSideException | −32602 | yes | no |
| 19 | status 401/403, "invalid api key", "key is inactive", "unauthorized" | ErrEndpointUnauthorized | −32016 | no | yes |
| 20 | Fallback (everything else) | ErrEndpointServerSideException | passthrough vendor code | yes | yes |
| 21 | 200-OK result begins with 0x08c379a0 at dt[1:11] (index 0 is JSON quote) | ErrEndpointExecutionException | 3 | no | no |
| 22 | trace_*/debug_*/eth_trace* AND raw body contains "execution timeout" (string scan, not JSON) | ErrEndpointServerSideException | −32015 | yes | yes |
gRPC/BDS normalization rules
Entry point: common/grpc_errors.go:L12. BDS error codes checked first, then gRPC codes.
| Trigger | Normalized error | JSON-RPC | U | N |
|---|---|---|---|---|
BDS UNSUPPORTED_BLOCK_TAG, UNSUPPORTED_METHOD | ErrEndpointUnsupported | −32601 | no | yes |
BDS RANGE_OUTSIDE_AVAILABLE | ErrEndpointMissingData | −32014 | yes | yes |
BDS INVALID_PARAMETER, INVALID_REQUEST | ErrEndpointClientSideException | −32602 | yes | no |
BDS RATE_LIMITED | ErrEndpointCapacityExceeded | −32005 | no | yes |
BDS TIMEOUT_ERROR | ErrEndpointRequestTimeout | −32015 | yes | yes |
BDS RANGE_TOO_LARGE | ErrEndpointRequestTooLarge (evm_block_range) | −32012 | no | yes |
BDS INTERNAL_ERROR | ErrEndpointServerSideException | −32603 | yes | yes |
gRPC Canceled | ErrEndpointRequestCanceled | — | yes | yes |
gRPC Unimplemented | ErrEndpointUnsupported | −32601 | no | yes |
gRPC InvalidArgument | ErrEndpointClientSideException | −32602 | yes | no |
gRPC ResourceExhausted | ErrEndpointCapacityExceeded | −32005 | no | yes |
gRPC DeadlineExceeded | ErrEndpointRequestTimeout | −32015 | yes | yes |
gRPC Unauthenticated, PermissionDenied | ErrEndpointUnauthorized | −32016 | no | yes |
gRPC NotFound, OutOfRange | ErrEndpointMissingData | −32014 | yes | yes |
gRPC Internal, Unknown, Unavailable, default | ErrEndpointServerSideException | −32603 | yes | yes |
SVM (Solana) error contract
Entry point: architecture/svm/error_normalizer.go:L68-73. The SVM extractor no-ops on non-SVM upstreams, so a mixed EVM/SVM project shares one composite extractor.
Native codes reach the client unchanged. This is the central guarantee and it is the opposite of the EVM path's normalize-the-number behavior. Solana clients dispatch on the exact number — @solana/kit maps -32002/-32005/-32016/… to named error classes — so rewriting the code to an eRPC constant silently breaks them. eRPC's routing verdict lives entirely in the outer StandardError class (retryable / capacity / client-vs-server), never in the wire number.
error.data is carried through verbatim. Solana packs the actionable half of an error there. Dropping it is what broke @solana/web3.js SendTransactionError (which reads data.logs) and @solana/kit. Unlike EVM there is no prefix-stripping to do — SVM payloads are structured objects, not revert strings. An empty-string data is treated as ParseError's "no data" placeholder and omitted rather than forwarded.
In particular:
-32002 SendTransactionPreflightFailurecarries anRpcSimulateTransactionResult—err,logs,unitsConsumed,accounts. Both the code and that object survive to the client, which is precisely why@solana/web3.jscan raiseSendTransactionErrorwith populated.logs.-32005 NodeUnhealthycarriesnumSlotsBehind.
The eRPC/Solana code collision. common.JsonRpcErrorNumber reuses -32005 for CapacityExceeded and -32016 for Unauthorized, while Solana assigns those to NodeUnhealthy and MinContextSlotNotReached. The invariant that keeps them apart: on an SVM path eRPC never synthesizes either number. A -32005 or -32016 in an SVM error body always came from the upstream and always means the agave semantic. eRPC's own verdicts are conveyed by the outer class and the HTTP status, and every fallback picks a collision-free code:
| eRPC verdict on an SVM path | Wire code when the upstream sent none | Why not the eRPC constant |
|---|---|---|
| Unauthorized (HTTP 401/403) | -32600 | -32016 would be decoded as MinContextSlotNotReached, so a client would retry against a fresher node forever instead of fixing its key |
| Capacity exceeded (HTTP 429, no body) | -32000 | -32005 would be decoded as NodeUnhealthy |
| Unknown / codeless error object | -32603 | — |
SVM code map
"Retry another upstream?" is IsRetryableTowardNetwork. Every row keeps the upstream's own numeric code on the wire.
| Code | agave name | eRPC class | Retry another upstream? | What it tells a client |
|---|---|---|---|---|
-32601 | MethodNotFound | ErrEndpointUnsupported | yes | This provider does not implement the method; another may. |
-32001 | BlockCleanedUp | ErrEndpointMissingData | yes | Pruned from this node's local ledger — a bigtable-backed provider still has it. |
-32004 | BlockNotAvailable | ErrEndpointMissingData | yes | The block exists but has not reached this node yet (tip propagation). Transient — retry. |
-32008 | NoSnapshot | ErrEndpointMissingData | yes | This node currently holds no snapshot. |
-32010 | KeyExcludedFromSecondaryIndex | ErrEndpointMissingData | yes | Index coverage is per-provider (--account-index), so an indexed provider serves it. A deliberate divergence from routers that mark this terminal. |
-32011 | TransactionHistoryNotAvailable | ErrEndpointMissingData | yes | This node has no transaction history (no bigtable); others do. |
-32014 | BlockStatusNotAvailableYet | ErrEndpointMissingData | yes | Block status not computed yet on this node. Transient — retry. |
-32007 | SlotSkipped | ErrEndpointMissingData, permanent | yes, once per provider | Ambiguous by design: skipped, or lost to a ledger jump. The ledger-jump half is node-local so the sweep tries every provider — but a skipped slot never materializes, so once all providers have answered there is no time-delayed re-sweep. Do not poll for it. |
-32009 | LongTermStorageSlotSkipped | ErrEndpointMissingData, permanent | yes, once per provider | The node consulted its own long-term storage and did not find the slot. Archive completeness differs per provider, so one provider's gap does not answer for the cluster: eRPC asks every provider once, like -32007, then stops. Do not poll for it. |
-32005 | NodeUnhealthy | ErrEndpointServerSideException | yes | This node is behind; data.numSlotsBehind says how far. A fresher upstream serves it. |
-32012 | ScanError | ErrEndpointServerSideException | yes | Scan aborted by rooted-slot movement — transient; another node or a plain retry succeeds. |
-32016 | MinContextSlotNotReached | ErrEndpointServerSideException | yes | This node has not caught up to the request's minContextSlot. Selection also pre-filters on this, so seeing it means no upstream had fresh enough tracked state. Back off; do not treat as a hard failure. |
-32019 | LongTermStorageUnreachable | ErrEndpointServerSideException | yes | This node's bigtable backend is down — distinct from -32009, which is a verdict about the data. |
-32020 on getSignaturesForAddress | vendor: signature not found | ErrEndpointMissingData, permanent | yes, once per provider | Not an agave code. Some vendor proxies send it when the before/until cursor is unknown to them, where agave answers an empty page. eRPC asks every other provider once and serves what they answer; it never asks the same provider again in that request. On any other method -32020 takes the unknown-code default. |
null from getBlockTime | vendor: no time for a rooted slot | ErrEndpointMissingData -32009, permanent | yes, once per provider | Not an agave answer for a slot at or below the provider's finalized slot that the cluster records a time for: agave answers -32007 or -32009 there. Some vendors answer null for a skipped slot. eRPC asks every other provider once; when none has the time, the client receives an error (-32007 or -32009), never null. A null for a slot before the cluster recorded block times is agave's answer and is served. |
-32002 | SendTransactionPreflightFailure | ErrEndpointClientSideException | no | The transaction itself is the problem. data is an RpcSimulateTransactionResult; read data.logs. |
-32003 | TransactionSignatureVerificationFailure | ErrEndpointClientSideException | no | Fix the signature. |
-32006 | TransactionPrecompileVerificationFailure | ErrEndpointClientSideException | no | Fix the instruction. |
-32013 | TransactionSignatureLenMismatch | ErrEndpointClientSideException | no | Fix the payload. |
-32015 | UnsupportedTransactionVersion | ErrEndpointClientSideException | no | Set maxSupportedTransactionVersion. A versioned transaction is present whichever node answers. |
-32018 | SlotNotEpochBoundary | ErrEndpointClientSideException | no | The caller-supplied slot is invalid for this query. |
-32600 / -32602 / -32700 | InvalidRequest / InvalidParams / ParseError | ErrEndpointClientSideException | no | Passed through rather than collapsed to -32600, preserving the distinction every JSON-RPC client already understands. |
-32017 | EpochRewardsPeriodActive | ErrEndpointExecutionException | no | Epoch-rewards distribution is in progress for the queried epoch; the whole cluster reports the same until it completes. Not the caller's fault, but retrying will not change it. |
-32603 | InternalError | ErrEndpointServerSideException | yes | Try another upstream. |
-32000 | generic server-error bucket | see below | see below | Disambiguated by message text. |
| anything else | newer agave codes | ErrEndpointServerSideException | yes | agave appends codes over time; the default is deliberately safe rather than surprising. The raw code is kept. |
WithRetryableTowardNetwork(false) on the client-side rows scopes the opt-out to SVM only — EVM's ClientSideException still retries, which is its default.
The -32000 bucket
Some vendors put everything in -32000. eRPC disambiguates by message text, and every branch keeps -32000 on the wire — a heuristic on vendor wording is far too weak a basis for rewriting the number a client dispatches on. Only the routing verdict changes:
| Message contains | eRPC class | Retry another upstream? |
|---|---|---|
| a rate-limit phrase | ErrEndpointCapacityExceeded | yes |
"missing in long-term storage" | ErrEndpointMissingData, permanent (codeless -32009 variant) | yes, once per provider |
"ledger jump" | ErrEndpointMissingData, permanent (codeless -32007 variant) | yes, once per provider |
"preflight", "transaction simulation failed", "blockhash not found" | ErrEndpointClientSideException | no |
"invalid" plus one of "signature"/"transaction"/"instruction" | ErrEndpointClientSideException | no |
| anything else | ErrEndpointServerSideException | yes |
HTTP-only failures (no JSON-RPC body)
| Status | eRPC class | Wire code | Note |
|---|---|---|---|
| 401 / 403 | ErrEndpointUnauthorized | upstream's code, else -32600 | Outranks the JSON-RPC body. Helius and QuickNode return 401/403 with an error object; reading that body first sent an expired API key down whichever generic path its code happened to map to. The upstream's message and data still ride along. |
| 429 | ErrEndpointCapacityExceeded | -32000 | |
| 5xx | ErrEndpointServerSideException | -32603 | Retryable. |
| other 4xx | ErrEndpointClientSideException | -32602 | Non-retryable toward network — typically an auth/config issue. |
Deterministic codes when upstreams disagree
When every upstream fails, the per-upstream errors are bundled into ErrUpstreamsExhausted and one representative is chosen for the client-visible code. That choice is deterministic for a given multiset of causes, and a retryable cause outranks a terminal one.
sync.Map.Range yields Go-map order, which varies run to run, so orderCauses imposes a total order before anything downstream picks a representative:
- Retryable-toward-network causes before terminal ones. When upstreams disagree about the same datum — one says "not available yet", another says "gone forever" — the retryable verdict is the safe representative. Reporting "gone forever" can make a consumer permanently skip data that does exist, which is unrecoverable; reporting "not yet" merely costs a retry.
- Then by upstream id, so equally-retryable causes still have exactly one canonical order. A tie on both falls back to the error text.
TranslateToJsonRpcException then tallies the dominant error code over that ordered slice and takes the first cause in the winning bucket — so with, say, one upstream reporting -32004 BlockNotAvailable and another reporting -32007 SlotSkipped for the same slot, the client deterministically sees the retryable -32004. Both ranks are architecture-neutral: rank 1 reads the very same flag the retry path consults, so no chain-specific error code leaks into common/.
Permanent is not terminal. -32007 and -32009 are permanent but still retryable across upstreams: eRPC asks every provider once, then stops. Waiting cannot un-skip a slot, so no time-delayed re-sweep runs. "Once" holds for the whole client request: an upstream that gave a permanent verdict is not asked again by a hedge leg, a network retry, or an upstream retry. When every selected upstream has given one, the request ends with the upstream's error. The permanent flag lives on each individual MissingData cause, never on the ErrUpstreamsExhausted wrapper — the predicate walks only a single-cause chain and stops before entering a multi-error fan-out.
SVM write-method guard
architecture/svm/util.go:L20-28. Case-insensitive, so a mis-cased method name cannot slip past the guard:
sendTransaction
sendRawTransaction
requestAirdropThese are never auto-dispatched to a second upstream by any machinery — network hedge (erpc/network_executor.go:L583-587), upstream retry and hedge (upstream/upstream_executor.go:L250-251,288-289), and selection probe mirroring (internal/policy/prober.go:L433) all gate on this helper. On top of that, an error from one of these methods is wrapped as ClientSideException on the response path, which is what makes the network-level upstream loop bail out: that loop checks common.IsClientError — specifically for ErrCodeEndpointClientSideException — rather than walking retryableTowardNetwork details, so without the wrap a ServerSideException from the primary would be silently failed over to the secondary.
The reasons differ per method, and the distinction matters:
sendTransaction/sendRawTransaction: Solana transaction broadcasts are same-signature idempotent on-chain, so the risk is not a double-spend — it is duplicate broadcasts burning vendor quota and violating the documented single-broadcast guarantee.requestAirdrop: genuinely non-idempotent. It mints per call, so a failover after an effective first attempt mints twice.
simulateTransaction is intentionally absent — it is read-only and safe to retry and hedge. (It is still never cached; see the SVM cache.) SVM and EVM method names cannot collide: EVM methods are eth_*-prefixed, SVM methods are bare, so call sites simply check both sets.
IsNonRetryableWriteMethod (EVM) — write-method guard
architecture/evm/util.go:L7-L17 (opens in a new tab). The EVM half of the guard; the SVM twin is above. Returns true for methods that MUST NOT be retried or hedged because they mutate state non-idempotently:
eth_sendTransaction
eth_createAccessList
eth_submitTransaction
eth_submitWork
eth_newFilter
eth_newBlockFilter
eth_newPendingTransactionFiltereth_sendRawTransaction is deliberately excluded. The comment explains: it supports idempotency handling (the ErrEndpointNonceException already_known/nonce_too_low path lets eRPC detect and safely retry/hedge sendRawTransaction without double-submission risk).
Call sites — used in two places in upstream/upstream_executor.go (opens in a new tab):
- Retry guard (L243): if the method is a non-retryable write,
isRetryableTowardsUpstreamreturnsfalseeven if the error would otherwise qualify. - Hedge guard (L281): if the method is a non-retryable write, the hedge path is bypassed entirely.
Interaction with ErrEndpointExecutionException N-flag override. For eth_sendRawTransaction, the normalizer overrides retryableTowardNetwork=true for revert/out-of-gas results (rules 9 and 14). This is safe precisely because eth_sendRawTransaction is NOT in IsNonRetryableWriteMethod — the two predicates are complementary.
ErrUpstreamsExhausted.SummarizeCauses() — bucket categories
common/errors.go:L955-L1101 (opens in a new tab). Iterates joined children and buckets into 19 categories. Category labels appended to error message as "(N upstream X, M upstream Y)":
| Category label | Codes detected |
|---|---|
| unsupported | ErrCodeEndpointUnsupported |
| missing | ErrCodeEndpointMissingData |
| rateLimit | ErrCodeEndpointCapacityExceeded, ErrCodeUpstreamRateLimitRuleExceeded |
| billing | ErrCodeEndpointBillingIssue |
| cbOpen | ErrCodeFailsafeCircuitBreakerOpen |
| timeout | context.DeadlineExceeded, ErrCodeEndpointRequestTimeout, ErrCodeNetworkRequestTimeout, ErrCodeFailsafeTimeoutExceeded |
| serverError | ErrCodeEndpointServerSideException |
| cancelled | ErrCodeUpstreamHedgeCancelled |
| client | ErrCodeEndpointClientSideException, ErrCodeJsonRpcRequestUnmarshal, ErrCodeInvalidRequest, ErrCodeInvalidUrlPath |
| transport | ErrCodeEndpointTransportFailure |
| unsynced | ErrCodeUpstreamSyncing, ErrCodeUpstreamBlockUnavailable |
| excluded | ErrCodeUpstreamExcludedByPolicy |
| nodeTypeMismatch | ErrCodeUpstreamNodeTypeMismatch |
| ignores | ErrCodeUpstreamMethodIgnored |
| skips | ErrCodeUpstreamRequestSkipped |
| tooLarge | ErrCodeEndpointRequestTooLarge, ErrCodeGetLogsExceededMaxAllowedRange, ErrCodeGetLogsExceededMaxAllowedAddresses, ErrCodeGetLogsExceededMaxAllowedTopics |
| auth | ErrCodeEndpointUnauthorized |
| validation | ErrCodeEndpointContentValidation |
| other | anything not matched above |
TranslateToJsonRpcException — ordered translation steps
Entry: common/json_rpc.go:L1501 (opens in a new tab). Steps applied in order — first match wins:
| Step | Input condition | Output code / behavior |
|---|---|---|
| 1 | ErrUpstreamsExhausted | Scan children for dominant code (highest count; ErrCodeUpstreamRequestSkipped and ErrCodeEndpointUnsupported excluded; earliest per code wins ties). Replace with dominant child. When NO children exist, translate ErrUpstreamsExhausted itself (→ −32603). When all children are skipped/unsupported, client sees the first child's code (typically −32601 or −32603). |
| 2 | Chain already contains ErrCodeJsonRpcExceptionInternal | Return as-is (upstream-derived normalized code preserved). |
| 3 | ErrCodeAuthRateLimitRuleExceeded / ErrCodeProjectRateLimitRuleExceeded / ErrCodeNetworkRateLimitRuleExceeded / ErrCodeUpstreamRateLimitRuleExceeded | −32005 CapacityExceeded, message "rate-limit exceeded" |
| 4 | ErrCodeAuthUnauthorized | −32016 Unauthorized, message "unauthorized" |
| 5 | ErrCodeUpstreamMethodIgnored | −32601 UnsupportedException, message "method ignored by upstream: <deepest msg>" |
| 6 | ErrCodeJsonRpcRequestUnmarshal | −32700 ParseException, message "failed to parse json-rpc request" |
| 7 | ErrCodeInvalidRequest / ErrCodeInvalidUrlPath | −32602 InvalidArgument, message "invalid request url and/or body" |
| 8 | ErrCodeGetLogsExceededMaxAllowedRange / ...Addresses / ...Topics | −32012 EvmLargeRange, message "getLogs request exceeded max allowed range" |
| 9 | Fallback (anything else) | −32603 ServerSideException with deepest message |
Helper predicates
| Predicate | Returns false / behavior | Source |
|---|---|---|
HasErrorCode(err, codes...) | Traverses StandardError cause chain AND joined multi-errors; a non-retryable code anywhere poisons the whole chain | common/errors.go:L2333-L2359 (opens in a new tab) |
IsCapacityIssue(err) | Returns true for: ErrCodeProjectRateLimitRuleExceeded, ErrCodeNetworkRateLimitRuleExceeded, ErrCodeUpstreamRateLimitRuleExceeded, ErrCodeAuthRateLimitRuleExceeded, ErrCodeEndpointCapacityExceeded | common/errors.go:L2500-L2509 (opens in a new tab) |
IsClientError(err) | Returns true for: ErrCodeEndpointClientSideException, ErrCodeJsonRpcRequestUnmarshal, ErrCodeGetLogsExceededMaxAllowedRange, ErrCodeGetLogsExceededMaxAllowedAddresses, ErrCodeGetLogsExceededMaxAllowedTopics | common/errors.go:L2511-L2520 (opens in a new tab) |
IsClientDisconnect(err) | Returns true for context.Canceled, context.DeadlineExceeded, or error message containing: "use of closed network connection", "broken pipe", "connection reset by peer", "ECONNRESET", "EPIPE" | common/errors.go:L129-L150 (opens in a new tab) |
IsRetryableTowardsUpstream(err) | Returns false if HasErrorCode finds any of: ErrCodeFailsafeCircuitBreakerOpen, ErrCodeUpstreamRequestSkipped, ErrCodeUpstreamMethodIgnored, ErrCodeEndpointUnsupported, ErrCodeEndpointBillingIssue, ErrCodeJsonRpcRequestUnmarshal, ErrCodeEndpointExecutionException, ErrCodeEndpointUnauthorized, ErrCodeEndpointRequestTooLarge, ErrCodeEndpointContentValidation, or any IsCapacityIssue code. For ErrUpstreamsExhausted recurses over children — retryable iff ANY child is retryable. | common/errors.go:L2438-L2498 (opens in a new tab) |
Extractor plumbing
| Component | Role | Source |
|---|---|---|
JsonRpcErrorExtractor interface | Injects arch-specific normalization into HTTP clients; avoids import cycles | common/error_extractor.go:L10-L12 (opens in a new tab) |
JsonRpcErrorExtractorFunc | http.HandlerFunc-style adapter | common/error_extractor.go:L17-L21 (opens in a new tab) |
evm.JsonRpcErrorExtractor | EVM impl delegating to ExtractJsonRpcError | architecture/evm/extractor.go:L11-L17 (opens in a new tab) |
| Injection site | evm.NewJsonRpcErrorExtractor() passed to client registry | upstream/registry.go:L79 (opens in a new tab) |
| HTTP invocation | c.errorExtractor.Extract(r, nr, jr, c.upstream) | clients/http_json_rpc_client.go:L930 (opens in a new tab) |
| gRPC invocation | common.ExtractGrpcErrorFromGrpcStatus(st, c.upstream) | clients/grpc_bds_client.go:L925 (opens in a new tab) |
| SVM HTTP invocation | svm.JsonRpcErrorExtractor.Extract(resp, nr, jr, upstream); no-ops unless upstream.Config().Type == svm | architecture/svm/error_normalizer.go:L68-77 |
| Vendor hook | getVendorSpecificErrorIfAny → vn.GetVendorSpecificErrorIfAny(...) fires BEFORE all generic rules | architecture/evm/error_normalizer.go:L878-L900 (opens in a new tab) |
Worked examples
1. Diagnosing why a request exhausted all upstreams. You see erpc_network_failed_request_total spike with error="ErrUpstreamsExhausted/ErrEndpointRequestTimeout". The compound label (compact mode) tells you the inner code. Check erpc_upstream_request_errors_total filtered by error containing Timeout to see which upstream timed out most. Switch metrics.errorLabelMode to "verbose" temporarily in a staging environment to read the full message — never in production.
2. eth_sendRawTransaction returning −32003 but the tx went through. The normalizer sets N=yes for reverts and out-of-gas on eth_sendRawTransaction (rules 9 and 14). eRPC retried on a different upstream. The first upstream returned ErrEndpointExecutionException with code 3 (revert), which is kept and surfaced to the caller — this is expected behavior. Insufficient-funds stays N=no even for sendRawTransaction; no retry occurs in that case.
3. All upstreams returning ErrEndpointMissingData — request retried despite "exhausted". ErrUpstreamsExhausted wrapping only missing-data children is still N=true (any retryable child makes the whole error retryable). Outer retry logic will try again. If data is genuinely absent from all nodes (e.g. pruned historical state), retry will keep failing — configure a dedicated archive upstream or catch −32014 in your client.
4. Alert fires on severity="warning" for hedge discards. ErrUpstreamHedgeCancelled is severity=warning. This is normal — it means a sibling hedge leg won the race. Alert only on severity="critical" in production; warning includes hedge discards and client disconnects that are expected at scale.
5. A Solana client sees −32002 with populated logs. That is the designed path, not a leak: the SVM extractor preserves the native code and forwards error.data verbatim, so @solana/web3.js recognizes -32002 and raises SendTransactionError with .logs from the RpcSimulateTransactionResult. eRPC classes it ErrEndpointClientSideException with retryableTowardNetwork=false, so no second upstream is tried — the transaction, not the node, is the problem.
6. Two Solana upstreams disagree on the same slot. One returns −32004 BlockNotAvailable (not propagated yet), the other −32007 SlotSkipped (permanently gone). The client deterministically sees −32004: orderCauses sorts retryable-toward-network causes ahead of terminal ones, and the dominant-code scan takes the first cause in the winning bucket. Reporting the terminal −32007 could make an indexer permanently skip a slot that does exist; reporting the retryable −32004 only costs a retry.
7. Every Solana upstream returns −32009 and the client gets −32009 after one pass. LongTermStorageSlotSkipped says that this node's long-term storage does not hold the slot. Another provider's archive can, so eRPC asks each upstream once and then returns the error. A hedge leg or a retry does not ask an upstream that already answered −32009 for this request, and no time-delayed re-sweep runs. Stop retrying in the client too. Contrast −32019 LongTermStorageUnreachable, which is a statement about this node's backend being down and stays retryable.
8. Solana requestAirdrop fails and is not retried. requestAirdrop is in the SVM write-method guard because it mints per call — a failover after an effective first attempt mints twice. sendTransaction/sendRawTransaction are in the same set for a different reason: same-signature broadcasts are idempotent on-chain, so the risk is duplicate broadcasts burning vendor quota, not a double-spend.
9. A chain answers is initializing; please retry shortly forever. That message is only correct while a bootstrap is in progress. Once a network has been in initialization for upstream.NoUpstreamsAvailableAfter (5 minutes) with zero upstreams registered, eRPC swaps it for ErrNetworkNoUpstreamsAvailable — no RPC providers are available for network '<id>' in project '<id>' on HTTP 404, and increments erpc_network_no_upstreams_available_total{project,network}. It means no configured upstream or provider covers that chain (removed from config, deprecated, or never supported), so retrying will not help; fix the config or provider coverage. The status is 404 rather than 5xx because the condition is a coverage gap, not a server fault — but it is still an operator-actionable state, so alert on erpc_network_no_upstreams_available_total rather than on wire 5xx. The initializer keeps re-attempting in the background, so a network that later gains an upstream recovers on its own.
Past that threshold the verdict is immediate: the request does not wait out the 30s bootstrap budget first, even while an unrelated upstream task (one with no evm.chainId, such as a revoked API key) keeps failing.
Best practices
- Alert on
severity="critical"only —severity="info"covers client errors and EVM reverts;severity="warning"covers hedge discards and client disconnects. - Keep
metrics.errorLabelModeat"compact"in production."verbose"creates a new Prometheus time series per unique error message and will exhaust memory. - When
ErrUpstreamsExhaustedappears in logs, checkSummarizeCausesbucket in the message (e.g."2 upstream timeout, 1 upstream rateLimit") to identify the dominant failure mode before tuning retry or circuit-breaker config. ErrEndpointTransportFailurestrips endpoint URLs from cause messages — if you need the raw URL for debugging, check the upstream config or traces, not the error log.ErrUpstreamClientInitializationis not fatal by default. If you see it at startup for an upstream that should have resolved (chain-ID mismatch, wrong type), check whether callers wrap it inTaskFatalErrorfor permanent failures.ErrUpstreamRateLimitRuleExceededreturns HTTP 200, not 429, on the wire. If your client is polling on 429 to detect upstream budget exhaustion, it will miss this case — filter on JSON-RPC code−32005instead.- For
eth_sendRawTransaction, a−32003response may be a successful idempotent retry (nonce-duplicate or out-of-gas handled by normalizer rule 11/14). Check thereasonfield in error details (already_knownvsnonce_too_low) to distinguish.
Edge cases & gotchas
ErrUpstreamsExhaustedwith NO cause is terminal (N=false). An exhausted error wrapping zero children means no upstream was tried; retrying at network scope cannot make progress. Source:common/errors.go:L2393-L2394(opens in a new tab)- All-missing-data exhausted IS retryable.
ErrUpstreamsExhaustedwrapping onlyErrEndpointMissingDatachildren is N=true because any retryable child makes the whole exhausted error retryable. Source:common/errors_retry_test.go:L51-L74(opens in a new tab) ErrEndpointExecutionExceptionis N=false — excepteth_sendRawTransactionreverts. The normalizer overrides N=yes foreth_sendRawTransactionreverts and out-of-gas (rules 9 and 14). Insufficient-funds (rule 13) does NOT get the override. Source:architecture/evm/error_normalizer.go:L263-L272(opens in a new tab)ErrEndpointClientSideExceptionis N=true by default. Only rules 17 (malformed tx), 18d (invalid params), and gRPC/BDSInvalidArgumentset N=false. Rule 6 (block-tag-unsupported) deliberately keeps N=true to allow other upstreams to attempt the tag. Source:common/errors_retry_test.go:L175-L187(opens in a new tab)ErrUpstreamRateLimitRuleExceededreturns 200 on the wire. It is NOT in the wire 429 switch despite itsErrorStatusCode()returning 429. Source:erpc/http_server.go:L1484-L1490(opens in a new tab)- OP-stack "sender is over rate limit" is capacity-exceeded but N=false. All eRPC provider entries proxy the same OP sequencer; retrying on a different provider hits the same limit. All other
ErrEndpointCapacityExceededare N=true. Source:architecture/evm/error_normalizer.go:L125-L139(opens in a new tab) - Nonce-duplicate detection must run before generic −32003. Some vendors use −32003 for "already known"/"nonce too low". Rules 11/12 appear before rule 14 in the normalizer. "Replacement transaction underpriced" is never an idempotent success; rule 12b treats it as a node-local refusal. Source:
architecture/evm/error_normalizer.go:L297-L301(opens in a new tab) - 200-OK revert detection checks
dt[1:11]. Index 0 is the JSON quote character; the ABI selector0x08c379a0starts at index 1. Source:architecture/evm/error_normalizer.go:L609-L624(opens in a new tab) - Trace/debug timeout detection scans raw bytes. Rule 22 does a raw string search to avoid parsing up to ~50MB trace responses. Source:
architecture/evm/error_normalizer.go:L626-L629(opens in a new tab) buildErrorResponseBodyunwraps single-child exhausted. When exactly one upstream tried, the wrapper is removed and clients see the real upstream error. Source:erpc/http_server.go:L1397-L1403(opens in a new tab)- Compact
ErrorSummarycompound labels are not universal. OnlyErrFailsafeRetryExceeded,ErrUpstreamRequest, andErrUpstreamRequestSkippedproduceOuterCode/InnerCodelabels.ErrFailsafeTimeoutExceededdoes NOT compound even with a cause. Source:common/errors_summary_test.go:L24-L30(opens in a new tab) ErrDynamicTimeoutExceededdistinguishes failsafe from HTTP deadline. Set ascontext.WithTimeoutCausecause by the timeout policy.context.Cause(ctx) == ErrDynamicTimeoutExceededtells you the failsafe policy fired, not the HTTP server's global deadline. Source:common/errors.go:L1981-L1984(opens in a new tab)TranslateToJsonRpcExceptionskipsUpstreamRequestSkippedandEndpointUnsupportedwhen counting dominant error. When all upstreams returned one of these codes, the first child's wire code is used (typically −32601 or −32603). Source:common/json_rpc.go:L1523-L1526(opens in a new tab)- BDS gRPC legacy extractor diverges from live path.
evm.ExtractGrpcError(no call sites) mapsTIMEOUT_ERROR/DeadlineExceededtoErrEndpointServerSideException; livecommon.ExtractGrpcErrorFromGrpcStatusmaps both toErrEndpointRequestTimeout. If the legacy function is ever restored, BDS timeout retry behavior will regress. ErrConsensusDisputeandErrConsensusLowParticipantsretryability follows the any-child rule. Both aggregate per-upstream participant errors viaerrors.Join. If ANY single child is retryable, the consensus error is retryable network-wide. Source:common/errors.go:L2397-L2411(opens in a new tab)ErrEndpointClientSideException.ErrorStatusCode()returns 200 for revert-class causes. When the innerErrJsonRpcExceptionInternalhasnormalizedCodeof3(JsonRpcErrorEvmReverted),-32000(JsonRpcErrorCallException), or-32003(JsonRpcErrorTransactionRejected), the method returns 200 rather than 400 — an EVM revert is a valid execution outcome. Note thatErrorStatusCode()is dead code (zero call sites), but the wire behavior is consistent:determineResponseStatusCode/handleErrorResponsealways return 200 for these cases via the default switch branch. Source:common/errors.go:L1894-L1905(opens in a new tab)- Legacy
evm.ExtractGrpcError(dead code) has noCanceledbranch. The livecommon.ExtractGrpcErrorFromGrpcStatusmaps gRPCCanceledtoErrEndpointRequestCanceled; the dead legacy function falls through to the defaultErrEndpointServerSideExceptioncase. Additionally, the legacy function maps both BDSTIMEOUT_ERRORand gRPCDeadlineExceededtoErrEndpointServerSideException(live path maps both toErrEndpointRequestTimeout). If the legacy function is ever restored, BDS/gRPC timeout and cancellation retry behavior will regress. Source:architecture/evm/error_normalizer.go:L660-L876(opens in a new tab) vscommon/grpc_errors.go:L86-L97(opens in a new tab) buildErrorResponseBodysetserror.dataonly under two conditions. Thedatafield is included only whenincludeErrorDetailsis true AND the method is NOTeth_call. Foreth_call, the revert data is intentionally suppressed in the top-level error body. Source:erpc/http_server.go:L1425-L1433(opens in a new tab)ErrJsonRpcExceptionInternalprefixes itsCodeChain()with the numeric normalized code. The overriddenCodeChain()produces"<normalizedCode> <- ErrJsonRpcExceptionInternal"(e.g."-32014 <- ErrJsonRpcExceptionInternal").NormalizedCode()returnsdetails["normalizedCode"]as aJsonRpcErrorNumber;OriginalCode()handles bothintandfloat64types (JSON round-trip issue). Source:common/errors.go:L2202-L2222(opens in a new tab)- On an SVM path,
−32005and−32016always mean the agave semantic. They collide with eRPC's ownCapacityExceededandUnauthorizedconstants, so the invariant is that eRPC never synthesizes either number on an SVM path: a-32005isNodeUnhealthy(withdata.numSlotsBehind), a-32016isMinContextSlotNotReached. eRPC's capacity verdict arrives as HTTP 429 with wire code-32000, and its auth verdict as HTTP 401/403 with-32600. - SVM
ErrEndpointClientSideExceptionis N=false, unlike EVM's. The SVM extractor callsWithRetryableTowardNetwork(false)explicitly on every client-side branch, scoping the opt-out to SVM. EVM'sClientSideExceptionremains N=true by default. permanentdoes not meanterminalon SVM missing-data errors.-32007and-32009are both permanent but retryable: eRPC asks every provider once per client request, then stops (no time-delayed re-sweep, because waiting cannot un-skip a slot).failedPermanentlyLockedcounts a permanent missing-data verdict as final for that upstream, so a hedge leg or a retry does not re-ask it, andAllUpstreamsFailedPermanentlyends the request when every selected upstream has given one (common/request.go:L1728-1742). The permanent flag lives on each individual cause, never on theErrUpstreamsExhaustedwrapper — the predicate stops before entering a multi-error fan-out, so the wrapper reportsfalseeven when every child is permanent.- HTTP 401/403 outranks an SVM JSON-RPC error body. Helius and QuickNode return 401/403 with an error object; classifying from the body first sent expired API keys down whichever generic path their code happened to map to. The status wins, and the codeless fallback is deliberately
-32600rather than eRPC's-32016, which an SVM client would decode asMinContextSlotNotReachedand retry forever instead of fixing the key. simulateTransactionis retryable and hedgeable on SVM. It is read-only, so it is deliberately excluded from the SVM write-method guard — but it is still inneverCacheMethods, so it is never served from cache.- The HyperEVM precompile-state reply is missing data, not out of gas. A HyperEVM read precompile (
0x…0800onwards) needs HyperCore state for the requested block. Many nodes hold it only for their live tip and answer older blocks with-32003 "out of gas: gas exhausted during precompiled contract execution: <gas cap>", while other nodes answer the same call. Rule 7b maps that wording toErrEndpointMissingData, so the sweep moves on to the next upstream. If every upstream lacks the state, the client gets-32014with the node's message verbatim. A contract that calls the precompile through a library which catches the failure and reverts with its own error (for examplePrecompileLib__SpotBalancePrecompileFailed()) produces a plainexecution reverted, which stays rule 9.eth_sendRawTransactionkeeps rule 14. Confirmed byTestNetworkForward_PrecompileStateGap_FailsOverToUpstreamWithStateandTestHttpServer_PrecompileStateGap_AllUpstreamsLackStateSurfacesNodeMessage. gas required exceeds allowanceis final, not a server fault. go-ethereum's gas estimator (eth/gasestimator) answerseth_estimateGaswith-32000 "gas required exceeds allowance (N)"when the call still runs out of gas at its cap N, most often a sender whose balance buys only N gas. Arbitrum nitro nodes return it (nitro carries the estimator in its go-ethereum fork); other go-ethereum-derived clients may too. Rule 14 maps it toErrEndpointExecutionException, so one upstream answers and the client gets the node's message with code-32003(the code rule 14 gives "out of gas" too). Before, it fell through to rule 20: the estimate was sent to every upstream and the client gotErrUpstreamsExhausted. A node's own RPC gas cap setting can also produce it; like "out of gas", it is not retried for that reason. Confirmed byTestExtractJsonRpcError_GasRequiredExceedsAllowance.invalid chain idis final, even for writes. A transaction signed for another chain (eth_estimateGas,eth_sendRawTransaction) fails the same way on every correctly configured upstream. Rule 14b maps it toErrEndpointExecutionExceptionand, unlike rule 14, does not make it retryable foreth_sendRawTransaction, so the client gets the node's message after one upstream. Before, it fell through to rule 20: every upstream was tried and the client gotErrUpstreamsExhausted. Confirmed byTestExtractJsonRpcError_InvalidChainID.exceeds block gas limitis final, even for writes. go-ethereum's txpool answers it when a transaction's gas limit is above the block gas limit; the block gas limit is consensus state, so every upstream refuses the same transaction. Rule 14c maps it toErrEndpointExecutionException, not retryable even foreth_sendRawTransaction. Before, it fell through to rule 20: a broadcast with retry and hedge asked every upstream again and again until the retry budget ran out, and the client gotErrFailsafeRetryExceededafter seconds instead of the node's message. Confirmed byTestExtractJsonRpcError_ExceedsBlockGasLimitandTestNetwork_SendRawTransaction_FireAndForget/ExceedsBlockGasLimitIsNotRetried.underpricedgets one try per upstream. "transaction underpriced" (below the node's minimum gas price) and "replacement transaction underpriced" (fee bump too small for the transaction in that node's pool) depend on node-local policy and pool contents, so rule 12b keepseth_sendRawTransactionfailover to other upstreams but never asks the refusing upstream again. Once every upstream has refused, the broadcast ends and the client gets the node's message. Before, they fell through to rule 20 and were retried on the same upstreams until the retry budget ran out (ErrFailsafeRetryExceeded). Confirmed byTestExtractJsonRpcError_UnderpricedandTestNetwork_SendRawTransaction_FireAndForget/UnderpricedFromEveryUpstreamIsNotRetried.
Observability
| Metric | Type | Labels | When it fires |
|---|---|---|---|
erpc_upstream_request_errors_total | counter | project, vendor, network, upstream, category, error, severity, composite, finality, user, agent_name | Each upstream attempt returning an error; error label = ErrorFingerprint(err) |
erpc_network_failed_request_total | counter | project, network, category, attempt, error, severity, finality, user, agent_name | Request failed at network/project level |
erpc_cache_set_error_total | counter | project, network, category, connector, policy, ttl, error | Cache set errored |
erpc_cache_get_error_total | counter | project, network, category, connector, policy, ttl, error | Cache get errored |
erpc_unexpected_panic_total | counter | scope, extra, error | Recovered panic |
Alert on severity="critical" only. severity="info" covers client errors and EVM reverts; severity="warning" covers hedge discards and client disconnects.
Tracing. common.ErrorSummary(err) is used as the OTel span status description on error. The error.summary span attribute is set in failsafe operations. Cache errors set cache.error / cache.connector_error span attributes. gRPC send errors set a grpc.send_error attribute. Source: common/tracing_core.go:L181 (opens in a new tab), data/failsafe.go:L240 (opens in a new tab)
Source code entry points
common/errors.go:L1-L2800(opens in a new tab) — Complete error type definitions, allErrCode*constants, retryability predicates, severity classification,ErrorSummary,ErrorFingerprint,HasErrorCode,IsClientDisconnect,TaskFatalError,ErrDynamicTimeoutExceeded,JsonRpcErrorNumberconstantsarchitecture/evm/error_normalizer.go:L20-L658(opens in a new tab) —ExtractJsonRpcError: all 22 generic HTTP normalization rules in order; vendor hook dispatch at L29-L31architecture/svm/error_normalizer.go(opens in a new tab) —JsonRpcErrorExtractor.Extract: the full SVM code map,wireCodenative-code preservation and the eRPC/Solana collision note,error.datapassthrough,isRateLimitMessage,newAuthoritativeMissingData,newSweptSkipMissingDataarchitecture/svm/util.go(opens in a new tab) —IsNonRetryableWriteMethod(SVM):sendTransaction,sendRawTransaction,requestAirdropcommon/errors.go—orderCauses(opens in a new tab) — the deterministic total order over exhausted causes (retryable before terminal, then upstream id)common/grpc_errors.go:L12-L225(opens in a new tab) — Live gRPC/BDS error normalization; BDS code priority then gRPC code fallbackcommon/json_rpc.go:L1501-L1630(opens in a new tab) —TranslateToJsonRpcException: internal error → wire JSON-RPC numeric code; dominant-child selection forErrUpstreamsExhaustederpc/http_server.go:L1280-L1491(opens in a new tab) —determineResponseStatusCode,buildErrorResponseBody,handleErrorResponse; the only two places that actually set wire HTTP statusarchitecture/evm/util.go:L7-L49(opens in a new tab) —IsNonRetryableWriteMethod;IsMissingDataErrorpatterns for rule 7common/config.go:L2536-L2550(opens in a new tab) —LabelModetype,ErrorLabelModeVerbose/ErrorLabelModeCompactconstants,MetricsConfig.ErrorLabelModefieldcommon/errors_retry_test.go(opens in a new tab) — Tests forIsRetryableTowardNetwork/IsRetryableTowardsUpstream/HasErrorCodebehavioral invariants
Related pages
- Retry — retryability flags in this table drive retry decisions.
- Circuit breaker —
ErrFailsafeCircuitBreakerOpenand capacity errors feed circuit scoring. - Hedge —
ErrUpstreamHedgeCancelledis the discard signal for losing hedge legs. - Rate limiters —
ErrUpstreamRateLimitRuleExceeded/ErrEndpointCapacityExceededare the rate-limit error types. - Auth —
ErrAuthUnauthorized/ErrAuthRateLimitRuleExceededare auth-layer errors. - SVM commitment & finality — where
-32016comes from and how theminContextSlotpre-filter tries to avoid it. - SVM slot tracking & health — the guard that turns an unindexed
getBlockinto the-32004family without an upstream call.