Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
grandpa: migration off-by-one
Browse files Browse the repository at this point in the history
  • Loading branch information
andresilva committed Jan 25, 2023
1 parent 5b07212 commit 50b175d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frame/grandpa/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ fn cleanup_set_id_sesion_map<T: Config>() -> Weight {
let until_set_id =
CurrentSetId::<T>::get().saturating_sub(T::MaxSetIdSessionEntries::get() as u64);

for set_id in 0..until_set_id {
for set_id in 0..=until_set_id {
SetIdSession::<T>::remove(set_id);
}

T::DbWeight::get()
.reads(1)
.saturating_add(T::DbWeight::get().writes(until_set_id))
.saturating_add(T::DbWeight::get().writes(until_set_id + 1))
}

0 comments on commit 50b175d

Please sign in to comment.