Skip to content

Commit 9c488fb

Browse files
committed
fix: remove validator set position from storage when slashing
1 parent 6926d60 commit 9c488fb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

proof_of_stake/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3249,6 +3249,9 @@ where
32493249
.at(&epoch)
32503250
.at(&token::Amount::from_change(amount_pre))
32513251
.remove(storage, &val_position)?;
3252+
validator_set_positions_handle()
3253+
.at(&epoch)
3254+
.remove(storage, validator)?;
32523255

32533256
// For the pipeline epoch only:
32543257
// promote the next max inactive validator to the active
@@ -3305,6 +3308,9 @@ where
33053308
.at(&epoch)
33063309
.at(&token::Amount::from_change(amount_pre).into())
33073310
.remove(storage, &val_position)?;
3311+
validator_set_positions_handle()
3312+
.at(&epoch)
3313+
.remove(storage, validator)?;
33083314
}
33093315
ValidatorState::BelowThreshold => {
33103316
println!("Below-threshold");

0 commit comments

Comments
 (0)