From 3ad78d12da601cece09a1ae9f6ae4007d7e496c5 Mon Sep 17 00:00:00 2001 From: Coach Chuck Date: Wed, 29 May 2024 10:09:40 -0600 Subject: [PATCH] fixed slots issue --- .../validator-keeper/src/operations/keeper_operations.rs | 5 +++++ keepers/validator-keeper/src/state/update_state.rs | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/keepers/validator-keeper/src/operations/keeper_operations.rs b/keepers/validator-keeper/src/operations/keeper_operations.rs index 67e7622a..b4f5008c 100644 --- a/keepers/validator-keeper/src/operations/keeper_operations.rs +++ b/keepers/validator-keeper/src/operations/keeper_operations.rs @@ -21,8 +21,13 @@ impl KeeperOperations { runs_for_epoch: &[u64; KeeperOperations::LEN], errors_for_epoch: &[u64; KeeperOperations::LEN], ) { + let aggregate_actions = runs_for_epoch.iter().sum::(); + let aggregate_errors = errors_for_epoch.iter().sum::(); + datapoint_info!( "keeper-operation-stats", + ("num-aggregate-actions", aggregate_actions, i64), + ("num-aggregate-errors", aggregate_errors, i64), ( "num-pre-create-update-runs", runs_for_epoch[KeeperOperations::PreCreateUpdate as usize], diff --git a/keepers/validator-keeper/src/state/update_state.rs b/keepers/validator-keeper/src/state/update_state.rs index 45caa381..de8fb500 100644 --- a/keepers/validator-keeper/src/state/update_state.rs +++ b/keepers/validator-keeper/src/state/update_state.rs @@ -30,12 +30,14 @@ pub async fn pre_create_update( ) -> Result<(), Box> { // Update Epoch match client.get_epoch_info().await { - Ok(current_epoch) => { - if current_epoch.epoch != keeper_state.epoch_info.epoch { + Ok(latest_epoch) => { + if latest_epoch.epoch != keeper_state.epoch_info.epoch { keeper_state.runs_for_epoch = [0; KeeperOperations::LEN]; keeper_state.errors_for_epoch = [0; KeeperOperations::LEN]; - keeper_state.epoch_info = current_epoch.clone(); } + + // Always update the epoch info + keeper_state.epoch_info = latest_epoch.clone(); } Err(e) => { return Err(Box::new(e));