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
feat(nostr): persist self nostr relays so the pull-loop is correct when asymmetric (#333)
Follow-up to #332. The pull-loop pulled only from `peers[*].nostr_transport.relay`
(the relays we reach *peers* on), which is correct only when both sides paired
over the same relay. A peer sends to us by publishing to a relay *we're*
reachable on — not necessarily one we reach them on. So record that:
- `endpoints::pin_self_nostr_relay` / `self_nostr_relays` — a deduped
`self.nostr_relays[]` set (additive on the self block; composes with the
existing slot fields).
- `wire nostr pair`/`accept`/`fetch --relay X` now record X as a relay we're
reachable on (accept folds it into its existing relay-state RMW).
- `relay::nostr_relays_from_peers` now unions `self.nostr_relays[]` (the
authoritative "where peers publish our inbound" set) with the peer-transport
relays (still covers the symmetric case before a self-relay is recorded).
Net: a `transport: nostr` peer round-trips regardless of pairing symmetry. Still
additive — no nostr relay recorded → empty pull set → HTTP path byte-identical.
Unit tests: `self_nostr_relay_roundtrips_and_dedups` (roundtrip, dedup, empty,
doesn't clobber other self keys) + the relay-helper test now asserts the
self∪peer union + dedup. 600 lib tests green; clippy clean.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ the PR description linked in each section.
12
12
13
13
### Added
14
14
15
-
-**Nostr transport is now bidirectional through the daemon** (#227 D3, RFC-007): `run_sync_pull` now also pulls Nostr-delivered events — for each relay a peer is reachable on (`peers[*].nostr_transport.relay`) it pulls events `#p`-tagged to our npub (`kind:1`), transport-verifies them (NIP-01 id + schnorr), and feeds them through the **same `process_events` path** as HTTP-pulled events (inner Ed25519 signature + trust pin + inbox dedup all reused). Together with the send-path fallback (#322), a `transport: nostr` peer now fully round-trips through the daemon. Strictly additive — a no-op when this session isn't `wire enroll nostr`'d or no peer carries a nostr transport (the HTTP-slot pull is byte-identical). The last RFC-007 D3 piece; live public-relay e2e (AC-3) remains a manual dogfood via `wire nostr`.
15
+
- **Nostr transport is now bidirectional through the daemon** (#227 D3, RFC-007): `run_sync_pull` now also pulls Nostr-delivered events — it pulls events `#p`-tagged to our npub (`kind:1`) from the relays we're reachable on, transport-verifies them (NIP-01 id + schnorr), and feeds them through the **same `process_events` path** as HTTP-pulled events (inner Ed25519 signature + trust pin + inbox dedup all reused). The pull set is `self.nostr_relays[]` (relays we paired/fetched over — where peers publish *our* inbound, so it's correct even when pairing is asymmetric) unioned with the peer-transport relays; `wire nostr pair/accept/fetch --relay X` records X. Together with the send-path fallback (#322), a `transport: nostr` peer now fully round-trips through the daemon. Strictly additive — a no-op when this session isn't `wire enroll nostr`'d or has no nostr relay recorded (the HTTP-slot pull is byte-identical). The last RFC-007 D3 piece; live public-relay e2e (AC-3) remains a manual dogfood via `wire nostr`.
16
16
17
17
-**1.0 surface freeze — deprecation policy + a golden MCP-catalog lock** (ROAD_TO_1.0 §6): published [`docs/DEPRECATION_POLICY.md`](docs/DEPRECATION_POLICY.md) — from 1.0, frozen surfaces (CLI verbs, `--json` shapes, the MCP tool catalog, on-disk state, protocol) change only through a deprecation window (announce → runtime warn → ≥1 MINOR & ≥90 days → remove in the next MAJOR), never a silent break. Added a `mcp_catalog_schema_is_frozen` test that golden-locks all 27 MCP tools' name + input-schema props + `required` list, so the agent-facing API can't drift unnoticed. Also promoted the hello-world first-connection round-trip to a required CI gate (`hello-world` job) now that daemon-survival is fixed (#263).
0 commit comments