From aa195300f55f3d62c68acc2bfcd9495ad67f2b6a Mon Sep 17 00:00:00 2001 From: ptrus Date: Mon, 21 Sep 2020 10:14:32 +0200 Subject: [PATCH 1/4] rust/serde_cbor: bump to 0.11.1 --- .github/dependabot.yml | 1 - Cargo.lock | 5 ++--- client/Cargo.toml | 2 +- runtime/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2198c0b6e9d..837f32b0957 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -60,4 +60,3 @@ updates: - dependency-name: intrusive-collections - dependency-name: serde - dependency-name: serde_bytes - - dependency-name: serde_cbor diff --git a/Cargo.lock b/Cargo.lock index 242825ac5e7..e34224bd69e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1706,11 +1706,10 @@ dependencies = [ [[package]] name = "serde_cbor" -version = "0.10.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7081ed758ec726a6ed8ee7e92f5d3f6e6f8c3901b1f972e3a4a2f2599fad14f" +checksum = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" dependencies = [ - "byteorder", "half", "serde", ] diff --git a/client/Cargo.toml b/client/Cargo.toml index cb6dfd4dc3d..ca7f221b538 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -9,7 +9,7 @@ oasis-core-runtime = { path = "../runtime" } serde = "1.0.71" serde_bytes = "~0.10" serde_derive = "1.0" -serde_cbor = "0.10.2" +serde_cbor = "0.11.1" anyhow = "1.0" thiserror = "1.0" futures = "0.1.25" diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 36f84645dd6..2868b14525c 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -12,7 +12,7 @@ slog-scope = "4.1.1" slog-stdlog = "4.0.0" serde = "1.0.71" serde_derive = "1.0" -serde_cbor = "0.10.2" +serde_cbor = "0.11.1" serde_json = "1.0.39" serde_bytes = "~0.10" serde_repr = "0.1.5" From 07e1cfd51da757a4789d642bf8eb533175598926 Mon Sep 17 00:00:00 2001 From: ptrus Date: Mon, 21 Sep 2020 11:00:36 +0200 Subject: [PATCH 2/4] rust/serde: bump to 1.0.116 Also removes explicit serde_derive crate, now used via the "derive" feature on the serde crate. --- .github/dependabot.yml | 1 - Cargo.lock | 12 +++++------- client/Cargo.toml | 3 +-- client/src/enclave_rpc/api/enclaverpc.rs | 2 +- client/src/transaction/api/client.rs | 2 +- client/src/transaction/api/storage.rs | 2 +- keymanager-api-common/Cargo.toml | 3 +-- keymanager-api-common/src/api.rs | 2 +- runtime/Cargo.toml | 3 +-- runtime/src/common/crypto/signature.rs | 2 +- runtime/src/common/registry.rs | 2 +- runtime/src/common/roothash.rs | 2 +- runtime/src/common/sgx/avr.rs | 2 +- runtime/src/enclave_rpc/session.rs | 2 +- runtime/src/enclave_rpc/types.rs | 2 +- runtime/src/lib.rs | 1 - runtime/src/storage/mkvs/interop/rpc.rs | 3 +-- runtime/src/storage/mkvs/mod.rs | 3 +-- runtime/src/storage/mkvs/sync/proof.rs | 2 +- runtime/src/storage/mkvs/sync/sync.rs | 2 +- runtime/src/storage/mkvs/tests/mod.rs | 3 +-- runtime/src/storage/mkvs/tree/node.rs | 2 +- runtime/src/transaction/dispatcher.rs | 2 +- runtime/src/transaction/rwset.rs | 2 +- runtime/src/transaction/tree.rs | 3 +-- runtime/src/transaction/types.rs | 2 +- runtime/src/types.rs | 3 +-- tests/runtimes/simple-keyvalue/api/Cargo.toml | 3 +-- tests/runtimes/simple-keyvalue/api/src/api.rs | 2 +- tests/runtimes/simple-keyvalue/api/src/lib.rs | 1 - tools/Cargo.toml | 3 +-- tools/bin/cargo-elf2sgxs.rs | 1 - tools/src/cargo.rs | 2 +- tools/src/lib.rs | 1 - 34 files changed, 33 insertions(+), 50 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 837f32b0957..5e7fa4a9222 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -58,5 +58,4 @@ updates: - dependency-name: futures - dependency-name: grpcio - dependency-name: intrusive-collections - - dependency-name: serde - dependency-name: serde_bytes diff --git a/Cargo.lock b/Cargo.lock index e34224bd69e..6d332fea875 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1151,7 +1151,6 @@ dependencies = [ "serde", "serde_bytes", "serde_cbor", - "serde_derive", "thiserror", "tokio 0.1.22", "tokio-current-thread", @@ -1170,7 +1169,6 @@ dependencies = [ "rustc-hex", "serde", "serde_bytes", - "serde_derive", "thiserror", "x25519-dalek 1.1.0", ] @@ -1236,7 +1234,6 @@ dependencies = [ "serde", "serde_bytes", "serde_cbor", - "serde_derive", "serde_json", "serde_repr", "sgx-isa", @@ -1279,7 +1276,6 @@ dependencies = [ "anyhow", "clap", "serde", - "serde_derive", "thiserror", "toml", ] @@ -1691,9 +1687,12 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.115" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54c9a88f2da7238af84b5101443f0c0d0a3bbdc455e34a5c9497b1903ed55d5" +checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5" +dependencies = [ + "serde_derive", +] [[package]] name = "serde_bytes" @@ -1849,7 +1848,6 @@ version = "0.3.0-alpha" dependencies = [ "oasis-core-runtime", "serde", - "serde_derive", ] [[package]] diff --git a/client/Cargo.toml b/client/Cargo.toml index ca7f221b538..a3951d934e4 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -6,9 +6,8 @@ edition = "2018" [dependencies] oasis-core-runtime = { path = "../runtime" } -serde = "1.0.71" +serde = { version = "1.0.116", features = ["derive"] } serde_bytes = "~0.10" -serde_derive = "1.0" serde_cbor = "0.11.1" anyhow = "1.0" thiserror = "1.0" diff --git a/client/src/enclave_rpc/api/enclaverpc.rs b/client/src/enclave_rpc/api/enclaverpc.rs index 19fea6f477b..164b18a728d 100644 --- a/client/src/enclave_rpc/api/enclaverpc.rs +++ b/client/src/enclave_rpc/api/enclaverpc.rs @@ -1,7 +1,7 @@ //! Client for service defined in go/runtime/enclaverpc/api. use grpcio::{CallOption, Channel, Client, ClientUnaryReceiver, Result}; +use serde::{Deserialize, Serialize}; use serde_bytes::ByteBuf; -use serde_derive::{Deserialize, Serialize}; use oasis_core_runtime::common::runtime::RuntimeId; diff --git a/client/src/transaction/api/client.rs b/client/src/transaction/api/client.rs index 79f223eb12d..f13c2a7a447 100644 --- a/client/src/transaction/api/client.rs +++ b/client/src/transaction/api/client.rs @@ -1,7 +1,7 @@ //! Client for service defined in go/runtime/client/api. use grpcio::{CallOption, Channel, Client, ClientSStreamReceiver, ClientUnaryReceiver, Result}; +use serde::{Deserialize, Serialize}; use serde_bytes::ByteBuf; -use serde_derive::{Deserialize, Serialize}; use oasis_core_runtime::{ common::{ diff --git a/client/src/transaction/api/storage.rs b/client/src/transaction/api/storage.rs index e76154e5de5..251f6aa4eea 100644 --- a/client/src/transaction/api/storage.rs +++ b/client/src/transaction/api/storage.rs @@ -1,7 +1,7 @@ //! Client for service defined in go/storage/api. use grpcio::{CallOption, Channel, Client, Result}; +use serde::{Deserialize, Serialize}; use serde_cbor::value::Value; -use serde_derive::{Deserialize, Serialize}; use oasis_core_runtime::{ common::{crypto::hash::Hash, roothash::Namespace}, diff --git a/keymanager-api-common/Cargo.toml b/keymanager-api-common/Cargo.toml index 234a35b3de0..2c9057b9b24 100644 --- a/keymanager-api-common/Cargo.toml +++ b/keymanager-api-common/Cargo.toml @@ -8,8 +8,7 @@ edition = "2018" oasis-core-runtime = { path = "../runtime" } base64 = "0.12.3" -serde = "1.0.71" -serde_derive = "1.0" +serde = { version = "1.0.116", features = ["derive"] } serde_bytes = "~0.10" rustc-hex = "2.0.1" anyhow = "1.0" diff --git a/keymanager-api-common/src/api.rs b/keymanager-api-common/src/api.rs index e59fabe9eba..b29c1bca77f 100644 --- a/keymanager-api-common/src/api.rs +++ b/keymanager-api-common/src/api.rs @@ -5,7 +5,7 @@ use std::{ use base64; use rand::{rngs::OsRng, Rng}; -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; use thiserror::Error; use x25519_dalek; diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 2868b14525c..a8f3dc9260e 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -10,8 +10,7 @@ slog = "2.4.1" slog-json = "2.3.0" slog-scope = "4.1.1" slog-stdlog = "4.0.0" -serde = "1.0.71" -serde_derive = "1.0" +serde = { version = "1.0.116", features = ["derive"] } serde_cbor = "0.11.1" serde_json = "1.0.39" serde_bytes = "~0.10" diff --git a/runtime/src/common/crypto/signature.rs b/runtime/src/common/crypto/signature.rs index ffe32193928..fa285194e0d 100644 --- a/runtime/src/common/crypto/signature.rs +++ b/runtime/src/common/crypto/signature.rs @@ -5,7 +5,7 @@ use anyhow::Result; use byteorder::{LittleEndian, ReadBytesExt}; use ed25519_dalek::{self, ed25519::signature::Signature as _, Signer as _, Verifier}; use rand::rngs::OsRng; -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; use thiserror::Error; use zeroize::Zeroize; diff --git a/runtime/src/common/registry.rs b/runtime/src/common/registry.rs index 949854e9e53..5a895327745 100644 --- a/runtime/src/common/registry.rs +++ b/runtime/src/common/registry.rs @@ -8,7 +8,7 @@ use super::{ super::storage::mkvs::WriteLog, crypto::{hash, signature::SignatureBundle}, }; -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; /// Runtime genesis information that is used to initialize runtime state in the first block. #[derive(Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] diff --git a/runtime/src/common/roothash.rs b/runtime/src/common/roothash.rs index f80e0025fe1..86a76d6e954 100644 --- a/runtime/src/common/roothash.rs +++ b/runtime/src/common/roothash.rs @@ -4,7 +4,7 @@ //! //! This **MUST** be kept in sync with go/roothash/api/block. //! -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; use serde_repr::*; use super::{ diff --git a/runtime/src/common/sgx/avr.rs b/runtime/src/common/sgx/avr.rs index 82f70f3e3f6..871248b199f 100644 --- a/runtime/src/common/sgx/avr.rs +++ b/runtime/src/common/sgx/avr.rs @@ -7,7 +7,7 @@ use byteorder::{LittleEndian, ReadBytesExt}; use chrono::prelude::*; use pem::parse_many; use percent_encoding; -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; use serde_json; use sgx_isa::{AttributesFlags, Report}; use thiserror::Error; diff --git a/runtime/src/enclave_rpc/session.rs b/runtime/src/enclave_rpc/session.rs index c6a7c97cac7..77cafb8b3c4 100644 --- a/runtime/src/enclave_rpc/session.rs +++ b/runtime/src/enclave_rpc/session.rs @@ -2,7 +2,7 @@ use std::{collections::HashSet, io::Write, mem, sync::Arc}; use anyhow::Result; -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; use snow; use thiserror::Error; diff --git a/runtime/src/enclave_rpc/types.rs b/runtime/src/enclave_rpc/types.rs index 06723920b5c..6494d3ef9f0 100644 --- a/runtime/src/enclave_rpc/types.rs +++ b/runtime/src/enclave_rpc/types.rs @@ -1,6 +1,6 @@ //! RPC protocol types. use rand::{rngs::OsRng, Rng}; -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; use crate::common::cbor::Value; diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 2933d93beb8..722d4af8e91 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -24,7 +24,6 @@ extern crate crossbeam; extern crate lazy_static; extern crate serde_bytes; extern crate serde_cbor; -extern crate serde_derive; extern crate serde_json; extern crate serde_repr; extern crate slog_json; diff --git a/runtime/src/storage/mkvs/interop/rpc.rs b/runtime/src/storage/mkvs/interop/rpc.rs index 38d5df1cf1b..5ca2001939c 100644 --- a/runtime/src/storage/mkvs/interop/rpc.rs +++ b/runtime/src/storage/mkvs/interop/rpc.rs @@ -1,7 +1,6 @@ use grpcio::{CallOption, Channel, Client, Error, Marshaller, Method, MethodType, Result}; -use serde::{de::DeserializeOwned, Serialize}; +use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_cbor::Value; -use serde_derive::{Deserialize, Serialize}; use crate::{ common::{cbor, crypto::hash::Hash, roothash::Namespace}, diff --git a/runtime/src/storage/mkvs/mod.rs b/runtime/src/storage/mkvs/mod.rs index 45c81e42063..403bd6c57f3 100644 --- a/runtime/src/storage/mkvs/mod.rs +++ b/runtime/src/storage/mkvs/mod.rs @@ -4,9 +4,8 @@ use std::ops::{Deref, DerefMut}; use anyhow::Result; use base64; use io_context::Context; -use serde::{self, ser::SerializeSeq, Serializer}; +use serde::{self, ser::SerializeSeq, Deserialize, Serialize, Serializer}; use serde_bytes::Bytes; -use serde_derive::{Deserialize, Serialize}; use crate::common::{crypto::hash::Hash, roothash::Namespace}; diff --git a/runtime/src/storage/mkvs/sync/proof.rs b/runtime/src/storage/mkvs/sync/proof.rs index a13bb147322..d61d7488957 100644 --- a/runtime/src/storage/mkvs/sync/proof.rs +++ b/runtime/src/storage/mkvs/sync/proof.rs @@ -3,8 +3,8 @@ use std::ops::{Deref, DerefMut}; use anyhow::{anyhow, Result}; use arbitrary::Arbitrary; use io_context::Context; +use serde::{Deserialize, Serialize}; use serde_bytes; -use serde_derive::{Deserialize, Serialize}; use crate::{ common::crypto::hash::Hash, diff --git a/runtime/src/storage/mkvs/sync/sync.rs b/runtime/src/storage/mkvs/sync/sync.rs index 670b1993f9c..803f33db3b7 100644 --- a/runtime/src/storage/mkvs/sync/sync.rs +++ b/runtime/src/storage/mkvs/sync/sync.rs @@ -2,8 +2,8 @@ use std::any::Any; use anyhow::Result; use io_context::Context; +use serde::{Deserialize, Serialize}; use serde_bytes; -use serde_derive::{Deserialize, Serialize}; use crate::{ common::crypto::hash::Hash, diff --git a/runtime/src/storage/mkvs/tests/mod.rs b/runtime/src/storage/mkvs/tests/mod.rs index f197e30d1d7..33963d95e0e 100644 --- a/runtime/src/storage/mkvs/tests/mod.rs +++ b/runtime/src/storage/mkvs/tests/mod.rs @@ -2,8 +2,7 @@ use std::fmt; use base64; -use serde; -use serde_derive::Deserialize; +use serde::{self, Deserialize}; /// Tree operation kind. #[derive(Clone, Debug, Deserialize)] diff --git a/runtime/src/storage/mkvs/tree/node.rs b/runtime/src/storage/mkvs/tree/node.rs index 7bcdd16491b..8add6a7e967 100644 --- a/runtime/src/storage/mkvs/tree/node.rs +++ b/runtime/src/storage/mkvs/tree/node.rs @@ -1,6 +1,6 @@ use std::{cell::RefCell, rc::Rc}; -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; use crate::{ common::{crypto::hash::Hash, roothash::Namespace}, diff --git a/runtime/src/transaction/dispatcher.rs b/runtime/src/transaction/dispatcher.rs index cda5430c46b..d38b65d44ed 100644 --- a/runtime/src/transaction/dispatcher.rs +++ b/runtime/src/transaction/dispatcher.rs @@ -357,7 +357,7 @@ impl Dispatcher for MethodDispatcher { #[cfg(test)] mod tests { use io_context::Context as IoContext; - use serde_derive::{Deserialize, Serialize}; + use serde::{Deserialize, Serialize}; use crate::common::{cbor, roothash::Header}; diff --git a/runtime/src/transaction/rwset.rs b/runtime/src/transaction/rwset.rs index 02bc3070e12..1c12d2b7808 100644 --- a/runtime/src/transaction/rwset.rs +++ b/runtime/src/transaction/rwset.rs @@ -1,6 +1,6 @@ //! Read/write set. +use serde::{Deserialize, Serialize}; use serde_bytes; -use serde_derive::{Deserialize, Serialize}; /// A coarsened key prefix that represents any key that starts with /// this prefix. diff --git a/runtime/src/transaction/tree.rs b/runtime/src/transaction/tree.rs index c6207c4326c..0b0811d37dd 100644 --- a/runtime/src/transaction/tree.rs +++ b/runtime/src/transaction/tree.rs @@ -1,9 +1,8 @@ //! Transaction I/O tree. use anyhow::{anyhow, Result}; use io_context::Context; -use serde::{self, ser::SerializeSeq, Serializer}; +use serde::{self, ser::SerializeSeq, Deserialize, Serializer}; use serde_bytes::{self, Bytes}; -use serde_derive::Deserialize; use super::tags::Tags; use crate::{ diff --git a/runtime/src/transaction/types.rs b/runtime/src/transaction/types.rs index d741bd6f4d9..cbc76ae0627 100644 --- a/runtime/src/transaction/types.rs +++ b/runtime/src/transaction/types.rs @@ -4,7 +4,7 @@ use std::{ ops::{Deref, DerefMut}, }; -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; use super::rwset::ReadWriteSet; use crate::common::cbor::Value; diff --git a/runtime/src/types.rs b/runtime/src/types.rs index 115fdceac21..73057cd7bf5 100644 --- a/runtime/src/types.rs +++ b/runtime/src/types.rs @@ -1,7 +1,6 @@ //! Types used by the worker-host protocol. -use serde::{self, Deserializer, Serializer}; +use serde::{self, Deserialize, Deserializer, Serialize, Serializer}; use serde_bytes; -use serde_derive::{Deserialize, Serialize}; use crate::{ common::{ diff --git a/tests/runtimes/simple-keyvalue/api/Cargo.toml b/tests/runtimes/simple-keyvalue/api/Cargo.toml index 6ebd0dc5ecd..ec41a5bc581 100644 --- a/tests/runtimes/simple-keyvalue/api/Cargo.toml +++ b/tests/runtimes/simple-keyvalue/api/Cargo.toml @@ -6,5 +6,4 @@ description = "Example of using a simple key/value store API" [dependencies] oasis-core-runtime = { path = "../../../../runtime" } -serde = "1.0.71" -serde_derive = "1.0" +serde = { version = "1.0.116", features = ["derive"] } diff --git a/tests/runtimes/simple-keyvalue/api/src/api.rs b/tests/runtimes/simple-keyvalue/api/src/api.rs index 004a9097657..c096d2f5d63 100644 --- a/tests/runtimes/simple-keyvalue/api/src/api.rs +++ b/tests/runtimes/simple-keyvalue/api/src/api.rs @@ -1,4 +1,4 @@ -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; use oasis_core_runtime::runtime_api; diff --git a/tests/runtimes/simple-keyvalue/api/src/lib.rs b/tests/runtimes/simple-keyvalue/api/src/lib.rs index 3e2ad58d7a4..9650428d9bb 100644 --- a/tests/runtimes/simple-keyvalue/api/src/lib.rs +++ b/tests/runtimes/simple-keyvalue/api/src/lib.rs @@ -1,5 +1,4 @@ extern crate serde; -extern crate serde_derive; extern crate oasis_core_runtime; diff --git a/tools/Cargo.toml b/tools/Cargo.toml index 80bb80cddff..9e929f31cbf 100644 --- a/tools/Cargo.toml +++ b/tools/Cargo.toml @@ -7,8 +7,7 @@ edition = "2018" [dependencies] anyhow = "1.0" thiserror = "1.0" -serde_derive = "1.0" -serde = "1.0.71" +serde = { version = "1.0.116", features = ["derive"] } toml = "0.5.0" clap = "2.29.1" ansi_term = "0.12.1" diff --git a/tools/bin/cargo-elf2sgxs.rs b/tools/bin/cargo-elf2sgxs.rs index 7528e2286df..bf472a97f06 100644 --- a/tools/bin/cargo-elf2sgxs.rs +++ b/tools/bin/cargo-elf2sgxs.rs @@ -3,7 +3,6 @@ extern crate ansi_term; extern crate anyhow; extern crate clap; extern crate serde; -extern crate serde_derive; use std::{ fs, io, diff --git a/tools/src/cargo.rs b/tools/src/cargo.rs index 17712722af5..85f338f0c34 100644 --- a/tools/src/cargo.rs +++ b/tools/src/cargo.rs @@ -10,7 +10,7 @@ use std::{ }; use anyhow::{anyhow, Result}; -use serde_derive::Deserialize; +use serde::Deserialize; use toml; /// Fortanix SGX metadata (based on ftxsgx-runner-cargo). diff --git a/tools/src/lib.rs b/tools/src/lib.rs index 78be875426e..d081f4f5080 100644 --- a/tools/src/lib.rs +++ b/tools/src/lib.rs @@ -1,6 +1,5 @@ //! Oasis core build tools. extern crate anyhow; -extern crate serde_derive; extern crate toml; pub mod cargo; From 6fcb98943acd105802ff1c59617f90007201b110 Mon Sep 17 00:00:00 2001 From: ptrus Date: Mon, 21 Sep 2020 14:56:30 +0200 Subject: [PATCH 3/4] rust/serde_bytes: bump to 0.11.5 --- .changelog/3294.internal.md | 7 +++++++ .github/dependabot.yml | 1 - Cargo.lock | 5 +++-- client/Cargo.toml | 2 +- client/src/enclave_rpc/transport.rs | 2 +- client/src/transaction/client.rs | 2 +- keymanager-api-common/Cargo.toml | 2 +- runtime/Cargo.toml | 2 +- runtime/src/enclave_rpc/demux.rs | 2 +- runtime/src/enclave_rpc/types.rs | 1 - runtime/src/transaction/types.rs | 3 ++- tests/clients/simple-keyvalue/Cargo.toml | 1 + tests/clients/simple-keyvalue/src/main.rs | 3 ++- 13 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 .changelog/3294.internal.md diff --git a/.changelog/3294.internal.md b/.changelog/3294.internal.md new file mode 100644 index 00000000000..a159cf5476d --- /dev/null +++ b/.changelog/3294.internal.md @@ -0,0 +1,7 @@ +rust: Bump serde crates + +- `serde_cbor@0.10.2` -> `serde_cbor@0.11.1` + +- `serde@1.0.71` -> `serde@1.0.116` + +- `serde_bytes@0.10.5` -> `serde@0.11.5` diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5e7fa4a9222..0b1595a9310 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -58,4 +58,3 @@ updates: - dependency-name: futures - dependency-name: grpcio - dependency-name: intrusive-collections - - dependency-name: serde_bytes 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, }; From 70bdca000ac72093185f172d27dcb5d9ab84ccf0 Mon Sep 17 00:00:00 2001 From: ptrus Date: Mon, 21 Sep 2020 15:05:40 +0200 Subject: [PATCH 4/4] dependabot/intrusive-collections: add update note --- .github/dependabot.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0b1595a9310..80489a3dc03 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -57,4 +57,7 @@ updates: # version, remove it from the ignore list. - dependency-name: futures - dependency-name: grpcio + # Wait with update until https://github.com/Amanieu/intrusive-rs/pull/51 + # is merged and released, so we can continue using `intrusive_adapter!` + # macro in`lru_cache.rs`. - dependency-name: intrusive-collections