Transport-refactor review — deferred findings (CLI + low/info backlog) #52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracking record for the findings from the multi-agent review of the NDK→nostr-tools refactor (PRs #43/#45/#47) that we chose not to action yet. No critical/high were found; the daemon-side mediums are already fixed.
Already fixed (for reference)
Deferred — CLI (medium, peripheral debug tool, not a daemon path)
Nip46Clientis nip44-only; dropped NDK's adaptive nip04/nip44 negotiation. Against a nip04-only signer the response is silently dropped → opaque<method> timed out. Fix: try nip44, fall back to nip04 keyed off?iv=(mirrorsrc/daemon/nip46/transport.ts), or at least log decrypt failures instead ofcatch { return }.fs.writeFileSync(.../private.key, pk)with no mode → ~0644). Fix:{ mode: 0o600 }+ dir0o700.Deferred — low / info backlog
pubkeynot asserted against the requestedremotePubkey(responses matched by id only). Bind expected peer before id-match.auth_urlor lengthen.create_accountemail dropped in the bare-domain /user@domainpath (content overwritten tousername,domain).bunker://parse, no--token), so token-based pairing is CLI-unreachable.subscribeAwaitingEosehas no timeout; while all relays are down startup blocks until one connects (self-healing; benign).healthy()with an empty registry is trivially true before the first sub is registered. Treat empty registry as idle/not-healthy.activeCountcounts REQ-attempted not EOSE-confirmed;publish()worst-case ~23.5s on a fully-degraded set with no first-success short-circuit / concurrency cap (signet has one).sendResponseshares onetrywithdispatch, so a publish failure after a successful sign emits a second (error) response for the same id. Split the two.reqEncryptionkeyed by client-chosen request id; a same-id interleave could clobber the scheme. Rare; improvement over NDK's shared field.event.pubkey ∈ admin npubscheck); the id is a ~50-bit value carried only inside nip44 envelopes, so it behaves as a bearer capability. Cheap hardening: bind expected admin pubkey into the pending entry.stop()hook; the watchdogsetIntervalisn't stored/unref'd. Fine for a supervised daemon; clean-shutdown polish.secretKeyByteshex branch does no validation (the all-zero worst case is refuted —getPublicKeythrows before persist; residual: a non-zero malformed hex yields a valid-but-wrong identity, admin-gated, npub visibly differs). UsenostrUtils.hexToBytes+ length check.nip05.queryProfileskips a dotless dev/regtest host (_@localhost) in the NIP-89 self-check (NIP05_REGEXneeds a dot); production domains are dotted.Several review observations were improvements over NDK (per-request encryption threading, explicit
verifyEvent, verbatim template signing, strongerpool.healthy()) — recorded as info only, no action.Full report: the review run produced an
overallAssessmentof "fundamentally sound, no critical/high, already deployed and signing on aio-demo."