Skip to content

Commit e53631c

Browse files
committed
refactor(extractor): add current partial block index to tracing for better context
1 parent a281e8a commit e53631c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tycho-indexer/src/extractor/protocol_extractor.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,8 +1087,17 @@ where
10871087
.get_last_processed_block()
10881088
.await
10891089
.map_or("None".to_string(), |b| b.number.to_string());
1090+
let current_partial_block_index = self
1091+
.partial_block_buffer
1092+
.lock()
1093+
.await
1094+
.as_ref()
1095+
.and_then(|b| b.partial_block_index)
1096+
.map_or("None".to_string(), |i| i.to_string());
10901097

10911098
tracing::Span::current().record("current_block", &last_processed_block_number);
1099+
tracing::Span::current()
1100+
.record("current_partial_block_index", &current_partial_block_index);
10921101
tracing::Span::current().record("target_hash", format!("{block_hash:x}"));
10931102
tracing::Span::current().record("target_number", block_ref.number);
10941103

@@ -1098,6 +1107,7 @@ where
10981107
"extractor_revert",
10991108
"extractor" => self.name.clone(),
11001109
"current_block" => last_processed_block_number,
1110+
"current_partial_block_index" => current_partial_block_index,
11011111
"target_block" => block_ref.number.to_string()
11021112
)
11031113
.increment(1);

0 commit comments

Comments
 (0)