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

Retry headers request in stages run command #13809

Closed
mattsse opened this issue Jan 15, 2025 · 4 comments · Fixed by #13816
Closed

Retry headers request in stages run command #13809

mattsse opened this issue Jan 15, 2025 · 4 comments · Fixed by #13816
Assignees
Labels
C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Jan 15, 2025

Describe the feature

this currently fails in CI

let tip: P::BlockHeader = fetch_client
.get_header(BlockHashOrNumber::Number(self.to))
.await?

if we lose the connection to the peer, in which case we should retry the request indefinitely

TODO

retry request if

impl RequestError {
/// Indicates whether this error is retryable or fatal.
pub const fn is_retryable(&self) -> bool {
matches!(self, Self::Timeout | Self::ConnectionDropped)
}

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Jan 15, 2025
@mattsse mattsse added D-good-first-issue Nice and easy! A great choice to get started and removed S-needs-triage This issue needs to be labelled labels Jan 15, 2025
@Dhruv-2003
Copy link
Contributor

I can take this issue

@mattsse
Copy link
Collaborator Author

mattsse commented Jan 15, 2025

assigned ty

@Dhruv-2003
Copy link
Contributor

On it, few qns @mattsse

  • should I just use loop or backon retry which seems to be used at other places ?
    let header = (move || get_single_header(fetch_client.clone(), id))
    .retry(backoff)
    .notify(|err, _| println!("Error requesting header: {err}. Retrying..."))
    .await?;
  • no. of retries and any interval b/w them ?

@mattsse
Copy link
Collaborator Author

mattsse commented Jan 16, 2025

for this we can just loop, this is simple enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants