Skip to content

fix(rpc): change ExecutionError code from -32003 to -32000 to match Geth#12169

Merged
LukaszRozmej merged 3 commits into
masterfrom
fix/execution-error-code
Jun 30, 2026
Merged

fix(rpc): change ExecutionError code from -32003 to -32000 to match Geth#12169
LukaszRozmej merged 3 commits into
masterfrom
fix/execution-error-code

Conversation

@manusw7

@manusw7 manusw7 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Changes ErrorCodes.ExecutionError from -32003 to -32000 to match Geth's errcodeDefault
  • In Geth, -32003 means "response too large" — using it for EVM execution errors was a semantic mismatch
  • Affected callers (EthRpcModule.TransactionExecutor, CallResultWithProof) inherit the fix automatically via the named constant
  • Updates test assertions in EthRpcModuleTests.EthCall.cs and StartupTests.cs to expect -32000

Fixes #12166

Test plan

  • Nethermind.JsonRpc.Test — 77 Eth_call tests pass
  • Nethermind.Runner.Test — 52 Startup tests pass

@claude

claude Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Claude finished @manusw7's task in 1m 19s —— View job


Review: PR #12169 — change ExecutionError from -32003 to -32000

  • Read changed files and PR diff
  • Verify Geth error-code semantics
  • Check for remaining -32003 references / colliding switch cases
  • Assess regression / compatibility impact

Verdict: ✅ Looks correct — safe to merge

The change is sound, minimal, and well-targeted. The rationale checks out against Geth's rpc/json.go, which reserves -32003 for errcodeResponseTooLarge and uses -32000 (errcodeDefault) for ordinary EVM execution errors (out of gas, insufficient funds, stack underflow, etc.). Routing ExecutionError to -32000 is the correct Geth-compatible mapping.

Correctness & completeness

  • The fix is made on the named constant, so the runtime callers — EthRpcModule.TransactionExecutor (EthRpcModule.TransactionExecutor.cs:133) and CallResultWithProof (CallResultWithProof.cs:73,78) — inherit it automatically. ✅
  • Tests that reference the value via the constant (ProofRpcModuleCallTests.cs:383, JsonRpcServiceTests.cs:247,251) follow automatically; tests that hardcoded the literal -32003 (EthRpcModuleTests.EthCall.cs, StartupTests.cs) are all updated. ✅
  • I searched the whole repo for any remaining -32003 literal in source, tests, or fixtures — none remain (the only 32003 hits are inside hash/trusted-setup data). ✅
  • No switch/case ErrorCodes.* constructs reference ExecutionError, so the new value colliding with InvalidInput/ResourceNotFound/TransactionRejected/Default (all already -32000) introduces no duplicate-case-label compile issue. This is consistent with how Geth lumps these under the default code. ✅

Notes (Low)

  • This is an observable JSON-RPC behavior change. Any downstream consumer keying on -32003 for eth_call/eth_estimateGas/proof_call errors will now see -32000. That's the intended Geth-alignment, but it's worth a one-line mention in the changelog / release notes so integrators aren't surprised.
  • The PR's third test-plan item (verify against a live Geth node) is still unchecked. Not a blocker given the unit coverage, but worth confirming the eth_estimateGas error path before release.

No Critical / High / Medium findings. The existing (updated) assertions act as the regression coverage required by the contributing guidelines.

@github-actions

Copy link
Copy Markdown
Contributor

EVM Opcode Benchmark Diff

Aggregated runs: base=3, pr=3
Noisy rerun opcodes: EXTCODEHASH, SDIV

Improvements (1)

Opcode Base Median (ns) PR Median (ns) Delta Abs Δ (ns) Base CV PR CV Threshold Uncertainty Effective
DIV 334.660 300.730 -10.14% 33.930 1.5% 1.6% ±5.0% ±2.0% ±5.0%

@manusw7

manusw7 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

/// EVM execution error (out of gas, insufficient funds during execution, etc.)
/// </summary>
public const int ExecutionError = -32003;
public const int ExecutionError = -32000;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now InvalidInput, ExecutionError, ResourceNotFound, TransactionRejected and Default all share same code? WTF?!

@svlachakis svlachakis Jun 30, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LukaszRozmej yeah that's how geth is.. I'll make it a bit cleaner to make them all point to the Default code.

@manusw7 manusw7 Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to add more context, there is an ongoing proposal for errror codes refactoring ethereum/execution-apis#823
so I think that when that go through a big refactor will be needed and (I hope) we'll have more consistency

svlachakis and others added 2 commits June 30, 2026 15:16
…-code

# Conflicts:
#	src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.EthCall.cs
InvalidInput, ExecutionError, ResourceNotFound and TransactionRejected
all resolve to -32000 (Geth's errcodeDefault). Define them as = Default
so the shared value is explicit rather than four independent -32000
literals that look like they should differ.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@svlachakis svlachakis requested a review from LukaszRozmej June 30, 2026 13:57
@LukaszRozmej LukaszRozmej merged commit 34cdf8f into master Jun 30, 2026
559 checks passed
@LukaszRozmej LukaszRozmej deleted the fix/execution-error-code branch June 30, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eth_call / eth_estimateGas: EVM execution failures return code -32003 instead of Geth's -32000

5 participants