Bump prost, prost-types, and tonic (#18537)
* Bump prost+tonic and accommodate generated service changes * Unignore advisory * Fixup .proto error list
This commit is contained in:
@@ -18,8 +18,8 @@ enum-iterator = "0.6.0"
|
||||
flate2 = "1.0.20"
|
||||
goauth = "0.10.0"
|
||||
log = "0.4.14"
|
||||
prost = "0.7.0"
|
||||
prost-types = "0.7.0"
|
||||
prost = "0.8.0"
|
||||
prost-types = "0.8.0"
|
||||
rand_core = "0.6.3"
|
||||
serde = "1.0.126"
|
||||
serde_derive = "1.0.103"
|
||||
@@ -29,7 +29,7 @@ solana-storage-proto = { path = "../storage-proto", version = "=1.8.0" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "=1.8.0" }
|
||||
thiserror = "1.0"
|
||||
futures = "0.3.15"
|
||||
tonic = { version = "0.4.3", features = ["tls", "transport"] }
|
||||
tonic = { version = "0.5.0", features = ["tls", "transport"] }
|
||||
zstd = "0.9.0"
|
||||
|
||||
[lib]
|
||||
|
24
storage-bigtable/build-proto/Cargo.lock
generated
24
storage-bigtable/build-proto/Cargo.lock
generated
@@ -88,9 +88,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.9.0"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
|
||||
checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf"
|
||||
dependencies = [
|
||||
"either",
|
||||
]
|
||||
@@ -143,9 +143,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost"
|
||||
version = "0.7.0"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2"
|
||||
checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost-derive",
|
||||
@@ -153,9 +153,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost-build"
|
||||
version = "0.7.0"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3"
|
||||
checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"heck",
|
||||
@@ -171,9 +171,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost-derive"
|
||||
version = "0.7.0"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4"
|
||||
checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"itertools",
|
||||
@@ -184,9 +184,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost-types"
|
||||
version = "0.7.0"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb"
|
||||
checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost",
|
||||
@@ -313,9 +313,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tonic-build"
|
||||
version = "0.4.0"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c1e8546fd40d56d28089835c0a81bb396848103b00f888aea42d46eb5974df07"
|
||||
checksum = "25db9a497663a9a779693ef67b6e6aef8345b3d3ff8d50ef92eae6c88cb1e386"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"prost-build",
|
||||
|
@@ -12,4 +12,4 @@ version = "1.8.0"
|
||||
[workspace]
|
||||
|
||||
[dependencies]
|
||||
tonic-build = "0.4.0"
|
||||
tonic-build = "0.5.0"
|
||||
|
@@ -898,6 +898,7 @@ pub mod bigtable_client {
|
||||
#![allow(unused_variables, dead_code, missing_docs)]
|
||||
use tonic::codegen::*;
|
||||
#[doc = " Service for reading from and writing to existing Bigtable tables."]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct BigtableClient<T> {
|
||||
inner: tonic::client::Grpc<T>,
|
||||
}
|
||||
@@ -915,17 +916,43 @@ pub mod bigtable_client {
|
||||
impl<T> BigtableClient<T>
|
||||
where
|
||||
T: tonic::client::GrpcService<tonic::body::BoxBody>,
|
||||
T::ResponseBody: Body + HttpBody + Send + 'static,
|
||||
T::ResponseBody: Body + Send + Sync + 'static,
|
||||
T::Error: Into<StdError>,
|
||||
<T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
|
||||
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
|
||||
{
|
||||
pub fn new(inner: T) -> Self {
|
||||
let inner = tonic::client::Grpc::new(inner);
|
||||
Self { inner }
|
||||
}
|
||||
pub fn with_interceptor(inner: T, interceptor: impl Into<tonic::Interceptor>) -> Self {
|
||||
let inner = tonic::client::Grpc::with_interceptor(inner, interceptor);
|
||||
Self { inner }
|
||||
pub fn with_interceptor<F>(
|
||||
inner: T,
|
||||
interceptor: F,
|
||||
) -> BigtableClient<InterceptedService<T, F>>
|
||||
where
|
||||
F: FnMut(tonic::Request<()>) -> Result<tonic::Request<()>, tonic::Status>,
|
||||
T: Service<
|
||||
http::Request<tonic::body::BoxBody>,
|
||||
Response = http::Response<
|
||||
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
|
||||
>,
|
||||
>,
|
||||
<T as Service<http::Request<tonic::body::BoxBody>>>::Error:
|
||||
Into<StdError> + Send + Sync,
|
||||
{
|
||||
BigtableClient::new(InterceptedService::new(inner, interceptor))
|
||||
}
|
||||
#[doc = r" Compress requests with `gzip`."]
|
||||
#[doc = r""]
|
||||
#[doc = r" This requires the server to support it otherwise it might respond with an"]
|
||||
#[doc = r" error."]
|
||||
pub fn send_gzip(mut self) -> Self {
|
||||
self.inner = self.inner.send_gzip();
|
||||
self
|
||||
}
|
||||
#[doc = r" Enable decompressing responses with `gzip`."]
|
||||
pub fn accept_gzip(mut self) -> Self {
|
||||
self.inner = self.inner.accept_gzip();
|
||||
self
|
||||
}
|
||||
#[doc = " Streams back the contents of all requested rows in key order, optionally"]
|
||||
#[doc = " applying the same Reader filter to each. Depending on their size,"]
|
||||
@@ -1053,16 +1080,4 @@ pub mod bigtable_client {
|
||||
self.inner.unary(request.into_request(), path, codec).await
|
||||
}
|
||||
}
|
||||
impl<T: Clone> Clone for BigtableClient<T> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
inner: self.inner.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl<T> std::fmt::Debug for BigtableClient<T> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "BigtableClient {{ ... }}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,10 @@ use crate::{
|
||||
use log::*;
|
||||
use std::time::{Duration, Instant};
|
||||
use thiserror::Error;
|
||||
use tonic::{metadata::MetadataValue, transport::ClientTlsConfig, Request};
|
||||
use tonic::{
|
||||
codegen::InterceptedService, metadata::MetadataValue, transport::ClientTlsConfig, Request,
|
||||
Status,
|
||||
};
|
||||
|
||||
mod google {
|
||||
mod rpc {
|
||||
@@ -93,6 +96,7 @@ impl std::convert::From<tonic::Status> for Error {
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
type InterceptedRequestResult = std::result::Result<Request<()>, Status>;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct BigTableConnection {
|
||||
@@ -177,12 +181,12 @@ impl BigTableConnection {
|
||||
///
|
||||
/// Clients require `&mut self`, due to `Tonic::transport::Channel` limitations, however
|
||||
/// creating new clients is cheap and thus can be used as a work around for ease of use.
|
||||
pub fn client(&self) -> BigTable {
|
||||
let client = if let Some(access_token) = &self.access_token {
|
||||
let access_token = access_token.clone();
|
||||
bigtable_client::BigtableClient::with_interceptor(
|
||||
self.channel.clone(),
|
||||
move |mut req: Request<()>| {
|
||||
pub fn client(&self) -> BigTable<impl FnMut(Request<()>) -> InterceptedRequestResult> {
|
||||
let access_token = self.access_token.clone();
|
||||
let client = bigtable_client::BigtableClient::with_interceptor(
|
||||
self.channel.clone(),
|
||||
move |mut req: Request<()>| {
|
||||
if let Some(access_token) = &access_token {
|
||||
match MetadataValue::from_str(&access_token.get()) {
|
||||
Ok(authorization_header) => {
|
||||
req.metadata_mut()
|
||||
@@ -192,12 +196,10 @@ impl BigTableConnection {
|
||||
warn!("Failed to set authorization header: {}", err);
|
||||
}
|
||||
}
|
||||
Ok(req)
|
||||
},
|
||||
)
|
||||
} else {
|
||||
bigtable_client::BigtableClient::new(self.channel.clone())
|
||||
};
|
||||
}
|
||||
Ok(req)
|
||||
},
|
||||
);
|
||||
BigTable {
|
||||
access_token: self.access_token.clone(),
|
||||
client,
|
||||
@@ -239,14 +241,14 @@ impl BigTableConnection {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct BigTable {
|
||||
pub struct BigTable<F: FnMut(Request<()>) -> InterceptedRequestResult> {
|
||||
access_token: Option<AccessToken>,
|
||||
client: bigtable_client::BigtableClient<tonic::transport::Channel>,
|
||||
client: bigtable_client::BigtableClient<InterceptedService<tonic::transport::Channel, F>>,
|
||||
table_prefix: String,
|
||||
timeout: Option<Duration>,
|
||||
}
|
||||
|
||||
impl BigTable {
|
||||
impl<F: FnMut(Request<()>) -> InterceptedRequestResult> BigTable<F> {
|
||||
async fn decode_read_rows_response(
|
||||
&self,
|
||||
mut rrr: tonic::codec::Streaming<ReadRowsResponse>,
|
||||
|
Reference in New Issue
Block a user