Commit Graph

105 Commits

Author SHA1 Message Date
fiatjaf fbd4dddba3 eventstore/bleve: index some generic tags and references on all events. 2026-04-14 20:40:28 -03:00
fiatjaf 5944a3ead6 bleve is not a full eventstore.Store. 2026-04-11 20:27:12 -03:00
fiatjaf 29cdd48fcb eventstore: adapt test to ReplaceEvent() signature change. 2026-04-11 15:36:09 -03:00
fiatjaf 181de14642 lmdb: two small fixes, and stop doing WRITEMAP so it stops crashing. 2026-04-11 15:24:37 -03:00
fiatjaf 1794f0690f bleve: open timeout option. 2026-04-11 02:03:58 -03:00
fiatjaf b989b66bb7 change ReplaceEvent() interface to return a list of the events deleted. 2026-04-10 11:56:08 -03:00
fiatjaf 4261bc88f8 eventstore/bleve: replace with implementation inspired from pyramid. 2026-04-10 11:25:42 -03:00
fiatjaf 0152341144 eventstore/lmdb: remove unused lastIdx code. 2026-04-08 21:45:10 -03:00
fiatjaf b9a3e78752 mmm: print free ranges count. 2026-04-03 08:23:15 -03:00
fiatjaf 2c30300756 mmm: use flock instead of file presence for locking the database. 2026-04-02 03:29:56 -03:00
fiatjaf d1fdc262f2 mmm: reduce default mmap size. 2026-04-02 03:29:56 -03:00
fiatjaf 56610a32e6 constant ints must be casted so they work with gomobile. 2026-03-29 09:15:33 -03:00
fiatjaf d4940c7858 eventstore/mmm: use sync.Pool for tempResults. 2026-03-28 11:22:39 -03:00
fiatjaf d43fbbf02d eventstore: fix lmdb and mmm ptag-kind queries.
the prefix was missing the 2 bytes of the kind when preparing the query.

