nostr:nprofile1qqsf03c2gsmx5ef4c9zmxvlew04gdh7u94afnknp33qvv3c94kvwxgspz4mhxue69uhhyetvv9ujuerpd46hxtnfduhszxthwden5te0dp38ytnrdaexzcmvv5h8xmmrd9skctcfh8d3u nostr:nprofile1qqsyvrp9u6p0mfur9dfdru3d853tx9mdjuhkphxuxgfwmryja7zsvhqpz9mhxue69uhkummnw3ezuamfdejj7qgswaehxw309ahx7um5wghx6mmd9uag6jvy nostr:nprofile1qqs04xzt6ldm9qhs0ctw0t58kf4z57umjzmjg6jywu0seadwtqqc75sprfmhxue69uhhq7tjv9kkjepwve5kzar2v9nzucm0d5hsz9thwden5te0wfjkccte9ejxzmt4wvhxjme0nvx4fv

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.

Reply to this note

Please Login to reply.

Discussion

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…

Not really. Strfry increased the default to 135kb but it's still there for many relays.

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.