Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use constant backoff in handshake retry strategy #3900

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/relayer/src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ pub mod channel_handshake_retry {

/// Defines the increment in delay between subsequent retries.
/// A value of `0` will make the retry delay constant.
const DELAY_INCREMENT: Duration = Duration::from_secs(1);
const DELAY_INCREMENT: Duration = Duration::from_secs(0);

/// Maximum number of retries
const MAX_RETRIES: u32 = 10;

/// The default retry strategy.
/// We retry with a growing backoff strategy. The strategy is parametrized by the
/// We retry with a constant backoff strategy. The strategy is parametrized by the
/// maximum block time expressed as a `Duration`.
pub fn default_strategy(max_block_time: Duration) -> impl Iterator<Item = Duration> {
let retry_delay = max_block_time / PER_BLOCK_RETRIES;
Expand Down
4 changes: 2 additions & 2 deletions crates/relayer/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ mod handshake_retry {

/// Defines the increment in delay between subsequent retries.
/// A value of `0` will make the retry delay constant.
const DELAY_INCREMENT: Duration = Duration::from_secs(1);
const DELAY_INCREMENT: Duration = Duration::from_secs(0);

/// Maximum number of retries
const MAX_RETRIES: u32 = 10;

/// The default retry strategy.
/// We retry with a growing backoff strategy. The strategy is parametrized by the
/// We retry with a constant backoff strategy. The strategy is parametrized by the
/// maximum block time expressed as a `Duration`.
pub fn default_strategy(max_block_time: Duration) -> impl Iterator<Item = Duration> {
let retry_delay = max_block_time / PER_BLOCK_RETRIES;
Expand Down
Loading