limits: sync streams, listings per author, inbound connections per IP
A peer may hold 4 sync streams and open 1500 a minute; banned peers get none and cannot redial. A node keeps at most 100 unexpired listings per author (--max-per-author); updates, renewals and deletions of held ones still work. At most 16 inbound connections per public IP or IPv6 /64 (--max-conns-per-ip); local and private addresses are exempt. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
+18
-3
@@ -703,9 +703,24 @@ Findings (see "What is left" in SPECS.md for the open ones):
|
||||
banned for an hour: closed connection, gossip blacklist; `internal/p2p/guard.go`).
|
||||
In the sim the attacker was cut off from all 6 nodes it reached and honest
|
||||
listings still arrived 50 of 50. What it does not stop: an attacker with many
|
||||
peer IDs (a ban costs it nothing but a new key), a peer that sends only
|
||||
valid but unwanted records, or one that stays under the limits. The ban is
|
||||
per node, not shared, and covers gossip only, not the sync protocol.
|
||||
peer IDs, a peer that sends only valid but unwanted records, or one that
|
||||
stays under the limits. Three more limits close part of that:
|
||||
- **Sync:** a peer may hold 4 sync streams at once and open 1500 a minute
|
||||
(a full sync of 100,000 listings is about 1200); a banned peer gets none.
|
||||
- **Per author:** a node keeps at most 100 unexpired listings per author
|
||||
(`--max-per-author`, -1 for no limit); a 101st new one is neither stored
|
||||
nor passed on, while updates, renewals and deletions of held ones still
|
||||
work. Each node decides for itself, so nodes with different values hold
|
||||
different sets and anti-entropy keeps offering the refused ones.
|
||||
- **Per address:** at most 16 inbound connections from one public IP, or one
|
||||
IPv6 /64 (`--max-conns-per-ip`, -1 for no limit); loopback, private and
|
||||
link-local addresses are exempt, and a banned peer ID is refused when it
|
||||
redials. A new peer ID from the same machine therefore does not help.
|
||||
Behind a Kubernetes service the real source address is only visible with
|
||||
`externalTrafficPolicy: Local` (the base manifest has it; the nodeport
|
||||
overlay uses `Cluster`, which hides it, so the limit does nothing there).
|
||||
Bans are per node and not shared (a shared ban would let one node get
|
||||
honest ones banned); the HTTP API still has no limits.
|
||||
3. **The DHT is only as good as its servers.** Only publicly reachable nodes
|
||||
serve it. With every seed gone, a newcomer whose remembered peers are all in
|
||||
another region found nobody (0 of 114 listings), and one that remembers no
|
||||
|
||||
Reference in New Issue
Block a user