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,iroh-net)!: prefer remote to connection in api #2610

Merged
merged 35 commits into from
Aug 17, 2024

Conversation

flub
Copy link
Contributor

@flub flub commented Aug 9, 2024

Description

Moves some functions and types to use remote to describe the information we know about a node,
instead of connections. This, based on the fact that iroh-net does not itself handle connections,
making the wording misleading at best.

Breaking Changes

iroh

  • client::node::Client::connection_info -> client::node::Client::remote_info
  • client::node::Client::connections -> client::node::Client::remote_infos_iter

iroh-net

  • endpoint::ConnectionInfo -> endpoint::RemoteInfo
  • endpoint::ConnectionInfo::id is removed since it's internal information.
  • endpoint::ConnectionInfo::last_alive_relay is deprecated. Use .relay_url.last_alive
  • endpoint::Endpoint::connection_info -> endpoint::Endpoint::remote_info
  • endpoint::Endpoint::connection_infos -> endpoint::Endpoint::remote_infos_iter

iroh-cli (bin)

  • node connection-info -> node remote-info
  • node connections -> node remote-list

Notes & open questions

  1. We decided to also move many of the (currently) node commands that come directly from iroh-net to
    a new net top level api. Doing so we should aim as well to move the cli to the more gracious
    remote <node-id> and remote list. In summary:
  • we have iroh node remote <node-id> and we want iroh net remote <remote-id>
  • we have iroh node remote-list and we want iroh net remote list
    Issue add top level net api #2639 is created for this
  1. This adds a deprecation that needs to be removed later. Issue remove deprecated endpoint::ConnectionInfo::last_alive_relay #2640 is created for this.

Change checklist

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

This migrates Endpoint::connection_info and Endpoint::connection_infos
to Endpoint::node_info and Endpoint::node_info_iter.  This returns
information about nodes in the node map.  This has not that much to do
with connections.  Calling this connections is rather misleading.

It documents all types below it properly, deprecating some
problematic fields and functions.
@flub
Copy link
Contributor Author

flub commented Aug 11, 2024

@dignifiedquire while this doesn't work yet could I get some feedback on using deprecations?

Also on the rename itself from Endpoint::connection_info[s] to Endpoint::node_info[_iter]. /cc @ramfox as you added this originally.

@dignifiedquire
Copy link
Contributor

given we haven't used deprecations for the last rounds of api changes, I don't think they are necessary currently

@flub flub changed the title refactor+docs(iroh-net): Endpoint::connection_info -> ::node_info refactor(iroh-net): Endpoint::connection_info -> ::node_info Aug 13, 2024
Copy link

github-actions bot commented Aug 13, 2024

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

Last updated: 2024-08-17T17:46:11Z

@flub flub marked this pull request as ready for review August 13, 2024 14:58
@flub flub requested review from dignifiedquire and ramfox August 13, 2024 14:58
@ramfox
Copy link
Contributor

ramfox commented Aug 14, 2024

I think this is a great name change: the original name is from when this data was ephemeral. I agree, it makes no sense now.

@divagant-martian divagant-martian changed the title refactor(iroh-net): Endpoint::connection_info -> ::node_info refactor(iroh-net)!: prefer 'remote' to 'connections' in api Aug 17, 2024
@divagant-martian divagant-martian changed the title refactor(iroh-net)!: prefer 'remote' to 'connections' in api refactor(iroh-net)!: prefer remote to connection in api Aug 17, 2024
@divagant-martian divagant-martian changed the title refactor(iroh-net)!: prefer remote to connection in api refactor(iroh,iroh-net)!: prefer remote to connection in api Aug 17, 2024
iroh-net/src/endpoint.rs Outdated Show resolved Hide resolved
@ramfox ramfox enabled auto-merge August 17, 2024 14:40
@ramfox ramfox added this pull request to the merge queue Aug 17, 2024
Merged via the queue into main with commit 9d06888 Aug 17, 2024
27 of 28 checks passed
@divagant-martian divagant-martian deleted the flub/connection-info-wtf branch August 17, 2024 18:52
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.

4 participants