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-net)!: Rename Endpoint::local_endpoints to direct_addresses #2369

Merged
merged 9 commits into from
Jun 18, 2024

Conversation

flub
Copy link
Contributor

@flub flub commented Jun 17, 2024

Description

This renames Endpoint::local_endpoints to Endpoint::direct_addresses. As a consequence it renames a lot of other things, e.g. config::Endpoint type becomes magicsock::DirectAddr. This is hopefully the last ambiguous use of "endpoint". The name "direct addresses" seemed to be the consensus on a discord bikeshedding thread.

The entire config module is removed and the types are moved into magicsock instead. These types did not have anything to do with configuration and this was also a source of confusion. Because the visibility of these types changed some dead code was removed as well.

Breaking Changes

  • iroh_net::Endpoint::local_endpoints -> iroh_net::Endpoint::direct_addresses
  • iroh_net::endpoint::LocalEndpointStream -> iroh_net::endpoint::DirectAddrStream
  • iroh_gossip::net::Gossip::update_endpoints -> iroh_gossip::net::Gossip::update_direct_addresses
  • iroh_net::config is removed.
  • iroh_net::config::Endpoint -> iroh_net::magicsock::DirectAddr
  • iroh_net::config::EndpointType -> iroh_net::magicsock::DirectAddrType
  • iroh_net::config::NetInfo -> removed
  • iroh_net::config::LinkInfo -> removed

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • [ ] Tests if relevant.
  • All breaking changes documented.

flub added 3 commits June 17, 2024 12:26
Also for EndpointType -> DirectAddressType
This changes the public api because for some reason config was public.
@flub flub changed the title Flub/endpoint no endpoint refactor(iroh-net)!: Rename Endpoint::local_endpoints to direct_addresses Jun 17, 2024
@flub flub marked this pull request as ready for review June 17, 2024 11:33
@flub flub requested review from dignifiedquire, divagant-martian and Frando and removed request for dignifiedquire and divagant-martian June 17, 2024 11:34
Copy link
Contributor

@divagant-martian divagant-martian left a comment

Choose a reason for hiding this comment

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

I find this really easier to understand overall. I left some comments about moved docs that could be improved because they look like go docs and are, in fact, inaccurate or even wrong.

If you consider doing those changes out of scope it's fine by me

iroh-net/src/magicsock.rs Outdated Show resolved Hide resolved
iroh-net/src/magicsock.rs Outdated Show resolved Hide resolved
@flub flub enabled auto-merge June 18, 2024 08:28
@dignifiedquire dignifiedquire added this to the v0.19.0 milestone Jun 18, 2024
@flub flub added this pull request to the merge queue Jun 18, 2024
Merged via the queue into main with commit 2ac3d01 Jun 18, 2024
24 of 25 checks passed
@flub flub deleted the flub/endpoint-no-endpoint branch June 18, 2024 08:52
github-merge-queue bot pushed a commit that referenced this pull request Jun 18, 2024
## Description

This audits the public visibility of items in the magicsock module.
pub(super) and pub(crate) mean the same thing here, since it is a
top-level module. This prefers pub(crate) to make it clear who can see
the items. Likewise it marks sub-items pub(crate) as well to make the
visibility clear.

## Breaking Changes

## Notes & open questions

This is targetted at #2369 which will need to be merged first.

## Change checklist

- [x] Self-review.
- ~~[ ] Documentation updates if relevant.~~
- ~~[ ] Tests if relevant.~~
- [x] All breaking changes documented.
ppodolsky pushed a commit to izihawa/iroh that referenced this pull request Jun 22, 2024
…sses (n0-computer#2369)

## Description

This renames Endpoint::local_endpoints to Endpoint::direct_addresses. As
a consequence it renames a lot of other things, e.g. config::Endpoint
type becomes magicsock::DirectAddr. This is hopefully the last ambiguous
use of "endpoint". The name "direct addresses" seemed to be the
consensus on a discord bikeshedding thread.

The entire config module is removed and the types are moved into
magicsock instead. These types did not have anything to do with
configuration and this was also a source of confusion. Because the
visibility of these types changed some dead code was removed as well.

## Breaking Changes

- iroh_net::Endpoint::local_endpoints ->
iroh_net::Endpoint::direct_addresses
- iroh_net::endpoint::LocalEndpointStream ->
iroh_net::endpoint::DirectAddrStream
- iroh_gossip::net::Gossip::update_endpoints ->
iroh_gossip::net::Gossip::update_direct_addresses
- iroh_net::config is removed.
- iroh_net::config::Endpoint -> iroh_net::magicsock::DirectAddr
- iroh_net::config::EndpointType -> iroh_net::magicsock::DirectAddrType
- iroh_net::config::NetInfo -> removed
- iroh_net::config::LinkInfo -> removed

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates if relevant.
- ~~[ ] Tests if relevant.~~
- [x] All breaking changes documented.
ppodolsky pushed a commit to izihawa/iroh that referenced this pull request Jun 22, 2024
…2371)

## Description

This audits the public visibility of items in the magicsock module.
pub(super) and pub(crate) mean the same thing here, since it is a
top-level module. This prefers pub(crate) to make it clear who can see
the items. Likewise it marks sub-items pub(crate) as well to make the
visibility clear.

## Breaking Changes

## Notes & open questions

This is targetted at n0-computer#2369 which will need to be merged first.

## Change checklist

- [x] Self-review.
- ~~[ ] Documentation updates if relevant.~~
- ~~[ ] Tests if relevant.~~
- [x] All breaking changes documented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants