Skip to content

Conversation

ramfox
Copy link
Member

@ramfox ramfox commented Oct 17, 2025

Description

Attempts to make Connection::remote_id and Connection::alpn infallible, by:

  1. intercepting the Connection in Incoming and Connecting to ensure a remote_id and alpn are present before returning an iroh::endpoint::Connection
  2. creates a ZRTTConnection that has the same methods as a Connection, but includes having a fallible remote_id and alpn

The code is not ideal, but it illustrates some of the limitations here.

This creates a bit of a mess when using 0-rrt connections, as you can see in the 0-rtt example and the 0-rtt tests, since a ZRTTConnection and Connection are no longer the same, it becomes very annoying to deal with the result of a Connecting::into_0rtt()

Breaking Changes

Notes & open questions

This whole PR is an open question

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.
    • List all breaking changes in the above "Breaking Changes" section.
    • Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are:

Copy link

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

Last updated: 2025-10-17T21:58:05Z

Copy link

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: 51dd046

@n0bot n0bot bot added this to iroh Oct 17, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Oct 17, 2025
Ok(data) => data.protocol,
Err(_) => None,
}
pub fn alpn(&self) -> Vec<u8> {
Copy link
Contributor

Choose a reason for hiding this comment

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

would be nicer to return a slice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

2 participants