Skip to content

fix: stop caching -32602 state-unavailable errors as deterministic#37

Merged
maoueh merged 2 commits into
developfrom
feature/check-why-state-error-are-cached
Jul 14, 2026
Merged

fix: stop caching -32602 state-unavailable errors as deterministic#37
maoueh merged 2 commits into
developfrom
feature/check-why-state-error-are-cached

Conversation

@maoueh

@maoueh maoueh commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Problem

A caching proxy was persisting this error permanently in the executor call cache:

rpc error (code -32602): Block requested not found. Request might be querying historical state that is not available. If possible, reformulate query to point to more recent blocks

The error was classified as deterministic (from_cache: true), but it must not be. -32602 state-unavailable errors depend on the node's pruning state — an archive node, or the same node later, answers the call correctly. Caching it poisons the (block, to, data) key with a wrong permanent error.

Root cause

eth-go's IsGenericDeterministicError blanket-treated code -32602 (JSON-RPC invalid argument) as deterministic, trusting the code alone. Some nodes reuse -32602 for "block / historical state not found", a node-state condition rather than a property of the call.

Fix

The real fix lives in eth-go (message guard excluding state-unavailable messages from the generic deterministic heuristic). This PR bumps eth-go to the develop tip (2e53ff6) carrying that fix, so evmx no longer caches these errors.

Verification

  • go build ./... clean
  • go test ./executor/... ./json-rpc/... green

maoueh added 2 commits July 14, 2026 13:59
Bump eth-go to develop tip which no longer classifies -32602
state-unavailable errors (pruned/historical state not found) as
deterministic. Such errors depend on node pruning state and must not
be persisted permanently in the executor call cache.
The eth-go bump transitively pulled x/crypto v0.44.0 which carries the
November 2025 batch of critical SSH agent/crypto advisories (GHSA-vgwf-h737-ff37
and friends). Pin x/crypto to v0.45.0, the first patched release, which clears
them without forcing a Go directive bump.
@maoueh maoueh merged commit 2eb6064 into develop Jul 14, 2026
5 of 6 checks passed
@maoueh maoueh deleted the feature/check-why-state-error-are-cached branch July 14, 2026 18:16
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.

2 participants