Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Migrating Rust programs from v1.5 to v1.6

Michael Vines edited this page Mar 17, 2021 · 5 revisions

The v1.6 release line requires some minor changes to Rust program source that previously used v1.5.14 or earlier. These changes can be made with a ~v1.5.15 release as well, to prepare your program for the upgrade to v1.6.

As reference, https://github.com/solana-labs/example-helloworld/pull/158/files makes the necessary changes to the helloworld example

Remove the explicit tokio dependency from your program crate

  1. Edit your Cargo.toml and remove the tokio = { version = "0.3", features = ["macros"]} from your [dev-dependencies]. A compatible tokio can now be imported from program-test with a use solana_program_test::tokio; statement.

Instruction::new() is deprecated

Instruction::new() is deprecated by Instruction::new_with_bincode(). The function signatures are the same.

Solana crate internal version pinning

The v1.5.15 and newer Rust crates pin the version of dependent Solana Rust crates to the same version, to avoid accidental version mixing and build breakage during the non-atomic publish of new release crates to crates.io.

If your program is referencing v1.5.14 or earlier, bump the Solana version to v1.5.15 to take advantage of this version pinning.

Clone this wiki locally