Skip to content

feat: configurable reconnection attempts on web socket#288

Merged
MauroToscano merged 2 commits intomainfrom
287-feat-batcher-make-max-reconnects-configurable
Jun 4, 2024
Merged

feat: configurable reconnection attempts on web socket#288
MauroToscano merged 2 commits intomainfrom
287-feat-batcher-make-max-reconnects-configurable

Conversation

@taturosati
Copy link
Copy Markdown
Contributor

Added config batcher.eth_ws_reconnects config param as maximum reconnection attempts.

Known issue: if the web socket connection gets an error (e.g Connection refused) it won't retry its reconnection

To test

  1. Start anvil
  2. Start batcher
  3. Kill anvil
  4. You should see a message like:
[2024-06-03T21:47:09Z ERROR ethers_providers::rpc::transports::ws::backend] Error response from WS err=WebSocket protocol error: Connection reset without closing handshake
[2024-06-03T21:47:09Z INFO  ethers_providers::rpc::transports::ws::manager] Reconnecting to backend remaining=99999999999998 url="ws://localhost:8545"

Note that im creating PR anyways, because in prod it reached max reconnection attempts, so it was not getting error connection refused

@taturosati taturosati linked an issue Jun 3, 2024 that may be closed by this pull request
@taturosati taturosati self-assigned this Jun 4, 2024
@taturosati taturosati requested review from JuArce and MauroToscano June 4, 2024 15:26
@MauroToscano MauroToscano merged commit 066c526 into main Jun 4, 2024
@MauroToscano MauroToscano deleted the 287-feat-batcher-make-max-reconnects-configurable branch June 4, 2024 21:02
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.

feat (batcher): make max reconnects configurable

3 participants