-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance error message for reverting eth_call #2829
Comments
Hi @victor-yanev, thanks for sending this. A couple of points 1. In addition to 2. Regarding the error code
AFAIU, regarding error codes, the JSON-RPC says, 3. I think we can downgrade the priority here. Medium or even Low seem good choices. The reason is that this is not a blocker for other issues, for example #2821. Hardhat or Foundry already perform error decoding. |
Hmmmm, I think we should close this issue then, as it seems that it's not a real problem |
Description
Calling
eth_call
on a function which reverts with a custom error will return the following:which:
3
is not in the JSON-RPC 2.0 specs https://www.jsonrpc.org/specification#error_object and usually-32000
is used for contract reverts)Steps to reproduce
eth_sendRawTransaction
eth_call
request with the unsigned transaction body and the block number from the receipt of the executed transactionExpected:
"data"
field of the error.Example with custom error thrown in solidity:
If the returned reason is encoded as a generic
Error(string)
(prefixed with0x08c379a
) and not a custom error, we can decode it and append it to the message to be consistent with hyperledger/besu/pull/5706:Actual:
execution reverted: CONTRACT_REVERT_EXECUTED
and the wrong error code3
instead of-32000
which is the default for contract revertsAdditional context
Hedera network
No response
Version
v0.54.0
Operating system
None
The text was updated successfully, but these errors were encountered: