refactor(iroh-net)!: Rename Endpoint::my_addr to Endpoint::node_addr #2362
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is in line with e.g. Endpoint::node_id.
Breaking Changes
Notes & open questions
Other networking APIs tend to have something like "local_addr",
e.g. UdpSocket::local_addr in the standard library or
Endpoint::local_addr in Quinn. Sometimes this is because they also
have a "peer_addr" version, e.g. UdpSocket::peer_addr.
In this light perhaps some of our APIs might benefit from using this
for consistency with other API conventions. In this case this would
become Endpoint::local_node_addr.
We already have Endpoint::local_addr which returns the socket
addresses we are bound to. Other candidates would be:
But, you can already see this fall apart. Because our endpoint is not
the thing that is connected to a peer (that is the Connection) I don't
think it makes sense to use the term "local" in the APIs.
And perhaps Endpoint::local_addr should be changed anyway, while it is
compatible with other usages it is rather out of tone for us because
we have too many kind of addresses (socket address, node address,
direct address, ...?). So perhaps that one is better off as
Endpoint::bound_sockets or so.
Change checklist
[ ] Tests if relevant.