-
Notifications
You must be signed in to change notification settings - Fork 375
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
Standardise error response with error codes instead of strings for eth_sendTransaction
, eth_sendRawTransaction
and eth_estimateGas
#523
Comments
One thing to note is what @shemnon said on discord: |
from @fjl
|
Here I'm adding a new helper function that extracts the revert reason of a contract call. Unfortunately, this aspect of the API is underspecified. See these spec issues for more detail: - ethereum/execution-apis#232 - ethereum/execution-apis#463 - ethereum/execution-apis#523 The function added here only works with Geth-like servers that return error code `3`. We will not be able to support all possible servers. However, if there is a specific server implementation that makes it possible to extract the same info, we could add it in the same function as well. --------- Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Here I'm adding a new helper function that extracts the revert reason of a contract call. Unfortunately, this aspect of the API is underspecified. See these spec issues for more detail: - ethereum/execution-apis#232 - ethereum/execution-apis#463 - ethereum/execution-apis#523 The function added here only works with Geth-like servers that return error code `3`. We will not be able to support all possible servers. However, if there is a specific server implementation that makes it possible to extract the same info, we could add it in the same function as well. --------- Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Like seen in this issue, there is no standard error code response for such errors.
My opinion is that depending on strings is futile. and we should possibly try to depend on error codes for tx failure errors instead.
Geth implementation:
https://github.com/ethereum/go-ethereum/blob/master/core/error.go
and here
https://github.com/ethereum/go-ethereum/blob/master/core/types/transaction.go
and here
https://github.com/ethereum/go-ethereum/blob/master/core/txpool/errors.go
Neth implementation:
https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.TxPool/AcceptTxResult.cs
and possibly other places as well.
The text was updated successfully, but these errors were encountered: