Not sure where it goes wrong. REQ seems fine, just the sub doesn't return anything, most of the time.

Reply to this note

Please Login to reply.

Discussion

Default max tags on strfry relays is set to 2000 tags

https://github.com/hoytech/strfry/blob/master/strfry.conf#L35-L36

That sounds exactly like something I had optimized in my attempt to program a relay, using the Bloom filters you mentioned elsewhere.

For a relay there are two phases when processing a REQ: First, the DB gets queried and then a subscription is held in memory and applied to every new event.

A relay could ignore a big REQ based on its size and not do anything with it, return the stuff from DB and kick it from memory or keep it in memory to check every new event against it.

My relay took a different approach: When EOSE is reached, the REQ got compacted using Cockoo filters in order to make the subscription cheaper at the cost of occasional false positives. See here:

https://github.com/Giszmo/NostrPostr/blob/master/nostrpostrlib/src/main/java/nostr/postr/Filter.kt#L195