Skip to content

nipcash: wait for the reply subscription before sending the request - #129

Merged
naliyi merged 2 commits into
mainfrom
fix/nipcash-wait-for-subscription
Oct 17, 2026
Merged

naliyi merged 2 commits into
mainfrom
fix/nipcash-wait-for-subscription

Conversation

@naliyi

@naliyi naliyi commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The private transport now waits for the relay's EOSE on the reply subscription before publishing the request (at most 2 s, then it publishes anyway). The subscription and the request travel on separate connections, so a relay could take the request first and deliver the hub's reply to no one; the client then waited out not_after for an answer that had been sent.
  • The test relays now send EOSE after registering a reply subscription, as real relays do.

Seen once in the v0.5.0-rc.24 release run (TestAuditDPrivacy_TimingPairsRequestAndReply timed out); not reproduced locally in 40 runs under load, so the new test reproduces it deterministically instead.

Test plan

  • New: a relay that is slow to register the REQ and answers the request at once; the reply still arrives. The no-wait mutant fails it 3/3.
  • go vet, go mod tidy, gofmt, go test -race -count=1 ./nipcash/...; nipcash/client back to ~2.7 s

wingha added 2 commits October 17, 2026 13:23
The reply subscription and the request travel on separate connections,
so a relay could take the request first and deliver the hub's reply to
no one; the client then waited out not_after for an answer that had been
sent. Seen once in the v0.5.0-rc.24 release run. The send now waits for
the relay's EOSE on the subscription, at most two seconds, before
publishing. The test relays send EOSE as real relays do.
@naliyi
naliyi merged commit c7a7067 into main Oct 17, 2026
3 checks passed
@naliyi
naliyi deleted the fix/nipcash-wait-for-subscription branch October 17, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant