OverviewFilesCommitsIssuesDocsReleasesPeers

hyperswarm-peer commits / 4c2e9d9

docs: correct §11 — JS's connect release is 10-15s, not immediate
§11 claimed JS releases a connect slot "immediate — milliseconds for a refused or unreachable peer". That was wrong and it was committed before it was checked. hyperdht/lib/connect.js: passiveConnectTimeout = setTimeout(onabort, 10000) // FIREWALL.OPEN relayTimeout = setTimeout(onabort, 15000) // relay path relayClient.pair(...).on('error', onabort) // explicit error The release is event-driven, but the event is usually a JS-side timer. Ours is 30s for everything except a holepunch abort, so the real gap is 2-3x on the common path plus immediate-vs-30s on explicit errors — still real, still compounding with defect B's missing liveness, and materially smaller than claimed. It also changes the fix: "release on stream close" is wrong, because an attempt that never opened has no stream to close. What is missing is an explicit-error abort path and a connect timeout in JS's range. Two changes, two gates. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
4c2e9d9c34af2786b456f723a16896d031d67a0c
by plankatron <fleeky@gmail.com> · 2026-09-10T15:16:00.000Z

Changed files (1) +35 -0

docs/PARITY-hyperswarm.md +35 -0
……@@ -712,3 +712,38 @@ failing run used the mutated build as intended — but "restoring the fixed
712712binary" restored the broken one. Caught by md5-ing all three; the tracked
713713binary is now rebuilt from verified-clean source. Copy a binary before you
714714overwrite it, not after.
715
716### 11.1 ⚠ CORRECTION to §11: JS is not "immediate", it is 10-15 seconds
717
718§11 said JS "releases on the connection's own close event, guaranteed and
719immediate — milliseconds for a refused or unreachable peer". That overstated it,
720and the overstatement was committed before it was checked.
721
722Read at source in `hyperdht/lib/connect.js`:
723
724 c.passiveConnectTimeout = setTimeout(onabort, 10000) // :244, FIREWALL.OPEN
725 c.relayTimeout = setTimeout(onabort, 15000) // :812, relay path
726 c.relayClient.pair(...).on('error', onabort) // :814, explicit error
727
728`onabort` destroys the session, the stream closes, and `close` fires
729`_connectDone()`. So the release IS event-driven, but the event is usually a
730JS-side timer, not the network.
731
732The accurate comparison:
733
734| case | JS | ours |
735|---|---|---|
736| explicit error (relay refuses, socket error) | immediate | **30s** |
737| unresponsive peer, open firewall | 10s | 30s |
738| unresponsive peer, relay path | 15s | 30s |
739| holepunch abort | immediate | immediate (`puncher.on_abort`) |
740
741So the gap is 2-3x on the common path plus immediate-vs-30s on explicit errors —
742real, and materially smaller than §11 claimed. With `SWARM_MAX_PARALLEL = 3` it
743still means our outbound capacity recovers two to three times more slowly from a
744topic carrying stale records, which is why it compounds with defect B.
745
746⛔ It also changes the FIX. "Release on stream close" is not right: a connect
747attempt that never opened has no stream to close. What we lack is (a) an
748explicit-error path that aborts without waiting, and (b) a connect timeout in
749JS's range rather than 30s. Those are two separate changes with separate gates.