Skip to content

Commit

Permalink
feat(hubble): make log levels a bit better
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiserKarel committed Apr 5, 2024
1 parent 74ed1fe commit 1ed2f3b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ repellendus
repr
reqwest
restaking
retryable
rgba
ripemd
rlib
Expand Down
10 changes: 8 additions & 2 deletions hubble/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ async fn index_blocks(
.try_chunks(200)
.map_err(|err| err.1)
.try_fold(pool, |pool, chunk| async {
info!(
chain_id.canonical,
"indexing blocks for chunk: {}..{}",
&chunk.first().unwrap(),
&chunk.last().unwrap()
);
let tx = pool.begin().await.map_err(Report::from)?;
let inserts = FuturesOrdered::from_iter(
chunk
Expand All @@ -145,7 +151,7 @@ async fn index_blocks(
return Err(err);
}
Ok(info) => {
info!(
debug!(
chain_id.canonical,
height = info.height,
hash = info.hash,
Expand Down Expand Up @@ -295,7 +301,7 @@ impl BlockInsert {
match Self::from_provider(chain_id, height, provider).await {
Ok(block) => return Ok((count, block)),
Err(err) => {
if !err.retryable() && count > max_retries {
if !err.retryable() || count > max_retries {
return Err(err.into());
}
count += 1;
Expand Down
2 changes: 1 addition & 1 deletion hubble/src/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub struct Log<Chain: ChainType, T> {
}

/// ChainIds track both the database ID of a chain, as well as some canonical representation for
/// degug logging
/// debug logging.
///
/// # Implementation Detail
/// ChainIds contain leaked values, hence care should be taken when creating them.
Expand Down

0 comments on commit 1ed2f3b

Please sign in to comment.