Skip to content

fix(flashblocks): Add flashblock ws connection retry period#20510

Merged
mattsse merged 4 commits intoparadigmxyz:mainfrom
okx:niven/fb-conn-retry-period
Jan 19, 2026
Merged

fix(flashblocks): Add flashblock ws connection retry period#20510
mattsse merged 4 commits intoparadigmxyz:mainfrom
okx:niven/fb-conn-retry-period

Conversation

@sieniven
Copy link
Contributor

@sieniven sieniven commented Dec 19, 2025

Summary

This PR adds websocket retry period to prevent unbounded retry loop on websocket connection failures on the flashblock service.

@sieniven
Copy link
Contributor Author

@0x00101010 would appreciate a review for this too 👍

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naming suggestion and one q re motivation

retry_period = CONNECTION_RETRY_PERIOD.as_secs(),
"Error receiving flashblock"
);
sleep(CONNECTION_RETRY_PERIOD).await;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you elaborate on why not immediately retrying is better here?

Copy link
Contributor Author

@sieniven sieniven Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-12-23 at 10 59 40 AM On the case where the websocket connection breaks, the current flashblocks streamer immediately retries to reconnect. However on cases where perhaps the flashblock publisher is down, this spams the RPC node on retry attempts, as the socket creation and connection attempt immediately fails and the error is propagated and handled immediately on re-poll.

The backoff logic should give sufficient time to allow another retry without wasting unnecessary cpu cycles

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Dec 22, 2025
@mattsse mattsse added the A-op-reth Related to Optimism and op-reth label Dec 22, 2025
@sieniven
Copy link
Contributor Author

@mattsse hey, any updates for this PR?

@sieniven
Copy link
Contributor Author

@mattsse bumping this again - this PR has been dangling for awhile, can we get this merged please?

};
use tracing::*;

const CONNECTION_BACKOUT_PERIOD: Duration = Duration::from_secs(5);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets rename this to CONNECTION_RETRY_BACKOFF

@mattsse mattsse added this pull request to the merge queue Jan 19, 2026
Merged via the queue into paradigmxyz:main with commit f7460e2 Jan 19, 2026
44 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Jan 19, 2026
@mattsse mattsse added the M-changelog This change should be included in the changelog label Jan 19, 2026
Vui-Chee added a commit to okx/reth that referenced this pull request Jan 20, 2026
* tag 'v1.10.1': (49 commits)
  chore: bump version to 1.10.1 (paradigmxyz#21188)
  chore: rename extend_ref methods on sorted data structures (paradigmxyz#21043)
  fix(flashblocks): Add flashblock ws connection retry period (paradigmxyz#20510)
  chore(bench): add --disable-tx-gossip to benchmark node args (paradigmxyz#21171)
  refactor(stages): reuse history index cache buffers in `collect_history_indices` (paradigmxyz#21017)
  feat(download): resumable snapshot downloads with auto-retry (paradigmxyz#21161)
  ci: update to tempoxyz (paradigmxyz#21176)
  chore: apply spelling and typo fixes (paradigmxyz#21182)
  docs: document minimal storage mode in pruning FAQ (paradigmxyz#21025)
  chore(deps): weekly `cargo update` (paradigmxyz#21167)
  feat(execution-types): add receipts_iter helper (paradigmxyz#21162)
  revert: undo Chain crate, add LazyTrieData to trie-common (paradigmxyz#21155)
  feat(engine): add new_payload_interval metric (start-to-start) (paradigmxyz#21159)
  feat(engine): add time_between_new_payloads metric (paradigmxyz#21158)
  fix(storage-api): gate reth-chain dependency behind std feature
  perf(storage): batch trie updates across blocks in save_blocks (paradigmxyz#21142)
  refactor: use ExecutionOutcome::single instead of tuple From (paradigmxyz#21152)
  chore(chain-state): reorganize deferred_trie.rs impl blocks (paradigmxyz#21151)
  feat(primitives-traits): add try_recover_signers for parallel batch recovery (paradigmxyz#21103)
  perf: make Chain use DeferredTrieData (paradigmxyz#21137)
  ...
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 22, 2026
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-op-reth Related to Optimism and op-reth M-changelog This change should be included in the changelog

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants