Skip to content

Commit 953ca06

Browse files
committed
chore: wrap forwarded block resyncing within a span to improve observability
1 parent 7d47b04 commit 953ca06

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/slots_processor/mod.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use alloy::{
44
use anyhow::{anyhow, Context as AnyhowContext, Result};
55

66
use crate::clients::beacon::types::BlockHeader;
7-
use tracing::{debug, info};
7+
use tracing::{debug, info, Instrument};
88

99
use crate::{
1010
clients::{
@@ -308,7 +308,13 @@ impl SlotsProcessor<ReqwestTransport> {
308308
// they were skipped and must be processed.
309309
for block in canonical_block_headers.iter() {
310310
if block.slot != new_head_header.slot {
311+
let reorg_span = tracing::info_span!(
312+
parent: &tracing::Span::current(),
313+
"forwarded_block",
314+
);
315+
311316
self.process_block(block)
317+
.instrument(reorg_span)
312318
.await
313319
.with_context(|| format!("Failed to sync forwarded block"))?;
314320
}

0 commit comments

Comments
 (0)