Integrate tracing (#6339)

Tracing Integration
- [reference](5bbf1859e9/projects/project-ideas.md (L297))


  - [x] replace slog & log with tracing throughout the codebase
- [x] implement custom crit log
- [x] make relevant changes in the formatter
- [x] replace sloggers
- [x] re-write SSE logging components

cc: @macladson @eserilev
This commit is contained in:
ThreeHrSleep
2025-03-13 04:01:05 +05:30
committed by GitHub
parent f23f984f85
commit d60c24ef1c
241 changed files with 9485 additions and 9328 deletions

View File

@@ -11,11 +11,11 @@ use beacon_chain::{
use eth2::types::{self as api_types};
use lighthouse_network::PubsubMessage;
use network::NetworkMessage;
use slog::{debug, error, warn, Logger};
use slot_clock::SlotClock;
use std::cmp::max;
use std::collections::HashMap;
use tokio::sync::mpsc::UnboundedSender;
use tracing::{debug, error, warn};
use types::{
slot_data::SlotData, BeaconStateError, Epoch, EthSpec, SignedContributionAndProof,
SyncCommitteeMessage, SyncDuty, SyncSubnetId,
@@ -178,7 +178,6 @@ pub fn process_sync_committee_signatures<T: BeaconChainTypes>(
sync_committee_signatures: Vec<SyncCommitteeMessage>,
network_tx: UnboundedSender<NetworkMessage<T::EthSpec>>,
chain: &BeaconChain<T>,
log: Logger,
) -> Result<(), warp::reject::Rejection> {
let mut failures = vec![];
@@ -192,10 +191,9 @@ pub fn process_sync_committee_signatures<T: BeaconChainTypes>(
Ok(positions) => positions,
Err(e) => {
error!(
log,
"Unable to compute subnet positions for sync message";
"error" => ?e,
"slot" => sync_committee_signature.slot,
error = ?e,
slot = %sync_committee_signature.slot,
"Unable to compute subnet positions for sync message"
);
failures.push(api_types::Failure::new(i, format!("Verification: {:?}", e)));
continue;
@@ -248,22 +246,20 @@ pub fn process_sync_committee_signatures<T: BeaconChainTypes>(
new_root,
}) => {
debug!(
log,
"Ignoring already-known sync message";
"new_root" => ?new_root,
"prev_root" => ?prev_root,
"slot" => slot,
"validator_index" => validator_index,
?new_root,
?prev_root,
%slot,
validator_index,
"Ignoring already-known sync message"
);
}
Err(e) => {
error!(
log,
"Failure verifying sync committee signature for gossip";
"error" => ?e,
"request_index" => i,
"slot" => sync_committee_signature.slot,
"validator_index" => sync_committee_signature.validator_index,
error = ?e,
request_index = i,
slot = %sync_committee_signature.slot,
validator_index = sync_committee_signature.validator_index,
"Failure verifying sync committee signature for gossip"
);
failures.push(api_types::Failure::new(i, format!("Verification: {:?}", e)));
}
@@ -273,11 +269,10 @@ pub fn process_sync_committee_signatures<T: BeaconChainTypes>(
if let Some(verified) = verified_for_pool {
if let Err(e) = chain.add_to_naive_sync_aggregation_pool(verified) {
error!(
log,
"Unable to add sync committee signature to pool";
"error" => ?e,
"slot" => sync_committee_signature.slot,
"validator_index" => sync_committee_signature.validator_index,
error = ?e,
slot = %sync_committee_signature.slot,
validator_index = sync_committee_signature.validator_index,
"Unable to add sync committee signature to pool"
);
}
}
@@ -312,7 +307,6 @@ pub fn process_signed_contribution_and_proofs<T: BeaconChainTypes>(
signed_contribution_and_proofs: Vec<SignedContributionAndProof<T::EthSpec>>,
network_tx: UnboundedSender<NetworkMessage<T::EthSpec>>,
chain: &BeaconChain<T>,
log: Logger,
) -> Result<(), warp::reject::Rejection> {
let mut verified_contributions = Vec::with_capacity(signed_contribution_and_proofs.len());
let mut failures = vec![];
@@ -362,13 +356,12 @@ pub fn process_signed_contribution_and_proofs<T: BeaconChainTypes>(
Err(SyncVerificationError::AggregatorAlreadyKnown(_)) => continue,
Err(e) => {
error!(
log,
"Failure verifying signed contribution and proof";
"error" => ?e,
"request_index" => index,
"aggregator_index" => aggregator_index,
"subcommittee_index" => subcommittee_index,
"contribution_slot" => contribution_slot,
error = ?e,
request_index = index,
aggregator_index = aggregator_index,
subcommittee_index = subcommittee_index,
contribution_slot = %contribution_slot,
"Failure verifying signed contribution and proof"
);
failures.push(api_types::Failure::new(
index,
@@ -382,10 +375,9 @@ pub fn process_signed_contribution_and_proofs<T: BeaconChainTypes>(
for (index, verified_contribution) in verified_contributions {
if let Err(e) = chain.add_contribution_to_block_inclusion_pool(verified_contribution) {
warn!(
log,
"Could not add verified sync contribution to the inclusion pool";
"error" => ?e,
"request_index" => index,
error = ?e,
request_index = index,
"Could not add verified sync contribution to the inclusion pool"
);
failures.push(api_types::Failure::new(index, format!("Op pool: {:?}", e)));
}