Skip to content

Commit

Permalink
Bump borsh to 0.10.3 (#30975)
Browse files Browse the repository at this point in the history
* 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

(cherry picked from commit 8c73a2c)
  • Loading branch information
kevinji authored and mergify[bot] committed May 30, 2023
1 parent 8203c6e commit bc8a969
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 44 deletions.
3 changes: 2 additions & 1 deletion .buildkite/scripts/build-downstream-projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 53 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
62 changes: 53 additions & 9 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion sdk/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
10 changes: 5 additions & 5 deletions sdk/program/src/stake/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
20 changes: 5 additions & 15 deletions sdk/program/src/system_instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion transaction-status/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion transaction-status/src/parse_associated_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bc8a969

Please sign in to comment.