Commit Graph

838 Commits

Author SHA1 Message Date
fiatjaf
e18528c043 move ExternalPointer to nip73 and write nip27.Parse() that gets all the parts of the text including URLs, Nostr URIs and just raw text. 2025-03-24 15:50:10 -03:00
fiatjaf
3ebfc7812b sdk: simplified dataloader event more. should be faster. 2025-03-24 15:50:10 -03:00
fiatjaf
78dbf9def5 use our own dataloader and simplify batch replaceable requests, removing bugs. 2025-03-24 15:50:10 -03:00
pippellia-btc
25838a024e added lenght check 2025-03-24 15:39:54 -03:00
fiatjaf
c1d9c094ee get rid of base64x temporarily since it doesn't work on arm64. v0.51.6 2025-03-19 14:59:49 -03:00
fiatjaf
7c9c5d7cd9 fix unsafe strings that change underneath us on envelope parsing by force-copying them as gjson doesn't. v0.51.5 2025-03-14 21:09:33 -03:00
fiatjaf
c64ebde59d fix sonic parsing req envelopes with limit/since/until. v0.51.4 2025-03-14 20:08:56 -03:00
fiatjaf
4dcadd4d88 update go version so we can use the new benchmarking helper. 2025-03-13 18:57:30 -03:00
fiatjaf
1b610ba318 khatru string transition v0.51.3 2025-03-12 00:55:08 -03:00
fiatjaf
cc23d81e80 pool's .FetchManyReplaceable() and amends to previous commit. 2025-03-12 00:49:58 -03:00
fiatjaf
441f94563f WithCheckDuplicateReplaceable() and helper functions for efficient replaceable event matching. 2025-03-12 00:19:41 -03:00
fiatjaf
d2ceac48f6 sdk: FetchWriteRelays() shouldn't have a hardcoded fallback, it's better to fail. 2025-03-12 00:18:41 -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
42a2243b72 tags Clone() and CloneDeep() 2025-03-11 16:35:51 -03:00
fiatjaf
7df79c1845 improve readme tagline. 2025-03-11 15:32:21 -03:00
fiatjaf
657c6edf6c remove sonic from the default build, guard it under "sonic" tag for now. v0.51.2 2025-03-10 17:33:32 -03:00
fiatjaf
74e121075e try to prevent pointer to pointer bug. v0.51.1 2025-03-10 16:16:44 -03:00
fiatjaf
769887fac1 sdk: ConcurrentMetadata test to fail properly. v0.51.0 2025-03-10 09:57:35 -03:00
fiatjaf
f19125af65 get rid of nocopy, do it directly. 2025-03-10 09:42:55 -03:00
fiatjaf
bbccd56108 kvstore: get rid of useless copy()s 2025-03-10 03:05:41 -03:00
fiatjaf
d430b8c9ed I had forgotten to implement Tags.FindAll() 2025-03-10 02:58:31 -03:00
fiatjaf
459273216c replace deprecated functions in multiple places. 2025-03-10 02:56:12 -03:00
fiatjaf
8d869009b0 localhost and 127.0.0.1 are "virtual" relays, but not when running go test 2025-03-10 02:49:08 -03:00
fiatjaf
7e04bbb4b8 breaking pointer mess
- ExternalPointer (?)
- nip27, nip22 and nip10 functions to return pointers
- get rid of sdk/thread helpers that were just a thin layer over nip10 and nip22
2025-03-10 02:38:06 -03:00
fiatjaf
f575f63f6c nip92: fix imeta parsing to guard against invalid tags. 2025-03-10 02:34:17 -03:00
fiatjaf
c15904ba7b change relay for COUNT test. 2025-03-10 02:33:47 -03:00
fiatjaf
a52165fb7d deprecate all useless tag methods, implement Find() and friends. 2025-03-10 02:33:29 -03:00
fiatjaf
99b11ea3be a method for identifying nip70 "protected" events. 2025-03-10 02:26:20 -03:00
fiatjaf
94e8b6790a a User interface that is like a Signer but can't sign. 2025-03-10 02:25:57 -03:00
fiatjaf
fa17e4003f get rid of deprecated keyer.Keyer. 2025-03-08 11:21:27 -03:00
fiatjaf
a37dd05344 remove simdjson because sonic is just better. v0.50.5 2025-03-07 21:49:48 -03:00
fiatjaf
9e94310604 ridiculous performance string and serialization performance improvements. 2025-03-07 21:45:47 -03:00
fiatjaf
4431f58df2 update khatru so feeds_test can run again. 2025-03-07 21:23:54 -03:00
fiatjaf
d7ef485934 comments on sonic functions. 2025-03-07 21:21:47 -03:00
fiatjaf
765f16f86a update sonic so it works with go1.24 v0.50.4 2025-03-07 16:31:10 -03:00
fiatjaf
7c57ad860a add more ParseMessage tests. 2025-03-07 15:50:55 -03:00
fiatjaf
8d7e854779 some fixes to sonic and make it faster by reusing arrays.
BenchmarkParseMessage/relay/jsonstdlib-4              216   5651451 ns/op
BenchmarkParseMessage/relay/easyjson-4                313   3703457 ns/op
BenchmarkParseMessage/relay/simdjson-4                469   2606309 ns/op
BenchmarkParseMessage/relay/sonic-4                   966   1268594 ns/op

