Skip to content

Commit bbd8f28

Browse files
committed
feat: make reorg traces on by default
1 parent 9b8e077 commit bbd8f28

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/block_range_scanner/reorg_handler.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<N: Network> ReorgHandler<N> {
7474
return Ok(None);
7575
}
7676

77-
info!("Reorg detected, searching for common ancestor");
77+
tracing::info!("Reorg detected, searching for common ancestor");
7878

7979
while let Some(&block_hash) = self.buffer.back() {
8080
info!(block_hash = %block_hash, "Checking if block exists on-chain");
@@ -93,12 +93,12 @@ impl<N: Network> ReorgHandler<N> {
9393
// no need to store finalized block's hash in the buffer, as it is returned by default only
9494
// if not buffered hashes exist on-chain
9595

96-
warn!("Possible deep reorg detected, setting finalized block as common ancestor");
96+
tracing::warn!("Possible deep reorg detected, setting finalized block as common ancestor");
9797

9898
let finalized = self.provider.get_block_by_number(BlockNumberOrTag::Finalized).await?;
9999

100100
let header = finalized.header();
101-
info!(finalized_hash = %header.hash(), block_number = header.number(), "Finalized block set as common ancestor");
101+
tracing::info!(finalized_hash = %header.hash(), block_number = header.number(), "Finalized block set as common ancestor");
102102

103103
Ok(Some(finalized))
104104
}
@@ -122,9 +122,6 @@ impl<N: Network> ReorgHandler<N> {
122122
info!(common_ancestor = %common_ancestor_header.hash(), block_number = common_ancestor_header.number(), "Common ancestor found");
123123
common_ancestor
124124
} else {
125-
warn!(
126-
finalized_hash = %finalized_header.hash(), block_number = finalized_header.number(), "Possible deep reorg detected, using finalized block as common ancestor"
127-
);
128125
// all buffered blocks are finalized, so no more need to track them
129126
self.buffer.clear();
130127
finalized

0 commit comments

Comments
 (0)