Make CGC queries dependant on the block slot

This commit is contained in:
dapplion
2025-03-28 13:10:17 -03:00
parent ca8eaea116
commit 0978156987
15 changed files with 165 additions and 110 deletions

View File

@@ -16,6 +16,7 @@ use strum::AsRefStr;
use strum::IntoEnumIterator;
use types::DataColumnSubnetId;
use types::EthSpec;
use types::Slot;
pub const SUCCESS: &str = "SUCCESS";
pub const FAILURE: &str = "FAILURE";
@@ -742,7 +743,7 @@ pub fn update_gossip_metrics<E: EthSpec>(
}
}
pub fn update_sync_metrics<E: EthSpec>(network_globals: &Arc<NetworkGlobals<E>>) {
pub fn update_sync_metrics<E: EthSpec>(network_globals: &Arc<NetworkGlobals<E>>, clock_slot: Slot) {
// reset the counts
if PEERS_PER_SYNC_TYPE
.as_ref()
@@ -771,7 +772,7 @@ pub fn update_sync_metrics<E: EthSpec>(network_globals: &Arc<NetworkGlobals<E>>)
let all_column_subnets =
(0..network_globals.spec.data_column_sidecar_subnet_count).map(DataColumnSubnetId::new);
let custody_column_subnets = network_globals.sampling_subnets.iter();
let custody_column_subnets = network_globals.sampling_subnets(clock_slot).iter();
// Iterate all subnet values to set to zero the empty entries in peers_per_column_subnet
for subnet in all_column_subnets {