Skip to content

Commit

Permalink
postgres_driver limit max num hashes to 100 (#2976)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status authored Aug 19, 2024
1 parent d24b56b commit b8550c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions waku/waku_archive/driver/postgres_driver/postgres_driver.nim
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,10 @@ method getMessages*(
): Future[ArchiveDriverResult[seq[ArchiveRow]]] {.async.} =
debug "beginning of getMessages"

const MAX_ALLOWED_HASHES = 100
if hashes.len > MAX_ALLOWED_HASHES:
return err(fmt"can not attend queries with more than {MAX_ALLOWED_HASHES} hashes")

let hexHashes = hashes.mapIt(toHex(it))

if cursor.isNone() and pubsubTopic.isNone() and contentTopics.len == 0 and
Expand Down

0 comments on commit b8550c5

Please sign in to comment.