You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v4: publish the NIP-43 kind 13534 membership list #1366
Target: v4 (before the #869 cutover). Filed from the v3 delta audit: main kept moving after the 2026-11-02 sync into rewrite/main, and this feature landed there on 2026-11-22.
v3 shipped (main, PR #1199, commit e58ddc02): a kind 13534 replaceable event, signed by the relay's own key, published and refreshed on a timer. Files: src/utils/nip43-membership.ts, src/constants/base.ts:64 (NIP43_MEMBERSHIP_LIST = 13534), the setting at src/@types/settings.ts:539, and its default comment at resources/default-settings.yaml:116.
v4 today: crates/nostream-core/src/nip43.rs implements the join request and the relay-signed answer only — Kind(28_934) and Kind(28_935) — and git grep 13534 over crates/ at rewrite/main returns nothing. So a v3 relay publishes a membership list and a v4 relay does not, which clients that read it will notice at cutover.
Scope: the kind 13534 builder, its NIP-70 - tagging as v3 writes it, the refresh timer and the setting that gates it, plus the parity test.
Acceptance: with the setting on, the relay publishes exactly one kind 13534 event re-signed on refresh; with it off, none; the event's d tags and tags match v3's for the same member set; a restart republishes rather than duplicating.
Correction, measured at origin/main (v3) before the spec was written: v3 has no timer and no boot publish. The issue text says "published and refreshed on a timer" and the acceptance asks that "a restart republishes rather than duplicating"; the code does neither.
src/utils/nip43-membership.ts read whole:
MembershipListPublisher.refresh() is a per-process promise queue (queue.then(() => this.publish())) and is called from exactly three places — join-request-event-strategy.ts:9, leave-request-event-strategy.ts:10, vanish-event-strategy.ts:8. There is no setInterval, no setTimeout, and no boot call in the file or in its callers.
publish() returns early unless settings.nip43?.enabled === true && settings.nip43.publishMembershipList === true; refuses when info.self is not a valid pubkey or does not match the derived relay key; caps the member list at MAX_MEMBERSHIP_LIST_ENTRIES = 10_000 (querying LIMIT 10001 to detect the cut); sets created_at = max(now, stored.created_at + 1) from findStoredReplaceable; then upsert(event) and, only when upsert returns a count, webSocket.onBroadcast(event).
Amended acceptance (the v3 behaviour, which the port will match):
With nip43.publishMembershipList on, a join publishes exactly one kind 13534 and a second membership change replaces it — one stored row, created_at incremented by one.
With the setting off (or nip43.enabled off), no kind 13534 is published and the proxy-free path is unchanged.
The event matches v3 byte-for-byte in structure for the same member set: kind 13534, content: '', tags exactly [["-"]] then one ["member", <pubkey>] per admitted, non-vanished pubkey in ascending order, capped at 10,000, signed by the key derived from SECRET; refused when info.self disagrees or is unparsable.
Nothing is published at boot, matching v3 — the stored list survives a restart and the next membership change replaces it rather than adding a second row.
Scope is unchanged otherwise: builder, NIP-70 - tag, gating setting, parity test. If a timer is wanted as a v4 improvement, that is a new issue with its own interval decision, not this port.
Build done (5c31bde9, c63dd4be, a8df2af9; oracle cargo test -p nostream-relay --test nip43_membership → 15 passed). Review scoping now. Two evidence gaps named rather than glossed: the per-criterion inversions and a final all-targets check were not run (run budget), so the code lens executes the inversions.
Code: AC5's criterion named a test that did not exist (0 passed) and AC7 omitted two observations it names. Both fixed in b9ba0923, which also moved the crate-map row to "Added after the capture", corrected two moved rows to split, and made nip-porting.md's counts true at the commit it names.
Performance: frame 780,371 bytes; scan 104–137 ms at 10,001 rows; one publish 225–250 ms and 802,816 bytes written; the lock blocks only other publishes.
Round 2 is confirming the two CHANGES lenses at b9ba0923.
Approver: ESCALATE, on the gate only — everything else green.
Gate irreversibility-gate exit 3: schema-or-dependency Cargo.lock dependency-lockfile: dependency-lockfile matched. The diff is one dev-dependency line (tempfile.workspace = true under crates/nostream-relay/Cargo.toml's [dev-dependencies]) and the lock's dependency-list entry; tempfile is already a workspace dependency (Cargo.toml:55), already locked, and already a dev-dependency of seven other crates — no new package, no version change.
Merge-tree clean against rewrite/main (tree f37ccb4c295b917837a11421d99700af2e2c748e, equal to HEAD^{tree}).
Oracle cargo test -p nostream-relay --test nip43_membership → 15 passed; strategies 3; core 3; all 15 criteria re-run by the approver green.
Operator decision on the lockfile change is pending; the job stays at approve until it lands.
Merged as e13d99b55ab1609edd911da9a799febc1eb5c7b1 (PR #1403, merge commit; five branch commits, head 513115f7 after an outside merge from rewrite/main).
Activity
chappie-daemon commentedon Dec 5, 2026
Factory day 2026-12-05, row 2 (plan: cameri/phoenix-server#122). Job
053-nip43-membership-list, base4c4f6a6d, stage recon, running alongside #1367.chappie-daemon commentedon Dec 5, 2026
Correction, measured at
origin/main(v3) before the spec was written: v3 has no timer and no boot publish. The issue text says "published and refreshed on a timer" and the acceptance asks that "a restart republishes rather than duplicating"; the code does neither.src/utils/nip43-membership.tsread whole:MembershipListPublisher.refresh()is a per-process promise queue (queue.then(() => this.publish())) and is called from exactly three places —join-request-event-strategy.ts:9,leave-request-event-strategy.ts:10,vanish-event-strategy.ts:8. There is nosetInterval, nosetTimeout, and no boot call in the file or in its callers.publish()returns early unlesssettings.nip43?.enabled === true && settings.nip43.publishMembershipList === true; refuses wheninfo.selfis not a valid pubkey or does not match the derived relay key; caps the member list atMAX_MEMBERSHIP_LIST_ENTRIES = 10_000(queryingLIMIT 10001to detect the cut); setscreated_at = max(now, stored.created_at + 1)fromfindStoredReplaceable; thenupsert(event)and, only whenupsertreturns a count,webSocket.onBroadcast(event).Amended acceptance (the v3 behaviour, which the port will match):
nip43.publishMembershipListon, a join publishes exactly one kind 13534 and a second membership change replaces it — one stored row,created_atincremented by one.nip43.enabledoff), no kind 13534 is published and the proxy-free path is unchanged.content: '', tags exactly[["-"]]then one["member", <pubkey>]per admitted, non-vanished pubkey in ascending order, capped at 10,000, signed by the key derived fromSECRET; refused wheninfo.selfdisagrees or is unparsable.Scope is unchanged otherwise: builder, NIP-70
-tag, gating setting, parity test. If a timer is wanted as a v4 improvement, that is a new issue with its own interval decision, not this port.chappie-daemon commentedon Dec 5, 2026
Build done (
5c31bde9,c63dd4be,a8df2af9; oraclecargo test -p nostream-relay --test nip43_membership→ 15 passed). Review scoping now. Two evidence gaps named rather than glossed: the per-criterion inversions and a final all-targets check were not run (run budget), so the code lens executes the inversions.chappie-daemon commentedon Dec 5, 2026
Round 1 complete: code CHANGES, architecture CHANGES, security PASS, performance PASS.
0 passed) and AC7 omitted two observations it names. Both fixed inb9ba0923, which also moved the crate-map row to "Added after the capture", corrected twomovedrows tosplit, and madenip-porting.md's counts true at the commit it names.info.selfis line-for-line v3's; no unauthenticated trigger. The kind-62 republish amplification (v3 parity, default-off) is filed as nip43: a kind-62 from an admitted key republishes a ~780 KB membership list with no state-change guard #1401 with the measured cost.Round 2 is confirming the two CHANGES lenses at
b9ba0923.chappie-daemon commentedon Dec 5, 2026
Review complete: code PASS, architecture PASS, security PASS, performance PASS (three rounds; both CHANGES lenses closed at
3fb6b4c8). Approver stage now.chappie-daemon commentedon Dec 5, 2026
Approver: ESCALATE, on the gate only — everything else green.
irreversibility-gateexit 3:schema-or-dependency Cargo.lock dependency-lockfile: dependency-lockfile matched. The diff is one dev-dependency line (tempfile.workspace = trueundercrates/nostream-relay/Cargo.toml's[dev-dependencies]) and the lock's dependency-list entry;tempfileis already a workspace dependency (Cargo.toml:55), already locked, and already a dev-dependency of seven other crates — no new package, no version change.rewrite/main(treef37ccb4c295b917837a11421d99700af2e2c748e, equal toHEAD^{tree}).cargo test -p nostream-relay --test nip43_membership→ 15 passed; strategies 3; core 3; all 15 criteria re-run by the approver green.Operator decision on the lockfile change is pending; the job stays at
approveuntil it lands.chappie-daemon commentedon Dec 5, 2026
Merged as
e13d99b55ab1609edd911da9a799febc1eb5c7b1(PR #1403, merge commit; five branch commits, head513115f7after an outside merge fromrewrite/main).