Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions crates/optimism/trie/src/prune/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ pub type OpProofStoragePrunerResult = Result<PrunerOutput, PrunerError>;
pub struct PrunerOutput {
/// Total elapsed wall time for this run (fetch + apply).
pub duration: Duration,
/// Time elapsed during the stat diff fetch phase(non-blocking).
pub fetch_duration: Duration,
/// Time elapsed during the prune phase.
pub prune_duration: Duration,
/// Earliest block at the start of the run.
pub start_block: u64,
/// New earliest block at the end of the run.
Expand Down Expand Up @@ -51,8 +47,6 @@ impl PrunerOutput {
/// extend the current [`PrunerOutput`] with another [`PrunerOutput`]
pub fn extend_ref(&mut self, other: Self) {
self.duration += other.duration;
self.fetch_duration += other.fetch_duration;
self.prune_duration += other.prune_duration;
// take the earliest start block
if self.start_block > other.start_block {
self.start_block = other.start_block;
Expand Down Expand Up @@ -91,8 +85,6 @@ mod tests {
fn test_pruner_output_display() {
let pruner_output = PrunerOutput {
duration: Duration::from_secs(10),
fetch_duration: Duration::from_secs(5),
prune_duration: Duration::from_secs(5),
start_block: 1,
end_block: 2,
write_counts: WriteCounts::new(1, 2, 3, 4),
Expand Down
6 changes: 0 additions & 6 deletions crates/optimism/trie/src/prune/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ use reth_metrics::{
pub(crate) struct Metrics {
/// Pruning duration
pub(crate) total_duration_seconds: Histogram,
/// Duration spent fetching state diffs (non-blocking)
pub(crate) state_diff_fetch_duration_seconds: Histogram,
/// Duration spent pruning
pub(crate) prune_duration_seconds: Histogram,
/// Number of pruned blocks
pub(crate) pruned_blocks: Gauge,
/// Number of account trie updates written in the prune run
Expand All @@ -30,8 +26,6 @@ impl Metrics {
let blocks_pruned = result.end_block - result.start_block;
if blocks_pruned > 0 {
self.total_duration_seconds.record(result.duration.as_secs_f64());
self.state_diff_fetch_duration_seconds.record(result.fetch_duration.as_secs_f64());
self.prune_duration_seconds.record(result.prune_duration.as_secs_f64());
self.pruned_blocks.set(blocks_pruned as f64);

// Consume write counts
Expand Down
11 changes: 2 additions & 9 deletions crates/optimism/trie/src/prune/pruner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ where
})?
.ok_or(PrunerError::BlockNotFound(parent_block_num))?;

let fetch_duration = batch_start_time.elapsed();
batch_start_time.elapsed();

let block_with_parent = BlockWithParent {
parent: parent_block_hash,
Expand All @@ -154,14 +154,7 @@ where
let write_counts = self.provider.prune_earliest_state(block_with_parent).await?;

let duration = batch_start_time.elapsed();
let batch_output = PrunerOutput {
duration,
fetch_duration,
prune_duration: duration.saturating_sub(fetch_duration),
start_block,
end_block,
write_counts,
};
let batch_output = PrunerOutput { duration, start_block, end_block, write_counts };

// Record metrics for this batch
#[cfg(feature = "metrics")]
Expand Down
26 changes: 1 addition & 25 deletions etc/grafana/dashboards/op-proof-history.json
Original file line number Diff line number Diff line change
Expand Up @@ -1944,30 +1944,6 @@
},
"pluginVersion": "12.3.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "rate(reth_optimism_trie_pruner_prune_duration_seconds_sum[$__rate_interval])/rate(reth_optimism_trie_pruner_prune_duration_seconds_count[$__rate_interval])",
"legendFormat": "Prune Duration",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "rate(reth_optimism_trie_pruner_state_diff_fetch_duration_seconds_sum[$__rate_interval])/rate(reth_optimism_trie_pruner_state_diff_fetch_duration_seconds_count[$__rate_interval])\n",
"hide": false,
"instant": false,
"legendFormat": "State Diff Fetch Duration",
"range": true,
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
Expand All @@ -1979,7 +1955,7 @@
"instant": false,
"legendFormat": "Total Duration",
"range": true,
"refId": "C"
"refId": "A"
}
],
"title": "Prune Duration Over Time",
Expand Down
Loading