internal/ethapi: return code 3 in eth_simulate for reverts#31444
internal/ethapi: return code 3 in eth_simulate for reverts#31444mattsse wants to merge 1 commit intoethereum:masterfrom
Conversation
67a7ec2 to
87fdcf3
Compare
There was a problem hiding this comment.
The underlying issue is that Geth doesn't return a revert error code if a call/estimateGas failed without a revert reason. I've submitted a separate PR to address that. But I think we should merge this PR as well. CC @s1na as this does alter the behavior of the simulate API when reverts happen (but it appears it was faulty before).
errCodeReverted to the proper code
|
I guess one other piece of context here. We currently define The PR I linked before fixes this issue. But this PR should go in as well. |
errCodeReverted to the proper codeThere was a problem hiding this comment.
Was about to merge, but realized that eth_simulate does not use 3 for the return code during reverts. This is also unrelated to the original issue between reth <> geth, which was resolved in #31456. See spec here
A nice thing to do might be to mention in a comment that these error codes are specifically for eth_simulate to avoid future confusion.
Revert error has a special error code:
https://github.com/ethereum/go-ethereum/blob/main/internal/ethapi/errors.go#L36-L40
This changes the
errCodeRevertedto 3 and uses theErrorCodefunction for the callErrorthe referenced wiki no longer exists, but is archived here: https://github.com/vapory-legacy/wiki/blob/master/JSON-RPC-Error-Codes-Improvement-Proposal.md
ref paradigmxyz/reth#15126