Merge remote-tracking branch 'origin/release-v8.1' into back-merge-v8.1.1

This commit is contained in:
Michael Sproul
2026-03-02 09:20:25 +11:00
10 changed files with 122 additions and 18 deletions

View File

@@ -12,14 +12,16 @@ use lighthouse_network::{
};
use logging::crit;
use std::hash::{DefaultHasher, Hash, Hasher};
use strum::IntoEnumIterator;
use tracing::{debug, error, info, info_span, warn};
use types::{DataColumnSidecarList, Epoch, EthSpec};
use crate::metrics;
use crate::sync::{
backfill_sync::{BACKFILL_EPOCHS_PER_BATCH, ProcessResult, SyncStart},
batch::{
BatchConfig, BatchId, BatchInfo, BatchOperationOutcome, BatchProcessingResult, BatchState,
ByRangeRequestType,
BatchConfig, BatchId, BatchInfo, BatchMetricsState, BatchOperationOutcome,
BatchProcessingResult, BatchState, ByRangeRequestType,
},
block_sidecar_coupling::CouplingError,
manager::CustodyBatchProcessResult,
@@ -1114,6 +1116,21 @@ impl<T: BeaconChainTypes> CustodyBackFillSync<T> {
*self.network_globals.custody_sync_state.write() = state;
}
pub fn register_metrics(&self) {
for state in BatchMetricsState::iter() {
let count = self
.batches
.values()
.filter(|b| b.state().metrics_state() == state)
.count();
metrics::set_gauge_vec(
&metrics::SYNCING_CHAIN_BATCHES,
&["custody_backfill", state.into()],
count as i64,
);
}
}
/// A fully synced peer has joined us.
/// If we are in a failed state, update a local variable to indicate we are able to restart
/// the failed sync on the next attempt.