GithubHelp home page GithubHelp logo

Comments (10)

daviddias avatar daviddias commented on May 29, 2024 1

@dignifiedquire changed the labels

from js-libp2p.

jbenet avatar jbenet commented on May 29, 2024
  • I think Identify should send the pubkey by default.
  • Maybe it could detect whether the connection is authenticated, and use the pubkey from there and avoid sending it then.
  • in general, Identify is really awkward right now. part of me thinks that Identify should happen as a "fully async" protocol (so we can write through without waiting for RTTs) and it should happen after auth and before stream muxing. This could add a layer of multistream, but it would make the possibility of nodes without an identify protocol breaking things not a thing.

from js-libp2p.

jbenet avatar jbenet commented on May 29, 2024

cc @whyrusleeping @diasdavid

from js-libp2p.

daviddias avatar daviddias commented on May 29, 2024

It is almost that @dignifiedquire. What I and @whyrusleeping detected was that go-libp2p setup, available these examples https://github.com/libp2p/go-libp2p/tree/master/examples, doesn't set up the public key on Identify, however this happens correctly in go-ipfs.

We need:

  • Be able to cope with an incomplete Identify in js-libp2p-swarm
  • Have go-libp2p examples are fully set up, because users of libp2p will not understand what is going on

I think Identify should send the pubkey by default.

I would prefer that as well. But better not to panic if not set.

Maybe it could detect whether the connection is authenticated, and use the pubkey from there and avoid sending it then.

That is the plan, if the pubkey is not passed.

in general, Identify is really awkward right now. part of me thinks that Identify should happen as a "fully async" protocol (so we can write through without waiting for RTTs)

Identify is today fully async, it is not required to be executed at all and if some part of the code tries to getPeerInfo on the conn, it will execute Identify if it hasn't already.

and it should happen after auth and before stream muxing. This could add a layer of multistream, but it would make the possibility of nodes without an identify protocol breaking things not a thing.

Not so confident about this.

from js-libp2p.

whyrusleeping avatar whyrusleeping commented on May 29, 2024

I can make sure that go-ipfs puts public keys in the identify handshake very easily. But i can't easily make us infer the remotes peer ID from the sent public key, that both requires us to think about that from a security perspective, and to restructure the entire way we're doing the identify to be closer to how @jbenet suggests here (with having identify happen before anything else).

I'll put up a quick PR to add in sending the public key, but i think that using it for any purpose is erroneous behaviour at this point.

from js-libp2p.

jbenet avatar jbenet commented on May 29, 2024

But i can't easily make us infer the remotes peer ID from the sent public key

Wait, how so? the peer.ID is well defined to be a function of pubkey -> peer.ID. what am i missing?

from js-libp2p.

dignifiedquire avatar dignifiedquire commented on May 29, 2024

@jbenet @diasdavid what exactly should I change now in js land?

from js-libp2p.

daviddias avatar daviddias commented on May 29, 2024

@dignifiedquire go added the pubkey to identify so that we don't hit this issue. We are discussing (so far there is an agreement but it won't come in this quarter) that it makes sense to Identify and Multistream to be the two protocols that libp2p users must buy in. It's already obvious that Multistream is, but right now, it is kind of klunky that Identify might be skipped with a presence of a Stream Muxer. (tl;dr; the proposal is to do both in go and js what JS was doing before - https://github.com/libp2p/js-libp2p-swarm/issues/78)

from js-libp2p.

dignifiedquire avatar dignifiedquire commented on May 29, 2024

@diasdavid cool. So should I hold off with the work on this for now? Can we then remove it from the milestone?

from js-libp2p.

jacobheun avatar jacobheun commented on May 29, 2024

Issue has been fixed for some time, closing.

from js-libp2p.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.