eventstore: fuzz testing found us a bug!

This commit is contained in:
fiatjaf
2025-08-05 22:56:55 -03:00
parent 47ca205e9e
commit 030cad168d
13 changed files with 1203 additions and 118 deletions

View File

@@ -83,9 +83,12 @@ func BatchSizePerNumberOfQueries(totalFilterLimit int, numberOfQueries int) int
return totalFilterLimit
}
return int(
math.Ceil(
math.Pow(float64(totalFilterLimit), 0.80) / math.Pow(float64(numberOfQueries), 0.71),
return max(
4,
int(
math.Ceil(
math.Pow(float64(totalFilterLimit), 0.80)/math.Pow(float64(numberOfQueries), 0.71),
),
),
)
}