From 150ae6cf89734bc99de363083585e9bb19001b1f Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 18 Mar 2024 14:04:23 +0100 Subject: [PATCH] Use constant backoff in handshake retry strategy --- crates/relayer/src/channel.rs | 4 ++-- crates/relayer/src/connection.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/relayer/src/channel.rs b/crates/relayer/src/channel.rs index a2075baa78..ade8806fdf 100644 --- a/crates/relayer/src/channel.rs +++ b/crates/relayer/src/channel.rs @@ -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 { let retry_delay = max_block_time / PER_BLOCK_RETRIES; diff --git a/crates/relayer/src/connection.rs b/crates/relayer/src/connection.rs index 5b3ce0c084..47b5620845 100644 --- a/crates/relayer/src/connection.rs +++ b/crates/relayer/src/connection.rs @@ -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 { let retry_delay = max_block_time / PER_BLOCK_RETRIES;