OverviewFilesCommitsIssuesDocsReleasesPeers

hyperswarm-peer commits / c95ac63

dht: the handshake pool fix, verified on the public DHT
test_handshake_pool.cpp proved the mechanism in one process. This is the evidence that the DAEMON works, which is a different claim. daemon/test_daemon_longlived.py, 20 real session-daemons driven one at a time at one long-lived daemon over the public DHT: fixed baseline 8/8, peers 17+ 3/4, no pool exhaustion, 19/20 PASS mutated baseline 6/8, peers 17+ 0/4, pool exhaustion YES FAIL (_sweep_handshakes commented out of tick) The gate exercises the defect, and the sweep is what separates the runs. The mutated build degrades from peer 5 rather than peer 17 because the host is joined server AND client: its own outbound attempts allocate from the same 16 slots as inbound handshakes, so the pool fills before 16 peers arrive. Binary rebuilt from verified-clean source (the sweep call is present, no mutation marker, empty diff against HEAD). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
c95ac630e4e12ee349fdc5c0d1315e6453b7fa07
by plankatron <fleeky@gmail.com> · 2026-09-10T15:14:39.000Z

Changed files (2) +37 -0

daemon/session-daemon +0 -0
(no content changes — binary or rename)
docs/PARITY-hyperswarm.md +37 -0
……@@ -675,3 +675,40 @@ Fix: release the slot when the connection's own stream closes, as JS does,
675675keeping the 30s timeout as the backstop it should be rather than the primary
676676mechanism. Needs a gate that fails N connect attempts at unreachable peers and
677677asserts the slots are free before the timeout elapses.
678
679### 8.7 The wall fix, verified on the PUBLIC DHT by mutation drill
680
681`test_handshake_pool.cpp` proves the mechanism in one process. That is not
682evidence the daemon works. `daemon/test_daemon_longlived.py` drives 20 real
683session-daemons, one at a time, at one long-lived daemon on the public DHT.
684
685 FIXED daemon
686 peers 1-8 connected : 8/8 (baseline)
687 peers 17+ connected : 3/4
688 pool exhaustion : no
689 19 of 20 connected PASS
690
691 MUTATED daemon (_sweep_handshakes commented out of tick)
692 peers 1-8 connected : 6/8 (baseline)
693 peers 17+ connected : 0/4
694 pool exhaustion : YES
695 degrades from peer 5 onward FAIL
696
697The gate exercises the defect and the fix is what separates the two runs.
698
699⚠ The mutated run degrades from peer 5, not peer 17. Expected: the host is
700joined server AND client, so it ALLOCATES INITIATOR HANDSHAKES TOO. Inbound
701peers and its own outbound attempts share the same 16 slots, so the pool fills
702well before 16 inbound connections.
703
704⚠ Peer 20 was silent in the passing run. A live DHT flakes; the late-peer bar
705is deliberately >=1, because 4/4 would make the gate itself unreliable.
706
707⛔ Process note, because it nearly shipped a bad binary: while setting up the
708drill I saved `daemon/session-daemon` as "FIXED" AFTER it had already been
709rebuilt from mutated source, so the two saved copies were the same file. The
710results above are unaffected — the passing run predates any mutation, and the
711failing run used the mutated build as intended — but "restoring the fixed
712binary" restored the broken one. Caught by md5-ing all three; the tracked
713binary is now rebuilt from verified-clean source. Copy a binary before you
714overwrite it, not after.