Skip to content

Conversation

dariusc93
Copy link
Member

@dariusc93 dariusc93 commented Sep 2, 2025

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

Comment on lines +64 to +65
ConnectionEvent::RemoteProtocolsChange(protocol)
| ConnectionEvent::LocalProtocolsChange(protocol) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check for only the remote protocol change instead of checking local and remote?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auto-relay: automatically make reservations on relays as we discover them
1 participant