I have observed backups running for a very long time under heavy load,
this introduces some artificial delay to give the online backup enough
time to make progress.
When submitting events to relays, clients currently have no way to know
if an event was successfully committed to the database. This NIP
introduces the concept of command results which are like NOTICE's except
provide more information about if an event was accepted or rejected.
A command result is a JSON object with the following structure that is
returned when an event is successfully saved to the database or
rejected:
["OK", <event_id>, <true|false>, <message>]
nip20: https://github.com/nostr-protocol/nips/pull/62
Implements core NIP-26 delegated event functionality. Events can
include a `delegation` tag that provides a signature and restrictions
on which events can be delegated.
Notable points on the implementation so far:
* Schema has been upgraded to include an index and new column.
* Basic rune parsing/evaluation to implement the example event in the
NIP, but no more.
* No special logic for deletion.
* No migration logic for determining delegated authors for
already-stored events.
Only lowercase and even-length tag values are stored as binary BLOBs.
Previously there was an error which search results from being returned
if the tag value was mixed-case and could be interpreted as hex.
A new database migration has been created to repair the `tag` table
for existing relays.
fixes: https://todo.sr.ht/~gheartsfield/nostr-rs-relay/37
The original implementation of subscription limit applied to the
entire query, instead of the specific filter. Now, each filter gets
its own query limit. When a limit is applied, the most recent N
events will be returned, otherwise the default is to return the
earliest events (in order), for all matching events.
This was quickly sneaked in by fiatjaf per my request[0], it makes many
queries more efficient and allows for paging when combined with until.
It is a bit weird to have multiple limits on each filter... for now we
just choose any or the last limit seen.
[0]: a4aea5337f
Signed-off-by: William Casarin <jb55@jb55.com>