Skip to content

fix(broadcastclient): respect reconnect backoff - #4787

Open
Ay-obami wants to merge 1 commit into
OffchainLabs:masterfrom
Ay-obami:fix/broadcast-reconnect-backoff
Open

Ay-obami wants to merge 1 commit into
OffchainLabs:masterfrom
Ay-obami:fix/broadcast-reconnect-backoff

Conversation

@Ay-obami

@Ay-obami Ay-obami commented Nov 8, 2026

Copy link
Copy Markdown

Summary

Make broadcast feed reconnects respect the existing reconnect backoff settings after an established connection drops.

The previous path reset firstReconnectAttempt on every successful WebSocket connect and again after receiving a message. That made the configured reconnect backoff path effectively unreachable for common disconnect/reconnect cycles, while retryConnect used its own linear 0..15s schedule without jitter.

This change:

  • removes the separate firstReconnectAttempt state;
  • uses ReconnectInitialBackoff / ReconnectMaximumBackoff for post-disconnect retries;
  • applies full jitter to each retry delay so clients do not redial in lockstep;
  • carries the escalated backoff across short-lived reconnects and resets it only after data is successfully read;
  • logs failed reconnect attempts at debug level;
  • adds deterministic unit coverage for backoff growth, clamping, disabled-test backoff, and jitter bounds.

Fixes #4785.

Validation

  • gofmt on modified files
  • git diff --check
  • isolated tests for the backoff/jitter helpers pass

I also attempted go test ./broadcastclient -run 'TestReconnect(BackoffSequence|FullJitter)$' -count=1 in a fresh clone. After initializing the pinned go-ethereum submodule, the package build still requires Nitro's generated solgen/go/... bindings, which are produced by the repository's Solidity generation pipeline and are not committed in a fresh clone. CI should exercise the full generated environment.

@CLAassistant

CLAassistant commented Nov 8, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Ay-obami
Ay-obami force-pushed the fix/broadcast-reconnect-backoff branch from 127e443 to b0bffc3 Compare November 8, 2026 16:52
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.

broadcastclient: reconnect after a dropped feed ignores reconnect-*-backoff and has no jitter (redials every ≤15 s forever)

2 participants