-
Notifications
You must be signed in to change notification settings - Fork 304
feat!: transport generic EndpointAddr #3554
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
base: main
Are you sure you want to change the base?
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-20T13:47:08Z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why bother adding Variant1
if you then break Variant0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to rename them all to variant1 as this is the variant for 1.0? 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking forward to use this on the multipath branch!
Co-authored-by: Floris Bruynooghe <[email protected]>
Description
This marks the first public step towards generic transports. For now there are two types of
TransportAddr
s,Relay
andIp
which, replace the previous explicit fields inEndpointAddr
ofrelay_url
anddirect_addrs
.Closes #3417
Breaking Changes
direct_addresses
are now calledip_addresses
EndpointAddr
type is completely changedaddresse(s)
are now normalized toaddr(s)
to be consistent in the code base