Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(iroh-gossip): make use of Endpoint::direct_addresses in iroh_gossip::net #2731

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

Frando
Copy link
Member

@Frando Frando commented Sep 16, 2024

Description

iroh_gossip::net::Gossip had a method to update the direct addresses of the iroh_net::Endpoint. IIRC that dates back when the Endpoint only exposed a single, non-cloneable stream of endpoint events, which was handled in the iroh Node and thus had to be forwarded to consumers like Gossip. This was long ago and by now the Endpoint provides a capable API for this. Therefore there is no need to expose this as a method (because Gossip always contains an Endpoint).

Breaking Changes

Gossip::update_direct_addresses is removed. Updating the direct addresses is now handled by Gossip automatically.

Notes & open questions

To react to all updates to the endpoint's NodeAddr, I am watching both Endpoint::direct_addresses and Endpoint::watch_home_relay. A simpler API for this usecase would be Endpoint::watch_node_addr.

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

Copy link

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/2731/docs/iroh/

Last updated: 2024-09-16T12:28:32Z

@dignifiedquire
Copy link
Contributor

nice

@Frando Frando marked this pull request as ready for review September 16, 2024 13:12
@Frando Frando added this pull request to the merge queue Sep 16, 2024
Merged via the queue into main with commit 9583729 Sep 16, 2024
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants