Bump borsh to 0.10.3 (#30975)

* Bump borsh to 0.10.3

transaction-status relies on SPL which still requires borsh 0.9, so
until SPL also gets updated that package alone will use an older version of
borsh.

* ci: Temporarily disable spl and openbook-dex builds
This commit is contained in:
Kevin Ji 2023-05-30 14:33:21 -07:00 committed by GitHub
parent 5334efd63c
commit 8c73a2cae9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 122 additions and 44 deletions

View File

@ -9,5 +9,6 @@ source "$here"/common.sh
agent="${1-solana}"
group "downstream projects" \
'{ "name": "spl", "command": "./ci/downstream-projects/run-spl.sh", "timeout_in_minutes": 30, "agent": "'"$agent"'" }' \
'{ "name": "example-helloworld", "command": "./ci/downstream-projects/run-example-helloworld.sh", "timeout_in_minutes": 30, "agent": "'"$agent"'" }'
# '{ "name": "spl", "command": "./ci/downstream-projects/run-spl.sh", "timeout_in_minutes": 30, "agent": "'"$agent"'" }' \
# '{ "name": "openbook-dex", "command": "./ci/downstream-projects/run-openbook-dex.sh", "timeout_in_minutes": 30, "agent": "'"$agent"'" }' \

62
Cargo.lock generated
View File

@ -648,18 +648,41 @@ version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa"
dependencies = [
"borsh-derive",
"borsh-derive 0.9.3",
"hashbrown 0.11.2",
]
[[package]]
name = "borsh"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b"
dependencies = [
"borsh-derive 0.10.3",
"hashbrown 0.13.2",
]
[[package]]
name = "borsh-derive"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775"
dependencies = [
"borsh-derive-internal",
"borsh-schema-derive-internal",
"borsh-derive-internal 0.9.3",
"borsh-schema-derive-internal 0.9.3",
"proc-macro-crate 0.1.5",
"proc-macro2 1.0.59",
"syn 1.0.109",
]
[[package]]
name = "borsh-derive"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7"
dependencies = [
"borsh-derive-internal 0.10.3",
"borsh-schema-derive-internal 0.10.3",
"proc-macro-crate 0.1.5",
"proc-macro2 1.0.59",
"syn 1.0.109",
@ -676,6 +699,17 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "borsh-derive-internal"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb"
dependencies = [
"proc-macro2 1.0.59",
"quote 1.0.28",
"syn 1.0.109",
]
[[package]]
name = "borsh-schema-derive-internal"
version = "0.9.3"
@ -687,6 +721,17 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "borsh-schema-derive-internal"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd"
dependencies = [
"proc-macro2 1.0.59",
"quote 1.0.28",
"syn 1.0.109",
]
[[package]]
name = "brotli"
version = "3.3.4"
@ -4977,7 +5022,7 @@ dependencies = [
name = "solana-banks-client"
version = "1.17.0"
dependencies = [
"borsh",
"borsh 0.10.3",
"futures 0.3.28",
"solana-banks-interface",
"solana-banks-server",
@ -6147,8 +6192,7 @@ dependencies = [
"bincode",
"bitflags",
"blake3",
"borsh",
"borsh-derive",
"borsh 0.10.3",
"bs58",
"bv",
"bytemuck",
@ -6554,7 +6598,7 @@ dependencies = [
"base64 0.21.2",
"bincode",
"bitflags",
"borsh",
"borsh 0.10.3",
"bs58",
"bytemuck",
"byteorder",
@ -6899,7 +6943,7 @@ dependencies = [
"Inflector",
"base64 0.21.2",
"bincode",
"borsh",
"borsh 0.9.3",
"bs58",
"lazy_static",
"log",
@ -7176,7 +7220,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "978dba3bcbe88d0c2c58366c254d9ea41c5f73357e72fc0bdee4d6b5fc99c8f4"
dependencies = [
"assert_matches",
"borsh",
"borsh 0.9.3",
"num-derive",
"num-traits",
"solana-program",

View File

@ -143,8 +143,7 @@ bincode = "1.3.3"
bitflags = "1.3.1"
blake3 = "1.3.3"
block-buffer = "0.10.4"
borsh = "0.9.3"
borsh-derive = "0.9.1"
borsh = "0.10.3"
bs58 = "0.4.0"
bv = "0.11.1"
byte-unit = "4.0.19"

View File

@ -619,18 +619,41 @@ version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa"
dependencies = [
"borsh-derive",
"borsh-derive 0.9.3",
"hashbrown 0.11.2",
]
[[package]]
name = "borsh"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b"
dependencies = [
"borsh-derive 0.10.3",
"hashbrown 0.13.2",
]
[[package]]
name = "borsh-derive"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775"
dependencies = [
"borsh-derive-internal",
"borsh-schema-derive-internal",
"borsh-derive-internal 0.9.3",
"borsh-schema-derive-internal 0.9.3",
"proc-macro-crate 0.1.5",
"proc-macro2 1.0.59",
"syn 1.0.109",
]
[[package]]
name = "borsh-derive"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7"
dependencies = [
"borsh-derive-internal 0.10.3",
"borsh-schema-derive-internal 0.10.3",
"proc-macro-crate 0.1.5",
"proc-macro2 1.0.59",
"syn 1.0.109",
@ -647,6 +670,17 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "borsh-derive-internal"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb"
dependencies = [
"proc-macro2 1.0.59",
"quote 1.0.28",
"syn 1.0.109",
]
[[package]]
name = "borsh-schema-derive-internal"
version = "0.9.3"
@ -658,6 +692,17 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "borsh-schema-derive-internal"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd"
dependencies = [
"proc-macro2 1.0.59",
"quote 1.0.28",
"syn 1.0.109",
]
[[package]]
name = "brotli"
version = "3.3.4"
@ -4429,7 +4474,7 @@ dependencies = [
name = "solana-banks-client"
version = "1.17.0"
dependencies = [
"borsh",
"borsh 0.10.3",
"futures 0.3.28",
"solana-banks-interface",
"solana-program",
@ -5082,8 +5127,7 @@ dependencies = [
"bincode",
"bitflags",
"blake3",
"borsh",
"borsh-derive",
"borsh 0.10.3",
"bs58",
"bv",
"bytemuck",
@ -5824,7 +5868,7 @@ dependencies = [
"base64 0.21.2",
"bincode",
"bitflags",
"borsh",
"borsh 0.10.3",
"bs58",
"bytemuck",
"byteorder 1.4.3",
@ -6067,7 +6111,7 @@ dependencies = [
"Inflector",
"base64 0.21.2",
"bincode",
"borsh",
"borsh 0.9.3",
"bs58",
"lazy_static",
"log",
@ -6281,7 +6325,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "978dba3bcbe88d0c2c58366c254d9ea41c5f73357e72fc0bdee4d6b5fc99c8f4"
dependencies = [
"assert_matches",
"borsh",
"borsh 0.9.3",
"num-derive",
"num-traits",
"solana-program",

View File

@ -14,7 +14,6 @@ edition = { workspace = true }
bincode = { workspace = true }
blake3 = { workspace = true, features = ["digest", "traits-preview"] }
borsh = { workspace = true }
borsh-derive = { workspace = true }
bs58 = { workspace = true }
bv = { workspace = true, features = ["serde"] }
bytemuck = { workspace = true, features = ["derive"] }

View File

@ -27,17 +27,17 @@ pub enum StakeState {
}
impl BorshDeserialize for StakeState {
fn deserialize(buf: &mut &[u8]) -> io::Result<Self> {
let enum_value: u32 = BorshDeserialize::deserialize(buf)?;
fn deserialize_reader<R: io::Read>(reader: &mut R) -> io::Result<Self> {
let enum_value = u32::deserialize_reader(reader)?;
match enum_value {
0 => Ok(StakeState::Uninitialized),
1 => {
let meta: Meta = BorshDeserialize::deserialize(buf)?;
let meta = Meta::deserialize_reader(reader)?;
Ok(StakeState::Initialized(meta))
}
2 => {
let meta: Meta = BorshDeserialize::deserialize(buf)?;
let stake: Stake = BorshDeserialize::deserialize(buf)?;
let meta = Meta::deserialize_reader(reader)?;
let stake = Stake::deserialize_reader(reader)?;
Ok(StakeState::Stake(meta, stake))
}
3 => Ok(StakeState::RewardsPool),

View File

@ -363,9 +363,7 @@ pub enum SystemInstruction {
/// [`invoke_signed`]: crate::program::invoke_signed
///
/// ```
/// # use borsh_derive::BorshDeserialize;
/// # use borsh::BorshSerialize;
/// # use borsh::de::BorshDeserialize;
/// # use borsh::{BorshDeserialize, BorshSerialize};
/// use solana_program::{
/// account_info::{next_account_info, AccountInfo},
/// entrypoint,
@ -581,9 +579,7 @@ pub fn create_account_with_seed(
/// [`invoke_signed`]: crate::program::invoke_signed
///
/// ```
/// # use borsh_derive::BorshDeserialize;
/// # use borsh::BorshSerialize;
/// # use borsh::de::BorshDeserialize;
/// # use borsh::{BorshDeserialize, BorshSerialize};
/// use solana_program::{
/// account_info::{next_account_info, AccountInfo},
/// entrypoint,
@ -793,9 +789,7 @@ pub fn assign_with_seed(
/// [`invoke_signed`]: crate::program::invoke_signed
///
/// ```
/// # use borsh_derive::BorshDeserialize;
/// # use borsh::BorshSerialize;
/// # use borsh::de::BorshDeserialize;
/// # use borsh::{BorshDeserialize, BorshSerialize};
/// use solana_program::{
/// account_info::{next_account_info, AccountInfo},
/// entrypoint,
@ -1014,9 +1008,7 @@ pub fn transfer_with_seed(
/// [`invoke_signed`]: crate::program::invoke_signed
///
/// ```
/// # use borsh_derive::BorshDeserialize;
/// # use borsh::BorshSerialize;
/// # use borsh::de::BorshDeserialize;
/// # use borsh::{BorshDeserialize, BorshSerialize};
/// use solana_program::{
/// account_info::{next_account_info, AccountInfo},
/// entrypoint,
@ -1210,9 +1202,7 @@ pub fn allocate_with_seed(
/// [`invoke_signed`]: crate::program::invoke_signed
///
/// ```
/// # use borsh_derive::BorshDeserialize;
/// # use borsh::BorshSerialize;
/// # use borsh::de::BorshDeserialize;
/// # use borsh::{BorshDeserialize, BorshSerialize};
/// use solana_program::{
/// account_info::{next_account_info, next_account_infos, AccountInfo},
/// entrypoint,

View File

@ -13,7 +13,8 @@ edition = { workspace = true }
Inflector = { workspace = true }
base64 = { workspace = true }
bincode = { workspace = true }
borsh = { workspace = true }
# NOTE: Use the workspace version once spl-associated-token-account uses borsh 0.10.
borsh0-9 = { package = "borsh", version = "0.9.3" }
bs58 = { workspace = true }
lazy_static = { workspace = true }
log = { workspace = true }

View File

@ -2,7 +2,7 @@ use {
crate::parse_instruction::{
check_num_accounts, ParsableProgram, ParseInstructionError, ParsedInstructionEnum,
},
borsh::BorshDeserialize,
borsh0_9::BorshDeserialize,
serde_json::json,
solana_sdk::{instruction::CompiledInstruction, message::AccountKeys, pubkey::Pubkey},
spl_associated_token_account::instruction::AssociatedTokenAccountInstruction,