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

tendermint-proto: (re-)add grpc feature and server definitions #1227

Closed
wants to merge 1 commit into from

Conversation

tony-iqlusion
Copy link
Collaborator

@tony-iqlusion tony-iqlusion commented Nov 10, 2022

See #1225.

Adds a "grpc" feature to the crate along with gRPC server definitions for the "privval" interface used by e.g. TMKMS to support remote signing.

These were originally added in #1137 by @tomtau but lost in the shuffle of Tendermint v0.35-related changes.

They have been updated to use tonic v0.8, which the tendermint-proto crate updated to after the original #1137 PR landed.

  • 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/

@codecov-commenter
Copy link

Codecov Report

Merging #1227 (f0bad92) into main (d102af4) will decrease coverage by 0.1%.
The diff coverage is n/a.

❗ Current head f0bad92 differs from pull request most recent head 474b1bc. Consider uploading reports for the commit 474b1bc to get more accurate results

@@           Coverage Diff           @@
##            main   #1227     +/-   ##
=======================================
- Coverage   64.2%   64.1%   -0.2%     
=======================================
  Files        244     244             
  Lines      21364   21411     +47     
=======================================
- Hits       13734   13730      -4     
- Misses      7630    7681     +51     
Impacted Files Coverage Δ
proto/src/lib.rs 100.0% <ø> (ø)
rpc/src/response.rs 48.1% <0.0%> (-11.4%) ⬇️
testgen/src/vote.rs 84.0% <0.0%> (-1.7%) ⬇️
testgen/src/commit.rs 90.6% <0.0%> (-0.7%) ⬇️
testgen/src/header.rs 83.5% <0.0%> (-0.6%) ⬇️
light-client-verifier/src/types.rs 38.4% <0.0%> (-0.3%) ⬇️
tendermint/src/node.rs 63.8% <0.0%> (-0.2%) ⬇️
abci/src/server.rs 9.4% <0.0%> (+0.1%) ⬆️
tendermint/src/timeout.rs 85.9% <0.0%> (+1.7%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tony-iqlusion tony-iqlusion marked this pull request as ready for review November 10, 2022 19:06
@tony-iqlusion tony-iqlusion changed the title [WIP] tendermint-proto: (re-)add grpc feature and server definitions tendermint-proto: (re-)add grpc feature and server definitions Nov 10, 2022
Adds a "grpc" feature to the crate along with gRPC server definitions
for the "privval" interface used by e.g. TMKMS to support remote
signing.

These were originally added in #1137 but lost in the shuffle of
Tendermint v0.35-related changes.

They have been updated to use `tonic` v0.8, which the `tendermint-proto`
crate updated to after the original #1137 PR landed.
Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

The current main seems to be based on v0.34.x: https://github.com/informalsystems/tendermint-rs/blob/main/proto/src/tendermint.rs#L65 which doesn't have the gRPC privval support (those service definitions don't exist here: https://github.com/tendermint/tendermint/blob/v0.34.23/proto/tendermint/privval/types.proto).

I'm not sure whether there's a plan to backport it to 0.34 and have a release with it.

@tony-iqlusion
Copy link
Collaborator Author

Oh wow, so it is. That's unfortunate

@tony-iqlusion
Copy link
Collaborator Author

@thanethomson any idea if/when the gRPC privval interface will get re-added upstream in Tendermint?

@thanethomson
Copy link
Contributor

any idea if/when the gRPC privval interface will get re-added upstream in Tendermint?

It's in our prioritized backlog. We have a bunch of burning, high-priority issues to deal with this quarter (see this board), so those things take precedence. As we have capacity we pick things off the prioritized backlog to work on.

@tony-iqlusion
Copy link
Collaborator Author

Aha cool, here's the relevant issue: tendermint/tendermint#9256

Copy link
Contributor

@mzabaluev mzabaluev left a comment

Choose a reason for hiding this comment

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

Looks good to me, with some minor comments.

@@ -1,6 +1,6 @@
//! tendermint-proto library gives the developer access to the Tendermint proto-defined structs.

#![no_std]
#![cfg_attr(not(feature = "grpc"), no_std)]
Copy link
Contributor

Choose a reason for hiding this comment

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

This effect could be made explicitly seen also in Cargo.toml by making this conditional on the "std" feature, which "grpc" would depend on. In practice though, "grpc" is the only feature that requires std for now.

Comment on lines +85 to +86
.build_client(false)
.build_server(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

What if we want to enable client-side gRPC bindings later, and feature-gate client and server sides independently? I think it's possible to introduce "grpc-server" and "grpc-client" features later, with "grpc" dependent on both, so this would be backward compatible.

@mzabaluev
Copy link
Contributor

If this is still needed, can you rebase it and fix the conflicts?

@romac romac added this to the 0.33.0 milestone Jul 13, 2023
@romac romac mentioned this pull request Jul 13, 2023
3 tasks
@tony-iqlusion
Copy link
Collaborator Author

@mzabaluev it's blocked on tendermint/tendermint#9256 (which I now see was closed as stale).

I would definitely still love to see all of this happen, if possible though.

@mzabaluev
Copy link
Contributor

Should this be closed in favor of #1338?

@tony-iqlusion
Copy link
Collaborator Author

Sure

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.

6 participants