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

p2p: use async bipipe #853

Merged
merged 8 commits into from
Apr 14, 2021
Merged

p2p: use async bipipe #853

merged 8 commits into from
Apr 14, 2021

Conversation

melekes
Copy link
Contributor

@melekes melekes commented Mar 31, 2021

Closes #841

A copy of the pipe crate (https://github.com/arcnmx/pipe-rs) is added to the tendermint-p2p crate. I had to add a new method - async_bipipe_buffered to make the handshake tests always pass. async_bipipe_buffered method uses the unbounded channel (rather than the blocking one) for communication - hence the prefix. Note I also removed the methods and structures from pipe clone that we're not using at the moment.

  • Referenced an issue explaining the need for the change
  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG.md

Closes #841

I had to clone the original crate to introduce 4 additional methods:

1. async_pipe
2. async_pipe_buffered
3. async_bipipe
4. async_bipipe_buffered

The difference is they all use unbounded `crossbeam` channel rather then
`bounded(0)` which makes them async.

And we need pipe to be async because of how the handshake is written
currently.
@melekes melekes self-assigned this Mar 31, 2021
@melekes
Copy link
Contributor Author

melekes commented Mar 31, 2021

I will see if this could be upstreamed (I doubt that, but I will try nonetheless) arcnmx/pipe-rs#10

@xla
Copy link
Contributor

xla commented Mar 31, 2021

I will see if this could be upstreamed (I doubt that, but I will try nonetheless) arcnmx/pipe-rs#10

If we have doubts that it will be upstream-ed should we just maintain a pipe implementation in the p2p package for our testing purposes?

@thanethomson
Copy link
Contributor

If we have doubts that it will be upstream-ed should we just maintain a pipe implementation in the p2p package for our testing purposes?

Yeah this makes sense to me 👍

@melekes
Copy link
Contributor Author

melekes commented Apr 7, 2021

I will see if this could be upstreamed (I doubt that, but I will try nonetheless) arcnmx/pipe-rs#10

If we have doubts that it will be upstream-ed should we just maintain a pipe implementation in the p2p package for our testing purposes?

done 👍

p2p/src/lib.rs Outdated Show resolved Hide resolved
p2p/Cargo.toml Outdated Show resolved Hide resolved
@melekes melekes requested review from xla and thanethomson April 12, 2021 17:15
xla
xla previously approved these changes Apr 13, 2021
Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛋 🐻 🅰️ 🙌

p2p/src/secret_connection/pipe.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌭 🎃 🍘 🗽

@melekes melekes merged commit 4fa065b into master Apr 14, 2021
@melekes melekes deleted the anton/841-non-deterministic-failure branch April 14, 2021 12:40
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.

Non-deterministic hanging test in tendermint_p2p::secret_connection
3 participants