Prevent Routing.Type=auto from enabling dhtserver mode if have too low of limits
- Dominant language
- Go
- Stars
- 17.1k
- Forks
- 3.2k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 11
Description
## Done Criteria
A Kubo node with ``Routing.Type=auto`` doesn't attempt to be a DHT server if the following additional conditions aren't met:
1. Swarm.ResourceMgr.System.ConnsInbound > 800 AND
2. Swarm.ResourceMgr.System.StreamsInbound > 800 AND
3. Swarm.ResourceMgr.Protocol.kaddht.StreamsInbound > 800 AND
4. Swarm.ConnMgr is enabled
(Existing logic of ensuring the node is publicly dialable will still apply.)
- [ ] Code change (above)
- [ ] Docs change: https://github.com/ipfs/kubo/blob/master/docs/config.md#routingtype
- [ ] Changelog addition
## Why Important
If a "dhtserver" node advertises itself to the DHT but has too-low of hard Swarm.ResourceMgr limits, then it won't be able to function and be of value to the DHT and instead degrades performance.
## Notes
* Kubo maintainers have observed instances of this happening in practice.
* See notes in https://github.com/ipfs/kubo/issues/9545 about:
* Why 800
* Why ``Swarm.ResourceMgr.System.StreamsInbound`` in addition to ``Swarm.ResourceMgr.System.Streamsnbound``
Contributor guide
Assessment
This issue has not been assessed yet.