Skip to content

Commit

Permalink
sdk: Upgrade to borsh 1.2.1 (solana-labs#34355)
Browse files Browse the repository at this point in the history
* sdk: Update to borsh 1, revert borsh 0.9 / 0.10

* Restore borsh 0.10 and 0.9 support

* Update sbf lockfile

* Add borsh 0.10 implementations for stake types

* Fix weirdness on whitespace

* Update to borsh 1.2.1

* Update changelog

* compute-budget: Move `pack` under dev-context-only-utils

* Revert test to use HashMap

* transaction-status: Add comment about borsh version
  • Loading branch information
joncinque authored Dec 8, 2023
1 parent 132c910 commit cfb16ab
Show file tree
Hide file tree
Showing 27 changed files with 840 additions and 176 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ Release channels have their own copy of this changelog:
* The default for `--use-snapshot-archives-at-startup` is now `when-newest` (#33883)
* The default for `solana-ledger-tool`, however, remains `always` (#34228)
* Added `central-scheduler` option for `--block-production-method` (#33890)
* Updated to Borsh v1
* Upgrade Notes
* `solana-program` and `solana-sdk` default to support for Borsh v1, with
limited backward compatibility for v0.10 and v0.9. Please upgrade to Borsh v1.

## [1.17.0]
* Changes
Expand Down
79 changes: 71 additions & 8 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ bincode = "1.3.3"
bitflags = { version = "2.3.3", features = ["serde"] }
blake3 = "1.5.0"
block-buffer = "0.10.4"
borsh = "0.10.3"
borsh = { version = "1.2.1", features = ["derive", "unstable__schema"] }
bs58 = "0.4.0"
bv = "0.11.1"
byte-unit = "4.0.19"
Expand Down
1 change: 1 addition & 0 deletions cost-model/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ name = "solana_cost_model"

[dev-dependencies]
solana-logger = { workspace = true }
solana-sdk = { workspace = true, features = ["dev-context-only-utils"] }
static_assertions = { workspace = true }
test-case = { workspace = true }

Expand Down
2 changes: 1 addition & 1 deletion cost-model/src/cost_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use {
},
},
solana_sdk::{
borsh0_10::try_from_slice_unchecked,
borsh1::try_from_slice_unchecked,
compute_budget::{self, ComputeBudgetInstruction},
feature_set::{include_loaded_accounts_data_size_in_fee_calculation, FeatureSet},
fee::FeeStructure,
Expand Down
2 changes: 1 addition & 1 deletion program-runtime/src/compute_budget_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use {
prioritization_fee::{PrioritizationFeeDetails, PrioritizationFeeType},
},
solana_sdk::{
borsh0_10::try_from_slice_unchecked,
borsh1::try_from_slice_unchecked,
compute_budget::{self, ComputeBudgetInstruction},
entrypoint::HEAP_LENGTH as MIN_HEAP_FRAME_BYTES,
feature_set::{
Expand Down
85 changes: 82 additions & 3 deletions programs/sbf/Cargo.lock

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

1 change: 1 addition & 0 deletions sdk/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ rust-version = "1.72.0" # solana platform-tools rust version
bincode = { workspace = true }
blake3 = { workspace = true, features = ["digest", "traits-preview"] }
borsh = { workspace = true }
borsh0-10 = { package = "borsh", version = "0.10.3" }
borsh0-9 = { package = "borsh", version = "0.9.3" }
bs58 = { workspace = true }
bv = { workspace = true, features = ["serde"] }
Expand Down
Loading

0 comments on commit cfb16ab

Please sign in to comment.