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

Conversation

cratelyn
Copy link

@cratelyn cratelyn commented May 20, 2024

NB: this backports hyperium#1701 to the v0.10.2 tonic release.


NB: DO NOT MERGE THIS PR. i'll tag this as v0.10.3-penumbra and pull this as a dependency into the penumbra monorepo.

@cratelyn cratelyn self-assigned this May 20, 2024
@cratelyn
Copy link
Author

cratelyn commented May 20, 2024

going to tweak this so it cleanly backports to 0.10. ci passed for the 0.11 release in my personal fork here.

#2 addresses ci lints that cropped up between the time of release and now. to clarify what is a backported fix, and what was maintenance related to ci, this pr is based upon the v0.10.2-ci-fixes-240520 branch.

@cratelyn cratelyn force-pushed the v0.10.2-backport-tonic#1701 branch 3 times, most recently from c9dbc73 to 6ecdd2f Compare May 20, 2024 21:21
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 v0.10.2-backport-tonic#1701 branch from 6ecdd2f to db355dd Compare May 20, 2024 22:43
@cratelyn cratelyn changed the base branch from v0.10.2-base to v0.10.2-ci-fixes-240520 May 20, 2024 22:45
@cratelyn cratelyn added this to the Sprint 7 milestone May 20, 2024
cratelyn added a commit that referenced this pull request May 20, 2024
this is the v0.10.2 release, with the additional extra changes:
- #1
- #2

the `-penumbra` prerelease suffix is used to clarify this from any
future upstream patch release.
cratelyn added a commit that referenced this pull request May 20, 2024
this is the v0.10.2 release, with the additional extra changes:
- #1
- #2

the `-penumbra` prerelease suffix is used to clarify this from any
future upstream patch release.
cratelyn added a commit that referenced this pull request May 20, 2024
this is the v0.10.2 release, with the additional extra changes:
- #1
- #2

the `-penumbra` prerelease suffix is used to clarify this from any
future upstream patch release.
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) (*)
```
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 cratelyn closed this Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant