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

rpc error message compatibility #6641

Open
0xyjk opened this issue Jan 31, 2024 · 2 comments
Open

rpc error message compatibility #6641

0xyjk opened this issue Jan 31, 2024 · 2 comments

Comments

@0xyjk
Copy link

0xyjk commented Jan 31, 2024

Is your feature request related to a problem? Please describe.
currently for nonce too low error, nethermind rpc error message does not contain nonce too low string
many project use string match to determine the error kind, for example optimism
this will cause client side can't catch the correct error kind and will lead to incorrect behaviour

Describe the solution you'd like
for compatibility, add extra string in rpc errror message, geth error message can be found here

@MarekM25
Copy link
Contributor

MarekM25 commented Feb 2, 2024

We can do this issue in two stages:

  1. Adjust error messages to geth
  2. Propose better error codes to other client teams.

@smartprogrammer93
Copy link
Contributor

Well, here what we return in this case is the following

$"{Code}, {Message}"

Code is basically nameof(OldNonce) and message is a descriptive message like so

$"Current nonce: {currentNonce}, nonce of rejected tx: {tx.Nonce}"

Not sure what is the correct approach here. no matter how i try to do it, it will be very custom code for this specific error. or we need to do a completely refactor and rename of enums and our logic of returned errors to comply with a none standardized approach while also losing proper messages explaining exactly what is wrong to the user.
if these projects are using string contains instead of string match we can arrange something. to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants