nym: fast interactive reads + faster reconnect (no money-path change)

Profile/username/NIP-05 reads were ~10s and the tunnel stalled 20s on a
dead gateway. Fixes:
- Profile/accepts/dm-relay fetches stream scoped to their dial set and
  return on the first matching event instead of waiting for every relay
  (or the full timeout) - the ~10s nprofile search.
- HTTP over the mixnet is tunnel-first, scoped-exit only as fallback when
  the tunnel is not up (NIP-11/price/name lookups are public data).
- Name re-verify interval 78s -> 6h (was a debug leftover churning reads).
- Discovery relay NIP-11 probes run in parallel, not sequentially.
- Tunnel build timeout split from the exit dial cap: build 20s -> 10s
  (env GOBLIN_NYM_BUILD_TIMEOUT) so a dead gateway is abandoned fast; the
  exit money-path dial stays 20s.
- Cold start brings the tunnel up first, then prewarms the exit once after
  publish (grant sequencing preserved).
- NIP-05 search bounded to 15s instead of hanging up to ~90s.

Money path (transport.rs, streamexit.rs) byte-for-byte unchanged.
This commit is contained in:
2ro
2026-07-02 18:57:52 -04:00
parent 5733b9a894
commit aa39737d3b
5 changed files with 122 additions and 74 deletions
+12 -1
View File
@@ -1492,7 +1492,18 @@ fn resolve_nip05_blocking(name: &str, domain: &str) -> Option<nip05::Nip05Resolu
.enable_all()
.build()
.ok()?;
rt.block_on(nip05::resolve(&name, &domain))
// Overall 15s cap: without it a miss could block ~90s (up to a 30s tunnel
// wait + a 60s HTTP timeout), which reads to the user as a silent
// indefinite hang. Capping makes a miss fast and retryable instead.
rt.block_on(async {
tokio::time::timeout(
std::time::Duration::from_secs(15),
nip05::resolve(&name, &domain),
)
.await
.ok()
.flatten()
})
})
.join()
.ok()