mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
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
26 lines
632 B
Rust
26 lines
632 B
Rust
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,
|
|
))
|
|
}
|