Pool: stop wedging listener accept loops on unauthenticated Noise handshakes #45
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
vnprc/hashpool#45
Loading…
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?
Move the Noise handshake off the pool's accept loops so one silent TCP connection can no longer block all new connections, and bound connection resources.
Primary goals:
roles/pool/src/lib/mining_pool/mod.rs:545-575,Connection::new::<Message>(...).awaitinside the accept arm) and the mint listener (roles/pool/src/lib/mining_pool/mint_connection.rs,perform_handshakeawaited insideestablish_connection's accept loop).tokio::time::timeout(SV2 Noise is initiator-speaks-first; a peer that connects and sends nothing parks the current inline await forever).Current state and specifics
Today
Connection::new(full Noise handshake) is.awaited before the loop returns tolistener.accept(), with no timeout on either listener. A single peer that completes the TCP handshake and then goes quiet permanently blocks every new miner connection on0.0.0.0:34254and every reconnection of the mint on the quote-listener port — cheap, remote, infrastructure-free DoS that compounds with any natural churn (restarts, network events). Neither listener caps concurrent connections. The same inline-await pattern exists in the translator's/jd-client's listeners via shared helpers; this issue covers the pool's two listeners, which face miners and the mint directly.Findings write-up:
notes/hashpool/security-review-2026-10-15.md(finding H-2, plus M-3 for the per-connection frame-buffer allocation ceiling).Scope
In scope: the two pool listeners named above — spawn-per-connection, handshake timeout, connection/handshake caps, and a regression test that a silent peer does not block a second connection.
Out of scope: frame-size caps in the shared noise helpers (separate follow-up), upstream SRI listener refactor, and mint-side listener changes (the mint only dials out).