Skip to content

Commit

Permalink
Include vendored proto definitions in the proto_descriptor file (#4425)
Browse files Browse the repository at this point in the history
## Describe your changes

This changes the proto build process to include cosmos/ibc-go proto
files in the vendored proto file list used to generate the
proto_descriptor file.

As-implemented, there are some duplicate paths that appear both as
dependencies of the penumbra protos and in ibc-go. The ibc-go protos
will be included first so the penumbra protos take priority. This
shouldn't be an issue in the way we currently use the protos but this
seems important to document for future reference.

## Issue ticket number and link

Closes #4422

## Checklist before requesting a review

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > Just changes gRPC reflection returns
  • Loading branch information
zbuc authored May 21, 2024
1 parent 82e1c54 commit 4d42f45
Show file tree
Hide file tree
Showing 60 changed files with 8,416 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bin/pclientd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ impl Opt {
.add_service(tonic_web::enable(stake_query_proxy))
.add_service(tonic_web::enable(compact_block_query_proxy))
.add_service(tonic_web::enable(tendermint_proxy_proxy))
// TODO: should we add the IBC services here as well? they will appear
// in reflection but not be available.
.add_service(tonic_web::enable(
tonic_reflection::server::Builder::configure()
.register_encoded_file_descriptor_set(
Expand Down
64 changes: 64 additions & 0 deletions crates/proto/src/gen/cosmos.base.query.v1beta1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/// PageRequest is to be embedded in gRPC request messages for efficient
/// pagination. Ex:
///
/// message SomeRequest {
/// Foo some_parameter = 1;
/// PageRequest pagination = 2;
/// }
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PageRequest {
/// key is a value returned in PageResponse.next_key to begin
/// querying the next page most efficiently. Only one of offset or key
/// should be set.
#[prost(bytes = "vec", tag = "1")]
pub key: ::prost::alloc::vec::Vec<u8>,
/// offset is a numeric offset that can be used when key is unavailable.
/// It is less efficient than using key. Only one of offset or key should
/// be set.
#[prost(uint64, tag = "2")]
pub offset: u64,
/// limit is the total number of results to be returned in the result page.
/// If left empty it will default to a value to be set by each app.
#[prost(uint64, tag = "3")]
pub limit: u64,
/// count_total is set to true to indicate that the result set should include
/// a count of the total number of items available for pagination in UIs.
/// count_total is only respected when offset is used. It is ignored when key
/// is set.
#[prost(bool, tag = "4")]
pub count_total: bool,
}
impl ::prost::Name for PageRequest {
const NAME: &'static str = "PageRequest";
const PACKAGE: &'static str = "cosmos.base.query.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.base.query.v1beta1.{}", Self::NAME)
}
}
/// PageResponse is to be embedded in gRPC response messages where the
/// corresponding request message has used PageRequest.
///
/// message SomeResponse {
/// repeated Bar results = 1;
/// PageResponse page = 2;
/// }
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PageResponse {
/// next_key is the key to be passed to PageRequest.key to
/// query the next page most efficiently
#[prost(bytes = "vec", tag = "1")]
pub next_key: ::prost::alloc::vec::Vec<u8>,
/// total is total number of results available if PageRequest.count_total
/// was set, its value is undefined otherwise
#[prost(uint64, tag = "2")]
pub total: u64,
}
impl ::prost::Name for PageResponse {
const NAME: &'static str = "PageResponse";
const PACKAGE: &'static str = "cosmos.base.query.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.base.query.v1beta1.{}", Self::NAME)
}
}
Loading

0 comments on commit 4d42f45

Please sign in to comment.