Skip to content

Allow retry strategies to be configured #1131

@romac

Description

@romac

Crate

ibc-relayer

Summary

Add configuration options to specify the retry strategies to be used in various places.

Problem Definition

As some chains may be slower or faster than other, the performance and reliability of Hermes could be improved by allowing to configure the retry strategies per-chain.

Proposal

Add a retry_strategies section to ChainConfig which might look like:

[chains]
id = 'ibc-0'
# ...

[chains.retry_strategies]
wait_for_tx_commit = { type = "Fixed", interval = 300, max_total_delay = 12_000 }
worker = { type = "ConstantGrowth", initial_delay = 200, increment = 100, max_delay = 500, max_total_delay = 2000 }
default = { type = "Fibonacci", initial_delay = 1000, max_delay = 60_000, max_total_delay = 600_000 }
pub struct ChainConfig {
  // ...

  #[serde(default)]
  retry_strategies: RetryStrategies
}

#[derive(Serialize, Deserialize)]
pub struct RetryStrategies {
  wait_for_tx_commit: RetryStrategy,
  worker: RetryStrategy,
  default: RetryStrategy,
}

impl Default for RetryStrategies {
  // ...
}

#[derive(Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum RetryStrategy {
  Fixed { interval: u64, max_total_delay: u64 },
  Fibonacci { initial_delay: u64, max_delay: u64, max_total_delay: u64 },
  ConstantGrowth { initial_delay: u64, increment: u64, max_delay: u64, max_total_delay: u64 },
}

Acceptance Criteria


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Metadata

Metadata

Assignees

No one assigned

    Labels

    I: configurationInternal: related to Hermes configurationO: new-featureObjective: cause to add a new feature or supportO: performanceObjective: cause to improve performance

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions