Commit Graph

92 Commits

Author SHA1 Message Date
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
fiatjaf 96fcff7908 mmm: drop mmap on .Close() call. 2025-10-13 21:26:42 +00:00
fiatjaf 4d1774264a mmm: add debug helpers for fixing an inconsistent db. 2025-10-12 13:55:44 +00:00
Jon Staab 113657314e Use ID in nip86.IDReason 2025-09-26 09:41:25 -03:00
fiatjaf 3c540e726e boltdb: fix reusing index key that has less capacity than necessary. 2025-09-23 19:34:59 -03:00
fiatjaf 79f1a9c636 fix sqlite mention. 2025-09-23 19:02:09 -03:00
fiatjaf fd9f956a3d update readmes so they're less outdated. 2025-09-22 17:05:17 -03:00
fiatjaf 9480fc1de6 eventstore: deletion safety tests. 2025-09-10 09:58:13 -03:00
fiatjaf 4754518278 mmm: querying by ids is restricted to the layer it was initiated. 2025-09-06 21:28:22 -03:00
fiatjaf cd398b94b5 get rid of badger everywhere, including as an sdk/hints backend. 2025-09-04 00:35:17 -03:00
fiatjaf 43d6814daf betterbinary: finally fix (well, a very hackish fix but should be ok) decoding events with way too many tags. 2025-08-27 01:19:08 -03:00
fiatjaf 72b5aa5051 lmdb: fix id logging when decoding fails. 2025-08-25 18:47:38 -03:00
fiatjaf d345bb3529 betterbinary: prevent binary index overflow by casting the numbers to int (from uint16). 2025-08-25 18:01:34 -03:00
fiatjaf b88edca786 eventstore: fix lmdb storing the same event a million times. 2025-08-22 18:02:19 -03:00