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

fix: use unidirectional streams v0.3.x #79

Merged
merged 2 commits into from
Jun 4, 2020

Conversation

vasco-santos
Copy link
Collaborator

@vasco-santos vasco-santos commented Jun 3, 2020

This PR makes libp2p pubsub subsystem use unidirectional streams instead of bidirectional streams per discussion on ipfs/go-ipfs#7390.

More details about the reasoning for this can be found in https://discuss.libp2p.io/t/gossip-questions/257/6

This PR replicates #105 for the 0.3.x version range of libp2p-gossipsub

I have tested this change on all libp2p repos: js-libp2p, libp2p-daemon and interop and everything is working properly. The tests here need to be updated though, as a result of the tests being implemented considering a bidirectional stream.

Bear in mind that a lot of this "connection logic" can be abstracted. I did not worry about it and just followed what we already had in floodsub and gossipsub. Hopefully, after gossipsub@1.1, I want to create the libp2p pubsub interface and move/refactor the tests there and re-use most of them in all our router implementations.

Needs:

@codecov-commenter
Copy link

codecov-commenter commented Jun 3, 2020

Codecov Report

Merging #79 into v0.3.x will decrease coverage by 1.21%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           v0.3.x      #79      +/-   ##
==========================================
- Coverage   82.79%   81.57%   -1.22%     
==========================================
  Files           8        8              
  Lines         494      494              
==========================================
- Hits          409      403       -6     
- Misses         85       91       +6     
Impacted Files Coverage Δ
src/pubsub.js 82.38% <0.00%> (-3.78%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf62125...f04a4c6. Read the comment docs.

@vasco-santos
Copy link
Collaborator Author

vasco-santos commented Jun 3, 2020

Per ipfs/kubo#7390 (comment) this should be ready to go.

cc @achingbrain cannot ask direct review

@vasco-santos vasco-santos marked this pull request as ready for review June 3, 2020 16:14
@vasco-santos vasco-santos requested a review from wemeetagain June 3, 2020 16:14
@vasco-santos vasco-santos force-pushed the fix/use-unidirectional-streams-v0.3.x branch from 8c182ab to f04a4c6 Compare June 4, 2020 08:00
@vasco-santos vasco-santos merged commit 7e48ab9 into v0.3.x Jun 4, 2020
@vasco-santos vasco-santos deleted the fix/use-unidirectional-streams-v0.3.x branch June 4, 2020 08:08
@vasco-santos
Copy link
Collaborator Author

Released 0.3.1 with this fix

fryorcraken pushed a commit to fryorcraken/js-libp2p-gossipsub that referenced this pull request Aug 2, 2022
…Safe#79)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
fryorcraken pushed a commit to fryorcraken/js-libp2p-gossipsub that referenced this pull request Aug 2, 2022
## [3.0.3](libp2p/js-libp2p-pubsub@v3.0.2...v3.0.3) (2022-06-30)

### Trivial Changes

* **deps:** bump @libp2p/peer-collections from 1.0.3 to 2.0.0 ([ChainSafe#79](libp2p/js-libp2p-pubsub#79)) ([c066676](libp2p/js-libp2p-pubsub@c066676))
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.

3 participants