Skip to content

Conversation

dignifiedquire
Copy link
Contributor

Work on integrating n0-computer/quinn#28 into the iroh magic

@n0bot n0bot bot added this to iroh Jul 7, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Jul 7, 2025
Copy link

github-actions bot commented Jul 7, 2025

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

Last updated: 2025-08-01T09:29:38Z

Copy link

github-actions bot commented Jul 7, 2025

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: ac1899b

@dignifiedquire dignifiedquire changed the title [WIP] feat: use quinn multipath [WIP] feat: use quic multipath Jul 8, 2025
@dignifiedquire dignifiedquire force-pushed the feat-multipath branch 3 times, most recently from 72cb071 to db712c0 Compare July 18, 2025 14:39
@dignifiedquire dignifiedquire force-pushed the feat-multipath branch 2 times, most recently from 4827e62 to 946f71c Compare July 28, 2025 20:29
flub added 7 commits October 9, 2025 12:32
I'm really not that happy with info or implementation.  This should be
improved.
The refresh interval and time when we went to pending was about the
same anyway.  Instead we need this info to just be up to date.  This
queuing mechanism was the wrong approach.
)]
pub struct NodeAddr {
/// The node's identifier.
#[debug("{}", node_id.fmt_short())]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should be reverted before merging

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, do you think so? I found it really annoying to have to look at those full public keys when we debug-log a NodeAddr. I considered using the alternative-debug format, but unfortunately tracing only has ? and % support in their macros, for Debug and Display respectively. I didn't thyink there's any strict rule about how a Debug should look? It's not like you can eval() this back into a thing like e.g. Python.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it reduces the ability to reproduce information, that's why I am concerend about doing it by default. you can copy and paste the nodeid, relayurl and socket addrs currently, but suddenly you can't do it for the nodeid anymore

Copy link
Member

Choose a reason for hiding this comment

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

A sigil for alternate display in tracing would be the best solution indeed. Looked again and found tokio-rs/tracing#3258 - I now pinged the tokio discord about how to move it forward (pr is open for 6 months without comments)

any_match = true;
match sender.send(*addr, src, transmit).await {
Ok(()) => {
trace!("sent");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

needs delete before merge

any_match = true;
match sender.send(url.clone(), *node_id, transmit).await {
Ok(()) => {
trace!("sent");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

needs delete before merge

self.msock
.metrics
.magicsock
.send_data
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why is send_data increased if we call mapped_addr?

warn!(dst = ?destination, "failed to send: {err:#}");

let sender = self.msock.node_map.node_state_actor(node_id);
let transmit = OwnedTransmit::from(quinn_transmit);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is very painful, it means we have to allocate each packet that we send one more time 😭

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess this only happens on the mixed path? which seems fine then

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, the tradeoff here is that this only happens for the Intial packet of each connection. Additionally we are not copying the data itself, because that is already a Bytes instance. So yeah, this was a consious tradeoff made with this design choice.

I guess this design choice isn't documented clearly enough yet.

/// direction as well.
pub needs_ping_back: Option<SendPing>,
}
// TODO: use this
Copy link
Contributor Author

Choose a reason for hiding this comment

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

lots of TODOs in this file

/// The key is the [`quinn::Connection::stable_id`].
connections: FxHashMap<usize, ConnectionState>,
/// Events emitted by Quinn about path changes.
#[allow(clippy::type_complexity)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

type alias?

.unwrap_or_else(move || SecretKey::generate(&mut rng));

// Override some transport config settings.
self.transport_config
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder if we should check the config and print a warning if we change them, because this does remove the ability for users to configure some of these

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.

4 participants