-
Notifications
You must be signed in to change notification settings - Fork 147
WIP: Progress on py-libp2p and rust-libp2p interop for Ping #532
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
base: main
Are you sure you want to change the base?
Conversation
@paschal533 : Thank you for submitting the PR. Appreciate it. Please have a look at the 12 checks that are failing in this PR. Looking forward to seeing a revised PR soon. |
@paschal533 : This PR needs some work as a number of tests are failing. Please connect with @panditdhamdhere , who was there in the maintainer's call today. He can work with you on the bridging the interoperability with rust-libp2p and has expressed interest to work on rust-libp2p related projects. On the same note, I will open up an issue on the interoperability with go-libp2p. @pranavkonde can help us here as shared by @panditdhamdhere. Thank you once again. Looking forward to seeing the interoperability with rust-libp2p. |
Hi, @panditdhamdhere, are you free this week? let's work on this interop testing. |
Yeah @paschal533 offcourse let's do it. |
Hello, @paschal533 and @panditdhamdhere, I am a new contributor in PLDG cohort-3. @seetadev recommended me work on this as a starting issue. I will go through libp2p/rust-libp2p#5717 and https://github.com/quinn-rs/quinn as @seetadev recommended for a few time, and then start to research about this PR. |
@lla-dane : Hi Abhinav. Great to learn about your interest. You can go through libp2p/rust-libp2p#5717 and the ping example at https://py-libp2p.readthedocs.io/en/stable/examples.html . In reference to py-libp2p, please study https://github.com/libp2p/py-libp2p ; https://py-libp2p.readthedocs.io/en/stable/getting_started.html . Please also study the test plans repo: https://github.com/libp2p/test-plans. @paschal533 and @panditdhamdhere : this would be very helpful from understanding interoperability. Interoperability in reference to our project means that a node using py-libp2p can seamlessly communicate with a rust-libp2p node using shared protocol modules (e.g., /ipfs/ping/1.0.0). |
Hi @lla-dane, welcome to Py-libp2p 🎉. Let's get this done once Yamux has been implemented. Looking forward to working with you on this. :) |
2099b1a
to
386f0a2
Compare
WORKING: Connection, handshake, Yamux setup, initial ping/pong. ISSUE: Frame parser corruption after 2-3 frames (boundary sync)
Ping Interoperability Progress Report✅ SUCCESS: Basic Ping Interop WorkingHi @lla-dane, @acul71, @seetadev, I have successfully established basic ping interoperability between py-libp2p and rust-libp2p The connection, handshake, and initial ping/pong exchange are working correctly. What's Working:
|
Component | Status | Notes |
---|---|---|
Connection | ✅ Pass | TCP connection established |
Noise Protocol | ✅ Pass | Security handshake successful |
Yamux Setup | ✅ Pass | Stream muxer negotiated |
Initial Ping | ✅ Pass | Connection-level ping works |
Stream Creation | ✅ Pass | New stream opened successfully |
Frame Parsing | ❌ Fail | Corruption after 2-3 frames |
Protocol Negotiation | ✅ Pass | /ipfs/ping/1.0.0 confirmed |
Application Ping | ⏸️ Blocked | Cannot test due to frame issue |
Overall: Significant progress made, core interop proven feasible. One critical parsing bug remains.
Great, thanks @paschal533. I will read through the chnages in ping.py here and do the same thing for ping in interop tests in #620 |
Alright |
@lla-dane and @paschal533 : Great progress :) Appreciate the initiative. Looking forward to seeing the interop test plans with rust-libp2p soon at https://github.com/libp2p/test-plans |
@lla-dane , @varun-r-mallya and @paschal533 : Wish to share that there are some merge conflicts in this branch that must be resolved. Please check examples/ping/ping.py |
…ecting peer detection
Description
This is a work-in-progress (WIP) pull request to improve interoperability between
py-libp2p
andrust-libp2p
, focusing on the Noise XX handshake and Yamux multiplexing. The goal is to enable a successful ping exchange between a Python client and a Rust server.Changes
examples/ping/ping.py:
KeyPair
derived from Rust’s private and public keys for testing (e.g., private:6866d018...
, public:0d3fb3dc...
). These are placeholders and change per Rust run; future work should dynamically fetch them.Transport
instantiation to passnoise_privkey=key_pair.private_key
instead ofnoise_keypair
(fixedcall-arg
error).cast(TProtocol, ...)
formuxer_transports_by_protocol
to resolvemypy
errors.libp2p/stream_muxer/yamux/yamux.py:
!BBHI
) per the Yamux spec, fixing the previous 8-byte mismatch.FLAG_SYN
andFLAG_FIN
.libp2p/security/noise/transport.py:
secure_inbound
signature to matchISecureTransport
(removedpeer_id
parameter).libp2p/security/noise/patterns.py:
remote_peer_id
optional inPatternXX.handshake_inbound
to matchIPattern
interface, fixingoverride
error.Current Status
Noise Handshake:
BadSignature
during Msg define interfaces for milestone 1 #3 verification. Logs show Python’s Noise public key (ecc32c64...
) doesn’t match the expected Rust key (0d3fb3dc...
), despite setting theKeyPair
.ping.py
are temporary and change per Rust run, indicating a need for dynamic key exchange or configuration.Muxing:
IncompleteReadError
after the handshake, likely due to Rust closing the connection post-BadSignature
.Next Steps:
Transport
uses a different Noise key despite settingnoise_privkey
.Logs
Request for Feedback
noise_privkey
inTransport
being applied correctly to the Noise handshake? Logs suggest a mismatch.ecc32c64...
) instead of using the provided0d3fb3dc...
?rust-libp2p
once the handshake succeeds?Notes
6866d018...
and0d3fb3dc...
) changes per run, so hardcoding is a temporary test measure. A production solution should query or negotiate keys.