During conversion from usize to ValidatorIndex first convert the value to i32 to make sure that the value is ≤ i32::MAX. Without that intermediate conversion, u32::MAX as usize is successfully converted into the index.
[ ] Referenced an issue explaining the need for the change
During conversion from usize to ValidatorIndex first convert the value to
i32
to make sure that the value is ≤ i32::MAX. Without that intermediate conversion,u32::MAX as usize
is successfully converted into the index..changelog/