diff --git a/Cargo.lock b/Cargo.lock index 6d332fea875..4cb88319d38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1696,9 +1696,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.10.5" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defbb8a83d7f34cc8380751eeb892b825944222888aff18996ea7901f24aec88" +checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" dependencies = [ "serde", ] @@ -1860,6 +1860,7 @@ dependencies = [ "oasis-core-client", "oasis-core-runtime", "rand", + "serde_bytes", "simple-keyvalue-api", "tokio 0.1.22", ] diff --git a/client/Cargo.toml b/client/Cargo.toml index a3951d934e4..0337f5e7bb6 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] oasis-core-runtime = { path = "../runtime" } serde = { version = "1.0.116", features = ["derive"] } -serde_bytes = "~0.10" +serde_bytes = "0.11.5" serde_cbor = "0.11.1" anyhow = "1.0" thiserror = "1.0" diff --git a/client/src/enclave_rpc/transport.rs b/client/src/enclave_rpc/transport.rs index 047b14dcd46..5b8b9de93a7 100644 --- a/client/src/enclave_rpc/transport.rs +++ b/client/src/enclave_rpc/transport.rs @@ -85,7 +85,7 @@ impl Transport for GrpcTransport { }; match self.grpc_client.call_enclave(&req, Default::default()) { - Ok(rsp) => Box::new(rsp.map(|r| r.into()).map_err(|error| error.into())), + Ok(rsp) => Box::new(rsp.map(|r| r.into_vec()).map_err(|error| error.into())), Err(error) => Box::new(future::err(error.into())), } } diff --git a/client/src/transaction/client.rs b/client/src/transaction/client.rs index 05132a2c1e5..6deb3553d37 100644 --- a/client/src/transaction/client.rs +++ b/client/src/transaction/client.rs @@ -93,7 +93,7 @@ impl TxnClient { Ok(resp) => Box::new( resp.map(|r| { drop(span); - r.into() + r.into_vec() }) .map_err(|error| TxnClientError::CallFailed(format!("{}", error)).into()), ), diff --git a/keymanager-api-common/Cargo.toml b/keymanager-api-common/Cargo.toml index 2c9057b9b24..6b5099998ca 100644 --- a/keymanager-api-common/Cargo.toml +++ b/keymanager-api-common/Cargo.toml @@ -9,7 +9,7 @@ oasis-core-runtime = { path = "../runtime" } base64 = "0.12.3" serde = { version = "1.0.116", features = ["derive"] } -serde_bytes = "~0.10" +serde_bytes = "0.11.5" rustc-hex = "2.0.1" anyhow = "1.0" thiserror = "1.0" diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index a8f3dc9260e..b0585f13df0 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -13,7 +13,7 @@ slog-stdlog = "4.0.0" serde = { version = "1.0.116", features = ["derive"] } serde_cbor = "0.11.1" serde_json = "1.0.39" -serde_bytes = "~0.10" +serde_bytes = "0.11.5" serde_repr = "0.1.5" lazy_static = "1.3.0" crossbeam = "0.7.1" diff --git a/runtime/src/enclave_rpc/demux.rs b/runtime/src/enclave_rpc/demux.rs index 233a2b88181..93b2e6c97a4 100644 --- a/runtime/src/enclave_rpc/demux.rs +++ b/runtime/src/enclave_rpc/demux.rs @@ -96,7 +96,7 @@ impl Demux { let id = frame.session.clone(); let untrusted_plaintext = frame.untrusted_plaintext.clone(); - if let Some(enriched_session) = self.sessions.get_mut(&id) { + if let Some(enriched_session) = self.sessions.get_mut(&id.into()) { match enriched_session .session .process_data(frame.payload, writer) diff --git a/runtime/src/enclave_rpc/types.rs b/runtime/src/enclave_rpc/types.rs index 6494d3ef9f0..fb898de8595 100644 --- a/runtime/src/enclave_rpc/types.rs +++ b/runtime/src/enclave_rpc/types.rs @@ -25,7 +25,6 @@ impl SessionID { /// Frame. #[derive(Debug, Serialize, Deserialize)] pub struct Frame { - #[serde(with = "serde_bytes")] pub session: SessionID, // The `untrusted_plaintext` field is only a temporary workaround until // the snow library supports encrypting the payload with authenticated diff --git a/runtime/src/transaction/types.rs b/runtime/src/transaction/types.rs index cbc76ae0627..ea89e8e67ef 100644 --- a/runtime/src/transaction/types.rs +++ b/runtime/src/transaction/types.rs @@ -58,7 +58,8 @@ mod batch_serialize { where D: Deserializer<'de>, { - Vec::::deserialize(deserializer).map(|v| v.into_iter().map(|e| e.into()).collect()) + Vec::::deserialize(deserializer) + .map(|v| v.into_iter().map(ByteBuf::into_vec).collect()) } } diff --git a/tests/clients/simple-keyvalue/Cargo.toml b/tests/clients/simple-keyvalue/Cargo.toml index 904b8e5b9d6..b46c4236d4a 100644 --- a/tests/clients/simple-keyvalue/Cargo.toml +++ b/tests/clients/simple-keyvalue/Cargo.toml @@ -15,3 +15,4 @@ grpcio = "0.4.6" io-context = "0.2.0" rand = "0.7.3" tokio = "0.1.17" +serde_bytes = "0.11.5" diff --git a/tests/clients/simple-keyvalue/src/main.rs b/tests/clients/simple-keyvalue/src/main.rs index b8e540c418f..669b1d86a81 100644 --- a/tests/clients/simple-keyvalue/src/main.rs +++ b/tests/clients/simple-keyvalue/src/main.rs @@ -13,6 +13,7 @@ use clap::{App, Arg}; use grpcio::EnvBuilder; use io_context::Context; use rand::{rngs::StdRng, Rng, SeedableRng}; +use serde_bytes::ByteBuf; use tokio::runtime::Runtime; use oasis_core_client::{ @@ -229,7 +230,7 @@ fn main() { round_max: latest_round, conditions: vec![QueryCondition { key: b"kv_op".to_vec(), - values: vec![b"insert".to_vec().into()], + values: vec![ByteBuf::from(b"insert".to_vec())], }], limit: 0, };