Do people have a good strategy for syncing content through nostr? For Mutiny when we sync nwc, dm, etc we save the highest timestamp of the event we last synced, however this doesn't work the best because relays send us them in descending order so if the app is closed before we process all the events, we do not fully sync all the events. Have been thinking of switching it to instead have it save the last timestamp of the last EOSE we received. To try to better ensure we sync every message first. Does anyone else have a better strategy?
I do since/until filters. If traversing back (newest first), I track oldest timestamp of event seen, and then use that as the until on next call, end if no new event ids seen before starting again at the head. If going forward (oldest to newest), I just reverse this with the newest timestamp of event seen.
#asknostr nostr:nevent1qqs9wtq03uuxgs79wc0wkagtlu2l8u4rgef7qe7jjpxc0hhvs65v4jcpz3mhxue69uhhyetvv9ujuerpd46hxtnfdupzpc0l807afeqrzk2ekz95lnyzgh4229rr0cw5as4wze4hgv6phcd0qvzqqqqqqye0yh5z
Negentropy might be the best option for a complete sync. I haven't used it myself yet.
What is negentropy sync, where can I read up on it?
The incoming order in multi-filter subs also varies a lot. Some relays send all matching events for the first filter before starting the second. Others do all at the same time. Others break them in chuncks. So the order of arrival cannot be relied on. You can save the last EOSE, but you will need to update it when live events show up in the same subscription after the EOSE is received. However, events in the past show up all the time. I initially thought this was a problem for GiftWraps alone, but no. Every event kind has this problem. Because `since` is based on the `created_at` and not in the relay's receiving date, when using `since`/`until` you are bound to miss events were broadcasted late, like 1hr or 1 day later. This is particularly problematic when users are not using large relays. Their messages might arrive later just because somebody else replied there and re-broadcasted the original not to the rest of the relays. Either way, EOSE/since/until will be broken until something like negentropy or https://github.com/nostr-protocol/nips/pull/826 becomes widespread.
Negentropy reconciliation. It's available in rust-nostr, just call `client.reconcile(..)`.
Wen negentropy sync @jb55 👀
I want to know what negentropy sync is, please shill me some nips
Implementation on damus is not complete afaik. Join here for latest: damus.io/devchat
Not sure how up to date this is: https://github.com/hoytech/negentropy
which version? I think strfry has two and the latest is most efficient, but not sure if it ever got merged
We’ve coded Negentropy in Go and would like to make sure it’s up to date with the new version. Do you have a link for it? Is the unmerged version stable yet?
nextneg branch on strfry, i guess it was never merged, but it was the basis for this article (i think?) https://logperiodic.com/rbsr.html @Doug Hoyte
Protocol version 1? nostr:note1f6ym3cfyjfzzf64f060aglcvzn2mr36z4g4ve5ep2uw6h6kcucts0t44hq
Is it in negentropy but not Strfry yet? https://github.com/hoytech/negentropy/commit/ed5f8e7e480f0c1b7a73196f1de3f66b0f7d7e19
The v0 since strfry not merged v1 yet (IIRC v1 is not compatible with v0). But the rust-negentropy implementation is ready for v1.
What does this do? Could you explain?
There isn't a NIP yet, but you can learn more here: https://github.com/hoytech/negentropy