we also simplify the query planner logic a little bit and eliminate some useless fields and everything is clearer.
2026-03-23 00:23:38 -03:00
fiatjaf 6a686c31af eventstore: add test for ptag filter with until clause.
following nostr:nevent1qvzqqqqqqypzq3svyhng9ld8sv44950j957j9vchdktj7cxumsep9mvvjthc2pjuqy0hwumn8ghj7urewfsk66ty9enxjct5dfskvtnrdakj76twvfhhsqgawaehxw309aehqct5d9sj6ctjvdskucfwvdhk6tmfde3x77qqyqspzxnz3g0sway64qpjkszxx0qv666sce30dymn5mw467j709zejjvtka2
2026-03-23 00:23:23 -03:00
fiatjaf 32dd39da81 sdk: fix default Publisher to work with any store. 2026-02-22 18:02:22 -03:00
fiatjaf d445ba9919 mmm: free ranges tracking improved with b.freeRangesLarge and b.freeRangesAll
one is unsorted and fast and we only care about it with picking a new free range.
the other is sorted and used when merging a new freed range with existing free ranges.
both are computed from the events id index at beginning, then tracked manually on each addition or deletion.
this change uncovered some errors so we fixed them and added some more fuzz test invariant checking.
code is simplified a little bit.
there was another thing I forgot.
2026-02-17 18:33:59 -03:00
fiatjaf 0cb0d1ccb0 unify usage and export nostr.IsOlder() helper. 2026-01-22 22:54:44 -03:00
fiatjaf ce7d165c9d mmm: eliminate annoying log line. 2026-01-19 22:33:35 -03:00
fiatjaf 459a10294f eventstore: a COUNT test and fix many bugs. 2026-01-18 21:31:12 -03:00
fiatjaf b559828c72 mmm: read-only mode. 2026-01-18 18:02:07 -03:00
fiatjaf df64c5b6ec eventstore/cmd: fix mmm deinitialization. 2026-01-18 17:44:03 -03:00
fiatjaf 78f6509882 mmm: fix infinite loop on COUNT. 2026-01-15 16:14:29 -03:00
fiatjaf dbd8f47674 lmdb: make serial() used from multiple processes. 2025-12-21 22:20:54 -03:00
fiatjaf daee8575d9 filter.GetTheoreticalLimit() to encompass the actual limit specified in the filter. 2025-12-19 06:52:46 -03:00
fiatjaf 14dcc01f8f eventstore: SortedMerge() takes a limit and is simpler (should be faster) for small limits. 2025-12-19 06:40:22 -03:00
fiatjaf c6bd1ee446 khatru: fix bbolt halting problem by deleting outside of the loop that fetches events to be deleted.
fixes nostr:nevent1qvzqqqqx25pzq2f38nys0gq4hs5k4l4s426689psdk7d52kzjk9s0ypne2nt7927qy88wumn8ghj7mn0wvhxcmmv9uq32amnwvaz7tmjv4kxz7fwv3sk6atn9e5k7tcqyphrdv7jerr3f5mtlpcl7j7dg26ecxj9vrd5pyf0jknkqmp5qyyj28gxd3q
2025-12-19 00:23:21 -03:00
fiatjaf 78d8f36e2d mmm: better ComputeStats() 2025-12-18 13:26:09 -03:00
fiatjaf 4d7f7ce25d mmm: stats return real pubkeys, not only prefixes. 2025-12-17 22:27:08 -03:00
fiatjaf 880b253d12 eventstore/mmm: stats. 2025-12-15 12:45:35 -03:00
fiatjaf e00f6dbc26 fix publisher test. 2025-11-30 22:41:31 -03:00
fiatjaf fb3b14c69c eventstore: skip replacing when it's the exact same id. 2025-11-30 22:41:31 -03:00
fiatjaf 8161bd9ad1 mmm: create directory before creating the lockfile. 2025-11-23 06:57:54 -03:00
fiatjaf 98959e73e7 eventstore: replace bluge with bleve.
bluge seems to be abandoned and bleve should work better, who knows.
2025-11-23 06:57:54 -03:00
fiatjaf 55a43e46b7 use xhex everywhere. 2025-11-23 06:57:54 -03:00
fiatjaf 98dbe7b9e9 improve and make nip77 api nicer so it could be better used in nak. 2025-11-12 20:21:02 -03:00
fiatjaf 43fabbeb2a eventstore: more consistent ErrDupEvent firing. 2025-11-12 16:10:50 -03:00
fiatjaf 20f06d9608 eventstore: SortedMerge() helper for combining results from different eventstores. 2025-10-30 11:42:04 -03:00
fiatjaf 0aa0038c40 mmm: lockfile to prevent multiple instances. 2025-10-28 19:09:28 -03:00
fiatjaf b3c617e36b eventstore: cmd can read from files and doesn't break on long lines. 2025-10-28 18:40:51 -03:00
fiatjaf fc16a36481 mmm: stop truncating mmap, reorder commits and write operations such that eventual inconsistencies are minimized and less harmful. 2025-10-16 03:11:11 +00:00
fiatjaf 98cbe66e16 mmm: test that free ranges are being used. 2025-10-16 01:43:51 +00:00
fiatjaf 0dcaf0fa95 mmm: fixes to rescan logic. 2025-10-15 23:02:32 +00:00
fiatjaf 5d2675f356 mmm: freeranges tests and fixes. 2025-10-15 03:50:00 +00:00
fiatjaf ac49036b77 mmm: small .EnsureLayer() change, fuzz tests for fixing borked databases 2025-10-15 01:31:44 +00:00
fiatjaf 9e41bc69c4 mmm: test .Rescan() 2025-10-14 01:46:42 +00:00
fiatjaf 53e838c61d mmm: freeranges computed on startup and kept only in memory. 2025-10-14 00:38:51 +00:00
fiatjaf bcc7575e04 mmm: do random rescans in the fuzz test to ensure they don't break anything. 2025-10-14 00:25:44 +00:00
fiatjaf 95c70e3225 mmm: Rescan() 2025-10-14 00:19:52 +00:00
fiatjaf 47b1608e6b mmm: fix fuzz test. 2025-10-13 21:53:48 +00:00