Skip to content

Commit

Permalink
chore: add metric and trace for already executed blocks (#11406)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Oct 2, 2024
1 parent 12554c4 commit c6529a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/engine/tree/src/tree/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ pub(crate) struct EngineApiMetrics {
pub(crate) struct EngineMetrics {
/// How many executed blocks are currently stored.
pub(crate) executed_blocks: Gauge,
/// How many already executed blocks were directly inserted into the tree.
pub(crate) inserted_already_executed_blocks: Counter,
/// The number of times the pipeline was run.
pub(crate) pipeline_runs: Counter,
/// The total count of forkchoice updated messages received.
Expand Down
2 changes: 2 additions & 0 deletions crates/engine/tree/src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,9 @@ where
FromEngine::Request(request) => {
match request {
EngineApiRequest::InsertExecutedBlock(block) => {
debug!(target: "engine::tree", block=?block.block().num_hash(), "inserting already executed block");
self.state.tree_state.insert_executed(block);
self.metrics.engine.inserted_already_executed_blocks.increment(1);
}
EngineApiRequest::Beacon(request) => {
match request {
Expand Down

0 comments on commit c6529a8

Please sign in to comment.