Repository navigation
feat(nip77): add NEG-OPEN/NEG-MSG/NEG-CLOSE wire protocol - #818
Conversation
🦋 Changeset detectedLatest commit: f2439ad The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
00d96bf to
529ccbf
Compare
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
529ccbf to
32d46c3
Compare
#818 removed src/utils/negentropy.ts from the root ignore list (its content moved into src/utils/negentropy-sessions.ts). Keeping that row would mask knip coverage, so the root ignore list takes main's; the workspaces block (website/site) is ours.
#818 removed src/utils/negentropy.ts from the root ignore list (its content moved into src/utils/negentropy-sessions.ts). Keeping that row would mask knip coverage, so the root ignore list takes main's; the workspaces block (website/site) is ours.
Serves NIP-77 (Negentropy) sync over the websocket for the PostgreSQL event store, using the reconciliation core from #809.
NEG-OPEN,NEG-MSGandNEG-CLOSEare validated and handled; replies areNEG-MSGandNEG-ERR.NEG-OPENfor an id that is already open replaces that session, and ids are a separate namespace fromREQids.NegentropySessions) and are dropped onNEG-CLOSE,NEG-ERR, idle timeout, disconnect and shutdown drain. ANEG-OPENthat races aNEG-CLOSEor a replacement can't bring back a stale session.(created_at, id)set in memory, so it is bounded:nip77.maxEventsPerSession(rejected withNEG-ERR blocked:and the limit as 4th element),nip77.maxSessionsPerConnectionandnip77.sessionIdleTimeoutMs. For the event cap the repository query reads one row past the limit instead of loading the whole set.COUNT.nip77settings section, documented inCONFIGURATION.md.nip77.enableddefaults tofalse, so merging this changes nothing for existing relays, and it only answers wheneventStore.backendispostgres.check:depsignore added with the core.NIP-11
supported_nipsand the admin console settings schema are left for a follow-up.Related Issue
Closes #817
Motivation and Context
#809 added the reconciliation core but nothing called it, so relays still could not answer NIP-77 sync requests. This exposes it with a kill-switch and resource limits, so it can be enabled safely. For reference, a session over 100,000 events measured about 25 MB steady and about 50 ms for the first reconcile step, which is the basis for the default cap.