eth: add official revert error code for call methods#600
Conversation
| schema: | ||
| $ref: '#/components/schemas/bytes' | ||
| errors: | ||
| - code: 3 |
There was a problem hiding this comment.
I suggest to have an error code similar to what we have on the engine API :
execution-apis/src/engine/common.md
Line 91 in 4140e52
Choose a close number like -31000
There was a problem hiding this comment.
I'm using code 3 here because it is the error code used by geth and erigon for this condition.
There is no requirement for codes to be negative - the JSON-RPC spec says "The error codes from and including -32768 to -32000 are reserved for pre-defined errors. ... The remainder of the space is available for application defined errors."
|
I recently discovered MetaMask implements this spec change already. |
kclowes
left a comment
There was a problem hiding this comment.
fwiw, this looks good to me. Would be nice to have this standardized across clients!
|
Merged after consensus was found in RPC Standards Call 14 ethereum/pm#1758 |
|
@fjl the standard defines the same response for the following endpoints:
-- edited --- eth_createAccessList does not return error codes - can we make it consistent? |
Here I am trying to add an official way of getting the revert data of a contract call. This is often requested by users:
eth_callunderspecified return error message #463eth_sendTransaction,eth_sendRawTransactionandeth_estimateGas#523The spec I'm adding here is what geth has been doing since 2022. It seems best to assign a separate error code because it's an unambiguous way of telling the error.