Skip to content

Commit

Permalink
fix(hubble): panic at end of index chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
cor committed May 31, 2024
1 parent 300c279 commit f4bbd53
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions hubble/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ async fn index_blocks_by_chunk(
}
tx.commit().await?;
}
panic!("end of index_blocks_by_chunk should not occur");
Ok(())
}

Expand Down Expand Up @@ -375,17 +376,9 @@ impl BlockInsert {
) -> Result<(usize, Self), FromProviderError> {
let mut count = 0;
loop {
match Self::from_provider(chain_id, height, provider).await {
Ok(block) => return Ok((count, block)),
Err(err) => {
if !err.retryable() || count > max_retries {
return Err(err);
}
count += 1;
tokio::time::sleep(Duration::from_secs(1)).await;
continue;
}
}
(|| {debug!("retrying fetching block from provider"; {Self::from_provider(chain_id, height, provider)}})
.retry(&crate::expo_backoff())
.await;
}
}

Expand Down

0 comments on commit f4bbd53

Please sign in to comment.