fix(rpc): change ExecutionError code from -32003 to -32000 to match Geth#12169
Conversation
84a83ec to
8025017
Compare
|
Claude finished @manusw7's task in 1m 19s —— View job Review: PR #12169 — change
|
EVM Opcode Benchmark DiffAggregated runs: base=3, pr=3 Improvements (1)
|
| /// EVM execution error (out of gas, insufficient funds during execution, etc.) | ||
| /// </summary> | ||
| public const int ExecutionError = -32003; | ||
| public const int ExecutionError = -32000; |
There was a problem hiding this comment.
Now InvalidInput, ExecutionError, ResourceNotFound, TransactionRejected and Default all share same code? WTF?!
There was a problem hiding this comment.
@LukaszRozmej yeah that's how geth is.. I'll make it a bit cleaner to make them all point to the Default code.
There was a problem hiding this comment.
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
…-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>
Summary
ErrorCodes.ExecutionErrorfrom-32003to-32000to match Geth'serrcodeDefault-32003means "response too large" — using it for EVM execution errors was a semantic mismatchEthRpcModule.TransactionExecutor,CallResultWithProof) inherit the fix automatically via the named constantEthRpcModuleTests.EthCall.csandStartupTests.csto expect-32000Fixes #12166
Test plan
Nethermind.JsonRpc.Test— 77Eth_calltests passNethermind.Runner.Test— 52 Startup tests pass