test: avoid evidenceFraction parameter to be very close to 1.0 (#16978)

Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Marko <marko@baricevic.me>
This commit is contained in:
Gustavo Grieco
2023-08-29 10:50:46 +00:00
committed by GitHub
co-authored by Marko Marko
parent 79cc75b1db
commit aabcfb2aa0
+6
View File
@@ -184,6 +184,12 @@ func RandomRequestFinalizeBlock(
// TODO: Determine capacity before allocation
evidence := make([]abci.Misbehavior, 0)
// If the evidenceFraction value is to close to 1.0,
// the following loop will most likely never end
if params.EvidenceFraction() > 0.9 {
// Reduce the evidenceFraction to a more sane value
params.evidenceFraction = 0.9
}
for r.Float64() < params.EvidenceFraction() {
vals := voteInfos