From 89e94d1d6ae3c7af79ec1e329b8755c4a8155dfa Mon Sep 17 00:00:00 2001 From: Ryan De La O Date: Sat, 13 May 2023 02:17:47 -0700 Subject: [PATCH 01/12] cli: Fix incorrect metadata.address generation (#2485) Currently when running 'anchor deploy --program-name --program-keypair ' the cli still uses the auto-generated keypair when fetching the program id to add to the IDL metadata at the end. It should instead use the address from the specified keypair. --------- Co-authored-by: acheron --- CHANGELOG.md | 1 + cli/src/lib.rs | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68c1b397e8..398f7d1de8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The minor version will be incremented upon a breaking change and the patch versi - ts: Narrowed `AccountClient` type to it's appropriate account type ([#2440](https://github.com/coral-xyz/anchor/pull/2440)) - lang: Fix inability to use identifiers `program_id`, `accounts`, `ix_data`, `remaining_accounts` in instruction arguments ([#2464](https://github.com/coral-xyz/anchor/pull/2464)) +- cli: Fix incorrect `metadata.address` generation in IDL after deploying with a custom keypair ([#2485](https://github.com/coral-xyz/anchor/pull/2485)) ### Breaking diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 0f70c8fcf2..b63dbc7a4f 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -3024,9 +3024,17 @@ fn deploy( println!("Program path: {binary_path}..."); - let program_keypair_filepath = match &program_keypair { - Some(program_keypair) => program_keypair.clone(), - None => program.keypair_file()?.path().display().to_string(), + let (program_keypair_filepath, program_id) = match &program_keypair { + Some(path) => ( + path.clone(), + solana_sdk::signature::read_keypair_file(path) + .map_err(|_| anyhow!("Unable to read keypair file"))? + .pubkey(), + ), + None => ( + program.keypair_file()?.path().display().to_string(), + program.pubkey()?, + ), }; // Send deploy transactions. @@ -3049,11 +3057,10 @@ fn deploy( std::process::exit(exit.status.code().unwrap_or(1)); } - let program_pubkey = program.pubkey()?; if let Some(mut idl) = program.idl.as_mut() { // Add program address to the IDL. idl.metadata = Some(serde_json::to_value(IdlTestMetadata { - address: program_pubkey.to_string(), + address: program_id.to_string(), })?); // Persist it. From b7bada148cead931bc3bdae7e9a641e9be66e6a6 Mon Sep 17 00:00:00 2001 From: Pierre Date: Tue, 16 May 2023 23:46:40 +1000 Subject: [PATCH 02/12] fix: remove skip preflight from cli (#2492) --------- Co-authored-by: acheron --- CHANGELOG.md | 1 + cli/src/lib.rs | 37 ++++++------------------------------- 2 files changed, 7 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 398f7d1de8..63f5bd5364 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The minor version will be incremented upon a breaking change and the patch versi - ts: Narrowed `AccountClient` type to it's appropriate account type ([#2440](https://github.com/coral-xyz/anchor/pull/2440)) - lang: Fix inability to use identifiers `program_id`, `accounts`, `ix_data`, `remaining_accounts` in instruction arguments ([#2464](https://github.com/coral-xyz/anchor/pull/2464)) - cli: Fix incorrect `metadata.address` generation in IDL after deploying with a custom keypair ([#2485](https://github.com/coral-xyz/anchor/pull/2485)) +- cli: IDL commands no longer hang when the payer doesn't have funds to pay for the transaction fee ([#2492](https://github.com/coral-xyz/anchor/pull/2492)) ### Breaking diff --git a/cli/src/lib.rs b/cli/src/lib.rs index b63dbc7a4f..b1df254e4a 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -20,7 +20,6 @@ use semver::{Version, VersionReq}; use serde::{Deserialize, Serialize}; use serde_json::{json, Map, Value as JsonValue}; use solana_client::rpc_client::RpcClient; -use solana_client::rpc_config::RpcSendTransactionConfig; use solana_program::instruction::{AccountMeta, Instruction}; use solana_sdk::account_utils::StateMut; use solana_sdk::bpf_loader; @@ -1931,13 +1930,9 @@ fn idl_set_buffer(cfg_override: &ConfigOverride, program_id: Pubkey, buffer: Pub ); // Send the transaction. - client.send_and_confirm_transaction_with_spinner_and_config( + client.send_and_confirm_transaction_with_spinner_and_commitment( &tx, CommitmentConfig::confirmed(), - RpcSendTransactionConfig { - skip_preflight: true, - ..RpcSendTransactionConfig::default() - }, )?; Ok(()) @@ -2020,13 +2015,9 @@ fn idl_set_authority( &[&keypair], latest_hash, ); - client.send_and_confirm_transaction_with_spinner_and_config( + client.send_and_confirm_transaction_with_spinner_and_commitment( &tx, CommitmentConfig::confirmed(), - RpcSendTransactionConfig { - skip_preflight: true, - ..RpcSendTransactionConfig::default() - }, )?; println!("Authority update complete."); @@ -2077,13 +2068,9 @@ fn idl_close_account(cfg: &Config, program_id: &Pubkey, idl_address: Pubkey) -> &[&keypair], latest_hash, ); - client.send_and_confirm_transaction_with_spinner_and_config( + client.send_and_confirm_transaction_with_spinner_and_commitment( &tx, CommitmentConfig::confirmed(), - RpcSendTransactionConfig { - skip_preflight: true, - ..RpcSendTransactionConfig::default() - }, )?; Ok(()) @@ -2141,13 +2128,9 @@ fn idl_write(cfg: &Config, program_id: &Pubkey, idl: &Idl, idl_address: Pubkey) &[&keypair], latest_hash, ); - client.send_and_confirm_transaction_with_spinner_and_config( + client.send_and_confirm_transaction_with_spinner_and_commitment( &tx, CommitmentConfig::confirmed(), - RpcSendTransactionConfig { - skip_preflight: true, - ..RpcSendTransactionConfig::default() - }, )?; offset += MAX_WRITE_SIZE; } @@ -3175,13 +3158,9 @@ fn create_idl_account( &[&keypair], latest_hash, ); - client.send_and_confirm_transaction_with_spinner_and_config( + client.send_and_confirm_transaction_with_spinner_and_commitment( &tx, CommitmentConfig::finalized(), - RpcSendTransactionConfig { - skip_preflight: true, - ..RpcSendTransactionConfig::default() - }, )?; } @@ -3243,13 +3222,9 @@ fn create_idl_buffer( ); // Send the transaction. - client.send_and_confirm_transaction_with_spinner_and_config( + client.send_and_confirm_transaction_with_spinner_and_commitment( &tx, CommitmentConfig::confirmed(), - RpcSendTransactionConfig { - skip_preflight: true, - ..RpcSendTransactionConfig::default() - }, )?; Ok(buffer.pubkey()) From 41a4d820d3d376830e281852cf244a7b2adcbe7b Mon Sep 17 00:00:00 2001 From: chalda Date: Thu, 18 May 2023 19:12:25 +0200 Subject: [PATCH 03/12] cli: Add print base64 instruction option for some of the IDL commands (#2486) Co-authored-by: acheron --- CHANGELOG.md | 1 + Cargo.lock | 2 + cli/Cargo.toml | 2 + cli/src/lib.rs | 213 +++++++++++++++++++++++++++++++++++-------------- 4 files changed, 159 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63f5bd5364..784473b24d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The minor version will be incremented upon a breaking change and the patch versi - spl: Add `token_program` constraint to `Token`, `Mint`, and `AssociatedToken` accounts in order to override required `token_program` fields and use different token interface implementations in the same instruction ([#2460](https://github.com/coral-xyz/anchor/pull/2460)) - cli: Add support for Solidity programs. `anchor init` and `anchor new` take an option `--solidity` which creates solidity code rather than rust. `anchor build` and `anchor test` work accordingly ([#2421](https://github.com/coral-xyz/anchor/pull/2421)) - bench: Add benchmarking for compute units usage ([#2466](https://github.com/coral-xyz/anchor/pull/2466)) +- cli: `idl set-buffer`, `idl set-authority` and `idl close` take an option `--print-only`. which prints transaction in a base64 Borsh compatible format but not sent to the cluster. It's helpful when managing authority under a multisig, e.g., a user can create a proposal for a `Custom Instruction` in SPL Governance ([#2486](https://github.com/coral-xyz/anchor/pull/2486)). ### Fixes diff --git a/Cargo.lock b/Cargo.lock index a56e49d6c6..7da4ed4378 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -169,6 +169,8 @@ dependencies = [ "anchor-lang", "anchor-syn", "anyhow", + "base64 0.13.1", + "bincode", "cargo_toml", "chrono", "clap 4.2.4", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 63537baf59..1d8665d756 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -19,6 +19,8 @@ default = [] [dependencies] clap = { version = "4.2.4", features = ["derive"] } anyhow = "1.0.32" +base64 = "0.13.1" +bincode = "1.3.3" syn = { version = "1.0.60", features = ["full", "extra-traits"] } anchor-lang = { path = "../lang", version = "0.27.0" } anchor-client = { path = "../client", version = "0.27.0" } diff --git a/cli/src/lib.rs b/cli/src/lib.rs index b1df254e4a..0d2dd1f386 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -336,6 +336,10 @@ pub enum IdlCommand { }, Close { program_id: Pubkey, + /// When used, the content of the instruction will only be printed in base64 form and not executed. + /// Useful for multisig execution when the local wallet keypair is not available. + #[clap(long)] + print_only: bool, }, /// Writes an IDL into a buffer account. This can be used with SetBuffer /// to perform an upgrade. @@ -350,6 +354,10 @@ pub enum IdlCommand { /// Address of the buffer account to set as the idl on the program. #[clap(short, long)] buffer: Pubkey, + /// When used, the content of the instruction will only be printed in base64 form and not executed. + /// Useful for multisig execution when the local wallet keypair is not available. + #[clap(long)] + print_only: bool, }, /// Upgrades the IDL to the new file. An alias for first writing and then /// then setting the idl buffer account. @@ -369,6 +377,10 @@ pub enum IdlCommand { /// New authority of the IDL account. #[clap(short, long)] new_authority: Pubkey, + /// When used, the content of the instruction will only be printed in base64 form and not executed. + /// Useful for multisig execution when the local wallet keypair is not available. + #[clap(long)] + print_only: bool, }, /// Command to remove the ability to modify the IDL account. This should /// likely be used in conjection with eliminating an "upgrade authority" on @@ -1823,14 +1835,19 @@ fn idl(cfg_override: &ConfigOverride, subcmd: IdlCommand) -> Result<()> { program_id, filepath, } => idl_init(cfg_override, program_id, filepath), - IdlCommand::Close { program_id } => idl_close(cfg_override, program_id), + IdlCommand::Close { + program_id, + print_only, + } => idl_close(cfg_override, program_id, print_only), IdlCommand::WriteBuffer { program_id, filepath, } => idl_write_buffer(cfg_override, program_id, filepath).map(|_| ()), - IdlCommand::SetBuffer { program_id, buffer } => { - idl_set_buffer(cfg_override, program_id, buffer) - } + IdlCommand::SetBuffer { + program_id, + buffer, + print_only, + } => idl_set_buffer(cfg_override, program_id, buffer, print_only), IdlCommand::Upgrade { program_id, filepath, @@ -1839,7 +1856,8 @@ fn idl(cfg_override: &ConfigOverride, subcmd: IdlCommand) -> Result<()> { program_id, address, new_authority, - } => idl_set_authority(cfg_override, program_id, address, new_authority), + print_only, + } => idl_set_authority(cfg_override, program_id, address, new_authority, print_only), IdlCommand::EraseAuthority { program_id } => idl_erase_authority(cfg_override, program_id), IdlCommand::Authority { program_id } => idl_authority(cfg_override, program_id), IdlCommand::Parse { @@ -1852,6 +1870,12 @@ fn idl(cfg_override: &ConfigOverride, subcmd: IdlCommand) -> Result<()> { } } +fn get_idl_account(client: &RpcClient, idl_address: &Pubkey) -> Result { + let account = client.get_account(idl_address)?; + let mut data: &[u8] = &account.data; + AccountDeserialize::try_deserialize(&mut data).map_err(|e| anyhow!("{:?}", e)) +} + fn idl_init(cfg_override: &ConfigOverride, program_id: Pubkey, idl_filepath: String) -> Result<()> { with_workspace(cfg_override, |cfg| { let keypair = cfg.provider.wallet.to_string(); @@ -1866,12 +1890,14 @@ fn idl_init(cfg_override: &ConfigOverride, program_id: Pubkey, idl_filepath: Str }) } -fn idl_close(cfg_override: &ConfigOverride, program_id: Pubkey) -> Result<()> { +fn idl_close(cfg_override: &ConfigOverride, program_id: Pubkey, print_only: bool) -> Result<()> { with_workspace(cfg_override, |cfg| { let idl_address = IdlAccount::address(&program_id); - idl_close_account(cfg, &program_id, idl_address)?; + idl_close_account(cfg, &program_id, idl_address, print_only)?; - println!("Idl account closed: {idl_address:?}"); + if !print_only { + println!("Idl account closed: {idl_address:?}"); + } Ok(()) }) @@ -1897,19 +1923,30 @@ fn idl_write_buffer( }) } -fn idl_set_buffer(cfg_override: &ConfigOverride, program_id: Pubkey, buffer: Pubkey) -> Result<()> { +fn idl_set_buffer( + cfg_override: &ConfigOverride, + program_id: Pubkey, + buffer: Pubkey, + print_only: bool, +) -> Result<()> { with_workspace(cfg_override, |cfg| { let keypair = solana_sdk::signature::read_keypair_file(&cfg.provider.wallet.to_string()) .map_err(|_| anyhow!("Unable to read keypair file"))?; let url = cluster_url(cfg, &cfg.test_validator); let client = RpcClient::new(url); + let idl_address = IdlAccount::address(&program_id); + let idl_authority = if print_only { + get_idl_account(&client, &idl_address)?.authority + } else { + keypair.pubkey() + }; // Instruction to set the buffer onto the IdlAccount. - let set_buffer_ix = { + let ix = { let accounts = vec![ AccountMeta::new(buffer, false), - AccountMeta::new(IdlAccount::address(&program_id), false), - AccountMeta::new(keypair.pubkey(), true), + AccountMeta::new(idl_address, false), + AccountMeta::new(idl_authority, true), ]; let mut data = anchor_lang::idl::IDL_IX_TAG.to_le_bytes().to_vec(); data.append(&mut IdlInstruction::SetBuffer.try_to_vec()?); @@ -1920,20 +1957,24 @@ fn idl_set_buffer(cfg_override: &ConfigOverride, program_id: Pubkey, buffer: Pub } }; - // Build the transaction. - let latest_hash = client.get_latest_blockhash()?; - let tx = Transaction::new_signed_with_payer( - &[set_buffer_ix], - Some(&keypair.pubkey()), - &[&keypair], - latest_hash, - ); + if print_only { + print_idl_instruction("SetBuffer", &ix, &idl_address)?; + } else { + // Build the transaction. + let latest_hash = client.get_latest_blockhash()?; + let tx = Transaction::new_signed_with_payer( + &[ix], + Some(&keypair.pubkey()), + &[&keypair], + latest_hash, + ); - // Send the transaction. - client.send_and_confirm_transaction_with_spinner_and_commitment( - &tx, - CommitmentConfig::confirmed(), - )?; + // Send the transaction. + client.send_and_confirm_transaction_with_spinner_and_commitment( + &tx, + CommitmentConfig::confirmed(), + )?; + } Ok(()) }) @@ -1945,7 +1986,7 @@ fn idl_upgrade( idl_filepath: String, ) -> Result<()> { let buffer = idl_write_buffer(cfg_override, program_id, idl_filepath)?; - idl_set_buffer(cfg_override, program_id, buffer) + idl_set_buffer(cfg_override, program_id, buffer, false) } fn idl_authority(cfg_override: &ConfigOverride, program_id: Pubkey) -> Result<()> { @@ -1964,9 +2005,7 @@ fn idl_authority(cfg_override: &ConfigOverride, program_id: Pubkey) -> Result<() } }; - let account = client.get_account(&idl_address)?; - let mut data: &[u8] = &account.data; - let idl_account: IdlAccount = AccountDeserialize::try_deserialize(&mut data)?; + let idl_account = get_idl_account(&client, &idl_address)?; println!("{:?}", idl_account.authority); @@ -1979,6 +2018,7 @@ fn idl_set_authority( program_id: Pubkey, address: Option, new_authority: Pubkey, + print_only: bool, ) -> Result<()> { with_workspace(cfg_override, |cfg| { // Misc. @@ -1991,6 +2031,12 @@ fn idl_set_authority( let url = cluster_url(cfg, &cfg.test_validator); let client = RpcClient::new(url); + let idl_authority = if print_only { + get_idl_account(&client, &idl_address)?.authority + } else { + keypair.pubkey() + }; + // Instruction data. let data = serialize_idl_ix(anchor_lang::idl::IdlInstruction::SetAuthority { new_authority })?; @@ -1998,7 +2044,7 @@ fn idl_set_authority( // Instruction accounts. let accounts = vec![ AccountMeta::new(idl_address, false), - AccountMeta::new_readonly(keypair.pubkey(), true), + AccountMeta::new_readonly(idl_authority, true), ]; // Instruction. @@ -2007,20 +2053,25 @@ fn idl_set_authority( accounts, data, }; - // Send transaction. - let latest_hash = client.get_latest_blockhash()?; - let tx = Transaction::new_signed_with_payer( - &[ix], - Some(&keypair.pubkey()), - &[&keypair], - latest_hash, - ); - client.send_and_confirm_transaction_with_spinner_and_commitment( - &tx, - CommitmentConfig::confirmed(), - )?; - println!("Authority update complete."); + if print_only { + print_idl_instruction("SetAuthority", &ix, &idl_address)?; + } else { + // Send transaction. + let latest_hash = client.get_latest_blockhash()?; + let tx = Transaction::new_signed_with_payer( + &[ix], + Some(&keypair.pubkey()), + &[&keypair], + latest_hash, + ); + client.send_and_confirm_transaction_with_spinner_and_commitment( + &tx, + CommitmentConfig::confirmed(), + )?; + + println!("Authority update complete."); + } Ok(()) }) @@ -2037,22 +2088,32 @@ fn idl_erase_authority(cfg_override: &ConfigOverride, program_id: Pubkey) -> Res return Ok(()); } - idl_set_authority(cfg_override, program_id, None, ERASED_AUTHORITY)?; + idl_set_authority(cfg_override, program_id, None, ERASED_AUTHORITY, false)?; Ok(()) } -fn idl_close_account(cfg: &Config, program_id: &Pubkey, idl_address: Pubkey) -> Result<()> { +fn idl_close_account( + cfg: &Config, + program_id: &Pubkey, + idl_address: Pubkey, + print_only: bool, +) -> Result<()> { let keypair = solana_sdk::signature::read_keypair_file(&cfg.provider.wallet.to_string()) .map_err(|_| anyhow!("Unable to read keypair file"))?; let url = cluster_url(cfg, &cfg.test_validator); let client = RpcClient::new(url); + let idl_authority = if print_only { + get_idl_account(&client, &idl_address)?.authority + } else { + keypair.pubkey() + }; // Instruction accounts. let accounts = vec![ AccountMeta::new(idl_address, false), - AccountMeta::new_readonly(keypair.pubkey(), true), - AccountMeta::new(keypair.pubkey(), true), + AccountMeta::new_readonly(idl_authority, true), + AccountMeta::new(keypair.pubkey(), false), ]; // Instruction. let ix = Instruction { @@ -2060,18 +2121,23 @@ fn idl_close_account(cfg: &Config, program_id: &Pubkey, idl_address: Pubkey) -> accounts, data: { serialize_idl_ix(anchor_lang::idl::IdlInstruction::Close {})? }, }; - // Send transaction. - let latest_hash = client.get_latest_blockhash()?; - let tx = Transaction::new_signed_with_payer( - &[ix], - Some(&keypair.pubkey()), - &[&keypair], - latest_hash, - ); - client.send_and_confirm_transaction_with_spinner_and_commitment( - &tx, - CommitmentConfig::confirmed(), - )?; + + if print_only { + print_idl_instruction("Close", &ix, &idl_address)?; + } else { + // Send transaction. + let latest_hash = client.get_latest_blockhash()?; + let tx = Transaction::new_signed_with_payer( + &[ix], + Some(&keypair.pubkey()), + &[&keypair], + latest_hash, + ); + client.send_and_confirm_transaction_with_spinner_and_commitment( + &tx, + CommitmentConfig::confirmed(), + )?; + } Ok(()) } @@ -2179,6 +2245,35 @@ fn write_idl(idl: &Idl, out: OutFile) -> Result<()> { Ok(()) } +/// Print `base64+borsh` encoded IDL instruction. +fn print_idl_instruction(ix_name: &str, ix: &Instruction, idl_address: &Pubkey) -> Result<()> { + println!("Print only mode. No execution!"); + println!("Instruction: {ix_name}"); + println!("IDL address: {idl_address}"); + println!("Program: {}", ix.program_id); + + // Serialize with `bincode` because `Instruction` does not implement `BorshSerialize` + let mut serialized_ix = bincode::serialize(ix)?; + + // Remove extra bytes in order to make the serialized instruction `borsh` compatible + // `bincode` uses 8 bytes(LE) for length meanwhile `borsh` uses 4 bytes(LE) + let mut remove_extra_vec_bytes = |index: usize| { + serialized_ix.drain((index + 4)..(index + 8)); + }; + + let accounts_index = std::mem::size_of_val(&ix.program_id); + remove_extra_vec_bytes(accounts_index); + let data_index = accounts_index + 4 + std::mem::size_of_val(&*ix.accounts); + remove_extra_vec_bytes(data_index); + + println!( + "Base64 encoded instruction: {}", + base64::encode(serialized_ix) + ); + + Ok(()) +} + fn account( cfg_override: &ConfigOverride, account_type: String, From 4793b90db17f233c30c8c9213756213f987a345b Mon Sep 17 00:00:00 2001 From: acheron <98934430+acheroncrypto@users.noreply.github.com> Date: Fri, 19 May 2023 10:58:16 +0200 Subject: [PATCH 04/12] Fix `toml_datetime` 1.64.0 MSRV error (#2495) --- Cargo.lock | 25 ++++++++++++++++--------- spl/Cargo.toml | 3 ++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7da4ed4378..f5ec0535fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -265,6 +265,7 @@ dependencies = [ "spl-associated-token-account", "spl-token", "spl-token-2022", + "toml_datetime", "winnow", ] @@ -763,22 +764,22 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.12.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f5715e491b5a1598fc2bef5a606847b5dc1d48ea625bd3c02c00de8285591da" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.2.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9e1f5fa78f69496407a27ae9ed989e3c3b072310286f5ef385525e4cbc24a9" +checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ "proc-macro2 1.0.56", "quote 1.0.26", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] @@ -2563,18 +2564,18 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.7" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.5.7" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ "proc-macro-crate 1.2.1", "proc-macro2 1.0.56", @@ -4938,6 +4939,12 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" + [[package]] name = "tower-service" version = "0.3.2" diff --git a/spl/Cargo.toml b/spl/Cargo.toml index 3d4b200632..a0334f664e 100644 --- a/spl/Cargo.toml +++ b/spl/Cargo.toml @@ -30,7 +30,8 @@ spl-token-2022 = { version = "0.5.0", features = ["no-entrypoint"], optional = t spl-associated-token-account = { version = "1.1.1", features = ["no-entrypoint"], optional = true } mpl-token-metadata = { version = "^1.11.0", optional = true, features = ["no-entrypoint"] } -# TODO: Remove after updating to latest version of platform-tools. +# TODO: Remove after Solana release v1.16 # Latest solana version(1.14.17) as of 2023-05-01 comes with rustc 1.62.0-dev but MSRV for latest # version of this crate is 1.64.0. See https://github.com/solana-labs/solana/pull/31418 winnow = "=0.4.1" +toml_datetime = "=0.6.1" From f9d0eca7040a7607e35e37b610e3600c1b78fd4e Mon Sep 17 00:00:00 2001 From: acheron <98934430+acheroncrypto@users.noreply.github.com> Date: Fri, 19 May 2023 13:18:14 +0200 Subject: [PATCH 05/12] spl: Update `spl-token-2022` to 0.6.1 (#2496) --- Cargo.lock | 28 +++++++++++++++---- spl/Cargo.toml | 2 +- tests/escrow/programs/escrow/Cargo.toml | 1 - tests/escrow/programs/escrow/src/lib.rs | 6 ++-- .../programs/token-proxy/Cargo.toml | 1 - .../programs/token-proxy/src/lib.rs | 10 +++++-- .../programs/token-wrapper/Cargo.toml | 1 - 7 files changed, 34 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f5ec0535fa..d2730894c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -264,7 +264,7 @@ dependencies = [ "solana-program", "spl-associated-token-account", "spl-token", - "spl-token-2022", + "spl-token-2022 0.6.1", "toml_datetime", "winnow", ] @@ -3727,7 +3727,7 @@ dependencies = [ "solana-config-program", "solana-sdk", "spl-token", - "spl-token-2022", + "spl-token-2022 0.5.0", "thiserror", "zstd", ] @@ -4219,7 +4219,7 @@ dependencies = [ "solana-sdk", "solana-transaction-status", "solana-version", - "spl-token-2022", + "spl-token-2022 0.5.0", "thiserror", ] @@ -4397,7 +4397,7 @@ dependencies = [ "spl-associated-token-account", "spl-memo", "spl-token", - "spl-token-2022", + "spl-token-2022 0.5.0", "thiserror", ] @@ -4546,7 +4546,7 @@ dependencies = [ "num-traits", "solana-program", "spl-token", - "spl-token-2022", + "spl-token-2022 0.5.0", "thiserror", ] @@ -4592,6 +4592,24 @@ dependencies = [ "thiserror", ] +[[package]] +name = "spl-token-2022" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0043b590232c400bad5ee9eb983ced003d15163c4c5d56b090ac6d9a57457b47" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-program", + "solana-zk-token-sdk", + "spl-memo", + "spl-token", + "thiserror", +] + [[package]] name = "static_assertions" version = "1.1.0" diff --git a/spl/Cargo.toml b/spl/Cargo.toml index a0334f664e..b01cc52141 100644 --- a/spl/Cargo.toml +++ b/spl/Cargo.toml @@ -26,7 +26,7 @@ borsh = { version = "^0.9", optional = true } serum_dex = { git = "https://github.com/openbook-dex/program/", rev = "1be91f2", version = "0.4.0", features = ["no-entrypoint"], optional = true } solana-program = "1.14.16" spl-token = { version = "3.5.0", features = ["no-entrypoint"], optional = true } -spl-token-2022 = { version = "0.5.0", features = ["no-entrypoint"], optional = true } +spl-token-2022 = { version = "0.6.1", features = ["no-entrypoint"], optional = true } spl-associated-token-account = { version = "1.1.1", features = ["no-entrypoint"], optional = true } mpl-token-metadata = { version = "^1.11.0", optional = true, features = ["no-entrypoint"] } diff --git a/tests/escrow/programs/escrow/Cargo.toml b/tests/escrow/programs/escrow/Cargo.toml index dd6bcf9e0b..1a75dd327c 100644 --- a/tests/escrow/programs/escrow/Cargo.toml +++ b/tests/escrow/programs/escrow/Cargo.toml @@ -18,4 +18,3 @@ default = [] [dependencies] anchor-lang = { path = "../../../../lang" } anchor-spl = { path = "../../../../spl" } -spl-token-2022 = { version = "0.5.0", features = ["no-entrypoint"] } diff --git a/tests/escrow/programs/escrow/src/lib.rs b/tests/escrow/programs/escrow/src/lib.rs index e0456344ab..7476dcb94c 100644 --- a/tests/escrow/programs/escrow/src/lib.rs +++ b/tests/escrow/programs/escrow/src/lib.rs @@ -16,10 +16,10 @@ //! - Initializer will get back ownership of their token X account use anchor_lang::prelude::*; -use anchor_spl::token_interface::{ - self, Mint, SetAuthority, TokenAccount, TokenInterface, TransferChecked, +use anchor_spl::{ + token_2022::spl_token_2022::instruction::AuthorityType, + token_interface::{self, Mint, SetAuthority, TokenAccount, TokenInterface, TransferChecked}, }; -use spl_token_2022::instruction::AuthorityType; declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"); diff --git a/tests/spl/token-proxy/programs/token-proxy/Cargo.toml b/tests/spl/token-proxy/programs/token-proxy/Cargo.toml index dbf8f4a201..122355d369 100644 --- a/tests/spl/token-proxy/programs/token-proxy/Cargo.toml +++ b/tests/spl/token-proxy/programs/token-proxy/Cargo.toml @@ -16,4 +16,3 @@ cpi = ["no-entrypoint"] [dependencies] anchor-lang = { path = "../../../../../lang" } anchor-spl = { path = "../../../../../spl" } -spl-token-2022 = { version = "0.5.0", features = ["no-entrypoint"] } diff --git a/tests/spl/token-proxy/programs/token-proxy/src/lib.rs b/tests/spl/token-proxy/programs/token-proxy/src/lib.rs index c609816f5d..90ae59365d 100644 --- a/tests/spl/token-proxy/programs/token-proxy/src/lib.rs +++ b/tests/spl/token-proxy/programs/token-proxy/src/lib.rs @@ -1,9 +1,13 @@ //! This example demonstrates the use of the `anchor_spl::token` CPI client. use anchor_lang::prelude::*; -use anchor_spl::associated_token::AssociatedToken; -use anchor_spl::token_interface::{ - self, Burn, Mint, MintTo, SetAuthority, TokenAccount, TokenInterface, Transfer, TransferChecked, +use anchor_spl::{ + associated_token::AssociatedToken, + token_2022::spl_token_2022, + token_interface::{ + self, Burn, Mint, MintTo, SetAuthority, TokenAccount, TokenInterface, Transfer, + TransferChecked, + }, }; declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"); diff --git a/tests/spl/token-wrapper/programs/token-wrapper/Cargo.toml b/tests/spl/token-wrapper/programs/token-wrapper/Cargo.toml index 0026c17632..e83d329891 100644 --- a/tests/spl/token-wrapper/programs/token-wrapper/Cargo.toml +++ b/tests/spl/token-wrapper/programs/token-wrapper/Cargo.toml @@ -18,4 +18,3 @@ default = [] [dependencies] anchor-lang = { path = "../../../../../lang" } anchor-spl = { path = "../../../../../spl" } -spl-token-2022 = { version = "0.5.0", features = ["no-entrypoint"] } From 67eb7520b5ef738b4990bc44c292cfefcb63412e Mon Sep 17 00:00:00 2001 From: acheron <98934430+acheroncrypto@users.noreply.github.com> Date: Sat, 20 May 2023 20:34:38 +0200 Subject: [PATCH 06/12] tests: Fix zero-copy tests (#2498) --- .github/workflows/reusable-tests.yaml | 2 +- tests/zero-copy/rust-toolchain.toml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 tests/zero-copy/rust-toolchain.toml diff --git a/.github/workflows/reusable-tests.yaml b/.github/workflows/reusable-tests.yaml index e69c38a7da..e8f08f27cc 100644 --- a/.github/workflows/reusable-tests.yaml +++ b/.github/workflows/reusable-tests.yaml @@ -403,7 +403,7 @@ jobs: path: tests/declare-id - cmd: cd tests/typescript && anchor test --skip-lint && npx tsc --noEmit path: tests/typescript - - cmd: cd tests/zero-copy && anchor test --skip-lint && cd programs/zero-copy && cargo test-bpf + - cmd: cd tests/zero-copy && rustup toolchain install 1.66.1-x86_64-unknown-linux-gnu && anchor test --skip-lint && cd programs/zero-copy && cargo test-bpf path: tests/zero-copy - cmd: cd tests/chat && anchor test --skip-lint path: tests/chat diff --git a/tests/zero-copy/rust-toolchain.toml b/tests/zero-copy/rust-toolchain.toml new file mode 100644 index 0000000000..7bd4253328 --- /dev/null +++ b/tests/zero-copy/rust-toolchain.toml @@ -0,0 +1,3 @@ +# TODO: Remove when `cargo-test-sbf` works with stable Rust +[toolchain] +channel = "1.66.1-x86_64-unknown-linux-gnu" From c3625c8cf2ea1cb5f94859f6234c2d73c6f17928 Mon Sep 17 00:00:00 2001 From: Last Emperor <46998219+lastemp@users.noreply.github.com> Date: Wed, 24 May 2023 15:05:47 +0300 Subject: [PATCH 07/12] examples: Add an example with `instruction` method (#2501) Co-authored-by: acheron --- examples/tutorial/basic-5/Anchor.toml | 9 ++ examples/tutorial/basic-5/Cargo.toml | 4 + examples/tutorial/basic-5/README.md | 13 ++ examples/tutorial/basic-5/package.json | 19 +++ .../basic-5/programs/basic-5/Cargo.toml | 17 +++ .../basic-5/programs/basic-5/Xargo.toml | 2 + .../basic-5/programs/basic-5/src/lib.rs | 115 ++++++++++++++++ examples/tutorial/basic-5/tests/basic-5.ts | 123 ++++++++++++++++++ examples/tutorial/basic-5/tsconfig.json | 10 ++ examples/tutorial/package.json | 12 +- examples/tutorial/yarn.lock | 118 ++++++++++++++++- 11 files changed, 434 insertions(+), 8 deletions(-) create mode 100644 examples/tutorial/basic-5/Anchor.toml create mode 100644 examples/tutorial/basic-5/Cargo.toml create mode 100644 examples/tutorial/basic-5/README.md create mode 100644 examples/tutorial/basic-5/package.json create mode 100644 examples/tutorial/basic-5/programs/basic-5/Cargo.toml create mode 100644 examples/tutorial/basic-5/programs/basic-5/Xargo.toml create mode 100644 examples/tutorial/basic-5/programs/basic-5/src/lib.rs create mode 100644 examples/tutorial/basic-5/tests/basic-5.ts create mode 100644 examples/tutorial/basic-5/tsconfig.json diff --git a/examples/tutorial/basic-5/Anchor.toml b/examples/tutorial/basic-5/Anchor.toml new file mode 100644 index 0000000000..e7f396fc7f --- /dev/null +++ b/examples/tutorial/basic-5/Anchor.toml @@ -0,0 +1,9 @@ +[provider] +cluster = "localnet" +wallet = "~/.config/solana/id.json" + +[programs.localnet] +basic_5 = "DuT6R8tQGYa8ACYXyudFJtxDppSALLcmK39b7918jeSC" + +[scripts] +test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" \ No newline at end of file diff --git a/examples/tutorial/basic-5/Cargo.toml b/examples/tutorial/basic-5/Cargo.toml new file mode 100644 index 0000000000..7aa6203805 --- /dev/null +++ b/examples/tutorial/basic-5/Cargo.toml @@ -0,0 +1,4 @@ +[workspace] +members = [ + "programs/*" +] \ No newline at end of file diff --git a/examples/tutorial/basic-5/README.md b/examples/tutorial/basic-5/README.md new file mode 100644 index 0000000000..0ee5c5636c --- /dev/null +++ b/examples/tutorial/basic-5/README.md @@ -0,0 +1,13 @@ +# basic-5 + +This is a robot program developed as a Rust Smart Contract(running on Solana Blockchain). +It simplifies actions of a robot on-chain. +This program acts as an example for developers who are new to Solana ecosystem to learn on how the typescript client interacts with the program on-chain. + +Instructions of the program: + +1. Create +2. Walk +3. Run +4. Jump +5. Reset \ No newline at end of file diff --git a/examples/tutorial/basic-5/package.json b/examples/tutorial/basic-5/package.json new file mode 100644 index 0000000000..8c4eadb4eb --- /dev/null +++ b/examples/tutorial/basic-5/package.json @@ -0,0 +1,19 @@ +{ + "name": "basic-5", + "version": "0.27.0", + "license": "(MIT OR Apache-2.0)", + "homepage": "https://github.com/coral-xyz/anchor#readme", + "bugs": { + "url": "https://github.com/coral-xyz/anchor/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/coral-xyz/anchor.git" + }, + "engines": { + "node": ">=11" + }, + "scripts": { + "test": "anchor test --skip-lint" + } + } \ No newline at end of file diff --git a/examples/tutorial/basic-5/programs/basic-5/Cargo.toml b/examples/tutorial/basic-5/programs/basic-5/Cargo.toml new file mode 100644 index 0000000000..8b5ee1f8e3 --- /dev/null +++ b/examples/tutorial/basic-5/programs/basic-5/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "basic-5" +version = "0.1.0" +description = "Created with Anchor" +rust-version = "1.60" +edition = "2021" + +[lib] +crate-type = ["cdylib", "lib"] +name = "basic_5" + +[features] +no-entrypoint = [] +cpi = ["no-entrypoint"] + +[dependencies] +anchor-lang = { path = "../../../../../lang" } \ No newline at end of file diff --git a/examples/tutorial/basic-5/programs/basic-5/Xargo.toml b/examples/tutorial/basic-5/programs/basic-5/Xargo.toml new file mode 100644 index 0000000000..475fb71ed1 --- /dev/null +++ b/examples/tutorial/basic-5/programs/basic-5/Xargo.toml @@ -0,0 +1,2 @@ +[target.bpfel-unknown-unknown.dependencies.std] +features = [] diff --git a/examples/tutorial/basic-5/programs/basic-5/src/lib.rs b/examples/tutorial/basic-5/programs/basic-5/src/lib.rs new file mode 100644 index 0000000000..03542a69c3 --- /dev/null +++ b/examples/tutorial/basic-5/programs/basic-5/src/lib.rs @@ -0,0 +1,115 @@ +use anchor_lang::prelude::*; + +declare_id!("DuT6R8tQGYa8ACYXyudFJtxDppSALLcmK39b7918jeSC"); + +#[program] +pub mod basic_5 { + use super::*; + + pub fn create(ctx: Context) -> Result<()> { + let action_state = &mut ctx.accounts.action_state; + // * - means dereferencing + action_state.user = *ctx.accounts.user.key; + // Lets initialize the state + action_state.action = 0; + + Ok(()) + } + + pub fn walk(ctx: Context) -> Result<()> { + let action_state = &mut ctx.accounts.action_state; + // Lets change the robot action state to "walk" + action_state.action = 1; + + Ok(()) + } + + pub fn run(ctx: Context) -> Result<()> { + let action_state = &mut ctx.accounts.action_state; + // Lets change the robot action state to "run" + action_state.action = 2; + + Ok(()) + } + + pub fn jump(ctx: Context) -> Result<()> { + let action_state = &mut ctx.accounts.action_state; + // Lets change the robot action state to "jump" + action_state.action = 3; + + Ok(()) + } + + pub fn reset(ctx: Context) -> Result<()> { + let action_state = &mut ctx.accounts.action_state; + // Lets reset the robot action states + action_state.action = 0; + + Ok(()) + } +} + +#[derive(Accounts)] +pub struct Create<'info> { + // init means to create action_state account + // bump to use unique address for action_state account + #[account( + init, + payer = user, + space = 8 + ActionState::INIT_SPACE, + seeds = [b"action-state", user.key().as_ref()], + bump + )] + pub action_state: Account<'info, ActionState>, + // mut makes it changeble (mutable) + #[account(mut)] + pub user: Signer<'info>, + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +pub struct Walk<'info> { + // Only the user on account action_state, should be able to change state + #[account(mut, has_one = user)] + pub action_state: Account<'info, ActionState>, + // mut makes it changeble (mutable) + #[account(mut)] + pub user: Signer<'info>, +} + +#[derive(Accounts)] +pub struct Run<'info> { + // Only the user on account action_state, should be able to change state + #[account(mut, has_one = user)] + pub action_state: Account<'info, ActionState>, + // mut makes it changeble (mutable) + #[account(mut)] + pub user: Signer<'info>, +} + +#[derive(Accounts)] +pub struct Jump<'info> { + // Only the user on account action_state, should be able to change state + #[account(mut, has_one = user)] + pub action_state: Account<'info, ActionState>, + // mut makes it changeble (mutable) + #[account(mut)] + pub user: Signer<'info>, +} + +#[derive(Accounts)] +pub struct Reset<'info> { + // Only the user on account action_state, should be able to change state + #[account(mut, has_one = user)] + pub action_state: Account<'info, ActionState>, + // mut makes it changeble (mutable) + #[account(mut)] + pub user: Signer<'info>, +} + +#[account] +#[derive(InitSpace)] +pub struct ActionState { + pub user: Pubkey, + pub action: u8, +} diff --git a/examples/tutorial/basic-5/tests/basic-5.ts b/examples/tutorial/basic-5/tests/basic-5.ts new file mode 100644 index 0000000000..796b205529 --- /dev/null +++ b/examples/tutorial/basic-5/tests/basic-5.ts @@ -0,0 +1,123 @@ +import * as anchor from "@coral-xyz/anchor"; +import { + TransactionInstruction, + TransactionMessage, + VersionedTransaction, +} from "@solana/web3.js"; +import { Basic5 } from "../target/types/basic_5"; + +describe("basic-5", () => { + const provider = anchor.AnchorProvider.local(); + + // Configure the client to use the local cluster. + anchor.setProvider(provider); + + const program = anchor.workspace.Basic5 as anchor.Program; + const user = provider.wallet.publicKey; + + let [actionState] = anchor.web3.PublicKey.findProgramAddressSync( + [Buffer.from("action-state"), user.toBuffer()], + program.programId + ); + + it("basic-5: Robot actions!", async () => { + // Create instruction: set up the Solana accounts to be used + const createInstruction = await program.methods + .create() + .accounts({ + actionState, + user, + systemProgram: anchor.web3.SystemProgram.programId, + }) + .instruction(); + // Walk instruction: Invoke the Robot to walk + const walkInstruction = await program.methods + .walk() + .accounts({ + actionState, + user, + }) + .instruction(); + // Run instruction: Invoke the Robot to run + const runInstruction = await program.methods + .run() + .accounts({ + actionState, + user, + }) + .instruction(); + // Jump instruction: Invoke the Robot to jump + const jumpInstruction = await program.methods + .jump() + .accounts({ + actionState, + user, + }) + .instruction(); + // Reset instruction: Reset actions of the Robot + const resetInstruction = await program.methods + .reset() + .accounts({ + actionState, + user, + }) + .instruction(); + + // Array of instructions + const instructions: TransactionInstruction[] = [ + createInstruction, + walkInstruction, + runInstruction, + jumpInstruction, + resetInstruction, + ]; + + await createAndSendV0Tx(instructions); + }); + + async function createAndSendV0Tx(txInstructions: TransactionInstruction[]) { + // Step 1 - Fetch the latest blockhash + let latestBlockhash = await provider.connection.getLatestBlockhash( + "confirmed" + ); + console.log( + " ✅ - Fetched latest blockhash. Last Valid Height:", + latestBlockhash.lastValidBlockHeight + ); + + // Step 2 - Generate Transaction Message + const messageV0 = new TransactionMessage({ + payerKey: user, + recentBlockhash: latestBlockhash.blockhash, + instructions: txInstructions, + }).compileToV0Message(); + console.log(" ✅ - Compiled Transaction Message"); + const transaction = new VersionedTransaction(messageV0); + + // Step 3 - Sign your transaction with the required `Signers` + provider.wallet.signTransaction(transaction); + console.log(" ✅ - Transaction Signed"); + + // Step 4 - Send our v0 transaction to the cluster + const txid = await provider.connection.sendTransaction(transaction, { + maxRetries: 5, + }); + console.log(" ✅ - Transaction sent to network"); + + // Step 5 - Confirm Transaction + const confirmation = await provider.connection.confirmTransaction({ + signature: txid, + blockhash: latestBlockhash.blockhash, + lastValidBlockHeight: latestBlockhash.lastValidBlockHeight, + }); + if (confirmation.value.err) { + throw new Error( + ` ❌ - Transaction not confirmed.\nReason: ${confirmation.value.err}` + ); + } + + console.log("🎉 Transaction Succesfully Confirmed!"); + let result = await program.account.actionState.fetch(actionState); + console.log("Robot action state details: ", result); + } +}); diff --git a/examples/tutorial/basic-5/tsconfig.json b/examples/tutorial/basic-5/tsconfig.json new file mode 100644 index 0000000000..8634a05df4 --- /dev/null +++ b/examples/tutorial/basic-5/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "types": ["mocha"], + "typeRoots": ["./node_modules/@types"], + "lib": ["es2015"], + "module": "commonjs", + "target": "es6", + "esModuleInterop": true + } +} diff --git a/examples/tutorial/package.json b/examples/tutorial/package.json index fba8354deb..ede14cf18a 100644 --- a/examples/tutorial/package.json +++ b/examples/tutorial/package.json @@ -10,13 +10,17 @@ "basic-1", "basic-2", "basic-3", - "basic-4" + "basic-4", + "basic-5" ], "dependencies": { "@coral-xyz/anchor": "file:../../ts/packages/anchor" }, "devDependencies": { - "mocha": "9.2.2", - "prettier": "^2.5.1" + "mocha": "^9.2.2", + "prettier": "^2.5.1", + "@types/mocha": "^9.1.1", + "ts-mocha": "^10.0.0", + "typescript": "^4.9.5" } -} +} \ No newline at end of file diff --git a/examples/tutorial/yarn.lock b/examples/tutorial/yarn.lock index e83796f9a8..6e530da13a 100644 --- a/examples/tutorial/yarn.lock +++ b/examples/tutorial/yarn.lock @@ -36,9 +36,9 @@ toml "^3.0.0" "@coral-xyz/borsh@^0.27.0": - version "0.26.0" - resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.26.0.tgz#d054f64536d824634969e74138f9f7c52bbbc0d5" - integrity sha512-uCZ0xus0CszQPHYfWAqKS5swS1UxvePu83oOF+TWpUkedsNlg6p2p4azxZNSSqwXb9uXMFgxhuMBX9r3Xoi0vQ== + version "0.27.0" + resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.27.0.tgz#700c647ea5262b1488957ac7fb4e8acf72c72b63" + integrity sha512-tJKzhLukghTWPLy+n8K8iJKgBq1yLT/AxaNd10yJrX8mI56ao5+OFAKAqW/h0i79KCvb4BK0VGO5ECmmolFz9A== dependencies: bn.js "^5.1.2" buffer-layout "^1.2.0" @@ -102,11 +102,21 @@ "@types/qs" "*" "@types/range-parser" "*" +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== + "@types/lodash@^4.14.159": version "4.14.176" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.176.tgz#641150fc1cda36fbfa329de603bbb175d7ee20c0" integrity sha512-xZmuPTa3rlZoIbtDUyJKZQimJV3bxCmzMIO2c9Pz9afyDro6kr7R79GwcB6mRhuoPmV2p1Vb66WOJH7F886WKQ== +"@types/mocha@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" + integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== + "@types/node@*": version "16.11.7" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.7.tgz#36820945061326978c42a01e56b61cd223dfdc42" @@ -177,6 +187,11 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -259,6 +274,11 @@ bs58@^4.0.0, bs58@^4.0.1: dependencies: base-x "^3.0.2" +buffer-from@^1.0.0, buffer-from@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + buffer-layout@^1.2.0, buffer-layout@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5" @@ -385,6 +405,11 @@ diff@5.0.0: resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== +diff@^3.1.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + dot-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" @@ -614,6 +639,13 @@ json-stringify-safe@^5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= +json5@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== + dependencies: + minimist "^1.2.0" + jsonparse@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" @@ -646,6 +678,11 @@ lower-case@^2.0.2: dependencies: tslib "^2.0.3" +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + minimatch@4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-4.2.1.tgz#40d9d511a46bdc4e563c22c3080cde9c0d8299b4" @@ -660,7 +697,19 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -mocha@9.2.2: +minimist@^1.2.0, minimist@^1.2.6: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +mkdirp@^0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + +mocha@^9.2.2: version "9.2.2" resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.2.2.tgz#d70db46bdb93ca57402c809333e5a84977a88fb9" integrity sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g== @@ -838,6 +887,19 @@ snake-case@^3.0.4: dot-case "^3.0.4" tslib "^2.0.3" +source-map-support@^0.5.6: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -854,6 +916,11 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== + strip-json-comments@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -910,11 +977,49 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= +ts-mocha@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-10.0.0.tgz#41a8d099ac90dbbc64b06976c5025ffaebc53cb9" + integrity sha512-VRfgDO+iiuJFlNB18tzOfypJ21xn2xbuZyDvJvqpTbWgkAgD17ONGr8t+Tl8rcBtOBdjXp5e/Rk+d39f7XBHRw== + dependencies: + ts-node "7.0.1" + optionalDependencies: + tsconfig-paths "^3.5.0" + +ts-node@7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf" + integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw== + dependencies: + arrify "^1.0.0" + buffer-from "^1.1.0" + diff "^3.1.0" + make-error "^1.1.1" + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map-support "^0.5.6" + yn "^2.0.0" + +tsconfig-paths@^3.5.0: + version "3.14.2" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088" + integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.2" + minimist "^1.2.6" + strip-bom "^3.0.0" + tslib@^2.0.3: version "2.3.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== +typescript@^4.9.5: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + utf-8-validate@^5.0.2: version "5.0.7" resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.7.tgz#c15a19a6af1f7ad9ec7ddc425747ca28c3644922" @@ -1019,6 +1124,11 @@ yargs@16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" +yn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" + integrity sha512-uTv8J/wiWTgUTg+9vLTi//leUl5vDQS6uii/emeTb2ssY7vl6QWf2fFbIIGjnhjvbdKlU0ed7QPgY1htTC86jQ== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From 23b90bffc023058aec1004dbc0898c233fb6e9b0 Mon Sep 17 00:00:00 2001 From: Noah Gundotra Date: Fri, 26 May 2023 12:36:46 -0400 Subject: [PATCH 08/12] Feature: CPI Events API (#2438) Co-authored-by: acheron --- CHANGELOG.md | 1 + cli/Cargo.toml | 2 +- lang/Cargo.toml | 1 + lang/attribute/event/Cargo.toml | 1 + lang/attribute/event/src/lib.rs | 139 +++++++++++++++++- lang/src/error.rs | 5 + lang/src/event.rs | 3 + lang/src/lib.rs | 6 + lang/syn/Cargo.toml | 1 + lang/syn/src/codegen/program/dispatch.rs | 31 +++- lang/syn/src/codegen/program/handlers.rs | 52 ++++++- lang/syn/src/parser/accounts/event_cpi.rs | 70 +++++++++ lang/syn/src/parser/accounts/mod.rs | 37 ++++- tests/events/programs/events/Cargo.toml | 2 +- tests/events/programs/events/src/lib.rs | 12 ++ tests/events/tests/events.js | 134 ++++++++++++----- tests/yarn.lock | 31 +--- .../anchor/src/program/accounts-resolver.ts | 51 +++++++ 18 files changed, 494 insertions(+), 85 deletions(-) create mode 100644 lang/src/event.rs create mode 100644 lang/syn/src/parser/accounts/event_cpi.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 784473b24d..431168dfae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The minor version will be incremented upon a breaking change and the patch versi - cli: Add support for Solidity programs. `anchor init` and `anchor new` take an option `--solidity` which creates solidity code rather than rust. `anchor build` and `anchor test` work accordingly ([#2421](https://github.com/coral-xyz/anchor/pull/2421)) - bench: Add benchmarking for compute units usage ([#2466](https://github.com/coral-xyz/anchor/pull/2466)) - cli: `idl set-buffer`, `idl set-authority` and `idl close` take an option `--print-only`. which prints transaction in a base64 Borsh compatible format but not sent to the cluster. It's helpful when managing authority under a multisig, e.g., a user can create a proposal for a `Custom Instruction` in SPL Governance ([#2486](https://github.com/coral-xyz/anchor/pull/2486)). +- lang: Add `emit_cpi!` and `#[event_cpi]` macros(behind `event-cpi` feature flag) to store event logs in transaction metadata ([#2438](https://github.com/coral-xyz/anchor/pull/2438)). ### Fixes diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 1d8665d756..37a6f0e597 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -24,7 +24,7 @@ bincode = "1.3.3" syn = { version = "1.0.60", features = ["full", "extra-traits"] } anchor-lang = { path = "../lang", version = "0.27.0" } anchor-client = { path = "../client", version = "0.27.0" } -anchor-syn = { path = "../lang/syn", features = ["idl", "init-if-needed"], version = "0.27.0" } +anchor-syn = { path = "../lang/syn", features = ["event-cpi", "idl", "init-if-needed"], version = "0.27.0" } serde_json = "1.0" shellexpand = "2.1.0" toml = "0.5.8" diff --git a/lang/Cargo.toml b/lang/Cargo.toml index af8b0529ce..c250115141 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -13,6 +13,7 @@ allow-missing-optionals = ["anchor-derive-accounts/allow-missing-optionals"] init-if-needed = ["anchor-derive-accounts/init-if-needed"] derive = [] default = [] +event-cpi = ["anchor-attribute-event/event-cpi"] anchor-debug = [ "anchor-attribute-access-control/anchor-debug", "anchor-attribute-account/anchor-debug", diff --git a/lang/attribute/event/Cargo.toml b/lang/attribute/event/Cargo.toml index 59857fe929..7c364d373d 100644 --- a/lang/attribute/event/Cargo.toml +++ b/lang/attribute/event/Cargo.toml @@ -13,6 +13,7 @@ proc-macro = true [features] anchor-debug = ["anchor-syn/anchor-debug"] +event-cpi = ["anchor-syn/event-cpi"] [dependencies] proc-macro2 = "1.0" diff --git a/lang/attribute/event/src/lib.rs b/lang/attribute/event/src/lib.rs index 33933bdfda..7301162d3e 100644 --- a/lang/attribute/event/src/lib.rs +++ b/lang/attribute/event/src/lib.rs @@ -1,5 +1,7 @@ extern crate proc_macro; +#[cfg(feature = "event-cpi")] +use anchor_syn::parser::accounts::event_cpi::{add_event_cpi_accounts, EventAuthority}; use quote::quote; use syn::parse_macro_input; @@ -45,6 +47,14 @@ pub fn event( }) } +// EventIndex is a marker macro. It functionally does nothing other than +// allow one to mark fields with the `#[index]` inert attribute, which is +// used to add metadata to IDLs. +#[proc_macro_derive(EventIndex, attributes(index))] +pub fn derive_event(_item: proc_macro::TokenStream) -> proc_macro::TokenStream { + proc_macro::TokenStream::from(quote! {}) +} + /// Logs an event that can be subscribed to by clients. /// Uses the [`sol_log_data`](https://docs.rs/solana-program/latest/solana_program/log/fn.sol_log_data.html) /// syscall which results in the following log: @@ -81,10 +91,127 @@ pub fn emit(input: proc_macro::TokenStream) -> proc_macro::TokenStream { }) } -// EventIndex is a marker macro. It functionally does nothing other than -// allow one to mark fields with the `#[index]` inert attribute, which is -// used to add metadata to IDLs. -#[proc_macro_derive(EventIndex, attributes(index))] -pub fn derive_event(_item: proc_macro::TokenStream) -> proc_macro::TokenStream { - proc_macro::TokenStream::from(quote! {}) +/// Log an event by making a self-CPI that can be subscribed to by clients. +/// +/// This way of logging events is more reliable than [`emit!`](emit!) because RPCs are less likely +/// to truncate CPI information than program logs. +/// +/// Uses a [`invoke_signed`](https://docs.rs/solana-program/latest/solana_program/program/fn.invoke_signed.html) +/// syscall to store the event data in the ledger, which results in the data being stored in the +/// transaction metadata. +/// +/// This method requires the usage of an additional PDA to guarantee that the self-CPI is truly +/// being invoked by the same program. Requiring this PDA to be a signer during `invoke_signed` +/// syscall ensures that the program is the one doing the logging. +/// +/// The necessary accounts are added to the accounts struct via [`#[event_cpi]`](event_cpi) +/// attribute macro. +/// +/// # Example +/// +/// ```ignore +/// use anchor_lang::prelude::*; +/// +/// #[program] +/// pub mod my_program { +/// use super::*; +/// +/// pub fn my_instruction(ctx: Context) -> Result<()> { +/// emit_cpi!(MyEvent { data: 42 }); +/// Ok(()) +/// } +/// } +/// +/// #[event_cpi] +/// #[derive(Accounts)] +/// pub struct MyInstruction {} +/// +/// #[event] +/// pub struct MyEvent { +/// pub data: u64, +/// } +/// ``` +/// +/// **NOTE:** This macro requires `ctx` to be in scope. +/// +/// *Only available with `event-cpi` feature enabled.* +#[cfg(feature = "event-cpi")] +#[proc_macro] +pub fn emit_cpi(input: proc_macro::TokenStream) -> proc_macro::TokenStream { + let event_struct = parse_macro_input!(input as syn::Expr); + + let authority = EventAuthority::get(); + let authority_name = authority.name_token_stream(); + let authority_name_str = authority.name; + let authority_seeds = authority.seeds; + + proc_macro::TokenStream::from(quote! { + { + let authority_info = ctx.accounts.#authority_name.to_account_info(); + let authority_bump = *ctx.bumps.get(#authority_name_str).unwrap(); + + let disc = anchor_lang::event::EVENT_IX_TAG_LE; + let inner_data = anchor_lang::Event::data(&#event_struct); + let ix_data: Vec = disc.into_iter().chain(inner_data.into_iter()).collect(); + + let ix = anchor_lang::solana_program::instruction::Instruction::new_with_bytes( + crate::ID, + &ix_data, + vec![ + anchor_lang::solana_program::instruction::AccountMeta::new_readonly( + *authority_info.key, + true, + ), + ], + ); + anchor_lang::solana_program::program::invoke_signed( + &ix, + &[authority_info], + &[&[#authority_seeds, &[authority_bump]]], + ) + .map_err(anchor_lang::error::Error::from)?; + } + }) +} + +/// An attribute macro to add necessary event CPI accounts to the given accounts struct. +/// +/// Two accounts named `event_authority` and `program` will be appended to the list of accounts. +/// +/// # Example +/// +/// ```ignore +/// #[event_cpi] +/// #[derive(Accounts)] +/// pub struct MyInstruction<'info> { +/// pub signer: Signer<'info>, +/// } +/// ``` +/// +/// The code above will be expanded to: +/// +/// ```ignore +/// #[derive(Accounts)] +/// pub struct MyInstruction<'info> { +/// pub signer: Signer<'info>, +/// /// CHECK: Only the event authority can invoke self-CPI +/// #[account(seeds = [b"__event_authority"], bump)] +/// pub event_authority: AccountInfo<'info>, +/// /// CHECK: Self-CPI will fail if the program is not the current program +/// pub program: AccountInfo<'info>, +/// } +/// ``` +/// +/// See [`emit_cpi!`](emit_cpi!) for a full example. +/// +/// *Only available with `event-cpi` feature enabled.* +#[cfg(feature = "event-cpi")] +#[proc_macro_attribute] +pub fn event_cpi( + _attr: proc_macro::TokenStream, + input: proc_macro::TokenStream, +) -> proc_macro::TokenStream { + let accounts_struct = parse_macro_input!(input as syn::ItemStruct); + let accounts_struct = add_event_cpi_accounts(&accounts_struct).unwrap(); + proc_macro::TokenStream::from(quote! {#accounts_struct}) } diff --git a/lang/src/error.rs b/lang/src/error.rs index b6a8c9cbc3..79e6a21890 100644 --- a/lang/src/error.rs +++ b/lang/src/error.rs @@ -44,6 +44,11 @@ pub enum ErrorCode { #[msg("IDL account must be empty in order to resize, try closing first")] IdlAccountNotEmpty, + // Event instructions + /// 1500 - The program was compiled without `event-cpi` feature + #[msg("The program was compiled without `event-cpi` feature")] + EventInstructionStub = 1500, + // Constraints /// 2000 - A mut constraint was violated #[msg("A mut constraint was violated")] diff --git a/lang/src/event.rs b/lang/src/event.rs new file mode 100644 index 0000000000..99f2abde12 --- /dev/null +++ b/lang/src/event.rs @@ -0,0 +1,3 @@ +// Sha256(anchor:event)[..8] +pub const EVENT_IX_TAG: u64 = 0x1d9acb512ea545e4; +pub const EVENT_IX_TAG_LE: [u8; 8] = EVENT_IX_TAG.to_le_bytes(); diff --git a/lang/src/lib.rs b/lang/src/lib.rs index 0317ea5cdc..1fb1a80918 100644 --- a/lang/src/lib.rs +++ b/lang/src/lib.rs @@ -38,6 +38,8 @@ mod common; pub mod context; pub mod error; #[doc(hidden)] +pub mod event; +#[doc(hidden)] pub mod idl; pub mod system_program; @@ -48,6 +50,8 @@ pub use anchor_attribute_account::{account, declare_id, zero_copy}; pub use anchor_attribute_constant::constant; pub use anchor_attribute_error::*; pub use anchor_attribute_event::{emit, event}; +#[cfg(feature = "event-cpi")] +pub use anchor_attribute_event::{emit_cpi, event_cpi}; pub use anchor_attribute_program::program; pub use anchor_derive_accounts::Accounts; pub use anchor_derive_space::InitSpace; @@ -299,6 +303,8 @@ pub mod prelude { AccountsClose, AccountsExit, AnchorDeserialize, AnchorSerialize, Id, InitSpace, Key, Owner, ProgramData, Result, Space, ToAccountInfo, ToAccountInfos, ToAccountMetas, }; + #[cfg(feature = "event-cpi")] + pub use super::{emit_cpi, event_cpi}; pub use anchor_attribute_error::*; pub use borsh; pub use error::*; diff --git a/lang/syn/Cargo.toml b/lang/syn/Cargo.toml index f1e7b85f0e..7908cd0574 100644 --- a/lang/syn/Cargo.toml +++ b/lang/syn/Cargo.toml @@ -16,6 +16,7 @@ hash = [] default = [] anchor-debug = [] seeds = [] +event-cpi = [] [dependencies] proc-macro2 = { version = "1.0", features=["span-locations"]} diff --git a/lang/syn/src/codegen/program/dispatch.rs b/lang/syn/src/codegen/program/dispatch.rs index dac9015082..2c6090b887 100644 --- a/lang/syn/src/codegen/program/dispatch.rs +++ b/lang/syn/src/codegen/program/dispatch.rs @@ -27,9 +27,13 @@ pub fn generate(program: &Program) -> proc_macro2::TokenStream { } }) .collect(); + let fallback_fn = gen_fallback(program).unwrap_or(quote! { Err(anchor_lang::error::ErrorCode::InstructionFallbackNotFound.into()) }); + + let event_cpi_handler = generate_event_cpi_handler(); + quote! { /// Performs method dispatch. /// @@ -67,17 +71,24 @@ pub fn generate(program: &Program) -> proc_macro2::TokenStream { #(#global_dispatch_arms)* anchor_lang::idl::IDL_IX_TAG_LE => { // If the method identifier is the IDL tag, then execute an IDL - // instruction, injected into all Anchor programs. - if cfg!(not(feature = "no-idl")) { + // instruction, injected into all Anchor programs unless they have + // no-idl enabled + #[cfg(not(feature = "no-idl"))] + { __private::__idl::__idl_dispatch( program_id, accounts, &ix_data, ) - } else { + } + #[cfg(feature = "no-idl")] + { Err(anchor_lang::error::ErrorCode::IdlInstructionStub.into()) } } + anchor_lang::event::EVENT_IX_TAG_LE => { + #event_cpi_handler + } _ => { #fallback_fn } @@ -96,3 +107,17 @@ pub fn gen_fallback(program: &Program) -> Option { } }) } + +/// Generate the event-cpi instruction handler based on whether the `event-cpi` feature is enabled. +pub fn generate_event_cpi_handler() -> proc_macro2::TokenStream { + #[cfg(feature = "event-cpi")] + quote! { + // `event-cpi` feature is enabled, dispatch self-cpi instruction + __private::__events::__event_dispatch(program_id, accounts, &ix_data) + } + #[cfg(not(feature = "event-cpi"))] + quote! { + // `event-cpi` feature is not enabled + Err(anchor_lang::error::ErrorCode::EventInstructionStub.into()) + } +} diff --git a/lang/syn/src/codegen/program/handlers.rs b/lang/syn/src/codegen/program/handlers.rs index 321f93785d..07ee097b41 100644 --- a/lang/syn/src/codegen/program/handlers.rs +++ b/lang/syn/src/codegen/program/handlers.rs @@ -91,6 +91,8 @@ pub fn generate(program: &Program) -> proc_macro2::TokenStream { } }; + let event_cpi_mod = generate_event_cpi_mod(); + let non_inlined_handlers: Vec = program .ixs .iter() @@ -173,14 +175,14 @@ pub fn generate(program: &Program) -> proc_macro2::TokenStream { #idl_accounts_and_functions } - - /// __global mod defines wrapped handlers for global instructions. pub mod __global { use super::*; #(#non_inlined_handlers)* } + + #event_cpi_mod } } } @@ -189,3 +191,49 @@ fn generate_ix_variant_name(name: String) -> proc_macro2::TokenStream { let n = name.to_camel_case(); n.parse().unwrap() } + +/// Generate the event module based on whether the `event-cpi` feature is enabled. +fn generate_event_cpi_mod() -> proc_macro2::TokenStream { + #[cfg(feature = "event-cpi")] + { + let authority = crate::parser::accounts::event_cpi::EventAuthority::get(); + let authority_name = authority.name; + let authority_seeds = authority.seeds; + + quote! { + /// __events mod defines handler for self-cpi based event logging + pub mod __events { + use super::*; + + #[inline(never)] + pub fn __event_dispatch( + program_id: &Pubkey, + accounts: &[AccountInfo], + event_data: &[u8], + ) -> anchor_lang::Result<()> { + let given_event_authority = next_account_info(&mut accounts.iter())?; + if !given_event_authority.is_signer { + return Err(anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintSigner, + ) + .with_account_name(#authority_name)); + } + + let (expected_event_authority, _) = + Pubkey::find_program_address(&[#authority_seeds], &program_id); + if given_event_authority.key() != expected_event_authority { + return Err(anchor_lang::error::Error::from( + anchor_lang::error::ErrorCode::ConstraintSeeds, + ) + .with_account_name(#authority_name) + .with_pubkeys((given_event_authority.key(), expected_event_authority))); + } + + Ok(()) + } + } + } + } + #[cfg(not(feature = "event-cpi"))] + quote! {} +} diff --git a/lang/syn/src/parser/accounts/event_cpi.rs b/lang/syn/src/parser/accounts/event_cpi.rs new file mode 100644 index 0000000000..fccbd2b3f4 --- /dev/null +++ b/lang/syn/src/parser/accounts/event_cpi.rs @@ -0,0 +1,70 @@ +use quote::quote; + +/// This struct is used to keep the authority account information in sync. +pub struct EventAuthority { + /// Account name of the event authority + pub name: &'static str, + /// Seeds expression of the event authority + pub seeds: proc_macro2::TokenStream, +} + +impl EventAuthority { + /// Returns the account name and the seeds expression of the event authority. + pub fn get() -> Self { + Self { + name: "event_authority", + seeds: quote! {b"__event_authority"}, + } + } + + /// Returns the name without surrounding quotes. + pub fn name_token_stream(&self) -> proc_macro2::TokenStream { + let name_token_stream = syn::parse_str::(self.name).unwrap(); + quote! {#name_token_stream} + } +} + +/// Add necessary event CPI accounts to the given accounts struct. +pub fn add_event_cpi_accounts( + accounts_struct: &syn::ItemStruct, +) -> syn::parse::Result { + let syn::ItemStruct { + attrs, + vis, + struct_token, + ident, + generics, + fields, + .. + } = accounts_struct; + + let fields = fields.into_iter().collect::>(); + + let info_lifetime = generics + .lifetimes() + .next() + .map(|lifetime| quote! {#lifetime}) + .unwrap_or(quote! {'info}); + let generics = generics + .lt_token + .map(|_| quote! {#generics}) + .unwrap_or(quote! {<'info>}); + + let authority = EventAuthority::get(); + let authority_name = authority.name_token_stream(); + let authority_seeds = authority.seeds; + + let accounts_struct = quote! { + #(#attrs)* + #vis #struct_token #ident #generics { + #(#fields,)* + + /// CHECK: Only the event authority can invoke self-CPI + #[account(seeds = [#authority_seeds], bump)] + pub #authority_name: AccountInfo<#info_lifetime>, + /// CHECK: Self-CPI will fail if the program is not the current program + pub program: AccountInfo<#info_lifetime>, + } + }; + syn::parse2(accounts_struct) +} diff --git a/lang/syn/src/parser/accounts/mod.rs b/lang/syn/src/parser/accounts/mod.rs index dedb6cdb92..1da0e52126 100644 --- a/lang/syn/src/parser/accounts/mod.rs +++ b/lang/syn/src/parser/accounts/mod.rs @@ -1,3 +1,7 @@ +pub mod constraints; +#[cfg(feature = "event-cpi")] +pub mod event_cpi; + use crate::parser::docs; use crate::*; use syn::parse::{Error as ParseError, Result as ParseResult}; @@ -7,10 +11,8 @@ use syn::token::Comma; use syn::Expr; use syn::Path; -pub mod constraints; - -pub fn parse(strct: &syn::ItemStruct) -> ParseResult { - let instruction_api: Option> = strct +pub fn parse(accounts_struct: &syn::ItemStruct) -> ParseResult { + let instruction_api: Option> = accounts_struct .attrs .iter() .find(|a| { @@ -20,7 +22,24 @@ pub fn parse(strct: &syn::ItemStruct) -> ParseResult { }) .map(|ix_attr| ix_attr.parse_args_with(Punctuated::::parse_terminated)) .transpose()?; - let fields = match &strct.fields { + + #[cfg(feature = "event-cpi")] + let accounts_struct = { + let is_event_cpi = accounts_struct + .attrs + .iter() + .filter_map(|attr| attr.path.get_ident()) + .any(|ident| *ident == "event_cpi"); + if is_event_cpi { + event_cpi::add_event_cpi_accounts(accounts_struct)? + } else { + accounts_struct.clone() + } + }; + #[cfg(not(feature = "event-cpi"))] + let accounts_struct = accounts_struct.clone(); + + let fields = match &accounts_struct.fields { syn::Fields::Named(fields) => fields .named .iter() @@ -28,7 +47,7 @@ pub fn parse(strct: &syn::ItemStruct) -> ParseResult { .collect::>>()?, _ => { return Err(ParseError::new_spanned( - &strct.fields, + &accounts_struct.fields, "fields must be named", )) } @@ -36,7 +55,11 @@ pub fn parse(strct: &syn::ItemStruct) -> ParseResult { constraints_cross_checks(&fields)?; - Ok(AccountsStruct::new(strct.clone(), fields, instruction_api)) + Ok(AccountsStruct::new( + accounts_struct, + fields, + instruction_api, + )) } fn constraints_cross_checks(fields: &[AccountField]) -> ParseResult<()> { diff --git a/tests/events/programs/events/Cargo.toml b/tests/events/programs/events/Cargo.toml index ed8601cc57..7b00b1a898 100644 --- a/tests/events/programs/events/Cargo.toml +++ b/tests/events/programs/events/Cargo.toml @@ -16,4 +16,4 @@ cpi = ["no-entrypoint"] default = [] [dependencies] -anchor-lang = { path = "../../../../lang" } +anchor-lang = { path = "../../../../lang", features = ["event-cpi"] } diff --git a/tests/events/programs/events/src/lib.rs b/tests/events/programs/events/src/lib.rs index ef17b7b4e3..ff3f57c0e3 100644 --- a/tests/events/programs/events/src/lib.rs +++ b/tests/events/programs/events/src/lib.rs @@ -23,6 +23,14 @@ pub mod events { }); Ok(()) } + + pub fn test_event_cpi(ctx: Context) -> Result<()> { + emit_cpi!(MyOtherEvent { + data: 7, + label: "cpi".to_string(), + }); + Ok(()) + } } #[derive(Accounts)] @@ -31,6 +39,10 @@ pub struct Initialize {} #[derive(Accounts)] pub struct TestEvent {} +#[event_cpi] +#[derive(Accounts)] +pub struct TestEventCpi {} + #[event] pub struct MyEvent { pub data: u64, diff --git a/tests/events/tests/events.js b/tests/events/tests/events.js index b938e0555c..28a3599f90 100644 --- a/tests/events/tests/events.js +++ b/tests/events/tests/events.js @@ -1,61 +1,117 @@ const anchor = require("@coral-xyz/anchor"); const { assert } = require("chai"); -describe("events", () => { +describe("Events", () => { // Configure the client to use the local cluster. anchor.setProvider(anchor.AnchorProvider.env()); const program = anchor.workspace.Events; - it("Is initialized!", async () => { - let listener = null; + describe("Normal event", () => { + it("Single event works", async () => { + let listener = null; - let [event, slot] = await new Promise((resolve, _reject) => { - listener = program.addEventListener("MyEvent", (event, slot) => { - resolve([event, slot]); + let [event, slot] = await new Promise((resolve, _reject) => { + listener = program.addEventListener("MyEvent", (event, slot) => { + resolve([event, slot]); + }); + program.rpc.initialize(); }); - program.rpc.initialize(); - }); - await program.removeEventListener(listener); + await program.removeEventListener(listener); - assert.isAbove(slot, 0); - assert.strictEqual(event.data.toNumber(), 5); - assert.strictEqual(event.label, "hello"); - }); + assert.isAbove(slot, 0); + assert.strictEqual(event.data.toNumber(), 5); + assert.strictEqual(event.label, "hello"); + }); - it("Multiple events", async () => { - // Sleep so we don't get this transaction has already been processed. - await sleep(2000); + it("Multiple events work", async () => { + let listenerOne = null; + let listenerTwo = null; - let listenerOne = null; - let listenerTwo = null; + let [eventOne, slotOne] = await new Promise((resolve, _reject) => { + listenerOne = program.addEventListener("MyEvent", (event, slot) => { + resolve([event, slot]); + }); + program.rpc.initialize(); + }); - let [eventOne, slotOne] = await new Promise((resolve, _reject) => { - listenerOne = program.addEventListener("MyEvent", (event, slot) => { - resolve([event, slot]); + let [eventTwo, slotTwo] = await new Promise((resolve, _reject) => { + listenerTwo = program.addEventListener( + "MyOtherEvent", + (event, slot) => { + resolve([event, slot]); + } + ); + program.rpc.testEvent(); }); - program.rpc.initialize(); + + await program.removeEventListener(listenerOne); + await program.removeEventListener(listenerTwo); + + assert.isAbove(slotOne, 0); + assert.strictEqual(eventOne.data.toNumber(), 5); + assert.strictEqual(eventOne.label, "hello"); + + assert.isAbove(slotTwo, 0); + assert.strictEqual(eventTwo.data.toNumber(), 6); + assert.strictEqual(eventTwo.label, "bye"); }); + }); - let [eventTwo, slotTwo] = await new Promise((resolve, _reject) => { - listenerTwo = program.addEventListener("MyOtherEvent", (event, slot) => { - resolve([event, slot]); - }); - program.rpc.testEvent(); + describe("Self-CPI event", () => { + it("Works without accounts being specified", async () => { + const tx = await program.methods.testEventCpi().transaction(); + const config = { + commitment: "confirmed", + }; + const txHash = await program.provider.sendAndConfirm(tx, [], config); + const txResult = await program.provider.connection.getTransaction( + txHash, + config + ); + + const ixData = anchor.utils.bytes.bs58.decode( + txResult.meta.innerInstructions[0].instructions[0].data + ); + const eventData = anchor.utils.bytes.base64.encode(ixData.slice(8)); + const event = program.coder.events.decode(eventData); + + assert.strictEqual(event.name, "MyOtherEvent"); + assert.strictEqual(event.data.label, "cpi"); + assert.strictEqual(event.data.data.toNumber(), 7); }); - await program.removeEventListener(listenerOne); - await program.removeEventListener(listenerTwo); + it("Malicious invocation throws", async () => { + const tx = new anchor.web3.Transaction(); + tx.add( + new anchor.web3.TransactionInstruction({ + programId: program.programId, + keys: [ + { + pubkey: anchor.web3.PublicKey.findProgramAddressSync( + [Buffer.from("__event_authority")], + program.programId + )[0], + isSigner: false, + isWritable: false, + }, + { + pubkey: program.programId, + isSigner: false, + isWritable: false, + }, + ], + data: Buffer.from([0xe4, 0x45, 0xa5, 0x2e, 0x51, 0xcb, 0x9a, 0x1d]), + }) + ); - assert.isAbove(slotOne, 0); - assert.strictEqual(eventOne.data.toNumber(), 5); - assert.strictEqual(eventOne.label, "hello"); + try { + await program.provider.sendAndConfirm(tx, []); + } catch (e) { + if (e.logs.some((log) => log.includes("ConstraintSigner"))) return; + console.log(e); + } - assert.isAbove(slotTwo, 0); - assert.strictEqual(eventTwo.data.toNumber(), 6); - assert.strictEqual(eventTwo.label, "bye"); + throw new Error("Was able to invoke the self-CPI instruction"); + }); }); }); - -function sleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); -} diff --git a/tests/yarn.lock b/tests/yarn.lock index f0a8cc1209..437dd856ee 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -16,28 +16,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@coral-xyz/anchor@=0.27.0": - version "0.26.0" - resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.26.0.tgz#c8e4f7177e93441afd030f22d777d54d0194d7d1" - integrity sha512-PxRl+wu5YyptWiR9F2MBHOLLibm87Z4IMUBPreX+DYBtPM+xggvcPi0KAN7+kIL4IrIhXI8ma5V0MCXxSN1pHg== - dependencies: - "@coral-xyz/borsh" "^0.26.0" - "@solana/web3.js" "^1.68.0" - base64-js "^1.5.1" - bn.js "^5.1.2" - bs58 "^4.0.1" - buffer-layout "^1.2.2" - camelcase "^6.3.0" - cross-fetch "^3.1.5" - crypto-hash "^1.3.0" - eventemitter3 "^4.0.7" - js-sha256 "^0.9.0" - pako "^2.0.3" - snake-case "^3.0.4" - superstruct "^0.15.4" - toml "^3.0.0" - -"@coral-xyz/anchor@file:../ts/packages/anchor": +"@coral-xyz/anchor@=0.27.0", "@coral-xyz/anchor@file:../ts/packages/anchor": version "0.27.0" dependencies: "@coral-xyz/borsh" "^0.27.0" @@ -56,10 +35,10 @@ superstruct "^0.15.4" toml "^3.0.0" -"@coral-xyz/borsh@^0.26.0", "@coral-xyz/borsh@^0.27.0": - version "0.26.0" - resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.26.0.tgz#d054f64536d824634969e74138f9f7c52bbbc0d5" - integrity sha512-uCZ0xus0CszQPHYfWAqKS5swS1UxvePu83oOF+TWpUkedsNlg6p2p4azxZNSSqwXb9uXMFgxhuMBX9r3Xoi0vQ== +"@coral-xyz/borsh@^0.27.0": + version "0.27.0" + resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.27.0.tgz#700c647ea5262b1488957ac7fb4e8acf72c72b63" + integrity sha512-tJKzhLukghTWPLy+n8K8iJKgBq1yLT/AxaNd10yJrX8mI56ao5+OFAKAqW/h0i79KCvb4BK0VGO5ECmmolFz9A== dependencies: bn.js "^5.1.2" buffer-layout "^1.2.0" diff --git a/ts/packages/anchor/src/program/accounts-resolver.ts b/ts/packages/anchor/src/program/accounts-resolver.ts index 3d144f7f1f..42b483e7d2 100644 --- a/ts/packages/anchor/src/program/accounts-resolver.ts +++ b/ts/packages/anchor/src/program/accounts-resolver.ts @@ -88,6 +88,7 @@ export class AccountsResolver { // addresses. That is, one PDA can be used as a seed in another. public async resolve() { await this.resolveConst(this._idlIx.accounts); + this._resolveEventCpi(this._idlIx.accounts); // Auto populate pdas and relations until we stop finding new accounts while ( @@ -225,6 +226,56 @@ export class AccountsResolver { } } + /** + * Resolve event CPI accounts `eventAuthority` and `program`. + * + * Accounts will only be resolved if they are declared next to each other to + * reduce the chance of name collision. + */ + private _resolveEventCpi( + accounts: IdlAccountItem[], + path: string[] = [] + ): void { + for (const i in accounts) { + const accountDescOrAccounts = accounts[i]; + const subAccounts = (accountDescOrAccounts as IdlAccounts).accounts; + if (subAccounts) { + this._resolveEventCpi(subAccounts, [ + ...path, + camelCase(accountDescOrAccounts.name), + ]); + } + + // Validate next index exists + const nextIndex = +i + 1; + if (nextIndex === accounts.length) return; + + const currentName = camelCase(accounts[i].name); + const nextName = camelCase(accounts[nextIndex].name); + + // Populate event CPI accounts if they exist + if (currentName === "eventAuthority" && nextName === "program") { + const currentPath = [...path, currentName]; + const nextPath = [...path, nextName]; + + if (!this.get(currentPath)) { + this.set( + currentPath, + PublicKey.findProgramAddressSync( + [Buffer.from("__event_authority")], + this._programId + )[0] + ); + } + if (!this.get(nextPath)) { + this.set(nextPath, this._programId); + } + + return; + } + } + } + private async resolvePdas( accounts: IdlAccountItem[], path: string[] = [] From 0c8498d195df377bd0982d33db0a0225772afd16 Mon Sep 17 00:00:00 2001 From: cavemanloverboy <93507302+cavemanloverboy@users.noreply.github.com> Date: Sat, 27 May 2023 06:53:02 -0700 Subject: [PATCH 09/12] cli: Exit `anchor clean` without error when dirs don't exist (#2504) --- cli/src/lib.rs | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 0d2dd1f386..8d305f5446 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -3051,23 +3051,31 @@ fn clean(cfg_override: &ConfigOverride) -> Result<()> { let target_dir = cfg_parent.join("target"); let deploy_dir = target_dir.join("deploy"); - for entry in fs::read_dir(target_dir)? { - let path = entry?.path(); - if path.is_dir() && path != deploy_dir { - fs::remove_dir_all(&path) - .map_err(|e| anyhow!("Could not remove directory {}: {}", path.display(), e))?; - } else if path.is_file() { - fs::remove_file(&path) - .map_err(|e| anyhow!("Could not remove file {}: {}", path.display(), e))?; + if target_dir.exists() { + for entry in fs::read_dir(target_dir)? { + let path = entry?.path(); + if path.is_dir() && path != deploy_dir { + fs::remove_dir_all(&path) + .map_err(|e| anyhow!("Could not remove directory {}: {}", path.display(), e))?; + } else if path.is_file() { + fs::remove_file(&path) + .map_err(|e| anyhow!("Could not remove file {}: {}", path.display(), e))?; + } } + } else { + println!("skipping target directory: not found") } - for file in fs::read_dir(deploy_dir)? { - let path = file?.path(); - if path.extension() != Some(&OsString::from("json")) { - fs::remove_file(&path) - .map_err(|e| anyhow!("Could not remove file {}: {}", path.display(), e))?; + if deploy_dir.exists() { + for file in fs::read_dir(deploy_dir)? { + let path = file?.path(); + if path.extension() != Some(&OsString::from("json")) { + fs::remove_file(&path) + .map_err(|e| anyhow!("Could not remove file {}: {}", path.display(), e))?; + } } + } else { + println!("skipping deploy directory: not found") } Ok(()) From 70d922301e809a6c936a5fe73b99df9aba130fe6 Mon Sep 17 00:00:00 2001 From: acheron <98934430+acheroncrypto@users.noreply.github.com> Date: Sun, 28 May 2023 22:34:53 +0200 Subject: [PATCH 10/12] cli: Add `anchor keys sync` command (#2505) --- CHANGELOG.md | 1 + Cargo.lock | 19 ++++++++---- cli/Cargo.toml | 1 + cli/src/lib.rs | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 431168dfae..88f20100d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The minor version will be incremented upon a breaking change and the patch versi - bench: Add benchmarking for compute units usage ([#2466](https://github.com/coral-xyz/anchor/pull/2466)) - cli: `idl set-buffer`, `idl set-authority` and `idl close` take an option `--print-only`. which prints transaction in a base64 Borsh compatible format but not sent to the cluster. It's helpful when managing authority under a multisig, e.g., a user can create a proposal for a `Custom Instruction` in SPL Governance ([#2486](https://github.com/coral-xyz/anchor/pull/2486)). - lang: Add `emit_cpi!` and `#[event_cpi]` macros(behind `event-cpi` feature flag) to store event logs in transaction metadata ([#2438](https://github.com/coral-xyz/anchor/pull/2438)). +- cli: Add `keys sync` command to sync program id declarations ([#2505](https://github.com/coral-xyz/anchor/pull/2505)). ### Fixes diff --git a/Cargo.lock b/Cargo.lock index d2730894c1..064b6c4b25 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,9 +67,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.19" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" dependencies = [ "memchr", ] @@ -179,6 +179,7 @@ dependencies = [ "heck 0.4.0", "pathdiff", "portpicker", + "regex", "reqwest", "semver 1.0.16", "serde", @@ -2155,7 +2156,7 @@ dependencies = [ "petgraph", "pico-args", "regex", - "regex-syntax", + "regex-syntax 0.6.27", "string_cache", "term", "tiny-keccak", @@ -3106,13 +3107,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.7.2", ] [[package]] @@ -3121,6 +3122,12 @@ version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + [[package]] name = "remove_dir_all" version = "0.5.3" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 37a6f0e597..cb0cb80e5b 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -40,6 +40,7 @@ dirs = "4.0" heck = "0.4.0" flate2 = "1.0.19" tar = "0.4.35" +regex = "1.8.3" reqwest = { version = "0.11.4", default-features = false, features = ["multipart", "blocking", "rustls-tls"] } tokio = "1.24" pathdiff = "0.2.0" diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 8d305f5446..8d36a8e630 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -14,6 +14,7 @@ use flate2::read::ZlibDecoder; use flate2::write::{GzEncoder, ZlibEncoder}; use flate2::Compression; use heck::{ToKebabCase, ToSnakeCase}; +use regex::RegexBuilder; use reqwest::blocking::multipart::{Form, Part}; use reqwest::blocking::Client; use semver::{Version, VersionReq}; @@ -323,7 +324,14 @@ pub enum Command { #[derive(Debug, Parser)] pub enum KeysCommand { + /// List all of the program keys. List, + /// Sync the program's `declare_id!` pubkey with the program's actual pubkey. + Sync { + /// Only sync the given program instead of all programs + #[clap(short, long)] + program_name: Option, + }, } #[derive(Debug, Parser)] @@ -3763,6 +3771,7 @@ fn registry_api_token(_cfg_override: &ConfigOverride) -> Result { fn keys(cfg_override: &ConfigOverride, cmd: KeysCommand) -> Result<()> { match cmd { KeysCommand::List => keys_list(cfg_override), + KeysCommand::Sync { program_name } => keys_sync(cfg_override, program_name), } } @@ -3776,6 +3785,81 @@ fn keys_list(cfg_override: &ConfigOverride) -> Result<()> { }) } +/// Sync the program's `declare_id!` pubkey with the pubkey from `target/deploy/.json`. +fn keys_sync(cfg_override: &ConfigOverride, program_name: Option) -> Result<()> { + with_workspace(cfg_override, |cfg| { + let programs = cfg.read_all_programs()?; + let programs = match program_name { + Some(program_name) => vec![programs + .into_iter() + .find(|program| program.lib_name == program_name) + .ok_or_else(|| anyhow!("`{program_name}` is not found"))?], + None => programs, + }; + + let declare_id_regex = RegexBuilder::new(r#"^(([\w]+::)*)declare_id!\("(\w*)"\)"#) + .multi_line(true) + .build() + .unwrap(); + + for program in programs { + // Get the pubkey from the keypair file + let actual_program_id = program.pubkey()?.to_string(); + + // Handle declaration in program files + let src_path = program.path.join("src"); + let files_to_check = vec![src_path.join("lib.rs"), src_path.join("id.rs")]; + + for path in files_to_check { + let mut content = match fs::read_to_string(&path) { + Ok(content) => content, + Err(_) => continue, + }; + + let incorrect_program_id = declare_id_regex + .captures(&content) + .and_then(|captures| captures.get(3)) + .filter(|program_id_match| program_id_match.as_str() != actual_program_id); + if let Some(program_id_match) = incorrect_program_id { + println!("Found incorrect program id declaration in {path:?}"); + + // Update the program id + content.replace_range(program_id_match.range(), &actual_program_id); + fs::write(&path, content)?; + + println!("Updated to {actual_program_id}\n"); + break; + } + } + + // Handle declaration in Anchor.toml + 'outer: for programs in cfg.programs.values_mut() { + for (name, mut deployment) in programs { + // Skip other programs + if name != &program.lib_name { + continue; + } + + if deployment.address.to_string() != actual_program_id { + println!("Found incorrect program id declaration in Anchor.toml for the program `{name}`"); + + // Update the program id + deployment.address = Pubkey::from_str(&actual_program_id).unwrap(); + fs::write(cfg.path(), cfg.to_string())?; + + println!("Updated to {actual_program_id}\n"); + break 'outer; + } + } + } + } + + println!("All program id declarations are synced."); + + Ok(()) + }) +} + fn localnet( cfg_override: &ConfigOverride, skip_build: bool, From 2bf8afebd2f77f43a2e1e36bb4bf016fe2f289c8 Mon Sep 17 00:00:00 2001 From: acheron <98934430+acheroncrypto@users.noreply.github.com> Date: Tue, 30 May 2023 19:50:45 +0200 Subject: [PATCH 11/12] cli: Use `confirmed` commitment level in commands (#2506) --- cli/src/lib.rs | 97 ++++++++++++++++---------------------------------- 1 file changed, 30 insertions(+), 67 deletions(-) diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 8d36a8e630..37b53121ad 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1676,14 +1676,12 @@ fn cd_member(cfg_override: &ConfigOverride, program_name: &str) -> Result<()> { } pub fn verify_bin(program_id: Pubkey, bin_path: &Path, cluster: &str) -> Result { - let client = RpcClient::new(cluster.to_string()); + // Use `finalized` state for verify + let client = RpcClient::new_with_commitment(cluster, CommitmentConfig::finalized()); // Get the deployed build artifacts. let (deployed_bin, state) = { - let account = client - .get_account_with_commitment(&program_id, CommitmentConfig::default())? - .value - .map_or(Err(anyhow!("Program account not found")), Ok)?; + let account = client.get_account(&program_id)?; if account.owner == bpf_loader::id() || account.owner == bpf_loader_deprecated::id() { let bin = account.data.to_vec(); let state = BinVerificationState::ProgramData { @@ -1696,13 +1694,7 @@ pub fn verify_bin(program_id: Pubkey, bin_path: &Path, cluster: &str) -> Result< UpgradeableLoaderState::Program { programdata_address, } => { - let account = client - .get_account_with_commitment( - &programdata_address, - CommitmentConfig::default(), - )? - .value - .map_or(Err(anyhow!("Program data account not found")), Ok)?; + let account = client.get_account(&programdata_address)?; let bin = account.data [UpgradeableLoaderState::size_of_programdata_metadata()..] .to_vec(); @@ -1791,19 +1783,12 @@ fn fetch_idl(cfg_override: &ConfigOverride, idl_addr: Pubkey) -> Result { } }; - let client = RpcClient::new(url); - - let mut account = client - .get_account_with_commitment(&idl_addr, CommitmentConfig::processed())? - .value - .map_or(Err(anyhow!("IDL account not found")), Ok)?; + let client = create_client(url); + let mut account = client.get_account(&idl_addr)?; if account.executable { let idl_addr = IdlAccount::address(&idl_addr); - account = client - .get_account_with_commitment(&idl_addr, CommitmentConfig::processed())? - .value - .map_or(Err(anyhow!("IDL account not found")), Ok)?; + account = client.get_account(&idl_addr)?; } // Cut off account discriminator. @@ -1941,7 +1926,7 @@ fn idl_set_buffer( let keypair = solana_sdk::signature::read_keypair_file(&cfg.provider.wallet.to_string()) .map_err(|_| anyhow!("Unable to read keypair file"))?; let url = cluster_url(cfg, &cfg.test_validator); - let client = RpcClient::new(url); + let client = create_client(url); let idl_address = IdlAccount::address(&program_id); let idl_authority = if print_only { @@ -1978,10 +1963,7 @@ fn idl_set_buffer( ); // Send the transaction. - client.send_and_confirm_transaction_with_spinner_and_commitment( - &tx, - CommitmentConfig::confirmed(), - )?; + client.send_and_confirm_transaction_with_spinner(&tx)?; } Ok(()) @@ -2000,12 +1982,9 @@ fn idl_upgrade( fn idl_authority(cfg_override: &ConfigOverride, program_id: Pubkey) -> Result<()> { with_workspace(cfg_override, |cfg| { let url = cluster_url(cfg, &cfg.test_validator); - let client = RpcClient::new(url); + let client = create_client(url); let idl_address = { - let account = client - .get_account_with_commitment(&program_id, CommitmentConfig::processed())? - .value - .map_or(Err(anyhow!("Account not found")), Ok)?; + let account = client.get_account(&program_id)?; if account.executable { IdlAccount::address(&program_id) } else { @@ -2037,7 +2016,7 @@ fn idl_set_authority( let keypair = solana_sdk::signature::read_keypair_file(&cfg.provider.wallet.to_string()) .map_err(|_| anyhow!("Unable to read keypair file"))?; let url = cluster_url(cfg, &cfg.test_validator); - let client = RpcClient::new(url); + let client = create_client(url); let idl_authority = if print_only { get_idl_account(&client, &idl_address)?.authority @@ -2073,10 +2052,7 @@ fn idl_set_authority( &[&keypair], latest_hash, ); - client.send_and_confirm_transaction_with_spinner_and_commitment( - &tx, - CommitmentConfig::confirmed(), - )?; + client.send_and_confirm_transaction_with_spinner(&tx)?; println!("Authority update complete."); } @@ -2110,7 +2086,7 @@ fn idl_close_account( let keypair = solana_sdk::signature::read_keypair_file(&cfg.provider.wallet.to_string()) .map_err(|_| anyhow!("Unable to read keypair file"))?; let url = cluster_url(cfg, &cfg.test_validator); - let client = RpcClient::new(url); + let client = create_client(url); let idl_authority = if print_only { get_idl_account(&client, &idl_address)?.authority @@ -2141,10 +2117,7 @@ fn idl_close_account( &[&keypair], latest_hash, ); - client.send_and_confirm_transaction_with_spinner_and_commitment( - &tx, - CommitmentConfig::confirmed(), - )?; + client.send_and_confirm_transaction_with_spinner(&tx)?; } Ok(()) @@ -2162,7 +2135,7 @@ fn idl_write(cfg: &Config, program_id: &Pubkey, idl: &Idl, idl_address: Pubkey) let keypair = solana_sdk::signature::read_keypair_file(&cfg.provider.wallet.to_string()) .map_err(|_| anyhow!("Unable to read keypair file"))?; let url = cluster_url(cfg, &cfg.test_validator); - let client = RpcClient::new(url); + let client = create_client(url); // Serialize and compress the idl. let idl_data = { @@ -2202,10 +2175,7 @@ fn idl_write(cfg: &Config, program_id: &Pubkey, idl: &Idl, idl_address: Pubkey) &[&keypair], latest_hash, ); - client.send_and_confirm_transaction_with_spinner_and_commitment( - &tx, - CommitmentConfig::confirmed(), - )?; + client.send_and_confirm_transaction_with_spinner(&tx)?; offset += MAX_WRITE_SIZE; } Ok(()) @@ -2330,7 +2300,7 @@ fn account( .unwrap_or(Cluster::Localnet); cluster = cfg_override.cluster.as_ref().unwrap_or(cluster); - let data = RpcClient::new(cluster.url()).get_account_data(&address)?; + let data = create_client(cluster.url()).get_account_data(&address)?; if data.len() < 8 { return Err(anyhow!( "The account has less than 8 bytes and is not an Anchor account." @@ -2794,7 +2764,7 @@ fn validator_flags( } else if key == "clone" { // Client for fetching accounts data let client = if let Some(url) = entries["url"].as_str() { - RpcClient::new(url.to_string()) + create_client(url) } else { return Err(anyhow!( "Validator url for Solana's JSON RPC should be provided in order to clone accounts from it" @@ -2813,12 +2783,7 @@ fn validator_flags( .collect::>>()?; let accounts_keys = pubkeys.iter().cloned().collect::>(); - let accounts = client - .get_multiple_accounts_with_commitment( - &accounts_keys, - CommitmentConfig::default(), - )? - .value; + let accounts = client.get_multiple_accounts(&accounts_keys)?; // Check if there are program accounts for (account, acc_key) in accounts.iter().zip(accounts_keys) { @@ -2926,7 +2891,6 @@ fn start_test_validator( flags: Option>, test_log_stdout: bool, ) -> Result { - // let (test_ledger_directory, test_ledger_log_filename) = test_validator_file_paths(test_validator); @@ -2978,7 +2942,7 @@ fn start_test_validator( .map_err(|e| anyhow::format_err!("{}", e.to_string()))?; // Wait for the validator to be ready. - let client = RpcClient::new(rpc_url); + let client = create_client(rpc_url); let mut count = 0; let ms_wait = test_validator .as_ref() @@ -3214,7 +3178,7 @@ fn create_idl_account( let keypair = solana_sdk::signature::read_keypair_file(keypair_path) .map_err(|_| anyhow!("Unable to read keypair file"))?; let url = cluster_url(cfg, &cfg.test_validator); - let client = RpcClient::new(url); + let client = create_client(url); let idl_data = serialize_idl(idl)?; // Run `Create instruction. @@ -3269,10 +3233,7 @@ fn create_idl_account( &[&keypair], latest_hash, ); - client.send_and_confirm_transaction_with_spinner_and_commitment( - &tx, - CommitmentConfig::finalized(), - )?; + client.send_and_confirm_transaction_with_spinner(&tx)?; } // Write directly to the IDL account buffer. @@ -3290,7 +3251,7 @@ fn create_idl_buffer( let keypair = solana_sdk::signature::read_keypair_file(keypair_path) .map_err(|_| anyhow!("Unable to read keypair file"))?; let url = cluster_url(cfg, &cfg.test_validator); - let client = RpcClient::new(url); + let client = create_client(url); let buffer = Keypair::new(); @@ -3333,10 +3294,7 @@ fn create_idl_buffer( ); // Send the transaction. - client.send_and_confirm_transaction_with_spinner_and_commitment( - &tx, - CommitmentConfig::confirmed(), - )?; + client.send_and_confirm_transaction_with_spinner(&tx)?; Ok(buffer.pubkey()) } @@ -3991,6 +3949,11 @@ fn strip_workspace_prefix(absolute_path: String) -> String { .into() } +/// Create a new [`RpcClient`] with `confirmed` commitment level instead of the default(finalized). +fn create_client(url: U) -> RpcClient { + RpcClient::new_with_commitment(url, CommitmentConfig::confirmed()) +} + #[cfg(test)] mod tests { use super::*; From 1c6f86e5f7793ce6adefe9cbfa11939647c509ce Mon Sep 17 00:00:00 2001 From: acheron <98934430+acheroncrypto@users.noreply.github.com> Date: Sun, 4 Jun 2023 13:09:39 +0200 Subject: [PATCH 12/12] Upgrade Solana to 1.16.0 (#2512) --- .github/workflows/no-caching-tests.yaml | 2 +- .github/workflows/reusable-tests.yaml | 57 +- .github/workflows/tests.yaml | 2 +- CHANGELOG.md | 1 + Cargo.lock | 1090 ++++++++++------- bench/COMPUTE_UNITS.md | 178 +-- cli/Cargo.toml | 12 +- client/Cargo.toml | 4 +- client/example/Cargo.toml | 2 +- lang/Cargo.toml | 9 +- lang/tests/generics_test.rs | 4 + spl/Cargo.toml | 10 +- .../programs/account-command/Cargo.toml | 2 +- tests/auction-house | 2 +- tests/bench/bench.json | 132 +- tests/bench/programs/bench/Cargo.toml | 5 - tests/zero-copy/programs/zero-copy/Cargo.toml | 2 +- 17 files changed, 832 insertions(+), 682 deletions(-) diff --git a/.github/workflows/no-caching-tests.yaml b/.github/workflows/no-caching-tests.yaml index c87e985de8..3338e84c91 100644 --- a/.github/workflows/no-caching-tests.yaml +++ b/.github/workflows/no-caching-tests.yaml @@ -11,7 +11,7 @@ jobs: uses: ./.github/workflows/reusable-tests.yaml with: cache: false - solana_cli_version: 1.14.16 + solana_cli_version: 1.16.0 node_version: 17.0.1 cargo_profile: release anchor_binary_name: anchor-binary-no-caching diff --git a/.github/workflows/reusable-tests.yaml b/.github/workflows/reusable-tests.yaml index e8f08f27cc..b6cc067bd1 100644 --- a/.github/workflows/reusable-tests.yaml +++ b/.github/workflows/reusable-tests.yaml @@ -332,33 +332,34 @@ jobs: # - run: cd tests/misc && chmod +x ci.sh && ./ci.sh # - run: cd tests/misc && anchor test --skip-lint - test-anchor-init: - needs: setup-anchor-cli - name: Test Anchor Init - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/setup/ - - uses: ./.github/actions/setup-ts/ - - uses: ./.github/actions/setup-solana/ + # TODO: Re-enable after releasing `0.28.0`. See https://github.com/coral-xyz/anchor/pull/2512 + # test-anchor-init: + # needs: setup-anchor-cli + # name: Test Anchor Init + # runs-on: ubuntu-latest + # timeout-minutes: 30 + # steps: + # - uses: actions/checkout@v3 + # - uses: ./.github/actions/setup/ + # - uses: ./.github/actions/setup-ts/ + # - uses: ./.github/actions/setup-solana/ - - uses: actions/cache@v3 - if: ${{ env.CACHE != 'false' }} - name: Cache Cargo registry + index - id: cache-anchor - with: - path: ${{ env.CARGO_CACHE_PATH }} - key: cargo-${{ runner.os }}-${{ env.CARGO_PROFILE }}-anchor-${{ hashFiles('**/Cargo.lock') }} + # - uses: actions/cache@v3 + # if: ${{ env.CACHE != 'false' }} + # name: Cache Cargo registry + index + # id: cache-anchor + # with: + # path: ${{ env.CARGO_CACHE_PATH }} + # key: cargo-${{ runner.os }}-${{ env.CARGO_PROFILE }}-anchor-${{ hashFiles('**/Cargo.lock') }} - - uses: actions/download-artifact@v3 - with: - name: ${{ env.ANCHOR_BINARY_NAME }} - path: ~/.cargo/bin/ - - run: chmod +x ~/.cargo/bin/anchor + # - uses: actions/download-artifact@v3 + # with: + # name: ${{ env.ANCHOR_BINARY_NAME }} + # path: ~/.cargo/bin/ + # - run: chmod +x ~/.cargo/bin/anchor - - run: cd "$(mktemp -d)" && anchor init hello-anchor && cd hello-anchor && yarn link @coral-xyz/anchor && yarn && anchor test && yarn lint:fix - - uses: ./.github/actions/git-diff/ + # - run: cd "$(mktemp -d)" && anchor init hello-anchor && cd hello-anchor && yarn link @coral-xyz/anchor && yarn && anchor test && yarn lint:fix + # - uses: ./.github/actions/git-diff/ test-programs: needs: setup-anchor-cli @@ -383,7 +384,9 @@ jobs: path: tests/multisig # - cmd: cd tests/lockup && anchor test --skip-lint # path: tests/lockup - - cmd: cd tests/swap/deps/openbook-dex/dex && cargo build-bpf -- --locked && cd ../../../ && anchor test --skip-lint + # TODO: Remove `1.14.18` installation if/when https://github.com/solana-labs/solana/issues/31960 is solved + # `swap` tests don't work with Solana `1.16.0`, downgrade to `1.14.18` + - cmd: cd tests/swap/deps/openbook-dex/dex && solana-install init 1.14.18 && cargo build-bpf -- --locked && cd ../../../ && solana-install init $SOLANA_CLI_VERSION && anchor test --skip-lint path: tests/swap - cmd: cd tests/escrow && anchor test --skip-lint && npx tsc --noEmit path: tests/escrow @@ -411,7 +414,9 @@ jobs: path: tests/ido-pool # - cmd: cd tests/cfo && anchor run test-with-build && cd deps/stake && git checkout Cargo.lock && cd ../swap && git checkout Cargo.lock # path: tests/cfo - - cmd: cd tests/auction-house && yarn --frozen-lockfile && anchor test --skip-lint && git checkout Cargo.lock + # TODO: Remove `1.14.18` installation if/when https://github.com/solana-labs/solana/issues/31960 is solved + # `auction-house` tests don't work with Solana `1.16.0`, downgrade to `1.14.18` + - cmd: cd tests/auction-house && solana-install init 1.14.18 && yarn --frozen-lockfile && anchor test --skip-lint && git checkout Cargo.lock path: tests/auction-house - cmd: cd tests/floats && yarn --frozen-lockfile && anchor test --skip-lint && npx tsc --noEmit path: tests/floats diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9bcdb0401f..bf903d19fe 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -14,7 +14,7 @@ jobs: uses: ./.github/workflows/reusable-tests.yaml with: cache: true - solana_cli_version: 1.14.16 + solana_cli_version: 1.16.0 node_version: 17.0.1 cargo_profile: debug anchor_binary_name: anchor-binary diff --git a/CHANGELOG.md b/CHANGELOG.md index 88f20100d0..32d05013b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ The minor version will be incremented upon a breaking change and the patch versi - lang: Fix inability to use identifiers `program_id`, `accounts`, `ix_data`, `remaining_accounts` in instruction arguments ([#2464](https://github.com/coral-xyz/anchor/pull/2464)) - cli: Fix incorrect `metadata.address` generation in IDL after deploying with a custom keypair ([#2485](https://github.com/coral-xyz/anchor/pull/2485)) - cli: IDL commands no longer hang when the payer doesn't have funds to pay for the transaction fee ([#2492](https://github.com/coral-xyz/anchor/pull/2492)) +- cli, client, lang, spl: Update Solana toolchain and dependencies to `1.16.0` and specify maximum version of `<1.17.0` ([#2512](https://github.com/coral-xyz/anchor/pull/2512)). ### Breaking diff --git a/Cargo.lock b/Cargo.lock index 064b6c4b25..cd90b599e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,7 +34,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if", - "cipher 0.3.0", + "cipher", "cpufeatures", "opaque-debug", ] @@ -47,7 +47,7 @@ checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" dependencies = [ "aead", "aes", - "cipher 0.3.0", + "cipher", "ctr", "polyval", "subtle", @@ -60,7 +60,19 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.9", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "getrandom 0.2.9", "once_cell", "version_check", ] @@ -101,7 +113,7 @@ version = "0.27.0" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "regex", "syn 1.0.109", @@ -114,7 +126,7 @@ dependencies = [ "anchor-syn", "anyhow", "bs58 0.4.0", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "rustversion", "syn 1.0.109", @@ -125,7 +137,7 @@ name = "anchor-attribute-constant" version = "0.27.0" dependencies = [ "anchor-syn", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "syn 1.0.109", ] @@ -134,7 +146,7 @@ name = "anchor-attribute-error" version = "0.27.0" dependencies = [ "anchor-syn", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] @@ -145,7 +157,7 @@ version = "0.27.0" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] @@ -156,7 +168,7 @@ version = "0.27.0" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] @@ -181,7 +193,7 @@ dependencies = [ "portpicker", "regex", "reqwest", - "semver 1.0.16", + "semver 1.0.17", "serde", "serde_json", "shellexpand", @@ -219,7 +231,7 @@ version = "0.27.0" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] @@ -228,7 +240,7 @@ dependencies = [ name = "anchor-derive-space" version = "0.27.0" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] @@ -248,8 +260,9 @@ dependencies = [ "arrayref", "base64 0.13.1", "bincode", - "borsh", + "borsh 0.10.3", "bytemuck", + "getrandom 0.2.9", "solana-program", "thiserror", ] @@ -259,15 +272,13 @@ name = "anchor-spl" version = "0.27.0" dependencies = [ "anchor-lang", - "borsh", + "borsh 0.10.3", "mpl-token-metadata", "serum_dex", "solana-program", "spl-associated-token-account", "spl-token", - "spl-token-2022 0.6.1", - "toml_datetime", - "winnow", + "spl-token-2022", ] [[package]] @@ -277,7 +288,7 @@ dependencies = [ "anyhow", "bs58 0.3.1", "heck 0.3.3", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "serde", "serde_json", @@ -286,6 +297,12 @@ dependencies = [ "thiserror", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -361,9 +378,9 @@ checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" [[package]] name = "ark-bn254" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea691771ebbb28aea556c044e2e5c5227398d840cee0c34d4d20fa8eb2689e8c" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" dependencies = [ "ark-ec", "ark-ff", @@ -372,41 +389,46 @@ dependencies = [ [[package]] name = "ark-ec" -version = "0.3.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea978406c4b1ca13c2db2373b05cc55429c3575b8b21f1b9ee859aa5b03dd42" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" dependencies = [ "ark-ff", + "ark-poly", "ark-serialize", "ark-std", "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", "num-traits", "zeroize", ] [[package]] name = "ark-ff" -version = "0.3.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" dependencies = [ "ark-ff-asm", "ark-ff-macros", "ark-serialize", "ark-std", "derivative", + "digest 0.10.7", + "itertools 0.10.5", "num-bigint 0.4.3", "num-traits", "paste", - "rustc_version 0.3.3", + "rustc_version 0.4.0", "zeroize", ] [[package]] name = "ark-ff-asm" -version = "0.3.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" dependencies = [ "quote 1.0.26", "syn 1.0.109", @@ -414,31 +436,58 @@ dependencies = [ [[package]] name = "ark-ff-macros" -version = "0.3.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ "num-bigint 0.4.3", "num-traits", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + [[package]] name = "ark-serialize" -version = "0.3.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ + "ark-serialize-derive", "ark-std", - "digest 0.9.0", + "digest 0.10.7", + "num-bigint 0.4.3", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2 1.0.59", + "quote 1.0.26", + "syn 1.0.109", ] [[package]] name = "ark-std" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", "rand 0.8.5", @@ -452,9 +501,9 @@ checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" [[package]] name = "arrayref" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" @@ -499,7 +548,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", "synstructure", @@ -511,7 +560,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] @@ -522,6 +571,17 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "async-channel" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + [[package]] name = "async-compression" version = "0.3.15" @@ -547,13 +607,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.58" +version = "0.1.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] @@ -585,6 +645,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + [[package]] name = "base64ct" version = "1.5.3" @@ -632,16 +698,16 @@ dependencies = [ [[package]] name = "blake3" -version = "1.3.1" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" +checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -656,9 +722,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] @@ -675,20 +741,43 @@ 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.56", + "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", ] @@ -698,7 +787,18 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", + "quote 1.0.26", + "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.26", "syn 1.0.109", ] @@ -709,7 +809,18 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", + "quote 1.0.26", + "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.26", "syn 1.0.109", ] @@ -778,7 +889,7 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 2.0.15", ] @@ -797,9 +908,9 @@ checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "caps" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938c50180feacea622ef3b8f4a496057c868dcf8ac7a64d781dd8f3f51a9c143" +checksum = "190baaad529bcfbde9e1a19022c42781bdb6ff9de25721abdb8fd98c0807730b" dependencies = [ "libc", "thiserror", @@ -832,13 +943,13 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.22" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", "serde", "time 0.1.44", @@ -855,16 +966,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "cipher" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" -dependencies = [ - "crypto-common", - "inout", -] - [[package]] name = "clap" version = "2.34.0" @@ -927,7 +1028,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" dependencies = [ "heck 0.4.0", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 2.0.15", ] @@ -976,18 +1077,26 @@ dependencies = [ "unreachable", ] +[[package]] +name = "concurrent-queue" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "console" -version = "0.15.2" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" dependencies = [ "encode_unicode", "lazy_static", "libc", - "terminal_size", "unicode-width", - "winapi", + "windows-sys 0.45.0", ] [[package]] @@ -1002,9 +1111,9 @@ dependencies = [ [[package]] name = "console_log" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494" +checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" dependencies = [ "log", "web-sys", @@ -1018,9 +1127,9 @@ checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" [[package]] name = "constant_time_eq" -version = "0.1.5" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b" [[package]] name = "core-foundation" @@ -1058,9 +1167,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.6" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", "crossbeam-utils", @@ -1131,7 +1240,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" dependencies = [ - "cipher 0.3.0", + "cipher", ] [[package]] @@ -1169,7 +1278,7 @@ dependencies = [ "cc", "codespan-reporting", "once_cell", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "scratch", "syn 1.0.109", @@ -1187,16 +1296,16 @@ version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] [[package]] name = "darling" -version = "0.14.3" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0808e1bd8671fb44a113a14e13497557533369847788fa2ae912b6ebfce9fa8" +checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" dependencies = [ "darling_core", "darling_macro", @@ -1204,27 +1313,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.14.3" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "001d80444f28e193f30c2f293455da62dcf9a6b29918a4253152ae2b1de592cb" +checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "strsim 0.10.0", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] name = "darling_macro" -version = "0.14.3" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" +checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" dependencies = [ "darling_core", "quote 1.0.26", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] @@ -1268,18 +1377,19 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] [[package]] name = "dialoguer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92e7e37ecef6857fdc0c0c5d42fd5b0938e46590c2183cc92dd310a6d078eb1" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" dependencies = [ "console", + "shell-words", "tempfile", "zeroize", ] @@ -1301,11 +1411,11 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.5" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.3", + "block-buffer 0.10.4", "crypto-common", "subtle", ] @@ -1357,7 +1467,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] @@ -1428,9 +1538,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "ena" @@ -1458,34 +1568,22 @@ dependencies = [ [[package]] name = "enum-iterator" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "706d9e7cf1c7664859d79cd524e4e53ea2b67ea03c98cc2870c5e539695d597e" +checksum = "7add3873b5dd076766ee79c8e406ad1a472c385476b9e38849f8eec24f1be689" dependencies = [ "enum-iterator-derive", ] [[package]] name = "enum-iterator-derive" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355f93763ef7b0ae1c43c4d8eccc9d5848d84ad1a1d8ce61c421d1ac85a19d05" -dependencies = [ - "proc-macro2 1.0.56", - "quote 1.0.26", - "syn 1.0.109", -] - -[[package]] -name = "enum_dispatch" -version = "0.3.8" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eb359f1476bf611266ac1f5355bc14aeca37b299d0ebccc038ee7058891c9cb" +checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb" dependencies = [ - "once_cell", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] @@ -1503,7 +1601,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "946ee94e3dbf58fdd324f9ce245c7b238d46a66f00e86a020b71996349e46cce" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] @@ -1618,9 +1716,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -1633,9 +1731,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -1643,15 +1741,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -1660,38 +1758,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-macro" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -1707,9 +1805,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "serde", "typenum", @@ -1741,9 +1839,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if", "js-sys", @@ -1797,7 +1895,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] @@ -1805,8 +1903,14 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash", + "ahash 0.8.3", ] [[package]] @@ -1833,6 +1937,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "hermit-abi" version = "0.3.1" @@ -1861,7 +1974,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -2010,9 +2123,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", @@ -2020,25 +2133,17 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.17.3" +version = "0.17.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729" +checksum = "db45317f37ef454e6519b6c3ed7d377e5f23346f0823f86e65ca36912d1d0ef8" dependencies = [ "console", + "instant", "number_prefix", "portable-atomic", "unicode-width", ] -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - [[package]] name = "instant" version = "0.1.12" @@ -2112,9 +2217,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" dependencies = [ "wasm-bindgen", ] @@ -2180,19 +2285,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.142" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" - -[[package]] -name = "libloading" -version = "0.7.3" +version = "0.2.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" -dependencies = [ - "cfg-if", - "winapi", -] +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" [[package]] name = "libsecp256k1" @@ -2302,9 +2397,18 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.8.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] @@ -2354,14 +2458,24 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.5" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.42.0", + "miow", + "ntapi", + "winapi", +] + +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi", ] [[package]] @@ -2370,7 +2484,7 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a69803fbfbc4bb0327de86f49d2639692c7c60276cb87d6cced84bb8189f2000" dependencies = [ - "borsh", + "borsh 0.9.3", "mpl-token-metadata-context-derive", "num-derive", "num-traits", @@ -2389,7 +2503,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aed414104154928aa995a44a0a474c449d04ce5a4ee6c975ad41c5d2912f0dfe" dependencies = [ "arrayref", - "borsh", + "borsh 0.9.3", "mpl-token-auth-rules", "mpl-token-metadata-context-derive", "mpl-utils", @@ -2419,7 +2533,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "822133b6cba8f9a43e5e0e189813be63dd795858f54155c729833be472ffdb51" dependencies = [ "arrayref", - "borsh", + "borsh 0.9.3", "solana-program", "spl-token", ] @@ -2432,16 +2546,16 @@ checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" [[package]] name = "nix" -version = "0.25.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ - "autocfg", "bitflags", "cfg-if", "libc", - "memoffset 0.6.5", + "memoffset 0.7.1", "pin-utils", + "static_assertions", ] [[package]] @@ -2454,6 +2568,15 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "ntapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" +dependencies = [ + "winapi", +] + [[package]] name = "num" version = "0.2.1" @@ -2506,7 +2629,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] @@ -2555,11 +2678,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi 0.2.6", "libc", ] @@ -2569,7 +2692,16 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive 0.6.1", ] [[package]] @@ -2579,11 +2711,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ "proc-macro-crate 1.2.1", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] +[[package]] +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate 1.2.1", + "proc-macro2 1.0.59", + "quote 1.0.26", + "syn 2.0.15", +] + [[package]] name = "num_threads" version = "0.1.6" @@ -2632,6 +2776,17 @@ version = "6.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3baf96e39c5359d2eb0dd6ccb42c62b91d9678aa68160d261b9e0ccbf9e9dea9" +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + [[package]] name = "parking_lot" version = "0.12.1" @@ -2639,7 +2794,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.4", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", ] [[package]] @@ -2682,7 +2851,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -2757,7 +2926,7 @@ checksum = "92aacdc5f16768709a569e913f7451034034178b05bdc8acda226659a3dccc66" dependencies = [ "phf_generator", "phf_shared 0.11.1", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] @@ -2829,9 +2998,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "0.3.19" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f6a7b87c2e435a3241addceeeff740ff8b7e76b74c13bf9acb17fa454ea00b" +checksum = "767eb9f07d4a5ebcb39bbf2d452058a93c011373abf6832e24194a1c3f004794" [[package]] name = "portpicker" @@ -2885,9 +3054,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" dependencies = [ "unicode-ident", ] @@ -2921,9 +3090,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4ced82a24bb281af338b9e8f94429b6eca01b4e66d899f40031f074e74c9" +checksum = "67c10f662eee9c94ddd7135043e544f3c82fa839a1e7b865911331961b53186c" dependencies = [ "bytes", "rand 0.8.5", @@ -2966,7 +3135,7 @@ version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", ] [[package]] @@ -3028,7 +3197,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.9", ] [[package]] @@ -3051,21 +3220,19 @@ dependencies = [ [[package]] name = "rayon" -version = "1.5.3" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" dependencies = [ - "autocfg", - "crossbeam-deque", "either", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.9.3" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -3100,7 +3267,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.9", "redox_syscall", "thiserror", ] @@ -3139,12 +3306,12 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.12" +version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" +checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" dependencies = [ "async-compression", - "base64 0.13.1", + "base64 0.21.2", "bytes", "encoding_rs", "futures-core", @@ -3264,7 +3431,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.16", + "semver 1.0.17", ] [[package]] @@ -3292,9 +3459,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.7" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", @@ -3325,9 +3492,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" [[package]] name = "ryu" @@ -3387,7 +3554,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] @@ -3436,9 +3603,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "semver-parser" @@ -3451,38 +3618,38 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.154" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cdd151213925e7f1ab45a9bbfb129316bd00799784b174b7cc7bcd16961c49e" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.7" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfc50e8183eeeb6178dcb167ae34a8051d63535023ae38b5d8d12beae193d37b" +checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.154" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc80d722935453bcafdc2c9a73cd6fac4dc1938f0346035d84bf99fa9e33217" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] name = "serde_json" -version = "1.0.87" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa", "ryu", @@ -3503,9 +3670,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "2.2.0" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d904179146de381af4c93d3af6ca4984b3152db687dacb9c3c35e86f39809c" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" dependencies = [ "serde", "serde_with_macros", @@ -3513,21 +3680,21 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "2.2.0" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1966009f3c05f095697c537312f5415d1e3ed31ce0a56942bac4c771c5c335e" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ "darling", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] name = "serde_yaml" -version = "0.9.17" +version = "0.9.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb06d4b6cdaef0e0c51fa881acb721bed3c924cfaa71d9c94a3b771dfdf6567" +checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c" dependencies = [ "indexmap", "itoa", @@ -3549,7 +3716,7 @@ dependencies = [ "field-offset", "itertools 0.9.0", "num-traits", - "num_enum", + "num_enum 0.5.11", "safe-transmute", "serde", "solana-program", @@ -3567,7 +3734,7 @@ checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -3591,7 +3758,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -3612,7 +3779,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" dependencies = [ - "digest 0.10.5", + "digest 0.10.7", "keccak", ] @@ -3631,7 +3798,7 @@ version = "0.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63927d22a1e8b74bda98cc6e151fcdf178b7abb0dc6c4f81e0bbf5ffe2fc4ec8" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "shank_macro_impl", "syn 1.0.109", @@ -3644,12 +3811,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ce03403df682f80f4dc1efafa87a4d0cb89b03726d0565e6364bdca5b9a441" dependencies = [ "anyhow", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "serde", "syn 1.0.109", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "shellexpand" version = "2.1.2" @@ -3707,9 +3880,9 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -3717,12 +3890,12 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e4ac2e5e6474d17f19341df43c62b62ee1e362bae9b06bc30223252dd4a362" +checksum = "579f978391c966b0a8f94467e446fd8155ed668e9d074c614329d4bad47134ac" dependencies = [ "Inflector", - "base64 0.13.1", + "base64 0.21.2", "bincode", "bs58 0.4.0", "bv", @@ -3734,16 +3907,16 @@ dependencies = [ "solana-config-program", "solana-sdk", "spl-token", - "spl-token-2022 0.5.0", + "spl-token-2022", "thiserror", "zstd", ] [[package]] name = "solana-address-lookup-table-program" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baac6a0dfc38f64e5e5e178e9eeade05ef1a2c644c95062523c6bc21f19f8866" +checksum = "b73818e763f0f23ff538c5e42a07b1a76d556ff5719780a897147fe2958d345a" dependencies = [ "bincode", "bytemuck", @@ -3762,9 +3935,9 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0a43f9bcf2405e50190cf3943046663caae557db9eb71a628f359e3f4f3eea" +checksum = "770e68ef834e2835687facdf7e706f12e7f5c0e17044c0b956f068f6297a1685" dependencies = [ "chrono", "clap 2.34.0", @@ -3780,9 +3953,9 @@ dependencies = [ [[package]] name = "solana-cli-config" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c79aa0d4d3cef702ca522c1b8dca170eb7137254b6d608f46bcb3a26d6fffd3" +checksum = "95cb48e3e7679ebb2188960cefde449899005753edf7f2d830080f16a7572b7b" dependencies = [ "dirs-next", "lazy_static", @@ -3796,13 +3969,12 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe890559c3d8e29123ed0bfba47d5d714acb1db2e4a9a981c9171960ae01425" +checksum = "0f3059c513c25718282bc53432f7d8b0a06748161d6dcbdf67ecc6fa2bcec520" dependencies = [ "async-trait", "bincode", - "enum_dispatch", "futures", "futures-util", "indexmap", @@ -3814,7 +3986,6 @@ dependencies = [ "solana-connection-cache", "solana-measure", "solana-metrics", - "solana-net-utils", "solana-pubsub-client", "solana-quic-client", "solana-rpc-client", @@ -3831,9 +4002,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebb520c573b28060cadd8ae0fa6ae116cf74dac01078bc437d8b3e3ab00efd22" +checksum = "daad46dde420f68e4064ccba14e604f8ac97a88553234bcd2a087c1030b3f522" dependencies = [ "bincode", "chrono", @@ -3845,9 +4016,9 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c913dfcaf847cecd8866e4aeaa440b34c8a5dae6c1c90b7a8cb3265ff9fc775" +checksum = "ea40235b2b75e6a125f95c14d91884516e7229fb0505930b1ae38d05b3ad32b3" dependencies = [ "async-trait", "bincode", @@ -3856,9 +4027,9 @@ dependencies = [ "log", "rand 0.7.3", "rayon", + "rcgen", "solana-measure", "solana-metrics", - "solana-net-utils", "solana-sdk", "thiserror", "tokio", @@ -3866,9 +4037,9 @@ dependencies = [ [[package]] name = "solana-faucet" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d90180632e0528cd46e0ebfaf98977b24fc4593422be9b200e0dfaf97ee09cc7" +checksum = "919219ad369fd499afd7af560186748816aa5f8320284458825e33592a60f6fe" dependencies = [ "bincode", "byteorder", @@ -3890,13 +4061,13 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48f7051cccdf891ac2603cdd295eb651529fe2b678b6b3af60b82dec9a9b3b06" +checksum = "e0ec1a23136ef6072f3c6e3eabf6349dc0219ae23129c44754a4f9f8506941cd" dependencies = [ - "ahash", + "ahash 0.8.3", "blake3", - "block-buffer 0.9.0", + "block-buffer 0.10.4", "bs58 0.4.0", "bv", "byteorder", @@ -3904,7 +4075,6 @@ dependencies = [ "either", "generic-array", "getrandom 0.1.16", - "hashbrown 0.12.3", "im", "lazy_static", "log", @@ -3924,21 +4094,21 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06395428329810ade1d2518a7e75d8a6f02d01fe548aabb60ff1ba6a2eaebbe5" +checksum = "89744bbdcb6dc87805bf50f3db4520adf56b9fdd2a55b80b8de3b4c97b5c4bc8" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "rustc_version 0.4.0", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] name = "solana-logger" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170714ca3612e4df75f57c2c14c8ab74654b3b66f668986aeed456cedcf24446" +checksum = "4fc342d61b86066ca7bb72ab4ba17f677b8c2c3a3e71fb9286a57097f3b36b85" dependencies = [ "env_logger", "lazy_static", @@ -3947,9 +4117,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52b03528be5a0fbbe4c06a4e1758d155363b51f7c782435b1eb1d4804ab124e3" +checksum = "ea333a383efa6ddab7f4ba48273502af563abeb392f5731a00b22b9f45c15491" dependencies = [ "log", "solana-sdk", @@ -3957,9 +4127,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc5ff9cbbe50e9918576ff46b4e38d9a946c33fc442982ce7ff397a3b851922a" +checksum = "7f7cced7756637c9d9b46aa52dca715bd0efb396f29aade27ecbd336787174fd" dependencies = [ "crossbeam-channel", "gethostname", @@ -3971,9 +4141,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f35dff5b963ec471514e89bd99c7ac43545756221c99b63c2229cf5f37ebb2" +checksum = "8a17ef4a81db76c9604037cadecdbd83c0b82cce3576a275e48327b4d06a98d7" dependencies = [ "bincode", "clap 3.2.23", @@ -3993,11 +4163,11 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d630964a18fb466d79c3f5e191f37083b52b584a3f596e17f4bd41a145254d" +checksum = "7b4bcf9dd10dffe2707c1dfd91b695c2dc3cb9585a7cbb17ed24c7d98a4103e9" dependencies = [ - "ahash", + "ahash 0.8.3", "bincode", "bv", "caps", @@ -4020,20 +4190,20 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ae9f0fa7db3a4e90fa0df2723ac8cbc042e579cf109cd0380bc5a8c88bed924" +checksum = "aaf210d64911289b4a76cbd1fd0bfc6ab1d08e9d568a2dd021d03835d2e7efb6" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", + "ark-serialize", "array-bytes", - "base64 0.13.1", + "base64 0.21.2", "bincode", "bitflags", "blake3", - "borsh", - "borsh-derive", + "borsh 0.10.3", "bs58 0.4.0", "bv", "bytemuck", @@ -4041,18 +4211,18 @@ dependencies = [ "console_error_panic_hook", "console_log", "curve25519-dalek", - "getrandom 0.2.8", + "getrandom 0.2.9", "itertools 0.10.5", "js-sys", "lazy_static", "libc", "libsecp256k1", "log", - "memoffset 0.8.0", + "memoffset 0.9.0", "num-bigint 0.4.3", "num-derive", "num-traits", - "parking_lot", + "parking_lot 0.12.1", "rand 0.7.3", "rand_chacha 0.2.2", "rustc_version 0.4.0", @@ -4074,20 +4244,20 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb3250dc9a0abc87693437ae0bb3eb02603396dcf7698c06f77c33b2c0291ca" +checksum = "b2dbb6d2286cb5bae6e480b0d9acae38c6618e3ff858319b64c455e6039661b1" dependencies = [ - "base64 0.13.1", + "base64 0.21.2", "bincode", "eager", "enum-iterator", "itertools 0.10.5", "libc", - "libloading", "log", "num-derive", "num-traits", + "percentage", "rand 0.7.3", "rustc_version 0.4.0", "serde", @@ -4102,15 +4272,15 @@ dependencies = [ [[package]] name = "solana-pubsub-client" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e441892b9a00fdceebb0e7eee3226f2f5985a15d081aab1924a298f24cdadb2" +checksum = "a4313ba746070ee268076535b36ed5e4dcf584e5ec815ca04d714af5d485d765" dependencies = [ "crossbeam-channel", "futures-util", "log", "reqwest", - "semver 1.0.16", + "semver 1.0.17", "serde", "serde_derive", "serde_json", @@ -4127,9 +4297,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d19f3bd22bd8cef3bd7007e878f8ee1e9534a2b2ad99abc1ac05ed3d9f9bed" +checksum = "6a57937b9919152f3f2b1a5c9874113edf82e267be1c1f2448780e515ce115bb" dependencies = [ "async-mutex", "async-trait", @@ -4140,6 +4310,7 @@ dependencies = [ "quinn", "quinn-proto", "quinn-udp", + "rcgen", "rustls", "solana-connection-cache", "solana-measure", @@ -4148,16 +4319,15 @@ dependencies = [ "solana-rpc-client-api", "solana-sdk", "solana-streamer", - "solana-tpu-client", "thiserror", "tokio", ] [[package]] name = "solana-rayon-threadlimit" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30893a53deeb0a3e32451f4f7cb063484e1504a06b127c4b40c223ea90093d7b" +checksum = "49e5674c5786d04e4c1766e580827a417e7a523d724b4c1e8bb6c1842097ff3c" dependencies = [ "lazy_static", "num_cpus", @@ -4165,18 +4335,18 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "970f142fbf6bda164847f60977ad56adde32cafb7c798d2e005110410754aa85" +checksum = "123151e4cba3be5e887c333e430c43316d3b882e9a364f3368a6ac448bcfd1bb" dependencies = [ "console", "dialoguer", "log", "num-derive", "num-traits", - "parking_lot", + "parking_lot 0.12.1", "qstring", - "semver 1.0.16", + "semver 1.0.17", "solana-sdk", "thiserror", "uriparse", @@ -4184,18 +4354,18 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "075485c8ce9300df10b67f01bb9e9ecb79c4c96c58e4b8aacac20e63c6144149" +checksum = "d81847cc7339aec68c34819e6223ce5782ca62b4b402ec7976ba9af0ff82f400" dependencies = [ "async-trait", - "base64 0.13.1", + "base64 0.21.2", "bincode", "bs58 0.4.0", "indicatif", "log", "reqwest", - "semver 1.0.16", + "semver 1.0.17", "serde", "serde_derive", "serde_json", @@ -4210,15 +4380,15 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0623112b87c9e65ef00538e27203b6129518d40376a4aa2ddc4fae5bf78a8a2c" +checksum = "41df84c31b89e75b0b47bf3ef265042fd3c806f4c0d8d928c7f7f7a04b67472d" dependencies = [ - "base64 0.13.1", + "base64 0.21.2", "bs58 0.4.0", "jsonrpc-core", "reqwest", - "semver 1.0.16", + "semver 1.0.17", "serde", "serde_derive", "serde_json", @@ -4226,15 +4396,15 @@ dependencies = [ "solana-sdk", "solana-transaction-status", "solana-version", - "spl-token-2022 0.5.0", + "spl-token-2022", "thiserror", ] [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a70673c11ff5d831c4e569b41aeb86c0e9c68dba79515b7c6f42b8f842be76fe" +checksum = "6c96a92be32409c7fd101169e34a0c4be17bd336a5bf4b22e52880ffda599126" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -4245,21 +4415,21 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbefda9f9bda78fd9d91ae21c38d9693e94d5979838fb69b70c6addb8dab953f" +checksum = "e0a43b1c03aa69e1410ada4b5b2971ab948806c188015ac54684deec67d2739a" dependencies = [ "assert_matches", - "base64 0.13.1", + "base64 0.21.2", "bincode", "bitflags", - "borsh", + "borsh 0.10.3", "bs58 0.4.0", "bytemuck", "byteorder", "chrono", "derivation-path", - "digest 0.10.5", + "digest 0.10.7", "ed25519-dalek", "ed25519-dalek-bip32", "generic-array", @@ -4272,7 +4442,7 @@ dependencies = [ "memmap2", "num-derive", "num-traits", - "num_enum", + "num_enum 0.6.1", "pbkdf2 0.11.0", "qstring", "rand 0.7.3", @@ -4298,23 +4468,25 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f809319358d5da7c3a0ac08ebf4d87b21170d928dbb7260254e8f3061f7f9e0e" +checksum = "aec66b2d42de3e7a90086ca6ec16f66ac0019bfc3a6ca44ade2404a9dc8c128a" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "rustversion", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] name = "solana-streamer" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd5b3dad02879b083b7218b9f9596d97cee8deda2b625bff67db95d8920f5f7" +checksum = "be763578e5c6719e543e9d86d9517d3b2dde6581db76b942b4bd4a1c3ed19256" dependencies = [ + "async-channel", + "bytes", "crossbeam-channel", "futures-util", "histogram", @@ -4342,9 +4514,9 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bdd6347caf841a007952c748cd35c3ec8395aa3816ac59b4a9b4c102237de" +checksum = "8baffff86187a65ef4cfa190019108c4c3b1738ecfd51b862eeac19a8f8caf98" dependencies = [ "bincode", "log", @@ -4353,14 +4525,13 @@ dependencies = [ "solana-rpc-client", "solana-rpc-client-api", "solana-sdk", - "solana-tpu-client", ] [[package]] name = "solana-tpu-client" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50a7dfa7a85ba000656d91c8847b61f8fa9b8067443449fab8e4c35fe01dee5c" +checksum = "0d068ff8db750b4cc3a0a2bce228370bc3f4b7883c53fab64a862a7ba1e7343b" dependencies = [ "async-trait", "bincode", @@ -4373,7 +4544,6 @@ dependencies = [ "solana-connection-cache", "solana-measure", "solana-metrics", - "solana-net-utils", "solana-pubsub-client", "solana-rpc-client", "solana-rpc-client-api", @@ -4384,14 +4554,14 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b803e356fc2de0074866a6da007e721c950e754747e761a263b7f9e4c17edefa" +checksum = "eb0138e64aa7a6c2630c26d450bcdc296a57a399fb256fe85707aec10ac978ee" dependencies = [ "Inflector", - "base64 0.13.1", + "base64 0.21.2", "bincode", - "borsh", + "borsh 0.9.3", "bs58 0.4.0", "lazy_static", "log", @@ -4404,35 +4574,34 @@ dependencies = [ "spl-associated-token-account", "spl-memo", "spl-token", - "spl-token-2022 0.5.0", + "spl-token-2022", "thiserror", ] [[package]] name = "solana-udp-client" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1b0d7efeb2cb7dafbf3b085c895e440b8947fe5def6bdad17ebae9badfdecb0" +checksum = "e61134203fd0598b31cd24fd2f2d5866419911e4dbdb93fe9ad53404f6d79819" dependencies = [ "async-trait", "solana-connection-cache", "solana-net-utils", "solana-sdk", "solana-streamer", - "solana-tpu-client", "thiserror", "tokio", ] [[package]] name = "solana-version" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3df7b4a4dc0a39da78d790845089a8d112fcd6d2d003ae93830387a564cfc5" +checksum = "0869902287377b9fd67fe6d1135ef612a9983f74cbee0e99fc5faf6df095dc15" dependencies = [ "log", "rustc_version 0.4.0", - "semver 1.0.16", + "semver 1.0.17", "serde", "serde_derive", "solana-frozen-abi", @@ -4442,9 +4611,9 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2439b8c68f000f8c3713eceabb5cabc8528d276e5bc971c694d4103d4be958ff" +checksum = "e5764f7601a524e52d3ef70d314c68678ef623f8e1f7e48b3ccc3dec09d80503" dependencies = [ "bincode", "log", @@ -4464,17 +4633,16 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.15.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a290aa32014e007b03f952d5b784433d95636c65a3fb08d19dc5658a450941c" +checksum = "34a565bea0147718f57ee8bbd79438341769acd53f634d665c34114040ea7c26" dependencies = [ "aes-gcm-siv", "arrayref", - "base64 0.13.1", + "base64 0.21.2", "bincode", "bytemuck", "byteorder", - "cipher 0.4.3", "curve25519-dalek", "getrandom 0.1.16", "itertools 0.10.5", @@ -4495,9 +4663,9 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.2.38" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e9e5085099858adba23d0a0b5298da8803f89999cb567ecafab9c916cdf53d" +checksum = "5c0820fa96c8e644159a308b338465d2a6314b0a71abc92ed3ecf9ad61c906e3" dependencies = [ "byteorder", "combine", @@ -4543,17 +4711,17 @@ dependencies = [ [[package]] name = "spl-associated-token-account" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc000f0fdf1f12f99d77d398137c1751345b18c88258ce0f99b7872cf6c9bd6" +checksum = "978dba3bcbe88d0c2c58366c254d9ea41c5f73357e72fc0bdee4d6b5fc99c8f4" dependencies = [ "assert_matches", - "borsh", + "borsh 0.9.3", "num-derive", "num-traits", "solana-program", "spl-token", - "spl-token-2022 0.5.0", + "spl-token-2022", "thiserror", ] @@ -4576,29 +4744,11 @@ dependencies = [ "bytemuck", "num-derive", "num-traits", - "num_enum", + "num_enum 0.5.11", "solana-program", "thiserror", ] -[[package]] -name = "spl-token-2022" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edb869dbe159b018f17fb9bfa67118c30f232d7f54a73742bc96794dff77ed8" -dependencies = [ - "arrayref", - "bytemuck", - "num-derive", - "num-traits", - "num_enum", - "solana-program", - "solana-zk-token-sdk", - "spl-memo", - "spl-token", - "thiserror", -] - [[package]] name = "spl-token-2022" version = "0.6.1" @@ -4609,7 +4759,7 @@ dependencies = [ "bytemuck", "num-derive", "num-traits", - "num_enum", + "num_enum 0.5.11", "solana-program", "solana-zk-token-sdk", "spl-memo", @@ -4631,7 +4781,7 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot", + "parking_lot 0.12.1", "phf_shared 0.10.0", "precomputed-hash", ] @@ -4671,7 +4821,7 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "unicode-ident", ] @@ -4682,7 +4832,7 @@ version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "unicode-ident", ] @@ -4693,7 +4843,7 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", "unicode-xid 0.2.4", @@ -4744,16 +4894,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "terminal_size" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "textwrap" version = "0.11.0" @@ -4771,22 +4911,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] @@ -4874,9 +5014,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.24.2" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb" +checksum = "b9d0183f6f6001549ab68f8c7585093bb732beefbcf6d23a10b9b95c73a1dd49" dependencies = [ "autocfg", "bytes", @@ -4884,12 +5024,12 @@ dependencies = [ "memchr", "mio", "num_cpus", - "parking_lot", + "once_cell", + "parking_lot 0.11.2", "pin-project-lite", "signal-hook-registry", - "socket2", "tokio-macros", - "windows-sys 0.42.0", + "winapi", ] [[package]] @@ -4898,7 +5038,7 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] @@ -4916,9 +5056,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" dependencies = [ "futures-core", "pin-project-lite", @@ -4943,9 +5083,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "f988a1a1adc2fb21f9c12aa96441da33a1728193ae0b95d2be22dbd17fcb4e5c" dependencies = [ "bytes", "futures-core", @@ -4964,12 +5104,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_datetime" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" - [[package]] name = "tower-service" version = "0.3.2" @@ -4983,6 +5117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -4994,7 +5129,7 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", ] @@ -5123,9 +5258,9 @@ dependencies = [ [[package]] name = "unsafe-libyaml" -version = "0.2.5" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7ed8ba44ca06be78ea1ad2c3682a43349126c8818054231ee6f4748012aed2" +checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6" [[package]] name = "unsize" @@ -5234,9 +5369,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -5244,16 +5379,16 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", - "syn 1.0.109", + "syn 2.0.15", "wasm-bindgen-shared", ] @@ -5271,9 +5406,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" dependencies = [ "quote 1.0.26", "wasm-bindgen-macro-support", @@ -5281,22 +5416,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", - "syn 1.0.109", + "syn 2.0.15", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" [[package]] name = "web-sys" @@ -5377,13 +5512,22 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm 0.42.0", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm 0.42.0", - "windows_x86_64_msvc 0.42.0", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", ] [[package]] @@ -5392,7 +5536,22 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -5412,9 +5571,9 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" @@ -5430,9 +5589,9 @@ checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" @@ -5448,9 +5607,9 @@ checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] name = "windows_i686_gnu" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" @@ -5466,9 +5625,9 @@ checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] name = "windows_i686_msvc" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" @@ -5484,9 +5643,9 @@ checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" @@ -5496,9 +5655,9 @@ checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" @@ -5514,9 +5673,9 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" @@ -5524,15 +5683,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" -[[package]] -name = "winnow" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" -dependencies = [ - "memchr", -] - [[package]] name = "winreg" version = "0.10.1" @@ -5603,7 +5753,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ - "proc-macro2 1.0.56", + "proc-macro2 1.0.59", "quote 1.0.26", "syn 1.0.109", "synstructure", diff --git a/bench/COMPUTE_UNITS.md b/bench/COMPUTE_UNITS.md index 0e68f3a312..2788e659de 100644 --- a/bench/COMPUTE_UNITS.md +++ b/bench/COMPUTE_UNITS.md @@ -11,95 +11,95 @@ The programs and their tests are located in [/tests/bench](https://github.com/co ## [Unreleased] -| Instruction | Compute Units | +/- | -| --------------------------- | ------------- | --- | -| accountInfo1 | 954 | - | -| accountInfo2 | 1567 | - | -| accountInfo4 | 2059 | - | -| accountInfo8 | 3856 | - | -| accountEmptyInit1 | 5958 | - | -| accountEmpty1 | 1090 | - | -| accountEmptyInit2 | 10583 | - | -| accountEmpty2 | 1852 | - | -| accountEmptyInit4 | 19557 | - | -| accountEmpty4 | 2646 | - | -| accountEmptyInit8 | 37541 | - | -| accountEmpty8 | 5043 | - | -| accountSizedInit1 | 6063 | - | -| accountSized1 | 1135 | - | -| accountSizedInit2 | 10783 | - | -| accountSized2 | 1966 | - | -| accountSizedInit4 | 19975 | - | -| accountSized4 | 2787 | - | -| accountSizedInit8 | 38381 | - | -| accountSized8 | 5359 | - | -| accountUnsizedInit1 | 6193 | - | -| accountUnsized1 | 1243 | - | -| accountUnsizedInit2 | 11042 | - | -| accountUnsized2 | 1893 | - | -| accountUnsizedInit4 | 20495 | - | -| accountUnsized4 | 3104 | - | -| accountUnsizedInit8 | 39419 | - | -| accountUnsized8 | 6051 | - | -| boxedAccountEmptyInit1 | 6160 | - | -| boxedAccountEmpty1 | 976 | - | -| boxedAccountEmptyInit2 | 10784 | - | -| boxedAccountEmpty2 | 1499 | - | -| boxedAccountEmptyInit4 | 19500 | - | -| boxedAccountEmpty4 | 2530 | - | -| boxedAccountEmptyInit8 | 37415 | - | -| boxedAccountEmpty8 | 4780 | - | -| boxedAccountSizedInit1 | 6256 | - | -| boxedAccountSized1 | 1003 | - | -| boxedAccountSizedInit2 | 10975 | - | -| boxedAccountSized2 | 1554 | - | -| boxedAccountSizedInit4 | 19884 | - | -| boxedAccountSized4 | 2642 | - | -| boxedAccountSizedInit8 | 38182 | - | -| boxedAccountSized8 | 5003 | - | -| boxedAccountUnsizedInit1 | 6374 | - | -| boxedAccountUnsized1 | 1069 | - | -| boxedAccountUnsizedInit2 | 11211 | - | -| boxedAccountUnsized2 | 1679 | - | -| boxedAccountUnsizedInit4 | 20351 | - | -| boxedAccountUnsized4 | 2899 | - | -| boxedAccountUnsizedInit8 | 39118 | - | -| boxedAccountUnsized8 | 5517 | - | -| boxedInterfaceAccountMint1 | 2299 | - | -| boxedInterfaceAccountMint2 | 4053 | - | -| boxedInterfaceAccountMint4 | 7538 | - | -| boxedInterfaceAccountMint8 | 14699 | - | -| boxedInterfaceAccountToken1 | 1737 | - | -| boxedInterfaceAccountToken2 | 2928 | - | -| boxedInterfaceAccountToken4 | 5291 | - | -| boxedInterfaceAccountToken8 | 10205 | - | -| interfaceAccountMint1 | 2530 | - | -| interfaceAccountMint2 | 4726 | - | -| interfaceAccountMint4 | 9431 | - | -| interfaceAccountMint8 | 17709 | - | -| interfaceAccountToken1 | 1755 | - | -| interfaceAccountToken2 | 3211 | - | -| interfaceAccountToken4 | 6006 | - | -| interface1 | 999 | - | -| interface2 | 1574 | - | -| interface4 | 1996 | - | -| interface8 | 3651 | - | -| program1 | 999 | - | -| program2 | 1573 | - | -| program4 | 1998 | - | -| program8 | 3651 | - | -| signer1 | 958 | - | -| signer2 | 1576 | - | -| signer4 | 2079 | - | -| signer8 | 3895 | - | -| systemAccount1 | 1013 | - | -| systemAccount2 | 1686 | - | -| systemAccount4 | 2298 | - | -| systemAccount8 | 4336 | - | -| uncheckedAccount1 | 953 | - | -| uncheckedAccount2 | 1567 | - | -| uncheckedAccount4 | 2060 | - | -| uncheckedAccount8 | 3855 | - | +| Instruction | Compute Units | +/- | +| --------------------------- | ------------- | -------------- | +| accountInfo1 | 1015 | 🔴 **+6.39%** | +| accountInfo2 | 1475 | 🟢 **-5.87%** | +| accountInfo4 | 1964 | 🟢 **-4.61%** | +| accountInfo8 | 3856 | - | +| accountEmptyInit1 | 5817 | 🟢 **-2.37%** | +| accountEmpty1 | 1149 | 🔴 **+5.41%** | +| accountEmptyInit2 | 10402 | 🟢 **-1.63%** | +| accountEmpty2 | 1754 | 🟢 **-5.29%** | +| accountEmptyInit4 | 19557 | - | +| accountEmpty4 | 2540 | 🟢 **-4.01%** | +| accountEmptyInit8 | 37541 | - | +| accountEmpty8 | 5043 | - | +| accountSizedInit1 | 5924 | 🟢 **-2.29%** | +| accountSized1 | 1214 | 🔴 **+6.96%** | +| accountSizedInit2 | 10783 | - | +| accountSized2 | 1873 | 🟢 **-4.73%** | +| accountSizedInit4 | 19975 | - | +| accountSized4 | 2787 | - | +| accountSizedInit8 | 38381 | - | +| accountSized8 | 5359 | - | +| accountUnsizedInit1 | 6052 | 🟢 **-2.28%** | +| accountUnsized1 | 1338 | 🔴 **+7.64%** | +| accountUnsizedInit2 | 10929 | 🟢 **-1.02%** | +| accountUnsized2 | 1778 | 🟢 **-6.08%** | +| accountUnsizedInit4 | 20495 | - | +| accountUnsized4 | 3136 | 🔴 **+1.03%** | +| accountUnsizedInit8 | 39419 | - | +| accountUnsized8 | 5952 | 🟢 **-1.64%** | +| boxedAccountEmptyInit1 | 6034 | 🟢 **-2.05%** | +| boxedAccountEmpty1 | 888 | 🟢 **-9.02%** | +| boxedAccountEmptyInit2 | 10633 | 🟢 **-1.40%** | +| boxedAccountEmpty2 | 1401 | 🟢 **-6.54%** | +| boxedAccountEmptyInit4 | 19500 | - | +| boxedAccountEmpty4 | 2424 | 🟢 **-4.19%** | +| boxedAccountEmptyInit8 | 37415 | - | +| boxedAccountEmpty8 | 4659 | 🟢 **-2.53%** | +| boxedAccountSizedInit1 | 6130 | 🟢 **-2.01%** | +| boxedAccountSized1 | 917 | 🟢 **-8.57%** | +| boxedAccountSizedInit2 | 10828 | 🟢 **-1.34%** | +| boxedAccountSized2 | 1463 | 🟢 **-5.86%** | +| boxedAccountSizedInit4 | 19884 | - | +| boxedAccountSized4 | 2543 | 🟢 **-3.75%** | +| boxedAccountSizedInit8 | 38182 | - | +| boxedAccountSized8 | 4898 | 🟢 **-2.10%** | +| boxedAccountUnsizedInit1 | 6240 | 🟢 **-2.10%** | +| boxedAccountUnsized1 | 972 | 🟢 **-9.07%** | +| boxedAccountUnsizedInit2 | 11048 | 🟢 **-1.45%** | +| boxedAccountUnsized2 | 1570 | 🟢 **-6.49%** | +| boxedAccountUnsizedInit4 | 20138 | 🟢 **-1.05%** | +| boxedAccountUnsized4 | 2768 | 🟢 **-4.52%** | +| boxedAccountUnsizedInit8 | 39118 | - | +| boxedAccountUnsized8 | 5347 | 🟢 **-3.08%** | +| boxedInterfaceAccountMint1 | 2299 | - | +| boxedInterfaceAccountMint2 | 4129 | 🔴 **+1.88%** | +| boxedInterfaceAccountMint4 | 7783 | 🔴 **+3.25%** | +| boxedInterfaceAccountMint8 | 15281 | 🔴 **+3.96%** | +| boxedInterfaceAccountToken1 | 2023 | 🔴 **+16.47%** | +| boxedInterfaceAccountToken2 | 3582 | 🔴 **+22.34%** | +| boxedInterfaceAccountToken4 | 6692 | 🔴 **+26.48%** | +| boxedInterfaceAccountToken8 | 13098 | 🔴 **+28.35%** | +| interfaceAccountMint1 | 2364 | 🟢 **-6.56%** | +| interfaceAccountMint2 | 5030 | 🔴 **+6.43%** | +| interfaceAccountMint4 | 9803 | 🔴 **+3.94%** | +| interfaceAccountMint8 | 18400 | 🔴 **+3.90%** | +| interfaceAccountToken1 | 2091 | 🔴 **+19.15%** | +| interfaceAccountToken2 | 3948 | 🔴 **+22.95%** | +| interfaceAccountToken4 | 7547 | 🔴 **+25.66%** | +| interface1 | 1059 | 🔴 **+6.01%** | +| interface2 | 1479 | 🟢 **-6.04%** | +| interface4 | 1900 | 🟢 **-4.81%** | +| interface8 | 3651 | - | +| program1 | 1053 | 🔴 **+5.41%** | +| program2 | 1467 | 🟢 **-6.74%** | +| program4 | 1878 | 🟢 **-6.01%** | +| program8 | 3598 | 🟢 **-1.45%** | +| signer1 | 1018 | 🔴 **+6.26%** | +| signer2 | 1484 | 🟢 **-5.84%** | +| signer4 | 1984 | 🟢 **-4.57%** | +| signer8 | 3895 | - | +| systemAccount1 | 1072 | 🔴 **+5.82%** | +| systemAccount2 | 1590 | 🟢 **-5.69%** | +| systemAccount4 | 2195 | 🟢 **-4.48%** | +| systemAccount8 | 4336 | - | +| uncheckedAccount1 | 1014 | 🔴 **+6.40%** | +| uncheckedAccount2 | 1475 | 🟢 **-5.87%** | +| uncheckedAccount4 | 1965 | 🟢 **-4.61%** | +| uncheckedAccount8 | 3855 | - | ### Notable changes diff --git a/cli/Cargo.toml b/cli/Cargo.toml index cb0cb80e5b..d21749c75b 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -31,18 +31,18 @@ toml = "0.5.8" solang-parser = "=0.2.3" semver = "1.0.4" serde = { version = "1.0.122", features = ["derive"] } -solana-sdk = "1.14.16" -solana-program = "1.14.16" -solana-client = "1.14.16" -solana-cli-config = "1.14.16" -solana-faucet = "1.14.16" +solana-sdk = "<1.17.0" +solana-program = "<1.17.0" +solana-client = "<1.17.0" +solana-cli-config = "<1.17.0" +solana-faucet = "<1.17.0" dirs = "4.0" heck = "0.4.0" flate2 = "1.0.19" tar = "0.4.35" regex = "1.8.3" reqwest = { version = "0.11.4", default-features = false, features = ["multipart", "blocking", "rustls-tls"] } -tokio = "1.24" +tokio = "~1.14.1" pathdiff = "0.2.0" cargo_toml = "0.13.0" walkdir = "2.3.2" diff --git a/client/Cargo.toml b/client/Cargo.toml index 2f950e0afb..b4aed6db20 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -16,7 +16,7 @@ anyhow = "1.0.32" regex = "1.4.5" serde = { version = "1.0.122", features = ["derive"] } solana-client = "1.14.7" -solana-sdk = "1.14.16" -solana-account-decoder = "1.14.16" +solana-sdk = "<1.17.0" +solana-account-decoder = "<1.17.0" thiserror = "1.0.20" url = "2.2.2" diff --git a/client/example/Cargo.toml b/client/example/Cargo.toml index 56768daab0..157b80e01b 100644 --- a/client/example/Cargo.toml +++ b/client/example/Cargo.toml @@ -17,4 +17,4 @@ events = { path = "../../tests/events/programs/events", features = ["no-entrypoi shellexpand = "2.1.0" anyhow = "1.0.32" clap = { version = "4.2.4", features = ["derive"] } -solana-sdk = "1.14.16" +solana-sdk = "<1.17.0" diff --git a/lang/Cargo.toml b/lang/Cargo.toml index c250115141..16ddb59fe6 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -30,14 +30,15 @@ anchor-attribute-access-control = { path = "./attribute/access-control", version anchor-attribute-account = { path = "./attribute/account", version = "0.27.0" } anchor-attribute-constant = { path = "./attribute/constant", version = "0.27.0" } anchor-attribute-error = { path = "./attribute/error", version = "0.27.0" } -anchor-attribute-program = { path = "./attribute/program", version = "0.27.0" } anchor-attribute-event = { path = "./attribute/event", version = "0.27.0" } +anchor-attribute-program = { path = "./attribute/program", version = "0.27.0" } anchor-derive-accounts = { path = "./derive/accounts", version = "0.27.0" } anchor-derive-space = { path = "./derive/space", version = "0.27.0" } arrayref = "0.3.6" base64 = "0.13.0" -borsh = "0.9" +bincode = "1.3.3" +borsh = "<0.11.0" bytemuck = "1.4.0" -solana-program = "1.14.16" +getrandom = { version = "0.2", features = ["custom"] } +solana-program = "<1.17.0" thiserror = "1.0.20" -bincode = "1.3.3" diff --git a/lang/tests/generics_test.rs b/lang/tests/generics_test.rs index a2c8f270ae..01cef66f4d 100644 --- a/lang/tests/generics_test.rs +++ b/lang/tests/generics_test.rs @@ -47,6 +47,10 @@ impl BorshDeserialize for WrappedU8Array { fn deserialize(_buf: &mut &[u8]) -> borsh::maybestd::io::Result { todo!() } + + fn deserialize_reader(_reader: &mut R) -> std::io::Result { + todo!() + } } impl Owner for WrappedU8Array { fn owner() -> Pubkey { diff --git a/spl/Cargo.toml b/spl/Cargo.toml index b01cc52141..389a1ed540 100644 --- a/spl/Cargo.toml +++ b/spl/Cargo.toml @@ -22,16 +22,10 @@ dex = ["serum_dex"] [dependencies] anchor-lang = { path = "../lang", version = "0.27.0", features = ["derive"] } -borsh = { version = "^0.9", optional = true } +borsh = { version = "<0.11.0", optional = true } serum_dex = { git = "https://github.com/openbook-dex/program/", rev = "1be91f2", version = "0.4.0", features = ["no-entrypoint"], optional = true } -solana-program = "1.14.16" +solana-program = "<1.17.0" spl-token = { version = "3.5.0", features = ["no-entrypoint"], optional = true } spl-token-2022 = { version = "0.6.1", features = ["no-entrypoint"], optional = true } spl-associated-token-account = { version = "1.1.1", features = ["no-entrypoint"], optional = true } mpl-token-metadata = { version = "^1.11.0", optional = true, features = ["no-entrypoint"] } - -# TODO: Remove after Solana release v1.16 -# Latest solana version(1.14.17) as of 2023-05-01 comes with rustc 1.62.0-dev but MSRV for latest -# version of this crate is 1.64.0. See https://github.com/solana-labs/solana/pull/31418 -winnow = "=0.4.1" -toml_datetime = "=0.6.1" diff --git a/tests/anchor-cli-account/programs/account-command/Cargo.toml b/tests/anchor-cli-account/programs/account-command/Cargo.toml index db2136edc4..a078db6a90 100644 --- a/tests/anchor-cli-account/programs/account-command/Cargo.toml +++ b/tests/anchor-cli-account/programs/account-command/Cargo.toml @@ -16,4 +16,4 @@ cpi = ["no-entrypoint"] default = [] [dependencies] -anchor-lang = "0.27.0" +anchor-lang = { path = "../../../../lang" } diff --git a/tests/auction-house b/tests/auction-house index b73b60e55a..82c049326c 160000 --- a/tests/auction-house +++ b/tests/auction-house @@ -1 +1 @@ -Subproject commit b73b60e55a87bda1d2770c7c10db920db9cdb06b +Subproject commit 82c049326c1f99b76ee40dc7dadc1769c56c53c1 diff --git a/tests/bench/bench.json b/tests/bench/bench.json index 28cf6152fd..ceab6f1f31 100644 --- a/tests/bench/bench.json +++ b/tests/bench/bench.json @@ -92,92 +92,92 @@ }, "unreleased": { "computeUnits": { - "accountInfo1": 954, - "accountInfo2": 1567, - "accountInfo4": 2059, + "accountInfo1": 1015, + "accountInfo2": 1475, + "accountInfo4": 1964, "accountInfo8": 3856, - "accountEmptyInit1": 5958, - "accountEmpty1": 1090, - "accountEmptyInit2": 10583, - "accountEmpty2": 1852, + "accountEmptyInit1": 5817, + "accountEmpty1": 1149, + "accountEmptyInit2": 10402, + "accountEmpty2": 1754, "accountEmptyInit4": 19557, - "accountEmpty4": 2646, + "accountEmpty4": 2540, "accountEmptyInit8": 37541, "accountEmpty8": 5043, - "accountSizedInit1": 6063, - "accountSized1": 1135, + "accountSizedInit1": 5924, + "accountSized1": 1214, "accountSizedInit2": 10783, - "accountSized2": 1966, + "accountSized2": 1873, "accountSizedInit4": 19975, "accountSized4": 2787, "accountSizedInit8": 38381, "accountSized8": 5359, - "accountUnsizedInit1": 6193, - "accountUnsized1": 1243, - "accountUnsizedInit2": 11042, - "accountUnsized2": 1893, + "accountUnsizedInit1": 6052, + "accountUnsized1": 1338, + "accountUnsizedInit2": 10929, + "accountUnsized2": 1778, "accountUnsizedInit4": 20495, - "accountUnsized4": 3104, + "accountUnsized4": 3136, "accountUnsizedInit8": 39419, - "accountUnsized8": 6051, - "boxedAccountEmptyInit1": 6160, - "boxedAccountEmpty1": 976, - "boxedAccountEmptyInit2": 10784, - "boxedAccountEmpty2": 1499, + "accountUnsized8": 5952, + "boxedAccountEmptyInit1": 6034, + "boxedAccountEmpty1": 888, + "boxedAccountEmptyInit2": 10633, + "boxedAccountEmpty2": 1401, "boxedAccountEmptyInit4": 19500, - "boxedAccountEmpty4": 2530, + "boxedAccountEmpty4": 2424, "boxedAccountEmptyInit8": 37415, - "boxedAccountEmpty8": 4780, - "boxedAccountSizedInit1": 6256, - "boxedAccountSized1": 1003, - "boxedAccountSizedInit2": 10975, - "boxedAccountSized2": 1554, + "boxedAccountEmpty8": 4659, + "boxedAccountSizedInit1": 6130, + "boxedAccountSized1": 917, + "boxedAccountSizedInit2": 10828, + "boxedAccountSized2": 1463, "boxedAccountSizedInit4": 19884, - "boxedAccountSized4": 2642, + "boxedAccountSized4": 2543, "boxedAccountSizedInit8": 38182, - "boxedAccountSized8": 5003, - "boxedAccountUnsizedInit1": 6374, - "boxedAccountUnsized1": 1069, - "boxedAccountUnsizedInit2": 11211, - "boxedAccountUnsized2": 1679, - "boxedAccountUnsizedInit4": 20351, - "boxedAccountUnsized4": 2899, + "boxedAccountSized8": 4898, + "boxedAccountUnsizedInit1": 6240, + "boxedAccountUnsized1": 972, + "boxedAccountUnsizedInit2": 11048, + "boxedAccountUnsized2": 1570, + "boxedAccountUnsizedInit4": 20138, + "boxedAccountUnsized4": 2768, "boxedAccountUnsizedInit8": 39118, - "boxedAccountUnsized8": 5517, + "boxedAccountUnsized8": 5347, "boxedInterfaceAccountMint1": 2299, - "boxedInterfaceAccountMint2": 4053, - "boxedInterfaceAccountMint4": 7538, - "boxedInterfaceAccountMint8": 14699, - "boxedInterfaceAccountToken1": 1737, - "boxedInterfaceAccountToken2": 2928, - "boxedInterfaceAccountToken4": 5291, - "boxedInterfaceAccountToken8": 10205, - "interfaceAccountMint1": 2530, - "interfaceAccountMint2": 4726, - "interfaceAccountMint4": 9431, - "interfaceAccountMint8": 17709, - "interfaceAccountToken1": 1755, - "interfaceAccountToken2": 3211, - "interfaceAccountToken4": 6006, - "interface1": 999, - "interface2": 1574, - "interface4": 1996, + "boxedInterfaceAccountMint2": 4129, + "boxedInterfaceAccountMint4": 7783, + "boxedInterfaceAccountMint8": 15281, + "boxedInterfaceAccountToken1": 2023, + "boxedInterfaceAccountToken2": 3582, + "boxedInterfaceAccountToken4": 6692, + "boxedInterfaceAccountToken8": 13098, + "interfaceAccountMint1": 2364, + "interfaceAccountMint2": 5030, + "interfaceAccountMint4": 9803, + "interfaceAccountMint8": 18400, + "interfaceAccountToken1": 2091, + "interfaceAccountToken2": 3948, + "interfaceAccountToken4": 7547, + "interface1": 1059, + "interface2": 1479, + "interface4": 1900, "interface8": 3651, - "program1": 999, - "program2": 1573, - "program4": 1998, - "program8": 3651, - "signer1": 958, - "signer2": 1576, - "signer4": 2079, + "program1": 1053, + "program2": 1467, + "program4": 1878, + "program8": 3598, + "signer1": 1018, + "signer2": 1484, + "signer4": 1984, "signer8": 3895, - "systemAccount1": 1013, - "systemAccount2": 1686, - "systemAccount4": 2298, + "systemAccount1": 1072, + "systemAccount2": 1590, + "systemAccount4": 2195, "systemAccount8": 4336, - "uncheckedAccount1": 953, - "uncheckedAccount2": 1567, - "uncheckedAccount4": 2060, + "uncheckedAccount1": 1014, + "uncheckedAccount2": 1475, + "uncheckedAccount4": 1965, "uncheckedAccount8": 3855 } } diff --git a/tests/bench/programs/bench/Cargo.toml b/tests/bench/programs/bench/Cargo.toml index 1d21010acf..d7b162620b 100644 --- a/tests/bench/programs/bench/Cargo.toml +++ b/tests/bench/programs/bench/Cargo.toml @@ -14,8 +14,3 @@ cpi = ["no-entrypoint"] [dependencies] anchor-lang = { path = "../../../../lang" } anchor-spl = { path = "../../../../spl" } - -# TODO: Remove this and store lock files for each version instead. -# Latest solana version(1.14.17) as of 2023-05-01 comes with rustc 1.62.0-dev but MSRV for latest -# version of this crate is 1.64.0. See https://github.com/solana-labs/solana/pull/31418 -winnow = "=0.4.1" diff --git a/tests/zero-copy/programs/zero-copy/Cargo.toml b/tests/zero-copy/programs/zero-copy/Cargo.toml index 9735eae387..21c5450906 100644 --- a/tests/zero-copy/programs/zero-copy/Cargo.toml +++ b/tests/zero-copy/programs/zero-copy/Cargo.toml @@ -22,4 +22,4 @@ bytemuck = {version = "1.4.0", features = ["derive", "min_const_generics"]} [dev-dependencies] anchor-client = { path = "../../../../client", features = ["debug"] } -solana-program-test = "1.14.16" +solana-program-test = "<1.17.0"