Skip to content

Commit

Permalink
pos/slash: fix the validator state update to be in sync with set changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Jul 18, 2023
1 parent 2afb27c commit ed57e33
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion proof_of_stake/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3444,8 +3444,10 @@ where
}
}
}
// Safe sub cause `validator_set_update_epoch > current_epoch`
let start_offset = validator_set_update_epoch.0 - current_epoch.0;
// Set the validator state as `Jailed` thru the pipeline epoch
for offset in 1..=params.pipeline_len {
for offset in start_offset..=params.pipeline_len {
validator_state_handle(validator).set(
storage,
ValidatorState::Jailed,
Expand Down

0 comments on commit ed57e33

Please sign in to comment.