BenchmarkParseMessage/client/jsonstdlib-4             216   5524239 ns/op
BenchmarkParseMessage/client/easyjson-4               422   2756370 ns/op
BenchmarkParseMessage/client/simdjson-4               519   2298477 ns/op
BenchmarkParseMessage/client/sonic-4                  644   1860583 ns/op
2025-03-07 15:38:22 -03:00
fiatjaf
39bde22639 sonic ast visitor approach. now we're getting faster.
BenchmarkParseMessage/relay/jsonstdlib-4              206   8630635 ns/op
BenchmarkParseMessage/relay/easyjson-4                278   4311793 ns/op
BenchmarkParseMessage/relay/simdjson-4                422   2943387 ns/op
BenchmarkParseMessage/relay/sonic-4                   849   1576884 ns/op

BenchmarkParseMessage/client/jsonstdlib-4             196   6140585 ns/op
BenchmarkParseMessage/client/easyjson-4               385   2826706 ns/op
BenchmarkParseMessage/client/simdjson-4               405   2628675 ns/op
BenchmarkParseMessage/client/sonic-4                  552   2413731 ns/op
2025-03-07 11:03:09 -03:00
fiatjaf
cb74908f5d use base64x everywhere instead of encoding/base64. 2025-03-07 10:06:46 -03:00
Daniel D’Aquino
8140857879 nipb0: Add authorization headers to Blossom downloads v0.50.3 2025-03-06 22:28:24 -03:00
fiatjaf
c9411a3c5b depressing sonic json decoder implementation, breakingly force COUNT to use a single filter, reorganize envelope tests. 2025-03-06 19:34:36 -03:00
fiatjaf
ec55b1fac8 nip19: decode to pointer. 2025-03-06 11:49:10 -03:00
fiatjaf
4fb6fcd9a2 make simdjson great again.
now it is generally a little faster than the easyjson approach.

goos: linux
goarch: amd64
pkg: github.com/nbd-wtf/go-nostr
cpu: AMD Ryzen 3 3200G with Radeon Vega Graphics
BenchmarkParseMessage/stdlib-4         	      90	  15616341 ns/op
BenchmarkParseMessage/easyjson-4       	     110	  11306466 ns/op
BenchmarkParseMessage/simdjson-4       	     162	   7779856 ns/op
PASS
ok  	github.com/nbd-wtf/go-nostr	5.547s
2025-03-05 23:56:15 -03:00
fiatjaf
de358e641c use bytes.Equal() instead of slices.Equal() on simdjson readers. 2025-03-05 22:37:39 -03:00
fiatjaf
535f62cec9 nip90: list all available jobs, update dvm definitions a little bit. 2025-03-05 19:44:40 -03:00
fiatjaf
eaec35c156 nip90: improve autogeneration, replace ag and awk with rg. v0.50.2 2025-03-05 11:40:52 -03:00
fiatjaf
1090fbb0b6 nip90: autogenerated dvm kinds from https://github.com/nostr-protocol/data-vending-machines 2025-03-05 11:13:08 -03:00
fiatjaf
b3b8d5804d nipb0: fixes to blossom. v0.50.1 2025-03-04 19:20:11 -03:00
fiatjaf
2865cccc46 keyer: add ReadOnlySigner. 2025-03-04 18:06:18 -03:00
fiatjaf
5bafd1c778 add nipb0/blossom helpers. 2025-03-04 12:42:24 -03:00