ipfs / ipfs/kubo

Prevent Routing.Type=auto from enabling dhtserver mode if have too low of limits

Open
#9,548 5 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.