-
Notifications
You must be signed in to change notification settings - Fork 121
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 module addition #488
base: main
Are you sure you want to change the base?
quic module addition #488
Conversation
Hi @seetadev! Thanks for this. A couple things right off.
I haven't gotten a chance to actually play with the code, but will do so. Are you familiar with the |
@pacrob: Hi Paul. Thank you so much for the detailed feedback — really appreciate it! Please find my comments below each feedback point.
I really appreciate the thorough review and constructive feedback. Looking forward to getting these changes in place. Will update soon. Thank you so much once again! 😊🚀 |
Hey, @seetadev , I'm so sorry about the delay here. I need to remember that CI doesn't run unless I trigger it. I added a newsfragment and ran CI and it looks like some errors are popping up. You can run linting manually locally with
and your test file directly with
|
@pacrob : Hi Paul. Thank you so much for reviewing the pull request and taking the time to run the CI—no worries about the delay, I completely understand how busy things can get! I really appreciate your guidance here. I'll go ahead and:
I’ll update the PR shortly with the fixes and let you know once everything is ready for another review. Thanks again for your patience and for pointing me in the right direction—it means a lot! Please feel free to share any additional feedback or suggestions to ensure the PR aligns perfectly with project standards. Looking forward to your thoughts once I push the updates! 😊 |
Tried running the tests with
So clearly, this is because there is no core module in |
Doing this got me this:
def __init__(
self, quic: QuicConnection, stream_handler: Optional[QuicStreamHandler] = None
) |
@SAMAD101 : Thank you for sharing the update. We are using QuicConfiguration and QuicProtocol from aioquic library for tests. Wish to also share that we are refactoring the code to use trio instead of asyncio. Try and familiarize the new code changes at 5d6c5bb. Will setup a call with you today or tomorrow and discuss on the unit and integration tests.
|
@SAMAD101 : Tried using the dev branch code changes and also spent time investigating the issues. Wish to recommend that we need to check on these 3 issues that seems to be causing the trouble here:
We need to figure out the optimal way to handle async iteration for QuicConnectionProtocol. Also, check whether the close method should be updated to return a value or if the linting rules should be adjusted. I think we will have most of the issues resolved once we arrive at a good conclusion on these aspects. Looking forward to discussing with you at the earliest.
|
QUIC Transport in Readme sectionBased on the feedback from @pacrob, @acul71, Sam, and Dave, I’ve made key code changes to the QUIC module. Currently working on integrating Additionally, I’m implementing key error handling and logging features to improve connection management. Will share updates soon! On the same note, I am also in the process of adding a higher level QuicProtocol Class. quic.py file already has implementations for QuicStream and QuicRawConnection, but it does not define a QuicProtocol class. I am adding a QuicProtocol class for:
To use QUIC transport, initialize a from libp2p.transport.quic import QuicTransport
quic_transport = QuicTransport()
host = BasicHost(transport_upgrader, listen_addrs=["/ip4/127.0.0.1/udp/0/quic"]) |
Hey @Khwahish29, Hope you're doing well! We're actively working on resolving the CI/CD issues. In the meantime, I’d love to get your feedback on the Zig QUIC module: [zig-msquic](https://github.com/MarcoPolo/zig-libp2p/tree/main/zig-msquic). Also, were you able to take a look at the QUIC implementation in Go? It’d be great to hear your thoughts on how we can align the approaches. Looking forward to your feedback and an MVP implementation before I bring in my new changes. Excited to collaborate on this—your contributions are really appreciated. |
@Khwahish29 : For the MVP, we have arrived at the following roadmap. Lets discuss:
|
Hey @seetadev Thanks for reaching out! I've gone through the Zig QUIC module (zig-msquic), and it looks promising. I appreciate the structured approach taken here. I’ll add more detailed feedback soon, particularly regarding how we can align it with other QUIC implementations. Regarding the Go QUIC implementation,I'll will share my thoughts shortly on how we can keep both approaches in sync. Aligning the architecture early on should make integration smoother. 🚀 |
Hey @seetadev Libp2p Enhancements: Comparing with Go’s QUIC Implementation, it is a first-class transport within libp2p. It uses quic-go, which combines TLS 1.3’s handshake (with identity verification) and native stream multiplexing—eliminating the need for separate negotiation layers. The TLS certificates (often ephemeral or self-signed with identity binding) directly provide the peer’s public key for authentication. For our Python implementation, we’ll leverage
MVP Roadmap
I'm preparing an MVP implementation that sets up this basic QUIC transport handler using Looking forward to your thoughts and further discussion as we refine this! |
@Khwahish29 : Great design spec for an MVP.
Maintainer’s Call StrategyWe discussed in the maintainer’s call that having three flavors of QUIC will give libp2p greater flexibility and interoperability across ecosystems. With JS, Zig, and Python each supporting QUIC in their own optimized way, we can establish a more robust, platform-agnostic transport layer for libp2p. This will enable seamless dialing between different libp2p modules using QUIC, enhancing network compatibility and resilience. Next StepsPlease go ahead with the MVP implementation plan using Very nicely shared and thoughtfully structured! Looking forward to seeing the MVP come together—this will be a big step toward strengthening QUIC support across libp2p. Let me know if you need any input or help along the way. 🚀 |
Title: Add QUIC Module Support to py-libp2p
Description:
This PR introduces support for the QUIC transport protocol in py-libp2p. QUIC is a modern, low-latency transport protocol that offers advantages like connection migration, multiplexing without head-of-line blocking, and improved security via TLS 1.3. Adding QUIC support enhances the performance, reliability, and compatibility of py-libp2p with other implementations in the libp2p ecosystem.
Key Changes:
New QUIC Module:
quic_transport
module for handling QUIC-based connections.Dependencies:
aioquic
library for QUIC protocol support.requirements.txt
with the necessary dependencies.Integration with Existing Components:
TransportManager
to register QUIC as an available transport.Configuration Options:
Testing:
go-libp2p
andjs-libp2p
QUIC implementations.Documentation:
README.md
and transport documentation to include details on using QUIC.examples/
.Why This Matters:
py-libp2p
with the latest advancements ingo-libp2p
andjs-libp2p
, ensuring smoother cross-implementation interoperability.Next Steps:
Related Issues:
Closes (#463)
Checklist: