-
Notifications
You must be signed in to change notification settings - Fork 393
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
Proposal: Error handling specification #1 #286
Comments
@JosephK95 thank you for these reports, this is very helpful. Just curious - are you intending to convert these into tests for this repository or did you just want to log these issues with us? |
Hi, @lightclient. Thanks for your response. My initial purpose was to share the issues with you so that you can consider reflecting them into the specification. I thought you could specify the expected return values in corner cases just like the Ethereum website did for some of the APIs: https://ethereum.org/ko/developers/docs/apis/json-rpc/ For example, the website specifies the following for the return value of Returns Object - A transaction object, or null when no transaction was found: While the decision making can be somewhat subjective, I personally think the justifications from Geth sound reasonable: ethereum/go-ethereum#25495 And while reading your comment, I thought it would be honorable if our project can somehow contribute to the tests in your repository. Considering that we have techniques to automatically generate valid chains and JavaScript test cases that trigger RPC requests, could you inform us which form of tests would fit your needs that we can contribute to? Thanks. |
Could you please publish your I am grateful for your contributions and would be very happy to have you contribute your tests to this repository. Unfortunately, it may be difficult to do so. Although the testing format is very simple (see the Like you, I have written a tool (rpctestgen) to build a chain and execute the RPC calls. My hesitation is that I anticipate more changes to these files over time as we fill in the tests with more test cases. Because all of the tests are currently generated using a single So, tldr; I'm apprehensive about accepting new tests from a generator that I don't maintain, because I will need to keep an eye on it going forward. -- If you are interested in writing your tests in |
Hi, @lightclient. Thanks for your detailed response. Could you give me some examples on how the changes of RPC methods can invalidate original test cases? Also, could you let us know if you have any plans to update your specification and standardize the expected values for error cases? |
Sorry for the late response @JosephK95, must've missed this.
So here, I was specifically referring to changing the underlying chain. For example, suppose we have a test for The other situation we may need to regenerate tests is if the RPC method definition is changed in some way. For example, a new field
We do intend to continue maintaining this specification. I don't have the bandwidth in the short term to work on standardizing expected values for error cases. I would gladly accept a PR of test cases so that individual client teams can see that their client deviates from the expected response. |
Hi all,
I am working on a project that validates whether four Ethereum client implementations (Geth, Erigon, Nethermind, Besu) behave consistently to one another.
And while doing the experiments, I found out that the clients handle error cases in very much different ways:
getBlockTransactionCount
null
Error
getPastLogs
[]
Error
getTransactionFromBlock
null
Error
getBlockUncleCount
null
Error
getUncle
null
Error
getCode
(1)Error
getCode
(2)Error
null
getBalance
Error
null
getTransactionCount
Error
0
getStorageAt
Error
null
getProof
Error
eth_getProof
getPastLogs
[]
Error
getFeeHistory
{ "oldestBlock": "0x0", "gasUsedRatio": null }
Error
getTransactionFromBlock
null
Error
getUncle
null
Error
I assume these discrepancies derived from the lack of error handling specification in this document. So, how about specifying the expected results (e.g., Error, null, 0, [ ], ...) so that different client implementations behave consistently in error cases as well?
Example test cases can be found in the following link: https://github.com/JosephK95/RPCTests
Thanks and please let me know if there is anything I can help you with.
The text was updated successfully, but these errors were encountered: