Agartha-Software / Agartha-Software/Wormhole
Swarm: Reduce usage of substreams
- Dominant language
- Rust
- Stars
- 12
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
Currently we rely on libp2p::request_response to handle all network messages, and each one creates a substream.
We're limited by reason, a software quota, and the fundamental limits of TCP ports to a number of simultaneous streams
The current implementation cleanly handles simultaneous outbound streams by allocating them with a semaphore and delaying until budget is available,
but we can't do that for incoming streams and excessive inbound connections will cause failures
This shouldn't happen in normal circumstances of excessive use, only if multiple excessive use peers are hammering one receiver
We currently aren't equipped to handle message failures, so any such failure is lossy and potentially corrupting the network
We should be batching things such as broadcasts anyway to limit the number of simultaneous streams
- [ ] handle inbound limits gracefully
- [ ] chunk multiple broadcast messages into a single message
- [ ] retry outbound failures
We will also need to be able to deal with an unresponsive peer, but this is a further step and not planned for this issue
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.