Giter VIP home page Giter VIP logo

Comments (7)

justin0mcateer avatar justin0mcateer commented on August 20, 2024

I am investigating this issue. GossipSub ignores any new connections to a peer if it already has a connection to that peer:
https://github.com/ChainSafe/js-libp2p-gossipsub/blob/master/src/index.ts#L745

I am going to take a stab at making the stream management more robust by using the AddressSorter mechanism to determine which connection is more 'preferred'.

One would think that once the Relay connection dies, that GossipSub would attempt to re-connect to the peer via the remaining (WebRTC) connection. Not sure why that doesn't happen I will investigate that further today.

from js-libp2p-gossipsub.

Marcel-G avatar Marcel-G commented on August 20, 2024

I think this issue got a little worse since libp2p/js-libp2p#1890
Gossipsub will now not send over relayed (transient) connections and it does not use the upgraded webrtc connection as mentioned in this issue. Effectively it doesn't send at all

from js-libp2p-gossipsub.

justin0mcateer avatar justin0mcateer commented on August 20, 2024

I have managed to get it working, but it wasn't easy. The biggest problem is that GossipSub tries to connect in peer discovery, but it gets aborted because it is a transient connection. The default connection logic is that GossipSub basically never tries again.

One work around to this is to enable 'directPeers' in the GossipSub config, this will cause GossipSub to attempt to connect to the listed peers every heartbeat (1 second by default).

from js-libp2p-gossipsub.

Marcel-G avatar Marcel-G commented on August 20, 2024

@justin0mcateer does that workaround involve knowing the directPeers peer ids and multiaddrs up-front or do you have a way of doing this dynamically?

from js-libp2p-gossipsub.

Marcel-G avatar Marcel-G commented on August 20, 2024

@achingbrain I see that runOnTransientConnection was added to handlers, but is it somehow relevant for topologies also?
It feels a little strange we would get onConnect with a connection that cannot be used with the protocol

const topology = {
onConnect: this.onPeerConnected.bind(this),
onDisconnect: this.onPeerDisconnected.bind(this)
}

from js-libp2p-gossipsub.

justin0mcateer avatar justin0mcateer commented on August 20, 2024

from js-libp2p-gossipsub.

achingbrain avatar achingbrain commented on August 20, 2024

Please can you try with [email protected] (just released) - it has the fixes for protocol handlers & transient streams incorporated - by default gossipsub will no longer run over a transient stream, only direct connections.

from js-libp2p-gossipsub.

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.