chore: add metric and trace for already executed blocks (#11406)

This commit is contained in:
Matthias Seitz
2024-10-02 10:07:33 +02:00
committed by GitHub
parent 12554c426f
commit c6529a830d
2 changed files with 4 additions and 0 deletions

View File

@ -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.

View File

@ -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 {