Commit Graph

974 Commits

Author SHA1 Message Date
fiatjaf
33838a4801 khatru: optional ChallengePrefix. 2025-07-17 16:46:44 -03:00
fiatjaf
840e2846ed khatru: fix eose waitgroup count for multiple filters. 2025-07-15 13:14:59 -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
dcd505712a fix one nip19 test bug. 2025-07-10 23:01:36 -03:00
fiatjaf
7289da9c72 improve/refactor websocket connections hoping this will fix the undetected disconnections we're seeing.
this commit also remove all the sonic envelope parsing and reintroduces filters in REQ as a slice instead of as a singleton.

why? well, the sonic stuff wasn't really that fast, it was a little bit but only got fast enough once I introduced unsafe conversions between []byte and string and did weird unsafe reuse of []byte in order to save the values of tags, which would definitely cause issues in the future if the caller wasn't aware of it (and even if they were, like myself).

and the filters stuff is because we abandoned the idea of changing NIP-01 to only accept one filter per REQ.
2025-07-10 22:58:37 -03:00
fiatjaf
9dc89517ee nip44: remove size limits.
implements https://github.com/nostr-protocol/nips/pull/1907
2025-07-07 21:25:41 -03:00
fiatjaf
5e04ad692d get rid of useless justfile. 2025-07-07 18:48:38 -03:00
fiatjaf
33cfe816ac nip86: fix type on pubkey response. 2025-07-07 12:28:29 -03:00
fiatjaf
09d71a059e update websocket library hoping locking bugs will be fixed. 2025-07-05 11:12:59 -03:00
fiatjaf
f59def9b05 nip44: prettier variable names. 2025-07-04 23:39:04 -03:00
fiatjaf
98f95fca15 check for validity of secret key when parsing from hex. 2025-07-01 10:57:50 -03:00
fiatjaf
ca03dc60f7 eventstore/lmdb,mmm: fix key size for "a"-style tags. 2025-06-29 22:25:28 -03:00
fiatjaf
5f4a966d45 nip61: this function was taking an event pointer. 2025-06-29 21:44:09 -03:00
fiatjaf
32df8e407a eventstore/mmm: we added another db on layers. 2025-06-29 21:43:55 -03:00
fiatjaf
028a1637fb nip46: handle ok=false from RPC calls better for instant failure. 2025-06-27 13:51:01 -03:00
fiatjaf
56568bdeed fix length checks from previous commit. 2025-06-27 13:24:03 -03:00
fiatjaf
67c787c8d3 guard event and filter decoders against bad-sized hexes. 2025-06-25 11:10:48 -03:00
fiatjaf
027d016d97 khatru: the accioly blossom redirect patch, reworked. 2025-06-10 16:43:30 -03:00
fiatjaf
50a753504d khatru: hodlbod's nip86 fixes. 2025-06-10 16:43:30 -03:00
fiatjaf
cc6ec3af73 simpler migrations (just reindex everything) and migrations on mmm. 2025-06-10 14:00:38 -03:00
fiatjaf
e9a08d669e eventstore: index tag letter together with the value. 2025-06-10 13:46:29 -03:00
fiatjaf
287d8c23c7 eventstore: add some basic tests. 2025-06-10 13:28:35 -03:00
fiatjaf
e12f2b3f90 nip27: fix ws:// parsing. 2025-06-08 10:53:15 -03:00
fiatjaf
96125dd6f0 khatru: SendNotice() util. 2025-06-08 07:15:02 -03:00
fiatjaf
9cad1f0a5b evenstore/mmm: fix wrong limit being read in queries. 2025-06-08 07:14:48 -03:00
fiatjaf
7a1292b58b handle files declared as .apk as .apk. 2025-06-03 19:01:18 -03:00
fiatjaf
28f85c9ea3 fix sending request header. 2025-05-30 10:09:03 -03:00
fiatjaf
ba91afc128 Pointer cannot hold a pointer so it can't be a hidden nil. 2025-05-25 15:58:18 -03:00
fiatjaf
f38ce069a9 fix type assertions from [32]byte to nostr.PubKey or nostr.ID. 2025-05-22 08:52:45 -03:00
fiatjaf
d3fb25441a nip19: EncodeNsec should not return an error. 2025-05-20 23:21:39 -03:00
fiatjaf
dec141b52e fix easyjson event encoding quotes. 2025-05-17 21:43:21 -03:00
fiatjaf
81fd999a8d fix tests in a bunch of places. 2025-05-17 10:43:30 -03:00
fiatjaf
df5f42aa5e remove unnecessary nil check. 2025-05-17 10:32:17 -03:00
fiatjaf
29cf3c7c6e simplify easyjson even more, rename functions, assume ids and pubkeys will always be safe hex strings that do not need to be escaped and eliminate unnecessary variables that would probably be eliminated by the compiler anyway. 2025-05-15 15:01:51 -03:00
fiatjaf
16aa5c95f3 simplify easyjson parser logic by assuming there will be no nulls. 2025-05-15 14:00:03 -03:00
fiatjaf
a37b513477 nipb0/blossom: UploadFile() -> UploadBlob(), os.File is a io.ReadSeeker. 2025-05-14 23:41:09 -03:00
fiatjaf
f9e2907a97 fix GetTheoreticalLimit() buggy logic. 2025-05-12 12:23:24 -03:00
fiatjaf
7b1f4ae49a fix types so tests compile. 2025-05-12 10:18:06 -03:00
fiatjaf
f4855dba4e BatchedSubManyEose => BatchedQueryMany 2025-05-12 09:25:02 -03:00
fiatjaf
6d44b5b0dc pool.BatchedSubscribeMany() 2025-05-12 06:13:21 -03:00
fiatjaf
65411a10c8 eventstore: fix maxLimit handling when filter.Limit is unset. 2025-05-12 06:12:58 -03:00
fiatjaf
9a0b263ecc keyer: New() to deal slightly better with hex secret keys. 2025-05-12 05:59:55 -03:00
fiatjaf
3f436d2a86 nip13: fix leading zeroes check (remainings from hex era). 2025-05-12 05:59:21 -03:00
fiatjaf
94d29f1230 nip77: convert to dealing with bytes instead of hex strings.
it was cool but this should be faster and less confusing.
2025-05-12 05:54:40 -03:00
fiatjaf
bbffe45824 do not error with "mute" when there are ephemeral handlers. 2025-05-12 05:15:24 -03:00
fiatjaf
4befaa0129 nip11, nip13, nip46 changes from promenade port.
and verify pubkey validity when decoding it from an arbitrary json object.
2025-05-11 17:42:19 -03:00
fiatjaf
f60fc08f8d eventstore: QueryEvents() to take a maxLimit param now so everything is clearer. 2025-05-11 09:36:59 -03:00
sudocarlos
9118217048 khatru/blossom: implement BUD-05 without optimizations 2025-05-09 15:20:39 -03:00
sudocarlos
ce382bbc47 khatru/blossom: return content-type in handleUpload() 2025-05-09 15:18:21 -03:00