mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 12:11:59 +00:00
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:
25
validator_client/src/check_synced.rs
Normal file
25
validator_client/src/check_synced.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
use crate::beacon_node_fallback::CandidateError;
|
||||
use eth2::{types::Slot, BeaconNodeHttpClient};
|
||||
use tracing::warn;
|
||||
|
||||
pub async fn check_node_health(
|
||||
beacon_node: &BeaconNodeHttpClient,
|
||||
) -> Result<(Slot, bool, bool), CandidateError> {
|
||||
let resp = match beacon_node.get_node_syncing().await {
|
||||
Ok(resp) => resp,
|
||||
Err(e) => {
|
||||
warn!(
|
||||
error = %e,
|
||||
"Unable connect to beacon node"
|
||||
);
|
||||
|
||||
return Err(CandidateError::Offline);
|
||||
}
|
||||
};
|
||||
|
||||
Ok((
|
||||
resp.data.head_slot,
|
||||
resp.data.is_optimistic,
|
||||
resp.data.el_offline,
|
||||
))
|
||||
}
|
||||
Reference in New Issue
Block a user