Skip to content

Move all RPC calls to single client that chooses WS/HTTP - #224

Open
peterbroadhurst wants to merge 1 commit into
last-detectedfrom
ws-only-listener
Open

Move all RPC calls to single client that chooses WS/HTTP#224
peterbroadhurst wants to merge 1 commit into
last-detectedfrom
ws-only-listener

Conversation

@peterbroadhurst

@peterbroadhurst peterbroadhurst commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

EVMConnect has both a HTTP and a WebSocket configuration.

When a WebSocket configuration exists, the block listener connects the WebSocket and then begins to use it.

However, the rest of the listener code continues to use the HTTP connection - meaning we end up with a split where detection of blocks is pinned to a sticky connection over a WebSocket, but the remaining calls happen over HTTP relying on sticky-session HTTP load balancing for calls that require server-side context like eth_newFilter / eth_getFilterChanges.

This PR introduces a common RPC layer that all aspects of the connector use, which then perform RPC method based selection of whether to send requests down a WebSocket or HTTP connection.

A mix still has benefits:

  • High volume submission can utilize concurrent HTTP connections such as eth_sendRawTransaction
  • Calling read operations like eth_call can use multiple backend nodes
  • Expensive calls like debug_traceTransaction can be moved off of the WebSocket

However, the mix previously used was not ideal.

So the approach here is to have a mode switch that supports:

  1. ws everything is pushed down the WebSocket once estsablished
  2. http everything is pushed down HTTP - only use of WebSocket is subscriptions (shoulder taps for new blocks)
  3. auto a new split that is documented in detail in this PR - the new default
  4. legacy as close as possible to the existing split, with two differences documented in the code

@peterbroadhurst
peterbroadhurst force-pushed the ws-only-listener branch 3 times, most recently from 882ea5f to 5cfacb3 Compare August 31, 2026 00:47
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@peterbroadhurst
peterbroadhurst marked this pull request as ready for review August 31, 2026 02:04
@peterbroadhurst
peterbroadhurst requested a review from a team as a code owner August 31, 2026 02:04
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.

1 participant