Comments (10)
@dignifiedquire changed the labels
from js-libp2p.
- 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.
from js-libp2p.
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.
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.
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.
@jbenet @diasdavid what exactly should I change now in js land?
from js-libp2p.
@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.
@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.
Issue has been fixed for some time, closing.
from js-libp2p.
Related Issues (20)
- Lacking Documentation: certhash for webRTC? HOT 1
- Race Condition on opening a Stream over a DataChannel HOT 3
- ERR_ENCRYPTION_FAILED tryng to connect to go-ipfs HOT 6
- kad: FIND_NODE(self) should return multiple peers
- libp2p.components not included in typescript types. HOT 1
- autonat and upnp-nat both detect external IP address, but neither updates announced addresses. HOT 2
- libp2p crashes with ABORT_ERR HOT 5
- Memory leak issue HOT 9
- New link for js-libp2p maintainers call? HOT 5
- Circuit Relay v2 should not publish routing key without public addresses HOT 1
- Yamux pontentially sending a WindowUpdate after it has closed the stream
- Unable to run a DHT Provide Successfully HOT 5
- Cannot connect to DNS multiaddr format HOT 3
- Browser-to-server libp2p reliability HOT 3
- investigation: hanging TCPSocketWrap in js-libp2p-amino-dht-bootstrapper HOT 1
- bug: max call stack exceeded when duplicate /webrtc listeners added HOT 1
- Finding Circuit Relay V2 servers HOT 1
- Update RTCConfig for WebRTCTransport
- Deprecate `@libp2p/mplex` tracking issue HOT 1
- PubSub not recognizing subscribers/peers, when peers are subscribed to same topic. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-libp2p.