chore: improve persistence spans (#21875)

This commit is contained in:
DaniPopes
2026-02-06 02:17:00 +01:00
committed by GitHub
parent df8f411f50
commit cb999b2a2d
9 changed files with 76 additions and 32 deletions

View File

@@ -21,7 +21,7 @@ use std::{
time::Instant,
};
use thiserror::Error;
use tracing::{debug, error};
use tracing::{debug, error, instrument};
/// Writes parts of reth's in memory tree state to the database and static files.
///
@@ -77,6 +77,7 @@ where
/// Prunes block data before the given block number according to the configured prune
/// configuration.
#[instrument(level = "debug", target = "engine::persistence", skip_all, fields(block_num))]
fn prune_before(&mut self, block_num: u64) -> Result<PrunerOutput, PrunerError> {
debug!(target: "engine::persistence", ?block_num, "Running pruner");
let start_time = Instant::now();
@@ -135,6 +136,7 @@ where
Ok(())
}
#[instrument(level = "debug", target = "engine::persistence", skip_all, fields(new_tip_num))]
fn on_remove_blocks_above(
&self,
new_tip_num: u64,
@@ -152,6 +154,7 @@ where
Ok(new_tip_hash.map(|hash| BlockNumHash { hash, number: new_tip_num }))
}
#[instrument(level = "debug", target = "engine::persistence", skip_all, fields(block_count = blocks.len()))]
fn on_save_blocks(
&mut self,
blocks: Vec<ExecutedBlock<N::Primitives>>,