Skip to content

Conversation

@kclowes
Copy link
Contributor

@kclowes kclowes commented Oct 23, 2025

The JSON-RPC spec states about the data field in an Error object:

This may be omitted.
The value of this member is defined by the Server

So I think we shouldn't validate that data is present or not in hive, and I also think we shouldn't validate that the errors need to be the same. This will help some tests to pass - for example in Reth:

  • debug_getRawBlock/get-invalid-number (reth_default)
  • debug_getRawHeader/get-invalid-number (reth_default)
  • debug_getRawReceipts/get-invalid-number (reth_default)

@fjl
Copy link
Collaborator

fjl commented Oct 24, 2025

But the data is important. What Reth does is wrong. They emit an error message in error.message and another one in error.data.

<<  {"jsonrpc":"2.0","id":1,"error":{"code":-32602,"message":"Invalid params","data":"hex string without 0x prefix at line 1 column 3"}}

The data field of the error is supposed to give machine-readable details about the error. For example, with the new error code 3, we use the data field to return the EVM return value to the caller so it can access the contract error. We definitely want to standardize what servers return in data.

@kclowes
Copy link
Contributor Author

kclowes commented Oct 24, 2025

So you think if it's there it should be validated? Or that all of these types of responses have to contain a data field, and be validated?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants