Skip to content

jsonrpc.ID type mismatch causes WebSocket response matching failure with some RPC nodes #111

@yl

Description

@yl

Problem

I encountered an issue when using go-ethlibs with WebSocket connections to certain RPC nodes.

The jsonrpc.ID type in go-ethlibs is currently defined as uint64, but some RPC nodes (such as NodeReal) modify or coerce this value in their responses. This leads to mismatches between requests and responses, especially when trying to match IDs in WebSocket mode.

Example

Using wscat, I sent the following request:

{"method":"eth_blockNumber","params":[],"id":11576893527143237441,"jsonrpc":"2.0"}

But the response returned a different id:

{"jsonrpc":"2.0","id":11576893527143238000,"result":"0x3027dc4"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions