Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NIP-91 AND tag filters
Intent
&<tag>keys while preserving existing OR behavior for#<tag>.Changes
src/filters.h:NostrFilterwithtagsAndto represent ANDed tag values and track unique tag keys across#and&.&<tag>keys, hex-decode&e/&p, and normalise values viaFilterSetBytes, de-duplicating overlaps so values present in&are removed from the corresponding#.indexOnlyScansso presence of any AND tag forces full-event scans and keeps the 3-tag-key limit based on the union of#and&keys.src/DBQuery.h:tagsortagsAnd, choosing the most selective tag key.src/ActiveMonitors.h:tagsAndalongsidetagsin the tag monitor index so subscription monitors receive events that satisfy AND tag filters.test/dumbFilter.pl:#e/#p/#tlogic with generic OR (#<tag>) and AND (&<tag>) handling to match the NostrFilter implementation, including ignoring values that appear in both AND and OR for the same tag key.test/filterFuzzTest.pl:&t,&eand&pso scan and monitor fuzz tests cover NIP-91 AND-tag semantics.Testing
From the project root:
make.test/README.md(for example, import the wellordered 500k dataset).perl test/filterFuzzTest.pl scan-limitperl test/filterFuzzTest.pl scanperl test/filterFuzzTest.pl monitor