Instrument tracing on block production code path (#8017)

Partially #7814. Instrument block production code path.

New root spans:
* `produce_block_v3`
* `produce_block_v2`

Example traces:

<img width="518" height="432" alt="image" src="https://github.com/user-attachments/assets/a9413d25-501c-49dc-95cc-623db5988981" />


  


Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
This commit is contained in:
Jimmy Chen
2025-09-10 13:30:51 +10:00
committed by GitHub
parent 2b22903fba
commit 8a4f6cf0d5
7 changed files with 101 additions and 50 deletions

View File

@@ -10,8 +10,10 @@ use beacon_chain::{
BeaconBlockResponseWrapper, BeaconChain, BeaconChainTypes, ProduceBlockVerification,
};
use eth2::types::{self as api_types, ProduceBlockV3Metadata, SkipRandaoVerification};
use lighthouse_tracing::{SPAN_PRODUCE_BLOCK_V2, SPAN_PRODUCE_BLOCK_V3};
use ssz::Encode;
use std::sync::Arc;
use tracing::instrument;
use types::{payload::BlockProductionVersion, *};
use warp::{
Reply,
@@ -40,6 +42,11 @@ pub fn get_randao_verification(
Ok(randao_verification)
}
#[instrument(
name = SPAN_PRODUCE_BLOCK_V3,
skip_all,
fields(%slot)
)]
pub async fn produce_block_v3<T: BeaconChainTypes>(
accept_header: Option<api_types::Accept>,
chain: Arc<BeaconChain<T>>,
@@ -155,6 +162,11 @@ pub async fn produce_blinded_block_v2<T: BeaconChainTypes>(
build_response_v2(chain, block_response_type, accept_header)
}
#[instrument(
name = SPAN_PRODUCE_BLOCK_V2,
skip_all,
fields(%slot)
)]
pub async fn produce_block_v2<T: BeaconChainTypes>(
accept_header: Option<api_types::Accept>,
chain: Arc<BeaconChain<T>>,