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

Return JSON-RPC error on eth_call revert #724

Merged
merged 1 commit into from
Dec 10, 2018
Merged

Conversation

colltoaction
Copy link
Contributor

Return a JSON-RPC error when calling eth_call results in revert. We decided to return the same error code and message as Parity: https://github.com/paritytech/parity-ethereum/blob/7fb33796b17a474242f24d364522ebe5c8a5beef/rpc/src/v1/helpers/errors.rs#L44.

We know this is not a full implementation, but it enables us to run more tests from the OpenZeppelin suite, in particular the ones that check the revert status. We decided to stop here because there's an ongoing discussion about the RPC interface, and it'll be best for us to spend the resources when the dust is settled.

Here are some interesting links I found when investigating how to implement this:

diega
diega previously approved these changes Dec 10, 2018
Copy link
Contributor

@diega diega left a comment

Choose a reason for hiding this comment

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

Brevity is beautiful

@colltoaction
Copy link
Contributor Author

@emiliorizzo this might affect the explorer if it uses call. I would suggest you build this and test the explorer after these changes are merged.

@colltoaction
Copy link
Contributor Author

colltoaction commented Dec 10, 2018

@diega I converted the exception class hierarchy to a method hierarchy per @lsebrie's feedback.

Copy link
Contributor

@lsebrie lsebrie left a comment

Choose a reason for hiding this comment

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

LGTM

@aeidelman aeidelman merged commit 2b446e7 into master Dec 10, 2018
@aeidelman aeidelman deleted the eth_call_revert branch December 10, 2018 21:15
@aeidelman aeidelman added this to the Orchid v0.5.4 milestone Dec 17, 2018
@colltoaction colltoaction removed this from the Orchid v0.5.4 milestone Dec 17, 2018
diega pushed a commit that referenced this pull request Jan 4, 2019
Return JSON-RPC error on eth_call revert
diega pushed a commit that referenced this pull request Mar 1, 2019
Return JSON-RPC error on eth_call revert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants