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

tonic-reflection: 🆕 use v1 reflection protobuffer definitions #1

Closed
wants to merge 1 commit into from

Conversation

cratelyn
Copy link
Owner

this fixes hyperium#1685.

in penumbra-zone/penumbra#4392, we observed that tonic servers do not properly support reflection when servicing a request sent by recent versions of [grpcurl], after v1.8.8 began using grpc.reflection.v1.ServerReflection. (see fullstorydev/grpcurl#407)

these lead to an error regarding an unexpected status code, like this:

❯ grpcurl --version
grpcurl v1.9.1

❯ grpcurl -vv grpc.testnet.penumbra.zone:443 list
Failed to list services: rpc error: code = Unknown desc = unexpected HTTP status code received from server: 405 (Method Not Allowed); malformed header: missing HTTP content-type

this adds the v1 reflection definition to tonic-reflection, which was observed as fixing these issues for our gRPC endpoint.

🩹 changes

changes in this commet are as follows:

  • vendors the v1 definition of reflection.proto.

  • renames the (deprecated) v1alpha definition to reflection_v1alpha.proto.

  • tonic_reflection::generated::grpc_reflection_v1 links to the generated Rust code (created by running cargo run --package codegen).

  • tonic_reflection::generated::FILE_DESCRIPTOR_SET is replaced by tonic_reflection::generated::{FILE_DESCRIPTOR_SET_V1ALPHA, FILE_DESCRIPTOR_SET_V1}.

  • tonic_reflection::pb now contains namespaced tonic_reflection::pb::{v1alpha, v1} submodules. (NB: this is a breaking change to the public tonic-reflection API.)

  • tonic_reflection::server is updated to use the generated tonic_reflection::pb::v1 code.


fixes: hyperium#1685
x-ref: penumbra-zone/penumbra#4392

Motivation

Solution

@cratelyn cratelyn force-pushed the kate/update-tonic-reflection-to-v1 branch 4 times, most recently from 55ead9f to b0e1bbb Compare May 20, 2024 17:45
this fixes hyperium#1685.

in penumbra-zone/penumbra#4392, we observed that tonic servers do not
properly support reflection when servicing a request sent by recent
versions of [`grpcurl`], after [v1.8.8] began using
`grpc.reflection.v1.ServerReflection`. (see fullstorydev/grpcurl#407)

these lead to an error regarding an unexpected status code, like this:

```
❯ grpcurl --version
grpcurl v1.9.1

❯ grpcurl -vv grpc.testnet.penumbra.zone:443 list
Failed to list services: rpc error: code = Unknown desc = unexpected HTTP status code received from server: 405 (Method Not Allowed); malformed header: missing HTTP content-type
```

this adds the v1 reflection definition to `tonic-reflection`, which was
observed as fixing these issues for our gRPC endpoint.

 ### 🩹 changes

changes in this commet are as follows:

* vendors the `v1` definition of [`reflection.proto`][proto].

* renames the (deprecated) `v1alpha` definition to
  `reflection_v1alpha.proto`.

* `tonic_reflection::generated::grpc_reflection_v1` links to the
  generated Rust code (created by running `cargo run --package codegen`).

* `tonic_reflection::generated::FILE_DESCRIPTOR_SET` is replaced by
  `tonic_reflection::generated::{FILE_DESCRIPTOR_SET_V1ALPHA, FILE_DESCRIPTOR_SET_V1}`.

* `tonic_reflection::pb` now contains namespaced
  `tonic_reflection::pb::{v1alpha, v1}` submodules. (**NB: this is a
  breaking change to the public `tonic-reflection` API.**)

* `tonic_reflection::server` is updated to use the generated
  `tonic_reflection::pb::v1` code.

* `HttpsUriWithoutTlsSupport` is now gated behind the `tls`
  feature flag, because it is not used otherwise.

[v1.8.8]: https://github.com/fullstorydev/grpcurl/releases/tag/v1.8.8
[proto]: https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1/reflection.proto
[grpcurl]: https://github.com/fullstorydev/grpcurl

---

fixes: hyperium#1685
x-ref: penumbra-zone/penumbra#4392
co-authored-by: Conor Schaefer <conor@penumbralabs.xyz>
@cratelyn cratelyn force-pushed the kate/update-tonic-reflection-to-v1 branch from b0e1bbb to d57f78d Compare May 20, 2024 17:57
@cratelyn
Copy link
Owner Author

ci is passing! i'm going to close this now. refer to the upstream pr.

@cratelyn cratelyn closed this May 20, 2024
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.

tonic-reflection is still using deprecated file descriptor set reflection_v1alpha1
1 participant