nethermind icon indicating copy to clipboard operation
nethermind copied to clipboard

rpc error message compatibility

Open 0xyjk opened this issue 1 year ago • 2 comments

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

0xyjk avatar Jan 31 '24 04:01 0xyjk

We can do this issue in two stages:

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

MarekM25 avatar Feb 02 '24 14:02 MarekM25

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.

smartprogrammer93 avatar Feb 03 '24 09:02 smartprogrammer93