nips
nips copied to clipboard
NIP-01: `limit` in multiple filters
How should relays interpret the limit
specification if present in multiple filters? There seem to be contradicting specs regarding the limit
filter field if given by multiple filters
[
{"limit": 2, …},
{"limit": 40, …}
]
- NIP-01 specifies that we can use multiple filters in a subscription
A REQ message may contain multiple filters. In this case, events that match any of the filters are to be returned, i.e., multiple filters are to be interpreted as || conditions.
- NIP-01 also specifies that a
limit
determines the<maximum number of events relays SHOULD return in the initial query>
Is the limit to be applied for each filter? So we return 40-42 events depending on whether the matching events overlap.
Or should the maximum limit
of any given limit be relevant, since the idea is to clamp the event count of the initial query?
Each filter has an independent limit. I often want to have a limit for all filters, so it seems like an oversight.
Each filter has an independent limit. I often want to have a limit for all filters, so it seems like an oversight.
I want/need a limit for each kind within each filter :)
Fortunately clients can just specify no limit and then disconnect whenever.
👍 I try to make this a bit clearer in #1117