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:
@@ -61,6 +61,12 @@ type syncRequest struct {
|
||||
|
||||
func (n *Node) handleSync(s network.Stream) {
|
||||
defer s.Close()
|
||||
end, ok := n.guard.beginSync(s.Conn().RemotePeer())
|
||||
if !ok {
|
||||
_ = s.Reset()
|
||||
return
|
||||
}
|
||||
defer end()
|
||||
_ = s.SetDeadline(time.Now().Add(syncTimeout))
|
||||
|
||||
var req syncRequest
|
||||
|
||||
Reference in New Issue
Block a user