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

[Nimbus][WebSockets] Exceptions being thrown when Nimbus connected to Nethermind by websockets #7025

Closed
kamilchodola opened this issue May 15, 2024 · 0 comments · Fixed by #7053
Assignees

Comments

@kamilchodola
Copy link
Contributor

To reproduce simply create a Nethermind <-> Nimbus node where on nimbus webSockets will be enabled:
--web3-url=ws://execution:8551/

Start the node and at Nethermind logs at the very first RPC received from Nimbus you should get this exception:

2024-05-15 10:07:00.9452|ERROR|JsonRpc.JsonRpcProcessor|76|Error during parsing/validation. System.Text.Json.JsonReaderException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 1 | BytePositionInLine: 0.
   at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
   at System.Text.Json.JsonDocument.TryParseValue(Utf8JsonReader& reader, JsonDocument& document, Boolean shouldThrow, Boolean useArrayPools)
   at Nethermind.JsonRpc.JsonRpcProcessor.TryParseJson(ReadOnlySequence`1& buffer, JsonDocument& jsonDocument) in /_/src/Nethermind/Nethermind.JsonRpc/JsonRpcProcessor.cs:line 369
   at Nethermind.JsonRpc.JsonRpcProcessor.ProcessAsync(PipeReader reader, JsonRpcContext context)+MoveNext() in /_/src/Nethermind/Nethermind.JsonRpc/JsonRpcProcessor.cs:line 157
2024-05-15 10:07:00.9452|DEBUG|JsonRpc.JsonRpcService|76|Sending error response, method: none, id: , errorType: -32700, message: Incorrect message, errorData:  

Looking at RPC Recorder output there is:

root@ba043f4868cb:/nethermind/logs# cat rpc.0.txt
{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByHash","params":["0x44bca881b07a6a09f83b130798072441705d9a665c5ac8bdf2f39a3cdf3bee29",false]}
{  "response": {    "jsonrpc": "2.0",    "result": null,    "id": 1  },  "report": {    "method": "eth_getBlockByHash",    "handlingTimeMicroseconds": "0x14db",    "success": true  }}
{  "response": {    "jsonrpc": "2.0",    "error": {      "code": -32700,      "message": "Incorrect message"    },    "id": null  },  "report": {    "method": "# parsing error #",    "handlingTimeMicroseconds": "0x8453",    "success": false  }}
{"jsonrpc":"2.0","id":2,"method":"eth_chainId","params":[]}
{  "response": {    "jsonrpc": "2.0",    "result": "0x1",    "id": 2  },  "report": {    "method": "eth_chainId",    "handlingTimeMicroseconds": "0x17c",    "success": true  }}
{  "response": {    "jsonrpc": "2.0",    "error": {      "code": -32700,      "message": "Incorrect message"    },    "id": null  },  "report": {    "method": "# parsing error #",    "handlingTimeMicroseconds": "0x15c2",    "success": false  }}

Which shows that RPC works well but for every request two responses are being generated (one valid and one invalid).

Node works fine but producing a lot of exceptions.

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 a pull request may close this issue.

2 participants