solana-go icon indicating copy to clipboard operation
solana-go copied to clipboard

RPC Provider Message ID Mismatch Near uint64 Limit

Open Exca-DK opened this issue 7 months ago • 0 comments

Description

We encountered an issue during the integration process with the RPC provider at coinpaprika. Specifically, the message_id returned from the RPC provider does not match our request_id when the request_id approaches the maximum value of uint64.

Problem Details

  • Issue: The mismatch occurs when request_id values are close to the maximum limit of uint64.
  • Observed Behavior: From our tests, any request_id above 2 << 54 - 1 results in a mismatch.
  • Expected Behavior: The message_id returned by the RPC provider should match the request_id sent in the request.

Reproduction Steps

  1. Send a request with a request_id value close to the maximum uint64 limit.
  2. Observe the message_id returned in the response.

Example

The id in question is located in the following code: solana-go/rpc/ws/types.go#L43

Logs

2024-07-11T11:10:11.513+0200    INFO    ws/client.go:338        added new subscription to websocket client      {"count": 1, "id": 3338220398172203928}
2024-07-11T11:10:11.513+0200    DEBUG   ws/client.go:340        writing data to conn    {"data": "{\"jsonrpc\":\"2.0\",\"method\":\"blockSubscribe\",\"params\":[{\"mentionsAccountOrProgram\":\"REDACTED\"},{\"commitment\":\"confirmed\",\"maxSupportedTransactionVersion\":0,\"transactionDetails\":\"full\"}],\"id\":3338220398172203928}"}
2024-07-11T11:10:11.577+0200    DEBUG   ws/client.go:190        received new subscription message       {"message_id": 3338220398172204000, "subscription_id": 0}
2024-07-11T11:10:11.577+0200    ERROR   ws/client.go:198        cannot find websocket message handler for a new stream.... this should not happen       {"request_id": 3338220398172204000, "subscription_id": 0}

Exca-DK avatar Jul 15 '24 11:07 Exca-DK