feat!: transport generic EndpointAddr#3554
Conversation
1daf8d2 to
8f38361
Compare
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3554/docs/iroh/ Last updated: 2025-10-21T09:09:41Z |
flub
left a comment
There was a problem hiding this comment.
Generally LGTM.
I'd like to treat the doc comments of EndpointAddr and TransportAddr and their fields as if the user encounters all those concepts for the first time. Like explain that endpoint_id is unique to this node. addr is a list of transient addresses, they may change, or may never have worked. Discovery is a thing. TransprotsAddr::Relay should give a short intro to relays, TransportsAddr::Ip explain that they may need holepuching and all such things.
iroh-base/src/endpoint_addr.rs
Outdated
| impl EndpointAddr { | ||
| /// Creates a new [`EndpointAddr`] with no `relay_url` and no `direct_addresses`. | ||
| pub fn new(endpoint_id: PublicKey) -> Self { | ||
| /// Creates a new [`EndpointAddr`] with no addresses. |
There was a problem hiding this comment.
Be verbose! Explain that you can still use this using discovery. Users will read this without any context and never have heard of iroh. They'll have skipped all the nice intro docs we have (we do have those, right?)
iroh-base/src/ticket/endpoint.rs
Outdated
| #[derive(Serialize, Deserialize)] | ||
| enum TicketWireFormat { | ||
| Variant0(Variant0NodeTicket), | ||
| Variant0(Variant1EndpointTicket), |
There was a problem hiding this comment.
Why bother adding Variant1 if you then break Variant0?
There was a problem hiding this comment.
I wanted to rename them all to variant1 as this is the variant for 1.0? 🤷
There was a problem hiding this comment.
updated to be called Variant1
iroh/src/magicsock.rs
Outdated
| /// [`Watcher`]: n0_watcher::Watcher | ||
| /// [`Watcher::initialized`]: n0_watcher::Watcher::initialized | ||
| pub(crate) fn direct_addresses(&self) -> n0_watcher::Direct<BTreeSet<DirectAddr>> { | ||
| pub(crate) fn ip_addresses(&self) -> n0_watcher::Direct<BTreeSet<DirectAddr>> { |
There was a problem hiding this comment.
This is a curious and tricky rename. The type still says DirectAddr. But it's also an internal API so whatever, not important enough to hold this up. We can figure out this naming iteratively.
There was a problem hiding this comment.
yeah..that's where I ended up with as well, wasn't sure how much to change the types, or leave it be for now
|
minimal versions failing because of rustls/rustls-platform-verifier#164 |
flub
left a comment
There was a problem hiding this comment.
looking forward to use this on the multipath branch!
768458c to
6aa21d3
Compare
Description
This marks the first public step towards generic transports. For now there are two types of
TransportAddrs,RelayandIpwhich, replace the previous explicit fields inEndpointAddrofrelay_urlanddirect_addrs.Closes #3417
Breaking Changes
direct_addressesare now calledip_addressesEndpointAddrtype is completely changedaddresse(s)are now normalized toaddr(s)to be consistent in the code base