Replies: 9 comments 2 replies
-
Ran a few libp2p-nodes on my end, here's my experience. For
let mut swarm = libp2p::SwarmBuilder::with_new_identity()
.with_tokio()
.with_tcp(
tcp::Config::default(),
noise::Config::new,
yamux::Config::default,
)?
.with_behaviour(|_| ping::Behaviour::default())?
### .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(u64::MAX)))
.build(); Without that, both the dialer and listener would start but no pings were exchanged. After this change, pings began firing every ~15 seconds. Tested this setup with the One issue Iβm running into: when using Listening on /ip4/127.0.0.1/tcp/5000
Listening on /ip4/192.168.31.130/tcp/5000 Without the peer ID in the address, other nodes can't initiate a connection. Finally, I tried the |
Beta Was this translation helpful? Give feedback.
-
Hi @lla-dane and @varun-r-mallya , we can continue our discussion here to keep the PRs clean. |
Beta Was this translation helpful? Give feedback.
-
Hi @seetadev, @lla-dane, @varun-r-mallya Iβve been digging into the Whatβs Working
The Noise IssueThe core issue is a desynchronization in the Noise transport mode between py-libp2pβs noise package and rust-libp2pβs snow crate. After the initial two transport mode messages, the Python side fails to decrypt subsequent messages correctly, resulting in garbage data that gets interpreted as invalid Yamux headers:
Relevant LogsPython Logs (
|
Beta Was this translation helpful? Give feedback.
-
In #532, all the py-rust combinations for ping interop are working correctly. There is just one small issue with In this combination, the 1st ping is working, consecutive 4 pings failing, and after that, successful pings! Other than this: the Upadate the rust-libp2p ping example like this file for similar logs in the the rust side. @guha-rahul will reflect the changes he made in #532 in #620. |
Beta Was this translation helpful? Give feedback.
-
Adding @acul71 , @guha-rahul , @sumanjeet0012, @Winter-Soren , @Sahilgill24 |
Beta Was this translation helpful? Give feedback.
-
@lla-dane : Wonderful update indeed. Are we ready to submit an interop test plan at libp2p/test plans repo? |
Beta Was this translation helpful? Give feedback.
-
@seetadev: Apologize for the late response. @guha-rahul has started reflecting the changes in #620. There were a few issues, I have pointed them out to him, once those are fixed and everything is working correctly, then we can move forward with submitting the test plans. |
Beta Was this translation helpful? Give feedback.
-
@lla-dane : No worries at all, and thanks for the update! Great to hear that @guha-rahul has started integrating the changes in #620 β thatβs a solid step forward. Appreciate you reviewing and pointing out the issues early; catching those now will definitely save time down the line. Once everythingβs stable and working as expected, moving ahead with the test plans sounds like the perfect next step. Feel free to loop me in when you're ready β happy to review or help out as needed. Thanks again for staying on top of this :) |
Beta Was this translation helpful? Give feedback.
-
Hi there everyone, So if we use lla-dane#2 (i personally use
We will see an output like
now from the interop_rsa branch we need to run (change the peer id)
cc: @seetadev @paschal533 would love to see you guys checking the interop |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Interoperability between
py-libp2p
andrust-libp2p
using the ping protocol is achievable, but there are nuances and caveats to consider due to the differing maturity and feature sets of the two implementations. This document provides a practical guide for testing and achieving ping interoperability.β Goal
Enable a Python (
py-libp2p
) node to ping or be pinged by a Rust (rust-libp2p
) node using the libp2p/ping protocol.π Protocol Compatibility Overview
rust-libp2p
py-libp2p
(as of latest commits)/multistream/1.0.0
)π§ͺ Ping Protocol Interop Setup
1. Ensure Compatible Transports + Encryption
To maximize compatibility:
py-libp2p
fork supports it).β Testing Interoperability
Start the Rust node, note the Peer ID + Multiaddr.
Launch the Python node, and connect:
await host.connect(rust_peer_info)
Open a stream to /ipfs/ping/1.0.0, send 32 bytes, and verify the echoed response.
Sample code for running a
rust-libp2p
Ping ServerRust Example Code
Beta Was this translation helpful? Give feedback.
All reactions