-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: use ws-star-multi instead of ws-star #1793
Conversation
@mkg20001 please can I get some context? We can already pass multiple discovery/transports to libp2p, what are the benefits of using this module? |
@alanshaw It allows passing multiple ws-star servers in a way that makes the node only fail to start if all servers are down (or optionally never at all), as compared to previous behavior where the app would fail if any server was down |
IIUC this is a fix for ipfs-shipyard/ipfs-share-files#63 (comment) (cc @olizilla @fsdiogo) and #1619 (comment) (cc @satazor) |
is this superseded by libp2p/js-libp2p-websocket-star#70 ? |
@parkan It depends. This is a fix that could be released now. Stardust still needs to be polished which could take a week or two. |
Yes, that is preferable! Ok so, the other thing I don't understand is why this is implemented as a separate module and not as a fix to |
Because that would only allow for ignoring any down server or none This module "listens" on Later it swaps |
I can see how that's true if we were to "fix" |
Libp2p has no concept of an "optional listening address",so that would need to get invented first. Additionally there is this problem that not listening on TCP for ex. disables the ability to dial |
We've had some discussion that would allow us to support optional listening addresses in libp2p, and I think that it's reasonable for us to get this implemented relatively soon. The idea relates to https://github.com/libp2p/interface-transport/issues/41, which would support an array of listening addresses. The idea being, that we could pass additional options to the switch, and subsequently to the transports to determine our level of tolerance on listening. So if configured to be very tolerant, we could end up failing to listening to any addresses but still continue to run. Some additional context (edited for ease of reading) from the comments around this discussion:
|
@alanshaw @jacobheun the idea of supporting this across a variety of transports is sound, though the semantics of failing to bind a port are pretty different for ws-star vs TCP so the behavior would need to be configurable however, the issue described in #1619 (and fixed in this PR) is a showstopper bug that prevents multiple prospective users from shipping otherwise working js-ipfs code, and I am having a very hard time explaining to them why we haven't put a fix in place (especially given that we've had this PR up for almost a month) -- I would say this is among the top 3 blockers to js-ipfs adoption, and by far the easiest of those to fix I could advise them to inject ws-star-multi themselves, but I am concerned that it will again drift out of sync with js-ipfs core and break in a subsequent update would it be possible to ship this as is, with a note to re-evaluate once we have a comprehensive, configurable solution across libp2p? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkg20001 please could you also put a comment in the code (as @parkan suggested) in both instances where libp2p-websocket-star-multi
is used that this can be removed once libp2p supports optional listening addresses along with a link to the issue.
This'll unblock @parkan and others right now and gives the libp2p guys some breathing room to get it implemented in the mean time.
Btw, should I move ws-star-multi to the libp2p org? |
Co-Authored-By: mkg20001 <mkg20001@gmail.com>
6d8b6e5
to
ff672fd
Compare
Added changes, LGTM |
Note that while ws-star-multi should fix the "server if offline = app crashes" kinds of issues it still leaves the infrastructural issues of overloaded and slow servers untouched. I'd prefer if a switch to stardust would be made, at least until rendezvous & circuit-relay are ready for replacing it. |
Merging as windows CI failure is unrelated and fixed by #1834 |
@alanshaw big up for including this in the patch release! https://github.com/ipfs/js-ipfs/releases/tag/v0.34.2 |
js-ipfs v0.32.2 solved issue mentioned in ipfs-shipyard/ipfs-share-files#63 (comment) by switching to `libp2p-websocket-star-multi` (details in ipfs/js-ipfs#1793).
This replaces ws-star with ws-star-multi transparently
resolves #1619