Commit Graph

46 Commits

Author SHA1 Message Date
fiatjaf 668d6fc956 nip77: remove third-party syncing from last commit and expose stuff so it can be implemented elsewhere (nak) directly. 2025-12-01 18:08:55 -03:00
fiatjaf 15dc5b11aa nip77: third-party negentropy syncing hack. 2025-12-01 16:38:24 -03:00
fiatjaf 55a43e46b7 use xhex everywhere. 2025-11-23 06:57:54 -03:00
fiatjaf 61b9717c5c nip77: fix loading events from targetSource into vector. 2025-11-23 06:57:54 -03:00
fiatjaf fd8c271dc4 nip77: only fetch ids after sync if there are ids to fetch. 2025-11-23 06:57:54 -03:00
fiatjaf d981d34ab9 nip77: set default frame size limit to 60000 (same as strfry). 2025-11-13 16:25:29 -03:00
fiatjaf 312cc32da5 nip77: one small useless optimization. 2025-11-13 16:18:49 -03:00
fiatjaf c20ca669cd nip77: more interface fixes to prevent channel deadlock. 2025-11-13 16:12:10 -03:00
fiatjaf dcb9378f09 nip77: fix test function calls. 2025-11-13 09:21:10 -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 bdced49a19 nip77: fix interface so we don't have channel lockdown. 2025-11-12 15:09:09 -03:00
fiatjaf dfd4bea78c nip77: fix two negentropy bugs reminiscent of the binary conversation from nostrlib. 2025-11-11 23:28:56 -03:00
Jon Staab 113657314e Use ID in nip86.IDReason 2025-09-26 09:41:25 -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 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 f60fc08f8d eventstore: QueryEvents() to take a maxLimit param now so everything is clearer. 2025-05-11 09:36:59 -03:00
fiatjaf ee2d618285 fix negentropy tests. 2025-04-20 11:19:57 -03:00
fiatjaf a7be696243 a bunch of conversions and api tweaks on khatru and eventstore. 2025-04-17 00:15:15 -03:00
fiatjaf f7884cea4f wait, Querier can just return an iter like eventstore, it's ok. 2025-04-16 03:06:27 -03:00
fiatjaf 5b8954461f it never ends. 2025-04-16 02:59:47 -03:00
fiatjaf 2b5b646a62 a big bundle of conversions and other changes. 2025-04-15 17:13:57 -03:00
fiatjaf 376834cbf9 more conversions. 2025-04-15 00:00:03 -03:00
fiatjaf b4268d649c a bunch of [32]byte conversions. still more needed. 2025-04-14 17:47:53 -03:00
fiatjaf 5e650f27ff nip77: fix envelope parsing. 2025-04-08 12:22:17 -03:00
fiatjaf cecc71cd81 fix and improve envelope stuff again, deal with messages as strings on all envelope parsing steps. 2025-03-12 00:18:11 -03:00
fiatjaf 332a1642f0 nip77: FetchIDsOnly() 2025-02-12 15:45:52 -03:00
fiatjaf ade3996fbf nip77: simplify direction selection. 2024-12-17 13:30:49 -03:00
Gabriel Moura b02f0d6537 implements direction to nip77 2024-12-17 13:26:03 -03:00
fiatjaf c5c9bba586 nip77: remove bloom filter, use a map. 2024-11-26 13:22:37 -03:00
fiatjaf a0bf181547 remove HTML escaping from (easy)json encoder everywhere. 2024-11-11 22:55:07 -03:00
fiatjaf 7fd28f6db0 negentropy: fix the two bugs @hoytech found. 2024-09-20 22:41:49 -03:00
fiatjaf 4d63672462 negentropy: fix frameSizeLimit check (was checking against the hex). 2024-09-20 20:53:57 -03:00
fiatjaf 101031b9e8 negentropy: fix getMinimalBound() to go 2 hex chars each time instead of 1. 2024-09-20 18:05:40 -03:00
fiatjaf 0bcefc86ef negentropy: return our version if we are a server and got the wrong version (blergh). 2024-09-20 17:47:55 -03:00
fiatjaf 9813d1776f negentropy: fuzz testing, move accumulator to vector package. 2024-09-20 10:57:00 -03:00
fiatjaf e9e96be95e negentropy: fix one stupid bug and rename Initiate() to Start(). 2024-09-19 15:53:04 -03:00
fiatjaf f94199cfc0 negentropy: refactor for allowing different types of storage. 2024-09-19 11:35:16 -03:00
fiatjaf 3d58ac5ec2 negentropy: create Haves and HaveNots channels so they can be listened to immediately. 2024-09-19 11:35:16 -03:00
fiatjaf b1dd120ec7 negentropy: slightly faster encodeVarInt() 2024-09-19 11:35:16 -03:00
fiatjaf 6910f391fe negentropy: small refactors here and there, comments and making the code clearer. 2024-09-19 11:35:16 -03:00
fiatjaf e1cdb71d6f negentropy: mention that we forked from that other repo. 2024-09-17 17:23:08 -03:00
fiatjaf 4c9ab850a5 negentropy: default frameSizeLimit to basically infinite. 2024-09-16 22:10:03 -03:00
fiatjaf 7ab94cc3d9 updating nip77.go to 286040c 2024-09-14 17:08:12 -03:00
fiatjaf 495c6e6e75 negentropy: test lists equality instead of matching elements. 2024-09-14 17:06:10 -03:00
fiatjaf 286040c4ce negentropy: do the algorithm entirely in hex.
plus:
  - nicer iterators
  - some optimizations here and there.
  - something else I forgot.
2024-09-14 16:28:21 -03:00
fiatjaf a094f3a9d2 negentropy.
- a way to handle custom messages from Relay (NEG-whatever etc)
- negentropy implementation (adapted from that other one)
- nip77 nostr negentropy extension
- QueryEvents method for RelayStore that returns a channel (makes negentropy syncing work more seamlessly)
2024-09-14 07:40:09 -03:00