Validator missed blocks count is incorrect after decreasing slashing window #12541
Description
Summary of Bug
After lowering the slashing window from 35000 to 18000 on the Kujira blockchain some validators are stuck with a missed block count that won't clear even if they don't miss any more blocks. Querying all blocks in the signing window for some validators (e.g. kujiravaloper1pshqems6hdka48gc56r2ykshyaarkt40hl0rlh) shows no misses while kujirad query slashing signing-info
reports a positive count.
I believe the issue is here:
cosmos-sdk/x/slashing/keeper/infractions.go
Lines 23 to 49 in 23576d3
This code updates the missed block count by checking the current value against the previous value at that index. The problem is any blocks missed at indexes above 18000 in the bit array are "lost" when the window changes because they'll contribute to the count but never be checked again. That explains the behavior we're seeing where multiple validators have miss counts that won't go below where they were on 7/3 when the parameter change took effect.
Version
v0.45.4
Steps to Reproduce
Cause a validator to miss blocks distributed throughout the slashing window and then lower the slashing window parameter for the chain. Compare manual missed block counts from checking signatures against what's reported by query slashing signing-info
.
For Admin Use
- Not duplicate issue
- Appropriate labels applied
- Appropriate contributors tagged
- Contributor assigned/self-assigned
Metadata
Assignees
Type
Projects
Status
☃️ Icebox
Activity