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

[WIP] Connection and stream interop between Python and Go #175

Closed
wants to merge 2 commits into from

Conversation

mhchia
Copy link
Contributor

@mhchia mhchia commented Jun 21, 2019

[Sill work in progress]

Fixes #169.

Note

  • Python -> Go
    • Ensured that we can establish an "insecure" and "multiplexed" connection with several modifications.

      • Steps
        • Don't send PeerID right after the initiator dials.
        • Fix outdated protocol ids.
        • Send length-prefixed messages in mutiselect.
        • Support Identify protocol.
      • TODOs
    • Ensured that we can open a stream through the established connection with several modifications.

      • Consume initial message b'0' when openning a stream.
  • Go -> Python
    • Have not tested yet.
  • Others
    • TODOs
      • Keybook implementation

@stuckinaboot
Copy link
Contributor

stuckinaboot commented Jun 22, 2019

Really great to see someone working on this! As this is a crucial functionality that depends on the whole py-libp2p networking stack being able to work with that of go-libp2p, I'm tagging @raulk in case he has any input here.

EDIT: See Raul’s response below as he describes the accurate steps to exchanging peer IDs.

With regards to your issue (Raul please correct me if I have this wrong or if there is some other place where sending peer IDs over the wire should take place), it could be useful to implement the identify protocol in order to achieve the sharing of peer IDs when a connection is established.

@raulk
Copy link
Member

raulk commented Jun 25, 2019

Hey! A few notes: peer IDs are exchanged along with public keys during the crypto handshake (SecIO, TLS 1.3, Noise in the future). Identify is a vital protocol, but by the time it kicks in, you already have a secure and multiplexed connection (and identify operates on a stream).

mhchia added 2 commits August 15, 2019 14:51
TODOs
- Find out when we should send `peer_id`
- Make `new_stream` work

Successfully established MuxedConn

But go side crashes after having the connection. My guess is related to
the empty PeerID

Add `muxed_multistream`

Add request_handler for Identify

Currently connections and streams work

Plus identify

Remove binary file `interop`
@mhchia mhchia force-pushed the fix/interop-with-go branch from faf4364 to a792c54 Compare August 15, 2019 06:55
@mhchia
Copy link
Contributor Author

mhchia commented Aug 15, 2019

Rebased onto master but tests fail. It seems like incoming connections are not handled well.

@mhchia
Copy link
Contributor Author

mhchia commented Aug 22, 2019

In this PR, only Identify and mplex fixes are not merged in master. I will soon make the PR for mplex fix.

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.

libp2p node interoperability
3 participants