Commit Graph

90 Commits

Author SHA1 Message Date
fiatjaf
80d0546ce6 we should be doing this since years ago: force an EOSE if the relay refuses to give us one. 2025-08-25 22:42:05 -03:00
fiatjaf
31a590ee4f fix sending on close channel with yet another mutex. 2025-08-23 09:16:12 -03:00
fiatjaf
6d4ef9df85 fix pool.FetchManyReplaceable() inverted logic. 2025-08-22 19:08:25 -03:00
fiatjaf
960312bd74 eliminate duplicates in PublishMany() 2025-08-06 00:37:39 -03:00
fiatjaf
788225b902 fix emitting duplicate events in pool.SubMany() 2025-07-30 07:09:14 -03:00
fiatjaf
6592319774 stop exposing connection, more debugLog calls and properly fail subscriptions when a relay dies. 2025-07-13 14:21:15 -03:00
fiatjaf
9f8b810882 fix main relay context being canceled instead of just the dial context. 2025-07-11 13:01:04 -03:00
fiatjaf
6d44b5b0dc pool.BatchedSubscribeMany() 2025-05-12 06:13:21 -03:00
fiatjaf
c0934e0639 since and until are not pointers anymore because that is too annoying. 2025-05-08 09:32:54 -03:00
fiatjaf
3f87ec329d reduce pool.EnsureRelay() timeout to 7s. 2025-05-04 20:21:33 -03:00
fiatjaf
002dc1e84d allow custom CheckDuplicate in pool subscriptions. 2025-05-02 15:19:16 -03:00
fiatjaf
15c6093c9b define a nostr.Kind type for event kinds, make adjustments everywhere and fix some horrible bugs with mmm, lmdb and badger querying and deleting. 2025-04-20 11:15:41 -03:00
fiatjaf
2b5b646a62 a big bundle of conversions and other changes. 2025-04-15 17:13:57 -03:00
fiatjaf
b4268d649c a bunch of [32]byte conversions. still more needed. 2025-04-14 17:47:53 -03:00
fiatjaf
05e2018d3a exit BatchedSubManyEose() immediately as the context expires.
I'm not sure about this, but seems to work.
2025-04-06 09:40:54 -03:00
fiatjaf
bba332aea6 pool: pre-update seenAlready atomically so there is no risk of the same event being parsed and dispatched twice racily. 2025-04-06 09:40:32 -03:00
fiatjaf
1ccd9ba417 pool.PublishMany() runs in parallel. 2025-04-03 23:24:13 -03:00
fiatjaf
a60e225a5f sdk/dataloader simplify and fix lock issues, now it will work. 2025-03-28 17:41:41 -03:00
fiatjaf
cc23d81e80 pool's .FetchManyReplaceable() and amends to previous commit. 2025-03-12 00:49:58 -03:00
fiatjaf
5bfaed2740 docstrings for many functions. 2025-03-04 11:42:44 -03:00
fiatjaf
00c22b0b77 maybe fix logic for closing waitgroup in subMany() 2025-02-16 18:45:09 -03:00
fiatjaf
7412a6fb40 use atomic eosed bool in subMany() 2025-02-16 17:36:05 -03:00
fiatjaf
c37ed1a309 pool: deprecate methods that take more than one filter. 2025-02-12 16:28:35 -03:00
fiatjaf
e0ed40613d pool: bug that was causing a SubMany() to close if any of the relays failed to connect.
fixes https://github.com/nbd-wtf/go-nostr/issues/172
2025-02-12 14:32:33 -03:00
fiatjaf
0ea7fd95f3 QuerySingle() to take opts. 2025-02-07 18:02:19 -03:00
fiatjaf
f19efb4013 nip19: helper for building nevent from RelayEvent. 2025-02-07 18:02:05 -03:00
fiatjaf
8446557788 debug log relay reconnections. 2025-02-03 10:35:42 -03:00
fiatjaf
4ca8320e18 actually this is the real fix. 2025-01-29 22:12:42 -03:00
fiatjaf
181234d774 fix SubMany() global eosed tracking and SubManyNotifyEOSE() proper notification. 2025-01-29 21:36:08 -03:00
fiatjaf
edb2f782cf pool.SubManyNotifyEOSE() 2025-01-28 16:12:53 -03:00
fiatjaf
3fd33ce281 fix locking on generic list and set fetching, decrease dataloader batch size, test. 2025-01-17 17:39:24 -03:00
fiatjaf
06a15fdaab follow list fetching test and related changes and fixes.
- make BatchedSubManyEose() use a single duplicate id index and use it for replaceable loaders;
- fixes parsing follow entry from kind:3 events (and others);
- adds a "cause" to most cancelation errors in relay/pool;
- remove the inherent cache from dataloader (we have our own hopefully);
- increase max frame size we can read from any websocket to 2**18 (262k), which gives over 2000 item lists.
2025-01-17 13:44:51 -03:00
fiatjaf
febf022124 add some basic sdk tests, fix saving hints (normalize urls), checkduplicates arg order, kvdb stuff and other things. 2025-01-16 17:39:16 -03:00
fiatjaf
e1971d12c0 WithCheckDuplicate(), let's see if this works. 2025-01-15 14:29:38 -03:00
fiatjaf
795f9516ae use @mmalmi json string preparsing speedup for duplicate events
- get rid of "nonUnique" variants of subMany as we can now relay on CheckDuplicate to track relays.
- add global pool tracker duplicateMiddleware.
2025-01-15 14:29:38 -03:00
fiatjaf
defc349e57 use coder/websocket for everything, get rid of gobwas.
supposedly it is faster, and anyway it's better to use it since we're already using it for wasm/js.

(previously named nhooyr/websocket).
2025-01-03 01:15:17 -03:00
fiatjaf
b33cfb19fa rename option pool.WithQueryMiddleware() to pool.WithAuthorKindQueryMiddleware(). 2025-01-03 00:12:34 -03:00
fiatjaf
95ddacb9f3 sdk: track query attempts automatically and other small tweaks to replaceable fetching and stuff. 2024-12-24 00:15:10 -03:00
fiatjaf
529ade9376 nip45: hyperlolog small fixes and improvements. support deterministic offset for hardcoded set of queries. 2024-12-07 00:12:43 -03:00
fiatjaf
0d40b40c9c pool: support CountMany() using hyperloglog. 2024-11-16 17:47:42 -03:00
fiatjaf
28b05cdd9b SimplePool.PublishMany(), finally. 2024-10-18 07:08:15 -03:00
fiatjaf
47d493b7e8 make libsecp256k1 available with a build tag. 2024-09-27 17:45:46 -03:00
fiatjaf
0caf8deb56 WithUserAgent() pool option. 2024-09-26 19:18:34 -03:00
fiatjaf
1b786ab213 take subscription options in pool.SubMany* 2024-09-24 12:05:28 -03:00
fiatjaf
8327310d52 improve SimplePool authHandler, rename IncomingEvent to RelayEvent so we can use it there. 2024-09-19 12:28:42 -03:00
fiatjaf
64c6057c08 return from subMany() on context done in one place where we weren't. 2024-09-11 21:05:34 -03:00
fiatjaf
077c14cef6 pool: implement optional penalty box mechanic. 2024-07-29 14:58:53 -03:00
fiatjaf
6ed112cc69 pool event middleware for optionally doing stuff with all events. 2024-06-27 16:49:50 -03:00
fiatjaf
d06f61136d allow using libsecp256k1 for signature verification in subscriptions. 2024-05-29 17:08:15 -03:00
fiatjaf
0836352724 namedLock() uses normalized uri and a simple test. 2024-05-29 08:39:49 -03:00