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] <support@dependabot.com>

* [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 <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
dependabot-preview[bot] 2020-07-09 00:08:05 +00:00 committed by GitHub
parent 1a6bbd2867
commit 841ecfd927
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 95 additions and 73 deletions

4
Cargo.lock generated
View File

@ -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",

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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<u8>, 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);

View File

@ -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"

View File

@ -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",

View File

@ -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"

View File

@ -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" }

View File

@ -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"

View File

@ -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)

View File

@ -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"

View File

@ -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"

View File

@ -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<T>(data: &[u8]) -> bincode::Result<T>
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)
}

View File

@ -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"

View File

@ -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" }

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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" }

View File

@ -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"

View File

@ -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",

View File

@ -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 {

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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<Slot, Vec<Self::SerializableAccountStorageEntry>> = bincode::config()
.limit(serialized_len)
let storage: HashMap<Slot, Vec<Self::SerializableAccountStorageEntry>> = bincode::options()
.with_limit(serialized_len)
.with_fixint_encoding()
.allow_trailing_bytes()
.deserialize_from(&mut stream)?;
// (2nd of 3 elements) read in write version

View File

@ -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<BankSlotDelta> = bincode::config()
.limit(MAX_SNAPSHOT_DATA_FILE_SIZE)
let slot_deltas: Vec<BankSlotDelta> = bincode::options()
.with_limit(MAX_SNAPSHOT_DATA_FILE_SIZE)
.with_fixint_encoding()
.allow_trailing_bytes()
.deserialize_from(stream)?;
Ok(slot_deltas)
})?;

View File

@ -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 }

View File

@ -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)
}

View File

@ -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"