@ hodlbod @Vitor Pamplona @PABLOF7z
Do you guys know of any upward limit on the size of filters? E.g. how many pub keys can I reference in one filter? I’ve never hit any limits before just curious if you all have see anything.
Login to reply
Replies (8)
WebSockets have an upper limit AFAIK, I'll have to check what it is but a single REQ can't be bigger than that
Websocket request limit in node defaults to 1GB, but most server implementations limit to something like 1-16MB. All of which would still work for very large filters. I'm just wondering if anyone has direct experiences with relays blocking for a REQ that was too large.
I believe I used to get errors at above 1000 or 1024 or something. I limit filters to 1000 items at a time in welshman
There are many limits. Byte size limits of 65000 bytes, filter limits of about 12 per sub, kind list limits of about 10 kinds, each connection can open 20 subs. Usually relays crop the return in 500 events regardless of your limit parameter. Rate limits are around 100ms for new events and 200ms for filters.
> filter limits of about 12 per sub
12 what per sub?? 👀
I'm filtering for kind 0 + relay list (10002) + a couple more kinds (e.g. 10050 and 10051). How many pubkeys could I add to the filter before it becomes a problem? e.g. Can I create a sub for those kinds for 10 pubkeys, 100 pubkeys, 1000 pubkeys?
I think the byte size limit was mostly removed? The rest of these are quite limited, more than I’ve seen in testing but I feel like you have a lot of data…
Nostr.land will limit it to a thousand or so, and a total of ~10K combinations per filter. Rate limits are dynamic based on the complexity of your queries and your AUTH status.
I would encourage you to split queries (at least for NFDB relays) in cases that aren't feeds, for example 1 per profile request. Internally it executes similarly but one means you won't lose an entire request due to rate-limits if they happen + the query execution can be parallelized more.
Not really. Strfry increased the default to 135kb but it's still there for many relays.