Skip to content

Commit

Permalink
fixed slots issue
Browse files Browse the repository at this point in the history
  • Loading branch information
coachchucksol committed May 29, 2024
1 parent a54131a commit 3ad78d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions keepers/validator-keeper/src/operations/keeper_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<u64>();
let aggregate_errors = errors_for_epoch.iter().sum::<u64>();

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],
Expand Down
8 changes: 5 additions & 3 deletions keepers/validator-keeper/src/state/update_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ pub async fn pre_create_update(
) -> Result<(), Box<dyn Error>> {
// 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));
Expand Down

0 comments on commit 3ad78d1

Please sign in to comment.