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

Allow retry strategies to be configured #1131

Open
3 of 5 tasks
romac opened this issue Jun 28, 2021 · 0 comments
Open
3 of 5 tasks

Allow retry strategies to be configured #1131

romac opened this issue Jun 28, 2021 · 0 comments
Labels
I: configuration Internal: related to Hermes configuration O: new-feature Objective: cause to add a new feature or support O: performance Objective: cause to improve performance
Milestone

Comments

@romac
Copy link
Member

romac commented Jun 28, 2021

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
@romac romac added O: new-feature Objective: cause to add a new feature or support O: performance Objective: cause to improve performance labels Jun 28, 2021
@romac romac added this to the 07.2021 milestone Jun 28, 2021
@romac romac added the I: configuration Internal: related to Hermes configuration label Jun 28, 2021
@adizere adizere modified the milestones: 07.2021, 08.2021 Jul 13, 2021
@adizere adizere modified the milestones: 08.2021, Backlog Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: configuration Internal: related to Hermes configuration O: new-feature Objective: cause to add a new feature or support O: performance Objective: cause to improve performance
Projects
None yet
Development

No branches or pull requests

2 participants