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

Fix JSONRPC error codes to be the same as in geth #897

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fairax
Copy link
Contributor

@fairax fairax commented Nov 9, 2022

Changes JSONRPC error code for revertal to be 3 and default error code to be -32000 instead of -32603. This behavior is the same as in geth which is referring to https://github.com/ethereum/wiki/wiki/JSON-RPC-Error-Codes-Improvement-Proposal.

@fairax fairax requested a review from sorpaas as a code owner November 9, 2022 09:02
@cla-bot-2021
Copy link

cla-bot-2021 bot commented Nov 9, 2022

User @fairax, please sign the CLA here.

@fairax
Copy link
Contributor Author

fairax commented Nov 9, 2022

/cla run-cla-check

@cla-bot-2021
Copy link

cla-bot-2021 bot commented Nov 9, 2022

@fairax The commands could not be executed:

Access denied to command "run-cla-check"

@sorpaas
Copy link
Member

sorpaas commented Nov 9, 2022

/cla run-cla-check

@cla-bot-2021
Copy link

cla-bot-2021 bot commented Nov 9, 2022

Queueing command execution: run-cla-check

@cla-bot-2021
Copy link

cla-bot-2021 bot commented Nov 9, 2022

@sorpaas Command execution has finished.

@sorpaas
Copy link
Member

sorpaas commented Nov 9, 2022

Can you provide a better link for the "JSON RPC Error Codes Improvement Proposal"? That wiki page links to another website's wiki page, but it never mentions 32603.

@fairax
Copy link
Contributor Author

fairax commented Nov 9, 2022

@nanocryk
Copy link
Contributor

nanocryk commented Nov 9, 2022

If there is no selector it is still a revert and thus should have error JSON_RPC_ERROR_REVERT instead of JSON_RPC_ERROR_DEFAULT, right?

@fairax
Copy link
Contributor Author

fairax commented Nov 9, 2022

Probably, but it is not how geth behaves. There are tests for different cases https://github.com/abdulgalimov/ethereum-and-unique-errors-analysis and for example call to method errRevert returns JSON_RPC_ERROR_REVERT but call to callZeroAddress returns JSON_RPC_ERROR_DEFAULT.

client/rpc/src/eth/execute.rs Outdated Show resolved Hide resolved
@fairax fairax requested review from nanocryk and removed request for sorpaas November 14, 2022 07:40
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.

3 participants