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

Add revert reason to eth_estimateGas RPC call error #1730

Conversation

VladLupashevskyi
Copy link
Contributor

@VladLupashevskyi VladLupashevskyi commented Dec 17, 2020

PR description

Here I added revert reason to the data field of eth_estimateGas rpc error.

The error looks as shown here:

{
    "code": -32000,
    "message": "Execution reverted",
    "data": "0x08c379a0..."
}

Fixed Issue(s)

fixes #1207

Changelog

@VladLupashevskyi VladLupashevskyi force-pushed the 1207-add-revert-reason-for-estimate-gas branch 3 times, most recently from 6558049 to e061bf0 Compare December 18, 2020 00:22
Copy link
Contributor

@shemnon shemnon left a comment

Choose a reason for hiding this comment

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

This also needs unit tests. Try these two files: https://gist.github.com/shemnon/6f3b58798d3bea1a2b299d59475e9758

Because revert is not a frontier feature you will need to probably put them in with the trace tests ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs - create a new directory and add that new directory here -

The ordinary jsonrpc tests are all frontier fork and the test .blocks file is fairly opaque, not sure how to re-genreate it on a different fork.

@VladLupashevskyi VladLupashevskyi force-pushed the 1207-add-revert-reason-for-estimate-gas branch from 349eff0 to 61d7428 Compare December 18, 2020 18:52
Signed-off-by: Vladyslav Lupashevskyi <vlad@lupashevskyi.com>
Signed-off-by: Vladyslav Lupashevskyi <vlad@lupashevskyi.com>
Signed-off-by: Vladyslav Lupashevskyi <vlad@lupashevskyi.com>
@VladLupashevskyi VladLupashevskyi force-pushed the 1207-add-revert-reason-for-estimate-gas branch from 61d7428 to 9eeacd9 Compare December 18, 2020 18:54
@VladLupashevskyi
Copy link
Contributor Author

@shemnon Thank you for your review and files for tests! Here I prepared tests, but decided not to add them directly to trace directory, I created eth_latest instead and used the testchain for trace tests.

@shemnon shemnon merged commit 0905d1b into hyperledger:master Dec 18, 2020
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
Add revert reason to eth_estimateGas RPC call error

Signed-off-by: Vladyslav Lupashevskyi <vlad@lupashevskyi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Revert reason in eth_estimateGas response
2 participants