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:
2026-11-19 00:30:36 +01:00
co-authored by Claude Sonnet 5.5
parent 0b3ead4b23
commit 5ac02360c4
12 changed files with 527 additions and 23 deletions
+4 -2
View File
@@ -149,8 +149,10 @@ starting a design-heavy item; see "Working with the owner".
that many against the 512 MiB pod limit.
- **Peer scoring beyond the guard.** `internal/p2p/guard.go` drops a peer
relaying over 1200 messages a minute and bans one that sends 20 invalid ones
for an hour (gossip only). Not covered: throwaway peer IDs, rate limits on
the sync protocol and the HTTP API, sharing bans between nodes.
for an hour, limits sync streams (4 at once, 1500 a minute), keeps at most
100 listings per author (`--max-per-author`) and 16 inbound connections per
public IP (`--max-conns-per-ip`). Not covered: a rate limit on the HTTP API,
attackers with many addresses, sharing bans between nodes (deliberately).
- **Joining without the seeds.** A newcomer whose remembered peers are all in
another region cannot find its region when no DHT server is up (sim: 0 of
114 listings). Remember region peers separately, or ask connected peers.