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

refactor(quic): rewrite quic using quinn #3454

Merged
merged 83 commits into from
Jul 28, 2023
Merged

Conversation

kpp
Copy link
Contributor

@kpp kpp commented Feb 11, 2023

Description

Rewrite quic using quinn instead of quinn-proto. libp2p-quic::endpoint::Driver is eliminated (and that hard quinn-proto machinery). Also:

  • ECN bits are handled
  • Support Generic Send Offload (GSO)

Notes

This PR preserves the original API and naming.

Testing hole punching:

cargo r -p relay-server-example -- --secret-key-seed 1 --port 15353

cargo r -p dcutr -- --mode listen --secret-key-seed 2 --relay-address /ip4/127.0.0.1/udp/15353/quic-v1/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X

cargo r -p dcutr -- --mode dial --secret-key-seed 3 --relay-address /ip4/127.0.0.1/udp/15353/quic-v1/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X --remote-peer-id 12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3

Links to any relevant issues

Open Questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

TODOs

  • Remove direct usage of quinn-proto
  • Fix doc comments
  • Delete commented code
  • Think how to close connection (code_reason + wait in poll_close?)
  • Fix tests
  • Update libp2p-perf to 0.51.0 (rust/: update dependencies mxinden/libp2p-perf#91)
  • Get rid of BoxedFuture in connection
  • Bench code
  • Hole punching

@mxinden
Copy link
Member

mxinden commented Feb 13, 2023

@kpp can you expand on the difference to #2801?

@kpp
Copy link
Contributor Author

kpp commented Feb 13, 2023

This one is fresh, uses all features from master but with less code. I tried to update #2801 but it turned out it was easier to rewrite it.

@kpp kpp changed the title WIP: Rewrite quic using quinn Rewrite quic using quinn Feb 14, 2023
@kpp kpp changed the title Rewrite quic using quinn refactor(quic): rewrite quic using quinn Feb 15, 2023
Copy link
Contributor Author

@kpp kpp left a comment

Choose a reason for hiding this comment

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

Left comments on close/poll_close. I am not sure how to resolve them.

transports/quic/src/connection.rs Outdated Show resolved Hide resolved
transports/quic/src/transport.rs Show resolved Hide resolved
fix(quic/connection): await connection.closed
@mergify
Copy link
Contributor

mergify bot commented Jul 27, 2023

This pull request has merge conflicts. Could you please resolve them @kpp? 🙏

Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Thank you @kpp for all the work on this pull request.

I will go ahead and merge here 🎉.

@mergify mergify bot merged commit 4e1fa9b into libp2p:master Jul 28, 2023
mxinden added a commit to mxinden/rust-libp2p-server that referenced this pull request Jul 29, 2023
@thomaseizinger
Copy link
Contributor

Awesome work @kpp and @mxinden!

@mxinden Mind updating the roadmap to mark this as completed?

mergify bot pushed a commit that referenced this pull request Jul 31, 2023
@kpp kpp deleted the quic_quinn branch August 1, 2023 12:35
mxinden added a commit to libp2p/test-plans that referenced this pull request Aug 1, 2023
With libp2p/rust-libp2p#3454 merged we can now test the
new rust-libp2p QUIC implementation based on upstream quinn directly from
rust-libp2p `master`.

This commit does the following in libp2p/test-plans:

1. Remove the `perf/impl/rust-libp2p-quinn` implementation.
2. Introduce the `perf/impl/rust-libp2p/master` version of the rust-libp2p implementation.

We can promote the latter to a proper version on the next rust-libp2p release.
mxinden added a commit to libp2p/test-plans that referenced this pull request Aug 1, 2023
With libp2p/rust-libp2p#3454 merged we can now test the
new rust-libp2p QUIC implementation based on upstream quinn directly from
rust-libp2p `master`.

This commit does the following in libp2p/test-plans:

1. Remove the `perf/impl/rust-libp2p-quinn` implementation.
2. Introduce the `perf/impl/rust-libp2p/master` version of the rust-libp2p implementation.

We can promote the latter to a proper version on the next rust-libp2p release.
thomaseizinger pushed a commit that referenced this pull request Aug 20, 2023
Rewrite quic using quinn instead of quinn-proto. libp2p-quic::endpoint::Driver is eliminated (and that hard quinn-proto machinery). Also:
- ECN bits are handled
- Support Generic Send Offload (GSO)

Pull-Request: #3454.
thomaseizinger pushed a commit that referenced this pull request Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants