Skip to content
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

eth_call and eth_estimateGas only return encoded revert reason #5705

Closed
matthew1001 opened this issue Jul 14, 2023 · 0 comments · Fixed by #5706
Closed

eth_call and eth_estimateGas only return encoded revert reason #5705

matthew1001 opened this issue Jul 14, 2023 · 0 comments · Fixed by #5706
Assignees
Labels
enhancement New feature or request RPC

Comments

@matthew1001
Copy link
Contributor

Description

When eth_call or eth_estimateGas result in execution reverted the error response contains the reason for the revert, ABI-encoded in the data field, e.g.

{
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
        "code": -32000,
        "message": "Execution reverted",
        "data": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002645524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63650000000000000000000000000000000000000000000000000000"
    }
}

Other clients (Quorum is the specific example I've tried) return the ABI-decoded reason as well. This is particularly convenient for reading revert reasons from application-side logs since a capture of the JSON/RPC flows can show you the cause of a problem without needing to decode the error. Given that the ABI-encoded reason is available it's a very small CPU overhead to perform the conversion in Besu, and the additional network traffic is pretty minimal as well.

Acceptance Criteria

Submit an eth_call or eth_estimateGas that causes execution reverted. The ABI-decoded text is included in the message part of the error response, after the "Execution reverted" prefix. The ABI-encoded data field is also included in the response. If there is no revert reason available, the message field remains as "Execution reverted" which is the existing behaviour.

@matthew1001 matthew1001 added enhancement New feature or request RPC labels Jul 14, 2023
@matthew1001 matthew1001 self-assigned this Jul 14, 2023
@matthew1001 matthew1001 added the doc-change-required Indicates an issue or PR that requires doc to be updated label Jul 17, 2023
@alexandratran alexandratran removed the doc-change-required Indicates an issue or PR that requires doc to be updated label Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request RPC
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants