Эх сурвалжийг харах

Update solana to version 1.13.3 (#2239)

* upgrade solana version to 1.13.3

* get everything to compile correctly

* update to using struct constructor to avoid deprecated field usage

* update deprecated functions

* more fixes to pass tests

* update auction-house submodule commit

* update the swap submodule

Co-authored-by: henrye <henry@notanemail>
Henry-E 2 жил өмнө
parent
commit
7a0a37e0f8

+ 1 - 1
.github/workflows/no-cashing-tests.yaml

@@ -5,7 +5,7 @@ on:
     branches:
       - master
 env:
-  SOLANA_CLI_VERSION: 1.10.29
+  SOLANA_CLI_VERSION: 1.13.3
   NODE_VERSION: 17.0.1
 
 jobs:

+ 1 - 1
.github/workflows/tests.yaml

@@ -8,7 +8,7 @@ on:
     branches:
       - master
 env:
-  SOLANA_CLI_VERSION: 1.10.29
+  SOLANA_CLI_VERSION: 1.13.3
   NODE_VERSION: 17.0.1
   CARGO_PROFILE: debug
 

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 295 - 210
Cargo.lock


+ 5 - 5
cli/Cargo.toml

@@ -28,11 +28,11 @@ shellexpand = "2.1.0"
 toml = "0.5.8"
 semver = "1.0.4"
 serde = { version = "1.0.122", features = ["derive"] }
-solana-sdk = "~1.10.29"
-solana-program = "~1.10.29"
-solana-client = "~1.10.29"
-solana-cli-config = "~1.10.29"
-solana-faucet = "~1.10.29"
+solana-sdk = "1.13.3"
+solana-program = "1.13.3"
+solana-client = "1.13.3"
+solana-cli-config = "1.13.3"
+solana-faucet = "1.13.3"
 dirs = "3.0"
 heck = "0.3.1"
 flate2 = "1.0.19"

+ 2 - 2
cli/src/lib.rs

@@ -1385,7 +1385,7 @@ pub fn verify_bin(program_id: Pubkey, bin_path: &Path, cluster: &str) -> Result<
                         .value
                         .map_or(Err(anyhow!("Program data account not found")), Ok)?;
                     let bin = account.data
-                        [UpgradeableLoaderState::programdata_data_offset().unwrap_or(0)..]
+                        [UpgradeableLoaderState::size_of_programdata_metadata()..]
                         .to_vec();
 
                     if let UpgradeableLoaderState::ProgramData {
@@ -1403,7 +1403,7 @@ pub fn verify_bin(program_id: Pubkey, bin_path: &Path, cluster: &str) -> Result<
                     }
                 }
                 UpgradeableLoaderState::Buffer { .. } => {
-                    let offset = UpgradeableLoaderState::buffer_data_offset().unwrap_or(0);
+                    let offset = UpgradeableLoaderState::size_of_buffer_metadata();
                     (
                         account.data[offset..].to_vec(),
                         BinVerificationState::Buffer,

+ 3 - 3
client/Cargo.toml

@@ -15,8 +15,8 @@ anchor-lang = { path = "../lang", version = "0.25.0" }
 anyhow = "1.0.32"
 regex = "1.4.5"
 serde = { version = "1.0.122", features = ["derive"] }
-solana-client = "~1.10.29"
-solana-sdk = "~1.10.29"
-solana-account-decoder = "~1.10.29"
+solana-client = "1.13.3"
+solana-sdk = "1.13.3"
+solana-account-decoder = "1.13.3"
 thiserror = "1.0.20"
 url = "2.2.2"

+ 1 - 1
client/example/Cargo.toml

@@ -17,4 +17,4 @@ shellexpand = "2.1.0"
 anyhow = "1.0.32"
 rand = "0.7.3"
 clap = { version = "3.0.0-rc.0", features = ["derive"] }
-solana-sdk = "~1.10.29"
+solana-sdk = "1.13.3"

+ 3 - 7
client/src/lib.rs

@@ -16,10 +16,9 @@ use solana_client::rpc_config::{
     RpcAccountInfoConfig, RpcProgramAccountsConfig, RpcSendTransactionConfig,
     RpcTransactionLogsConfig, RpcTransactionLogsFilter,
 };
-use solana_client::rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType};
+use solana_client::rpc_filter::{Memcmp, RpcFilterType};
 use solana_client::rpc_response::{Response as RpcResponse, RpcLogsResponse};
 use solana_sdk::account::Account;
-use solana_sdk::bs58;
 use solana_sdk::commitment_config::CommitmentConfig;
 use solana_sdk::signature::{Signature, Signer};
 use solana_sdk::transaction::Transaction;
@@ -156,11 +155,8 @@ impl Program {
         &self,
         filters: Vec<RpcFilterType>,
     ) -> Result<ProgramAccountsIterator<T>, ClientError> {
-        let account_type_filter = RpcFilterType::Memcmp(Memcmp {
-            offset: 0,
-            bytes: MemcmpEncodedBytes::Base58(bs58::encode(T::discriminator()).into_string()),
-            encoding: None,
-        });
+        let account_type_filter =
+            RpcFilterType::Memcmp(Memcmp::new_base58_encoded(0, &T::discriminator()));
         let config = RpcProgramAccountsConfig {
             filters: Some([vec![account_type_filter], filters].concat()),
             account_config: RpcAccountInfoConfig {

+ 1 - 1
docker/Makefile

@@ -6,7 +6,7 @@ ANCHOR_CLI=v$(shell awk -F ' = ' '$$1 ~ /version/ { gsub(/[\"]/, "", $$2); print
 #
 # Solana toolchain.
 #
-SOLANA_CLI=v1.10.29
+SOLANA_CLI=v1.13.3
 #
 # Build version should match the Anchor cli version.
 #

+ 1 - 1
lang/Cargo.toml

@@ -39,6 +39,6 @@ arrayref = "0.3.6"
 base64 = "0.13.0"
 borsh = "0.9"
 bytemuck = "1.4.0"
-solana-program = "~1.10.29"
+solana-program = "1.13.3"
 thiserror = "1.0.20"
 bincode = "1.3.3"

+ 3 - 3
spl/Cargo.toml

@@ -23,7 +23,7 @@ dex = ["serum_dex"]
 anchor-lang = { path = "../lang", version = "0.25.0", features = ["derive"] }
 borsh = { version = "^0.9", optional = true }
 serum_dex = { git = "https://github.com/project-serum/serum-dex", rev = "1be91f2", version = "0.4.0", features = ["no-entrypoint"], optional = true }
-solana-program = "~1.10.29"
-spl-token = { version = "~3.3.0", features = ["no-entrypoint"], optional = true }
-spl-associated-token-account = { version = "~1.0.5", features = ["no-entrypoint"], optional = true }
+solana-program = "1.13.3"
+spl-token = { version = "3.5.0", features = ["no-entrypoint"], optional = true }
+spl-associated-token-account = { version = "1.1.1", features = ["no-entrypoint"], optional = true }
 mpl-token-metadata = { version = "1.3.4", optional = true, features = ["no-entrypoint"] }

+ 1 - 0
spl/src/associated_token.rs

@@ -10,6 +10,7 @@ pub fn create<'info>(ctx: CpiContext<'_, '_, '_, 'info, Create<'info>>) -> Resul
         ctx.accounts.payer.key,
         ctx.accounts.authority.key,
         ctx.accounts.mint.key,
+        ctx.accounts.token_program.key,
     );
     solana_program::program::invoke_signed(
         &ix,

+ 1 - 1
tests/auction-house

@@ -1 +1 @@
-Subproject commit 45518c16f00c68509e06432925403046f2b64463
+Subproject commit b73b60e55a87bda1d2770c7c10db920db9cdb06b

+ 1 - 1
tests/cfo/deps/swap

@@ -1 +1 @@
-Subproject commit 9c6bd407eb96ac77f4aef0d4387ca5b122f1c20c
+Subproject commit 24c6e5c9845f5f4cbfd51bd239fcbe6eaa2e5337

+ 1 - 1
tests/cfo/programs/cfo/Cargo.toml

@@ -19,7 +19,7 @@ test = []
 [dependencies]
 anchor-lang = { path = "../../../../lang" }
 anchor-spl = { path = "../../../../spl" }
-spl-token = { version = "~3.3.0", features = ["no-entrypoint"] }
+spl-token = { version = "3.5.0", features = ["no-entrypoint"] }
 swap = { path = "../../deps/swap/programs/swap", features = ["cpi"] }
 serum_dex = { path = "../../deps/serum-dex/dex", features = ["no-entrypoint"] }
 registry = { path = "../../deps/stake/programs/registry", features = ["cpi"] }

+ 1 - 1
tests/misc/programs/misc/Cargo.toml

@@ -19,4 +19,4 @@ default = []
 anchor-lang = { path = "../../../../lang", features = ["init-if-needed"] }
 anchor-spl = { path = "../../../../spl" }
 misc2 = { path = "../misc2", features = ["cpi"] }
-spl-associated-token-account = "~1.0.3"
+spl-associated-token-account = "1.1.1"

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно