-
Notifications
You must be signed in to change notification settings - Fork 1k
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
#1701
Merged
LucioFranco
merged 1 commit into
hyperium:master
from
cratelyn:kate/update-tonic-reflection-to-v1
May 29, 2024
Merged
tonic-reflection: 🆕 use v1
reflection protobuffer definitions
#1701
LucioFranco
merged 1 commit into
hyperium:master
from
cratelyn:kate/update-tonic-reflection-to-v1
May 29, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced May 16, 2024
cratelyn
force-pushed
the
kate/update-tonic-reflection-to-v1
branch
3 times, most recently
from
May 20, 2024 17:07
c8ad511
to
b364581
Compare
cratelyn
force-pushed
the
kate/update-tonic-reflection-to-v1
branch
2 times, most recently
from
May 20, 2024 17:45
55ead9f
to
b0e1bbb
Compare
debugged ci over in my fork here. pardon the noise, this should be ready for a review now! |
cratelyn
force-pushed
the
kate/update-tonic-reflection-to-v1
branch
from
May 20, 2024 17:57
b0e1bbb
to
d57f78d
Compare
This was referenced May 20, 2024
cratelyn
added a commit
to penumbra-zone/penumbra
that referenced
this pull request
May 20, 2024
fixes #4392. in #4392, we found an issue with gRPC reflection when recent versions of `grpcurl` were used to list supported endpoints. this was tracked down and fixed in #hyperium/tonic#1701, in collaboration with @conorsch. that pr targets the more recent 0.11 tonic release however, which we are not yet using. eventually we should upgrade to tonic 0.11 (see #4400). as a short-term measure, but we want to unblock engineers from Skip working on an integration with Penumbra. this commit patches the `tonic` dependencies used to point to a temporary fork of the `tonic` repo, where i have backported that patch (and some ci-related fixes) to the 0.10 release. see also: * hyperium/tonic#1701 * penumbra-zone/tonic#1 * penumbra-zone/tonic#2 * #4392 * #4400 --- checking that all transitive dependencies point to the patched version: ``` ; cargo tree | grep tonic │ └── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic-reflection v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) │ │ └── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic-web v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic-reflection v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic-web v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic-reflection v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic-web v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ```
1 task
conorsch
pushed a commit
to penumbra-zone/penumbra
that referenced
this pull request
May 21, 2024
fixes #4392. in #4392, we found an issue with gRPC reflection when recent versions of `grpcurl` were used to list supported endpoints. this was tracked down and fixed in #hyperium/tonic#1701, in collaboration with @conorsch. that pr targets the more recent 0.11 tonic release however, which we are not yet using. eventually we should upgrade to tonic 0.11 (see #4400). as a short-term measure, but we want to unblock engineers from Skip working on an integration with Penumbra. this commit patches the `tonic` dependencies used to point to a temporary fork of the `tonic` repo, where i have backported that patch (and some ci-related fixes) to the 0.10 release. see also: * hyperium/tonic#1701 * penumbra-zone/tonic#1 * penumbra-zone/tonic#2 * #4392 * #4400 --- checking that all transitive dependencies point to the patched version: ``` ; cargo tree | grep tonic │ └── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic-reflection v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) │ │ └── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic-web v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) │ │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) │ ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic-reflection v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic-web v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic-reflection v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic-web v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ├── tonic v0.10.2 (https://github.com/penumbra-zone/tonic.git?tag=v0.10.3-penumbra#db355dd7) (*) ```
@cratelyn sorry for the delay would you be able to resolve conflicts and then we can merge this? |
cratelyn
force-pushed
the
kate/update-tonic-reflection-to-v1
branch
from
May 21, 2024 14:44
d57f78d
to
85e0c77
Compare
@LucioFranco i sure can! 🙂 i've rebased this on the latest |
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. [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 <[email protected]>
cratelyn
force-pushed
the
kate/update-tonic-reflection-to-v1
branch
from
May 23, 2024 15:19
85e0c77
to
eef33cc
Compare
...and once more, rebased on |
LucioFranco
approved these changes
May 29, 2024
ttkjesper
added a commit
to ttkgames/tonic
that referenced
this pull request
Jul 10, 2024
While testing the new tonic 0.12 release, we discovered that hyperium#1701 upgraded the reflection protocol to `v1` from `v1alpha`. This breaks compatibility with popular gRPC debugging tools like `Postman` and `Kreya`, who only use the `v1alpha` protocol. Changes: * Expose V1Builder and V1AlphaBuilder for the different protocols * Add a type alias Builder for backwards compatibility * Move the descriptor parser outside the builder * Add basic tests for the different protocol versions
mkatychev
added a commit
to knox-networks/tonic
that referenced
this pull request
Aug 19, 2024
…ns (hyperium#1701)" This reverts commit b29f466.
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this fixes #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 usinggrpc.reflection.v1.ServerReflection
. (see fullstorydev/grpcurl#407)that leads to an error regarding an unexpected status code, like this:
this adds the v1 reflection definition to
tonic-reflection
, which was observed as fixing these issues for our gRPC endpoint.🩹 changes
changes in this commit are as follows:
vendors the
v1
definition ofreflection.proto
.renames the (deprecated)
v1alpha
definition toreflection_v1alpha.proto
.tonic_reflection::generated::grpc_reflection_v1
links to the generated Rust code (created by runningcargo run --package codegen
).tonic_reflection::generated::FILE_DESCRIPTOR_SET
is replaced bytonic_reflection::generated::{FILE_DESCRIPTOR_SET_V1ALPHA, FILE_DESCRIPTOR_SET_V1}
.tonic_reflection::pb
now contains namespacedtonic_reflection::pb::{v1alpha, v1}
submodules. (NB: this is a breaking change to the publictonic-reflection
API.)tonic_reflection::server
is updated to use the generatedtonic_reflection::pb::v1
code.fixes: #1685
x-ref: penumbra-zone/penumbra#4392