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

[WIP] p2p: add AsyncSecretConnection based on tokio #1464

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tony-iqlusion
Copy link
Collaborator

Adds an async version of SecretConnection, currently specialized to TCP-based connections exclusively.

This requires quite a bit of duplication, especially since the existing SecretConnection implementation is entirely built around std::io traits, which are unusable in an async context.

The implementation returns whole chunks as a Vec<u8>, which avoids the need to "double buffer" incoming data as ownership of such data is passed directly to the caller upon completing a read.

  • Referenced an issue explaining the need for the change
  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Added entry in .changelog/

Adds an `async` version of `SecretConnection`, currently specialized to
TCP-based connections exclusively.

This requires quite a bit of duplication, especially since the existing
`SecretConnection` implementation is entirely built around `std::io`
traits, which are unusable in an async context.

The implementation returns whole chunks as a `Vec<u8>`, which avoids the
need to "double buffer" incoming data as ownership of such data is
passed directly to the caller upon completing a read.
@tony-iqlusion
Copy link
Collaborator Author

Note: I'd like to move TMKMS to an async architecture, which would make it better at concurrency (e.g. supporting multiple YubiHSMs, and pipelining extension signing requests to multiple YubiHSMs) but that's difficult to do when the entire request layer is synchronous.

I thought I'd do this in an additive manner for now, rather than attempting to make any breaking changes to tendermint-p2p.

This implementation is currently untested. I'd like to get some tests in to show it can at least interop against the synchronous SecretConnection server.

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.

1 participant