From 841ecfd927219c831d2e1a4fa13f22739b8d070e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 9 Jul 2020 00:08:05 +0000 Subject: [PATCH] chore(deps): bump bincode from 1.2.1 to 1.3.1 (#10867) * chore(deps): bump bincode from 1.2.1 to 1.3.1 Bumps [bincode](https://github.com/servo/bincode) from 1.2.1 to 1.3.1. - [Release notes](https://github.com/servo/bincode/releases) - [Commits](https://github.com/servo/bincode/commits) Signed-off-by: dependabot-preview[bot] * [auto-commit] Update all Cargo lock files * Switch from deprecated method * Add options to maintain behavior with bincode::options() Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: dependabot-buildkite Co-authored-by: Tyera Eulberg --- Cargo.lock | 4 ++-- account-decoder/Cargo.toml | 2 +- bench-tps/Cargo.toml | 2 +- cli/Cargo.toml | 2 +- client/Cargo.toml | 2 +- core/Cargo.toml | 2 +- core/src/rpc.rs | 8 +++++--- dos/Cargo.toml | 2 +- explorer/wasm/Cargo.lock | 4 ++-- faucet/Cargo.toml | 2 +- install/Cargo.toml | 2 +- ledger/Cargo.toml | 2 +- ledger/src/shred.rs | 7 +++++-- net-utils/Cargo.toml | 2 +- perf/Cargo.toml | 2 +- perf/src/packet.rs | 7 +++++-- programs/bpf/Cargo.lock | 18 +++++++++--------- programs/bpf_loader/Cargo.toml | 2 +- programs/btc_spv/Cargo.toml | 2 +- programs/budget/Cargo.toml | 2 +- programs/config/Cargo.toml | 2 +- programs/exchange/Cargo.toml | 2 +- programs/librapay/Cargo.lock | 20 ++++++++++---------- programs/move_loader/Cargo.lock | 4 ++-- programs/move_loader/src/processor.rs | 15 ++++++++++----- programs/ownable/Cargo.toml | 2 +- programs/stake/Cargo.toml | 2 +- programs/vest/Cargo.toml | 2 +- programs/vote/Cargo.toml | 2 +- runtime/Cargo.toml | 2 +- runtime/src/serde_snapshot/legacy.rs | 8 +++++--- runtime/src/snapshot_utils.rs | 20 ++++++++++++-------- sdk/Cargo.toml | 2 +- sdk/src/program_utils.rs | 7 +++++-- transaction-status/Cargo.toml | 2 +- 35 files changed, 95 insertions(+), 73 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a2765fe8..0083de739 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -177,9 +177,9 @@ checksum = "58946044516aa9dc922182e0d6e9d124a31aafe6b421614654eb27cf90cec09c" [[package]] name = "bincode" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" +checksum = "f30d3a39baa26f9651f17b375061f3233dde33424a8b72b0dbe93a68a0bc896d" dependencies = [ "byteorder", "serde", diff --git a/account-decoder/Cargo.toml b/account-decoder/Cargo.toml index 909a8ced1..9b096014c 100644 --- a/account-decoder/Cargo.toml +++ b/account-decoder/Cargo.toml @@ -9,7 +9,7 @@ license = "Apache-2.0" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" bs58 = "0.3.1" Inflector = "0.11.4" lazy_static = "1.4.0" diff --git a/bench-tps/Cargo.toml b/bench-tps/Cargo.toml index d917f2489..9c2a48716 100644 --- a/bench-tps/Cargo.toml +++ b/bench-tps/Cargo.toml @@ -8,7 +8,7 @@ license = "Apache-2.0" homepage = "https://solana.com/" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" clap = "2.33.1" log = "0.4.8" rayon = "1.3.1" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 2746280f6..d3369d97f 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -9,7 +9,7 @@ license = "Apache-2.0" homepage = "https://solana.com/" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" bs58 = "0.3.1" chrono = { version = "0.4.11", features = ["serde"] } clap = "2.33.1" diff --git a/client/Cargo.toml b/client/Cargo.toml index 268fb431f..5631f4de9 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -9,7 +9,7 @@ license = "Apache-2.0" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" bs58 = "0.3.1" indicatif = "0.15.0" jsonrpc-core = "14.2.0" diff --git a/core/Cargo.toml b/core/Cargo.toml index 5047c8b32..b1a2b44b0 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -14,7 +14,7 @@ edition = "2018" codecov = { repository = "solana-labs/solana", branch = "master", service = "github" } [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" bv = { version = "0.11.1", features = ["serde"] } bs58 = "0.3.1" byteorder = "1.3.4" diff --git a/core/src/rpc.rs b/core/src/rpc.rs index 29b502d89..f70da67ee 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -5,7 +5,7 @@ use crate::{ non_circulating_supply::calculate_non_circulating_supply, rpc_error::RpcCustomError, rpc_health::*, send_transaction_service::SendTransactionService, validator::ValidatorExit, }; -use bincode::serialize; +use bincode::{config::Options, serialize}; use jsonrpc_core::{Error, Metadata, Result}; use jsonrpc_derive::rpc; use solana_account_decoder::{UiAccount, UiAccountEncoding}; @@ -1688,8 +1688,10 @@ fn deserialize_bs58_transaction(bs58_transaction: String) -> Result<(Vec, Tr info!("{}", err); return Err(Error::invalid_params(&err)); } - bincode::config() - .limit(PACKET_DATA_SIZE as u64) + bincode::options() + .with_limit(PACKET_DATA_SIZE as u64) + .with_fixint_encoding() + .allow_trailing_bytes() .deserialize_from(&wire_transaction[..]) .map_err(|err| { info!("transaction deserialize error: {:?}", err); diff --git a/dos/Cargo.toml b/dos/Cargo.toml index d5e8f1766..30b00bd2c 100644 --- a/dos/Cargo.toml +++ b/dos/Cargo.toml @@ -8,7 +8,7 @@ license = "Apache-2.0" homepage = "https://solana.com/" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" clap = "2.33.1" log = "0.4.8" rand = "0.7.0" diff --git a/explorer/wasm/Cargo.lock b/explorer/wasm/Cargo.lock index 4d61c6525..cbddccf25 100644 --- a/explorer/wasm/Cargo.lock +++ b/explorer/wasm/Cargo.lock @@ -2,9 +2,9 @@ # It is not intended for manual editing. [[package]] name = "bincode" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" +checksum = "f30d3a39baa26f9651f17b375061f3233dde33424a8b72b0dbe93a68a0bc896d" dependencies = [ "byteorder", "serde", diff --git a/faucet/Cargo.toml b/faucet/Cargo.toml index 07a6ac827..892b85ee5 100644 --- a/faucet/Cargo.toml +++ b/faucet/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://solana.com/" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" byteorder = "1.3.4" bytes = "0.4" clap = "2.33" diff --git a/install/Cargo.toml b/install/Cargo.toml index c7d86a3d4..2bd742355 100644 --- a/install/Cargo.toml +++ b/install/Cargo.toml @@ -10,7 +10,7 @@ homepage = "https://solana.com/" [dependencies] atty = "0.2.11" -bincode = "1.2.1" +bincode = "1.3.1" bzip2 = "0.3.3" chrono = { version = "0.4.11", features = ["serde"] } clap = { version = "2.33.1" } diff --git a/ledger/Cargo.toml b/ledger/Cargo.toml index a4feee8d6..7a1209a97 100644 --- a/ledger/Cargo.toml +++ b/ledger/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://solana.com/" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" byteorder = "1.3.4" chrono = { version = "0.4.11", features = ["serde"] } crossbeam-channel = "0.4" diff --git a/ledger/src/shred.rs b/ledger/src/shred.rs index b6bf97045..3f41b29bb 100644 --- a/ledger/src/shred.rs +++ b/ledger/src/shred.rs @@ -3,6 +3,7 @@ use crate::{ entry::{create_ticks, Entry}, erasure::Session, }; +use bincode::config::Options; use core::cell::RefCell; use rayon::{ iter::{IndexedParallelIterator, IntoParallelRefMutIterator, ParallelIterator}, @@ -137,8 +138,10 @@ impl Shred { where T: Deserialize<'de>, { - let ret = bincode::config() - .limit(PACKET_DATA_SIZE as u64) + let ret = bincode::options() + .with_limit(PACKET_DATA_SIZE as u64) + .with_fixint_encoding() + .allow_trailing_bytes() .deserialize(&buf[*index..*index + size])?; *index += size; Ok(ret) diff --git a/net-utils/Cargo.toml b/net-utils/Cargo.toml index 6456f597c..034cc75f9 100644 --- a/net-utils/Cargo.toml +++ b/net-utils/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://solana.com/" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" bytes = "0.4" clap = "2.33.1" log = "0.4.8" diff --git a/perf/Cargo.toml b/perf/Cargo.toml index dab8d0494..9fabb98c4 100644 --- a/perf/Cargo.toml +++ b/perf/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" [dependencies] rand = "0.7.0" dlopen = "0.1.8" -bincode = "1.2.1" +bincode = "1.3.1" rayon = "1.3.1" serde = "1.0.112" dlopen_derive = "0.1.4" diff --git a/perf/src/packet.rs b/perf/src/packet.rs index 8609838cc..981bb756f 100644 --- a/perf/src/packet.rs +++ b/perf/src/packet.rs @@ -1,5 +1,6 @@ //! The `packet` module defines data structures and methods to pull data from the network. use crate::{cuda_runtime::PinnedVec, recycler::Recycler}; +use bincode::config::Options; use serde::Serialize; pub use solana_sdk::packet::{Meta, Packet, PACKET_DATA_SIZE}; use std::net::SocketAddr; @@ -100,8 +101,10 @@ pub fn limited_deserialize(data: &[u8]) -> bincode::Result where T: serde::de::DeserializeOwned, { - bincode::config() - .limit(PACKET_DATA_SIZE as u64) + bincode::options() + .with_limit(PACKET_DATA_SIZE as u64) + .with_fixint_encoding() + .allow_trailing_bytes() .deserialize_from(data) } diff --git a/programs/bpf/Cargo.lock b/programs/bpf/Cargo.lock index ed15626a7..4400ec76c 100644 --- a/programs/bpf/Cargo.lock +++ b/programs/bpf/Cargo.lock @@ -71,7 +71,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bincode" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1415,7 +1415,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "solana-bpf-loader-program" version = "1.3.0" dependencies = [ - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "jemalloc-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1430,7 +1430,7 @@ dependencies = [ name = "solana-bpf-programs" version = "1.3.0" dependencies = [ - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "elf 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "solana-bpf-loader-program 1.3.0", @@ -1572,7 +1572,7 @@ dependencies = [ name = "solana-config-program" version = "1.3.0" dependencies = [ - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.112 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1647,7 +1647,7 @@ dependencies = [ name = "solana-runtime" version = "1.3.0" dependencies = [ - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "bv 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "bzip2 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1691,7 +1691,7 @@ name = "solana-sdk" version = "1.3.0" dependencies = [ "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "bs58 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "bv 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1746,7 +1746,7 @@ dependencies = [ name = "solana-stake-program" version = "1.3.0" dependencies = [ - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1765,7 +1765,7 @@ dependencies = [ name = "solana-vote-program" version = "1.3.0" dependencies = [ - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2411,7 +2411,7 @@ dependencies = [ "checksum backtrace 0.3.48 (registry+https://github.com/rust-lang/crates.io-index)" = "0df2f85c8a2abbe3b7d7e748052fdd9b76a0458fdeb16ad4223f5eca78c7c130" "checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" "checksum base64 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "53d1ccbaf7d9ec9537465a97bf19edc1a4e158ecb49fc16178202238c569cc42" -"checksum bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" +"checksum bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f30d3a39baa26f9651f17b375061f3233dde33424a8b72b0dbe93a68a0bc896d" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" "checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" "checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" diff --git a/programs/bpf_loader/Cargo.toml b/programs/bpf_loader/Cargo.toml index 2738ef71c..b31039a91 100644 --- a/programs/bpf_loader/Cargo.toml +++ b/programs/bpf_loader/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://solana.com/" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" byteorder = "1.3.4" jemalloc-sys = { version = "0.3.2", features = ["disable_initial_exec_tls"] } num-derive = { version = "0.3" } diff --git a/programs/btc_spv/Cargo.toml b/programs/btc_spv/Cargo.toml index 8ba272724..c88e47f71 100644 --- a/programs/btc_spv/Cargo.toml +++ b/programs/btc_spv/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://solana.com/" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" log = "0.4.2" num-derive = "0.3" num-traits = "0.2" diff --git a/programs/budget/Cargo.toml b/programs/budget/Cargo.toml index b21d9e5e5..40a5ea474 100644 --- a/programs/budget/Cargo.toml +++ b/programs/budget/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://solana.com/" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" chrono = { version = "0.4.11", features = ["serde"] } log = "0.4.8" num-derive = "0.3" diff --git a/programs/config/Cargo.toml b/programs/config/Cargo.toml index 358d577b6..6f7a8e573 100644 --- a/programs/config/Cargo.toml +++ b/programs/config/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://solana.com/" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" chrono = { version = "0.4.11", features = ["serde"] } log = "0.4.8" serde = "1.0.112" diff --git a/programs/exchange/Cargo.toml b/programs/exchange/Cargo.toml index ac8a2232d..b3a34afa2 100644 --- a/programs/exchange/Cargo.toml +++ b/programs/exchange/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://solana.com/" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" log = "0.4.8" num-derive = { version = "0.3" } num-traits = { version = "0.2" } diff --git a/programs/librapay/Cargo.lock b/programs/librapay/Cargo.lock index bce5558a3..faebc7ef7 100644 --- a/programs/librapay/Cargo.lock +++ b/programs/librapay/Cargo.lock @@ -107,7 +107,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bincode" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2360,7 +2360,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "solana-config-program" version = "1.3.0" dependencies = [ - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.112 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2395,7 +2395,7 @@ dependencies = [ name = "solana-librapay" version = "1.3.0" dependencies = [ - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "solana-logger 1.3.0", "solana-move-loader-program 1.3.0", @@ -2440,7 +2440,7 @@ dependencies = [ name = "solana-move-loader-program" version = "1.3.0" dependencies = [ - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2477,7 +2477,7 @@ dependencies = [ name = "solana-runtime" version = "1.3.0" dependencies = [ - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "bv 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "bzip2 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2521,7 +2521,7 @@ name = "solana-sdk" version = "1.3.0" dependencies = [ "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "bs58 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "bv 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2576,7 +2576,7 @@ dependencies = [ name = "solana-stake-program" version = "1.3.0" dependencies = [ - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2595,7 +2595,7 @@ dependencies = [ name = "solana-vote-program" version = "1.3.0" dependencies = [ - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2671,7 +2671,7 @@ name = "solana_libra_crypto" version = "0.0.1-sol5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "curve25519-dalek 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3810,7 +3810,7 @@ dependencies = [ "checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" "checksum base64 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "53d1ccbaf7d9ec9537465a97bf19edc1a4e158ecb49fc16178202238c569cc42" "checksum bech32 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "58946044516aa9dc922182e0d6e9d124a31aafe6b421614654eb27cf90cec09c" -"checksum bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" +"checksum bincode 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f30d3a39baa26f9651f17b375061f3233dde33424a8b72b0dbe93a68a0bc896d" "checksum bit-set 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" "checksum bit-vec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5f0dc55f2d8a1a85650ac47858bb001b4c0dd73d79e3c455a842925e68d29cd3" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" diff --git a/programs/move_loader/Cargo.lock b/programs/move_loader/Cargo.lock index 2d88f1128..39408d9e7 100644 --- a/programs/move_loader/Cargo.lock +++ b/programs/move_loader/Cargo.lock @@ -117,9 +117,9 @@ checksum = "58946044516aa9dc922182e0d6e9d124a31aafe6b421614654eb27cf90cec09c" [[package]] name = "bincode" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" +checksum = "f30d3a39baa26f9651f17b375061f3233dde33424a8b72b0dbe93a68a0bc896d" dependencies = [ "byteorder", "serde", diff --git a/programs/move_loader/src/processor.rs b/programs/move_loader/src/processor.rs index 1a421297d..bc0a8fff6 100644 --- a/programs/move_loader/src/processor.rs +++ b/programs/move_loader/src/processor.rs @@ -1,6 +1,9 @@ -use crate::account_state::{pubkey_to_address, LibraAccountState}; -use crate::data_store::DataStore; -use crate::error_mappers::*; +use crate::{ + account_state::{pubkey_to_address, LibraAccountState}, + data_store::DataStore, + error_mappers::*, +}; +use bincode::config::Options; use bytecode_verifier::verifier::{VerifiedModule, VerifiedScript}; use log::*; use num_derive::{FromPrimitive, ToPrimitive}; @@ -126,8 +129,10 @@ impl MoveProcessor { ) -> Result<(), InstructionError> { let original_len = data.len() as u64; let mut writer = std::io::Cursor::new(data); - bincode::config() - .limit(original_len) + bincode::options() + .with_limit(original_len) + .with_fixint_encoding() + .allow_trailing_bytes() .serialize_into(&mut writer, &state) .map_err(map_data_error)?; if writer.position() < original_len { diff --git a/programs/ownable/Cargo.toml b/programs/ownable/Cargo.toml index d8f39076a..9a5063061 100644 --- a/programs/ownable/Cargo.toml +++ b/programs/ownable/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://solana.com/" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" solana-sdk = { path = "../../sdk", version = "1.3.0" } num-derive = "0.3" num-traits = "0.2" diff --git a/programs/stake/Cargo.toml b/programs/stake/Cargo.toml index 622999230..fc24d761f 100644 --- a/programs/stake/Cargo.toml +++ b/programs/stake/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://solana.com/" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" log = "0.4.8" num-derive = "0.3" num-traits = "0.2" diff --git a/programs/vest/Cargo.toml b/programs/vest/Cargo.toml index 04590eede..5368f909c 100644 --- a/programs/vest/Cargo.toml +++ b/programs/vest/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://solana.com/" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" chrono = { version = "0.4.11", features = ["serde"] } num-derive = "0.2" num-traits = "0.2" diff --git a/programs/vote/Cargo.toml b/programs/vote/Cargo.toml index 16339b4e5..39d871ae2 100644 --- a/programs/vote/Cargo.toml +++ b/programs/vote/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://solana.com/" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" log = "0.4.8" num-derive = "0.3" num-traits = "0.2" diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index edca8caea..c909337d5 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://solana.com/" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" bv = { version = "0.11.1", features = ["serde"] } byteorder = "1.3.4" bzip2 = "0.3.3" diff --git a/runtime/src/serde_snapshot/legacy.rs b/runtime/src/serde_snapshot/legacy.rs index aa554eba9..62f477355 100644 --- a/runtime/src/serde_snapshot/legacy.rs +++ b/runtime/src/serde_snapshot/legacy.rs @@ -1,6 +1,6 @@ #[cfg(all(test, RUSTC_WITH_SPECIALIZATION))] use solana_sdk::abi_example::IgnoreAsHelper; -use {super::*, solana_measure::measure::Measure, std::cell::RefCell}; +use {super::*, bincode::config::Options, solana_measure::measure::Measure, std::cell::RefCell}; // Serializable version of AccountStorageEntry for snapshot format #[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] @@ -191,8 +191,10 @@ impl<'a> TypeContext<'a> for Context { let serialized_len = min(serialized_len, deserialize_from(&mut stream)?); // (1st of 3 elements) read in map of slots to account storage entries - let storage: HashMap> = bincode::config() - .limit(serialized_len) + let storage: HashMap> = bincode::options() + .with_limit(serialized_len) + .with_fixint_encoding() + .allow_trailing_bytes() .deserialize_from(&mut stream)?; // (2nd of 3 elements) read in write version diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index 928cd75f8..d417fa9c7 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -1,13 +1,13 @@ -use crate::bank_forks::CompressionType; -use crate::hardened_unpack::{unpack_snapshot, UnpackError}; -use crate::snapshot_package::AccountsPackage; use crate::{ bank::{Bank, BankSlotDelta}, + bank_forks::CompressionType, + hardened_unpack::{unpack_snapshot, UnpackError}, serde_snapshot::{ bankrc_from_stream, bankrc_to_stream, SerdeStyle, SnapshotStorage, SnapshotStorages, }, + snapshot_package::AccountsPackage, }; -use bincode::serialize_into; +use bincode::{config::Options, serialize_into}; use bzip2::bufread::BzDecoder; use flate2::read::GzDecoder; use fs_extra::dir::CopyOptions; @@ -723,8 +723,10 @@ where info!("Loading bank from {:?}", &root_paths.snapshot_file_path); let bank = deserialize_snapshot_data_file(&root_paths.snapshot_file_path, |mut stream| { - let mut bank: Bank = bincode::config() - .limit(MAX_SNAPSHOT_DATA_FILE_SIZE) + let mut bank: Bank = bincode::options() + .with_limit(MAX_SNAPSHOT_DATA_FILE_SIZE) + .with_fixint_encoding() + .allow_trailing_bytes() .deserialize_from(&mut stream)?; info!("Rebuilding accounts..."); @@ -758,8 +760,10 @@ where let status_cache_path = unpacked_snapshots_dir.join(SNAPSHOT_STATUS_CACHE_FILE_NAME); let slot_deltas = deserialize_snapshot_data_file(&status_cache_path, |stream| { info!("Rebuilding status cache..."); - let slot_deltas: Vec = bincode::config() - .limit(MAX_SNAPSHOT_DATA_FILE_SIZE) + let slot_deltas: Vec = bincode::options() + .with_limit(MAX_SNAPSHOT_DATA_FILE_SIZE) + .with_fixint_encoding() + .allow_trailing_bytes() .deserialize_from(stream)?; Ok(slot_deltas) })?; diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index d2e9e1da8..27474cab2 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -28,7 +28,7 @@ default = [ [dependencies] assert_matches = { version = "1.3.0", optional = true } -bincode = "1.2.1" +bincode = "1.3.1" bs58 = "0.3.1" bv = { version = "0.11.1", features = ["serde"] } byteorder = { version = "1.3.4", optional = true } diff --git a/sdk/src/program_utils.rs b/sdk/src/program_utils.rs index 6f5f57e28..cfe803347 100644 --- a/sdk/src/program_utils.rs +++ b/sdk/src/program_utils.rs @@ -1,4 +1,5 @@ use crate::instruction::InstructionError; +use bincode::config::Options; /// Deserialize with a limit based the maximum amount of data a program can expect to get. /// This function should be used in place of direct deserialization to help prevent OOM errors @@ -7,8 +8,10 @@ where T: serde::de::DeserializeOwned, { let limit = crate::packet::PACKET_DATA_SIZE as u64; - bincode::config() - .limit(limit) + bincode::options() + .with_limit(limit) + .with_fixint_encoding() // As per https://github.com/servo/bincode/issues/333, these two options are needed + .allow_trailing_bytes() // to retain the behavior of bincode::deserialize with the new `options()` method .deserialize_from(instruction_data) .map_err(|_| InstructionError::InvalidInstructionData) } diff --git a/transaction-status/Cargo.toml b/transaction-status/Cargo.toml index e17b00011..7f91f4fdc 100644 --- a/transaction-status/Cargo.toml +++ b/transaction-status/Cargo.toml @@ -9,7 +9,7 @@ license = "Apache-2.0" edition = "2018" [dependencies] -bincode = "1.2.1" +bincode = "1.3.1" bs58 = "0.3.1" Inflector = "0.11.4" lazy_static = "1.4.0"