Misc. dependency cleanup (#6810)

* remove ensure_dir_exists (2 deps saved)

* group UNHANDLED_ERRORs into a generic (2 deps saved)

* Introduce separate `health_metrics` crate

* separate health_metrics crate

* remove metrics from warp_utils

* move ProcessHealth::observe and SystemHealth::observe to health_metrics

* fix errors

* nitpick `Cargo.toml`s

---------

Co-authored-by: Daniel Knopik <daniel@dknopik.de>
# Conflicts:
#	Cargo.toml
This commit is contained in:
Daniel Knopik
2025-01-16 02:48:50 +01:00
committed by GitHub
parent b1a19a8b20
commit 669932aa67
43 changed files with 303 additions and 315 deletions

View File

@@ -6,7 +6,7 @@ use slog::{debug, Logger};
use state_processing::BlockReplayer;
use std::sync::Arc;
use types::{BeaconState, SignedBlindedBeaconBlock};
use warp_utils::reject::{beacon_chain_error, custom_not_found};
use warp_utils::reject::{custom_not_found, unhandled_error};
pub fn compute_sync_committee_rewards<T: BeaconChainTypes>(
chain: Arc<BeaconChain<T>>,
@@ -20,7 +20,7 @@ pub fn compute_sync_committee_rewards<T: BeaconChainTypes>(
let reward_payload = chain
.compute_sync_committee_rewards(block.message(), &mut state)
.map_err(beacon_chain_error)?;
.map_err(unhandled_error)?;
let data = if reward_payload.is_empty() {
debug!(log, "compute_sync_committee_rewards returned empty");
@@ -71,7 +71,7 @@ pub fn get_state_before_applying_block<T: BeaconChainTypes>(
.state_root_iter([Ok((parent_block.state_root(), parent_block.slot()))].into_iter())
.minimal_block_root_verification()
.apply_blocks(vec![], Some(block.slot()))
.map_err(beacon_chain_error)?;
.map_err(unhandled_error::<BeaconChainError>)?;
Ok(replayer.into_state())
}