Skip to content
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

QUIC address translation #2245

Merged
merged 2 commits into from
Nov 19, 2023
Merged

QUIC address translation #2245

merged 2 commits into from
Nov 19, 2023

Conversation

nazar-pc
Copy link
Member

@nazar-pc nazar-pc commented Nov 19, 2023

Turns out all of our farmers were clients because address translation was not implemented in libp2p-quic. libp2p/rust-libp2p#4896 fixes that upstream, this PR just pulls it into susbpace-v7 of our fork and uses here sooner.

This allows farmers to confirm their external address and become servers. Without that the only server we have are those that specified --external-address and they are overloaded.

Code contributor checklist:

let Some(candidate_protocol) = addr.iter().find_map(|protocol| match protocol {
udp @ Protocol::Udp(_) => Some(udp),
tcp @ Protocol::Tcp(_) => Some(tcp),
_ => None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we capture QuicV1 or Quic here now that its properly translated ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really, quic is the only UDP protocol we use, so the only thing we care about here are TCP/UDP ports to avoid mismatches. If we were pedantic about it we could check the rest, but dealing with a single protocol rather than a list makes code much shorter.

Copy link
Contributor

@ParthDesai ParthDesai left a comment

Choose a reason for hiding this comment

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

Make sense to me. Only one non-blocking nit.

crates/subspace-networking/src/node_runner.rs Show resolved Hide resolved
@nazar-pc nazar-pc added this pull request to the merge queue Nov 19, 2023
Merged via the queue into main with commit f54777f Nov 19, 2023
10 checks passed
@nazar-pc nazar-pc deleted the quic-address-translation branch November 19, 2023 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants