Skip to content

Commit aabcfb2

Browse files
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>
1 parent 79cc75b commit aabcfb2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

x/simulation/mock_cometbft.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ func RandomRequestFinalizeBlock(
184184

185185
// TODO: Determine capacity before allocation
186186
evidence := make([]abci.Misbehavior, 0)
187+
// If the evidenceFraction value is to close to 1.0,
188+
// the following loop will most likely never end
189+
if params.EvidenceFraction() > 0.9 {
190+
// Reduce the evidenceFraction to a more sane value
191+
params.evidenceFraction = 0.9
192+
}
187193

188194
for r.Float64() < params.EvidenceFraction() {
189195
vals := voteInfos

0 commit comments

Comments
 (0)