rust-libp2p
rust-libp2p copied to clipboard
feat(relay): implement autorelay
Description
This PR implements a basic autorelay system that would automatically make reservation as soon as it is discovered that the connected node supports HOP protocol.
resolves #4651.
Notes & open questions
Currently, this PR is a PoC, but ideally would be the initial foundation for autorelay implementation. Currently, we will only support making reservation as we discover them, but ideally, we should implement events to notify swarm about no relays available, which would allow the node to perform its own discovery of relays (ie walking DHT, etc), as well as supporting static relays that would have priority or be used in the event of no relays being discovered, although it is all up for discussion to determine what is needed vs wants.
Change checklist
- [ ] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] A changelog entry has been made in the appropriate crates