From 6060787e4318f8257cafb7a59a421843c2cb74b7 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Wed, 31 Jul 2024 17:00:02 -0700 Subject: [PATCH 01/49] Move SubDao::dc_key() -> Dao::dc_key() The Data Credits Key is not SubDao specific. --- helium-lib/src/dao.rs | 12 +- helium-lib/src/dc.rs | 8 +- helium-lib/src/hotspot/mod.rs | 206 +++++++++++++++++++++++++++++++++- 3 files changed, 215 insertions(+), 11 deletions(-) diff --git a/helium-lib/src/dao.rs b/helium-lib/src/dao.rs index 1438ae77..171cc7ec 100644 --- a/helium-lib/src/dao.rs +++ b/helium-lib/src/dao.rs @@ -97,6 +97,12 @@ impl Dao { ); key } + + pub fn dc_key() -> Pubkey { + let (key, _) = + Pubkey::find_program_address(&[b"dc", Token::Dc.mint().as_ref()], &data_credits::id()); + key + } } #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize)] @@ -151,12 +157,6 @@ impl SubDao { key } - pub fn dc_key() -> Pubkey { - let (key, _) = - Pubkey::find_program_address(&[b"dc", Token::Dc.mint().as_ref()], &data_credits::id()); - key - } - pub fn delegated_dc_key(&self, router_key: &str) -> Pubkey { let hash = Sha256::digest(router_key); let (key, _) = Pubkey::find_program_address( diff --git a/helium-lib/src/dc.rs b/helium-lib/src/dc.rs index eb19c53b..68376b31 100644 --- a/helium-lib/src/dc.rs +++ b/helium-lib/src/dc.rs @@ -37,7 +37,7 @@ pub async fn mint>( hnt_price_oracle: Pubkey, ) -> impl ToAccountMetas { data_credits::accounts::MintDataCreditsV0 { - data_credits: SubDao::dc_key(), + data_credits: Dao::dc_key(), owner, hnt_mint: *Token::Hnt.mint(), dc_mint: *Token::Dc.mint(), @@ -55,7 +55,7 @@ pub async fn mint>( let hnt_price_oracle = client .as_ref() - .anchor_account::(&SubDao::dc_key()) + .anchor_account::(&Dao::dc_key()) .await? .hnt_price_oracle; @@ -89,7 +89,7 @@ pub async fn delegate>( fn mk_accounts(delegated_dc_key: Pubkey, subdao: SubDao, owner: Pubkey) -> impl ToAccountMetas { data_credits::accounts::DelegateDataCreditsV0 { delegated_data_credits: delegated_dc_key, - data_credits: SubDao::dc_key(), + data_credits: Dao::dc_key(), dc_mint: *Token::Dc.mint(), dao: Dao::Hnt.key(), sub_dao: subdao.key(), @@ -136,7 +136,7 @@ pub async fn burn>( data_credits::accounts::BurnWithoutTrackingV0BurnAccounts { burner: Token::Dc.associated_token_adress(&owner), dc_mint: *Token::Dc.mint(), - data_credits: SubDao::dc_key(), + data_credits: Dao::dc_key(), token_program: anchor_spl::token::ID, system_program: solana_sdk::system_program::ID, associated_token_program: anchor_spl::associated_token::ID, diff --git a/helium-lib/src/hotspot/mod.rs b/helium-lib/src/hotspot/mod.rs index d2ea1707..68e3abd3 100644 --- a/helium-lib/src/hotspot/mod.rs +++ b/helium-lib/src/hotspot/mod.rs @@ -132,7 +132,7 @@ pub async fn direct_update + AsRef>( dao: Dao::Hnt.key(), sub_dao: subdao.key(), dc_mint: *Token::Dc.mint(), - dc: SubDao::dc_key(), + dc: Dao::dc_key(), compression_program: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, data_credits_program: data_credits::id(), token_program: anchor_spl::token::ID, @@ -272,6 +272,210 @@ pub async fn transfer + AsRef>( Ok(tx) } +pub mod dataonly { + use super::*; + use crate::programs::{ + SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID, TOKEN_METADATA_PROGRAM_ID, + }; + use helium_proto::{BlockchainTxnAddGatewayV1, Message}; + + pub async fn onboard + AsRef + GetAnchorAccount>( + client: &C, + hotspot_key: &helium_crypto::PublicKey, + assertion: HotspotInfoUpdate, + keypair: &Keypair, + ) -> Result { + use helium_entity_manager::accounts::OnboardDataOnlyIotHotspotV0; + fn mk_accounts( + config_account: helium_entity_manager::DataOnlyConfigV0, + owner: Pubkey, + hotspot_key: &helium_crypto::PublicKey, + ) -> OnboardDataOnlyIotHotspotV0 { + let dao = Dao::Hnt; + let entity_key = hotspot_key.as_entity_key(); + let data_only_config_key = dao.dataonly_config_key(); + OnboardDataOnlyIotHotspotV0 { + payer: owner, + dc_fee_payer: owner, + iot_info: SubDao::Iot.info_key(&entity_key), + hotspot_owner: owner, + merkle_tree: config_account.merkle_tree, + dc_burner: Token::Dc.associated_token_adress(&owner), + rewardable_entity_config: SubDao::Iot.rewardable_entity_config_key(), + data_only_config: data_only_config_key, + dao: dao.key(), + key_to_asset: dao.entity_key_to_kta_key(&entity_key), + sub_dao: SubDao::Iot.key(), + dc_mint: *Token::Dc.mint(), + dc: Dao::dc_key(), + compression_program: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, + data_credits_program: data_credits::id(), + helium_sub_daos_program: helium_sub_daos::id(), + token_program: anchor_spl::token::ID, + associated_token_program: spl_associated_token_account::id(), + system_program: solana_sdk::system_program::id(), + } + } + + let config_account = client + .anchor_account::( + &Dao::Hnt.dataonly_config_key(), + ) + .await?; + let kta = kta::for_entity_key(hotspot_key).await?; + let (asset, asset_proof) = asset::for_kta_with_proof(client, &kta).await?; + let mut onboard_accounts = + mk_accounts(config_account, keypair.pubkey(), hotspot_key).to_account_metas(None); + onboard_accounts.extend_from_slice(&asset_proof.proof(Some(3))?); + + let onboard_ix = solana_sdk::instruction::Instruction { + program_id: helium_entity_manager::id(), + accounts: onboard_accounts, + data: helium_entity_manager::instruction::OnboardDataOnlyIotHotspotV0 { + _args: helium_entity_manager::OnboardDataOnlyIotHotspotArgsV0 { + data_hash: asset.compression.data_hash, + creator_hash: asset.compression.creator_hash, + index: asset.compression.leaf_id()?, + root: asset_proof.root.to_bytes(), + elevation: *assertion.elevation(), + gain: assertion.gain_i32(), + location: assertion.location_u64(), + }, + } + .data(), + }; + + let ixs = &[ + priority_fee::compute_budget_instruction(300_000), + priority_fee::compute_price_instruction_for_accounts(client, &onboard_ix.accounts) + .await?, + onboard_ix, + ]; + + let blockhash = AsRef::::as_ref(client) + .get_latest_blockhash() + .await?; + let tx = + Transaction::new_signed_with_payer(ixs, Some(&keypair.pubkey()), &[keypair], blockhash); + Ok(tx) + } + + pub async fn issue + GetAnchorAccount>( + client: &C, + verifier: &str, + add_tx: &mut BlockchainTxnAddGatewayV1, + keypair: &Keypair, + ) -> Result { + use helium_entity_manager::accounts::IssueDataOnlyEntityV0; + fn mk_accounts( + config_account: helium_entity_manager::DataOnlyConfigV0, + owner: Pubkey, + entity_key: &[u8], + ) -> IssueDataOnlyEntityV0 { + let dao = Dao::Hnt; + let dataonly_config_key = dao.dataonly_config_key(); + IssueDataOnlyEntityV0 { + payer: owner, + ecc_verifier: ECC_VERIFIER, + collection: config_account.collection, + collection_metadata: dao.collection_metadata_key(&config_account.collection), + collection_master_edition: dao + .collection_master_edition_key(&config_account.collection), + data_only_config: dataonly_config_key, + entity_creator: dao.entity_creator_key(), + dao: dao.key(), + key_to_asset: dao.entity_key_to_kta_key(&entity_key), + tree_authority: dao.merkle_tree_authority(&config_account.merkle_tree), + recipient: owner, + merkle_tree: config_account.merkle_tree, + data_only_escrow: dao.dataonly_escrow_key(), + bubblegum_signer: dao.bubblegum_signer(), + token_metadata_program: TOKEN_METADATA_PROGRAM_ID, + log_wrapper: SPL_NOOP_PROGRAM_ID, + bubblegum_program: mpl_bubblegum::ID, + compression_program: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, + system_program: solana_sdk::system_program::id(), + } + } + + let config_account = client + .anchor_account::( + &Dao::Hnt.dataonly_config_key(), + ) + .await?; + let hotspot_key = helium_crypto::PublicKey::from_bytes(&add_tx.gateway)?; + let entity_key = hotspot_key.as_entity_key(); + let accounts = mk_accounts(config_account, keypair.pubkey(), &entity_key); + + let issue_ix = Instruction { + program_id: helium_entity_manager::id(), + accounts: accounts.to_account_metas(None), + data: helium_entity_manager::instruction::IssueDataOnlyEntityV0 { + _args: helium_entity_manager::IssueDataOnlyEntityArgsV0 { entity_key }, + } + .data(), + }; + + let ixs = &[ + priority_fee::compute_budget_instruction(300_000), + priority_fee::compute_price_instruction_for_accounts(client, &accounts).await?, + issue_ix, + ]; + let mut tx = Transaction::new_with_payer(ixs, Some(&keypair.pubkey())); + + let blockhash = AsRef::::as_ref(client) + .get_latest_blockhash() + .await?; + tx.try_partial_sign(&[keypair], blockhash)?; + + let sig = add_tx.gateway_signature.clone(); + add_tx.gateway_signature = vec![]; + let msg = add_tx.encode_to_vec(); + + let signed_tx = verify_helium_key(verifier, &msg, &sig, tx).await?; + Ok(signed_tx) + } + + async fn verify_helium_key( + verifier: &str, + msg: &[u8], + signature: &[u8], + tx: Transaction, + ) -> Result { + #[derive(Deserialize, Serialize, Default)] + struct VerifyRequest<'a> { + // hex encoded solana transaction + pub transaction: &'a str, + // hex encoded signed message + pub msg: &'a str, + // hex encoded signature + pub signature: &'a str, + } + #[derive(Deserialize, Serialize, Default)] + struct VerifyResponse { + // hex encoded solana transaction + pub transaction: String, + } + let client = reqwest::Client::new(); + let serialized_tx = hex::encode(bincode::serialize(&tx).map_err(EncodeError::from)?); + let response = client + .post(format!("{}/verify", verifier)) + .json(&VerifyRequest { + transaction: &serialized_tx, + msg: &hex::encode(msg), + signature: &hex::encode(signature), + }) + .send() + .await? + .json::() + .await?; + let signed_tx = + bincode::deserialize(&hex::decode(response.transaction).map_err(DecodeError::from)?) + .map_err(DecodeError::from)?; + Ok(signed_tx) + } +} + #[derive(Debug, Serialize, Clone, Copy, PartialEq, Eq, Default, Hash)] #[cfg_attr(feature = "clap", derive(clap::ValueEnum))] #[serde(rename_all = "kebab-case")] From 8cae4dbdd0a2f9a290859cce6d76481d0165f1f5 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Wed, 31 Jul 2024 17:01:59 -0700 Subject: [PATCH 02/49] Add `dc::burn_delegated` function --- helium-lib/src/dao.rs | 21 ++++++++++++ helium-lib/src/dc.rs | 80 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) diff --git a/helium-lib/src/dao.rs b/helium-lib/src/dao.rs index 171cc7ec..4989d406 100644 --- a/helium-lib/src/dao.rs +++ b/helium-lib/src/dao.rs @@ -2,6 +2,7 @@ use crate::{ data_credits, entity_key::AsEntityKey, helium_entity_manager, helium_sub_daos, keypair::Pubkey, lazy_distributor, programs::TOKEN_METADATA_PROGRAM_ID, token::Token, }; +use chrono::Timelike; use sha2::{Digest, Sha256}; #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize)] @@ -98,6 +99,11 @@ impl Dao { key } + pub fn dc_account_payer() -> Pubkey { + let (key, _) = Pubkey::find_program_address(&[b"account_payer"], &data_credits::id()); + key + } + pub fn dc_key() -> Pubkey { let (key, _) = Pubkey::find_program_address(&[b"dc", Token::Dc.mint().as_ref()], &data_credits::id()); @@ -231,4 +237,19 @@ impl SubDao { ); key } + + pub fn epoch_info_key(&self) -> Pubkey { + const EPOCH_LENGTH: u32 = 60 * 60 * 24; + let epoch = chrono::Utc::now().second() / EPOCH_LENGTH; + + let (key, _) = Pubkey::find_program_address( + &[ + "sub_dao_epoch_info".as_bytes(), + self.key().as_ref(), + &epoch.to_le_bytes(), + ], + &helium_sub_daos::ID, + ); + key + } } diff --git a/helium-lib/src/dc.rs b/helium-lib/src/dc.rs index 68376b31..7e140e60 100644 --- a/helium-lib/src/dc.rs +++ b/helium-lib/src/dc.rs @@ -1,3 +1,9 @@ +use anchor_client::anchor_lang::AccountDeserialize; +use helium_anchor_gen::{ + data_credits::accounts::BurnDelegatedDataCreditsV0, + helium_sub_daos::{self, DaoV0, SubDaoV0}, +}; + use crate::{ anchor_lang::{InstructionData, ToAccountMetas}, anchor_spl, circuit_breaker, @@ -6,6 +12,7 @@ use crate::{ data_credits, error::{DecodeError, Error}, keypair::{Keypair, Pubkey}, + priority_fee, solana_sdk::{instruction::Instruction, signer::Signer, transaction::Transaction}, token::{Token, TokenAmount}, }; @@ -162,3 +169,76 @@ pub async fn burn>( ); Ok(tx) } + +pub async fn burn_delegated>( + client: &C, + sub_dao: SubDao, + keypair: &Keypair, + amount: u64, + router_key: Pubkey, +) -> Result { + fn mk_accounts( + sub_dao: SubDao, + router_key: Pubkey, + dc_burn_authority: Pubkey, + registrar: Pubkey, + ) -> BurnDelegatedDataCreditsV0 { + let delegated_data_credits = SubDao::Iot.delegated_dc_key(&router_key.to_string()); + let escrow_account = SubDao::Iot.escrow_key(&delegated_data_credits); + + BurnDelegatedDataCreditsV0 { + sub_dao_epoch_info: sub_dao.epoch_info_key(), + delegated_data_credits, + escrow_account, + + dao: Dao::Hnt.key(), + sub_dao: sub_dao.key(), + + account_payer: Dao::dc_account_payer(), + data_credits: Dao::dc_key(), + dc_burn_authority, + dc_mint: *Token::Dc.mint(), + registrar, + + token_program: anchor_spl::token::ID, + helium_sub_daos_program: helium_sub_daos::id(), + system_program: solana_sdk::system_program::ID, + } + } + + let (dc_burn_authority, registrar) = { + let account_data = client.as_ref().get_account_data(&SubDao::Iot.key()).await?; + let sub_dao = SubDaoV0::try_deserialize(&mut account_data.as_ref())?; + + let account_data = client.as_ref().get_account_data(&Dao::Hnt.key()).await?; + let dao = DaoV0::try_deserialize(&mut account_data.as_ref())?; + + (sub_dao.dc_burn_authority, dao.registrar) + }; + + let accounts = mk_accounts(sub_dao, router_key, dc_burn_authority, registrar); + let burn_ix = solana_sdk::instruction::Instruction { + program_id: data_credits::id(), + accounts: accounts.to_account_metas(None), + data: data_credits::instruction::BurnDelegatedDataCreditsV0 { + _args: data_credits::BurnDelegatedDataCreditsArgsV0 { amount }, + } + .data(), + }; + + let ixs = [ + priority_fee::compute_price_instruction(300_000), + priority_fee::compute_price_instruction_for_accounts(client, &burn_ix.accounts).await?, + burn_ix, + ]; + + let recent_blockhash = client.as_ref().get_latest_blockhash().await?; + + let tx = Transaction::new_signed_with_payer( + &ixs, + Some(&keypair.pubkey()), + &[keypair], + recent_blockhash, + ); + Ok(tx) +} From 58cf64b8d7d8cbff8486704e8ac706d8413586ba Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Thu, 1 Aug 2024 19:34:43 -0700 Subject: [PATCH 03/49] add helper for going from solana keypair to wrapped helium-lib keypair The solana_sdk provides a `read_keypair_file` function, but it returns a Result with a Box. Rather than recreate all those functions for a wrapped Keypair, I thought to start with an easy conversion from one to the other. So you can read the keypair with the solana_sdk, then very quickly turn it into a helium-lib keypair. Bring the discussion!!! --- helium-lib/src/keypair.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/helium-lib/src/keypair.rs b/helium-lib/src/keypair.rs index f328c949..ee524fc4 100644 --- a/helium-lib/src/keypair.rs +++ b/helium-lib/src/keypair.rs @@ -99,6 +99,12 @@ impl TryFrom<&[u8; 64]> for Keypair { } } +impl From for Keypair { + fn from(keypair: solana_sdk::signer::keypair::Keypair) -> Self { + Self(keypair) + } +} + impl Keypair { pub fn generate() -> Self { Keypair(solana_sdk::signer::keypair::Keypair::new()) From d2bf60cccf66c2a742e50652a99b5d4e66f120cb Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Thu, 1 Aug 2024 19:37:31 -0700 Subject: [PATCH 04/49] Add boosting module, function for starting hex boost The module is named boosting so there is hopefully less confusion with the existance of `helium_anchor_lang::hexboosting` that is autogenerated. --- helium-lib/src/boosting.rs | 67 ++++++++++++++++++++++++++++++++++++++ helium-lib/src/lib.rs | 3 +- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 helium-lib/src/boosting.rs diff --git a/helium-lib/src/boosting.rs b/helium-lib/src/boosting.rs new file mode 100644 index 00000000..ad472f9b --- /dev/null +++ b/helium-lib/src/boosting.rs @@ -0,0 +1,67 @@ +use chrono::{DateTime, Utc}; +use helium_anchor_gen::hexboosting::accounts::StartBoostV0; + +use crate::{ + anchor_lang::{InstructionData, ToAccountMetas}, + client::SolanaRpcClient, + error::Error, + hexboosting, + keypair::Keypair, + keypair::Pubkey, + solana_sdk::{instruction::Instruction, signature::Signer, transaction::Transaction}, +}; + +pub trait StartBoostingHex { + fn start_authority(&self) -> Pubkey; + fn boost_config(&self) -> Pubkey; + fn boosted_hex(&self) -> Pubkey; + fn activation_ts(&self) -> DateTime; +} + +pub async fn start_boost>( + client: &C, + keypair: &Keypair, + updates: impl IntoIterator, +) -> Result { + fn mk_accounts( + start_authority: Pubkey, + boost_config: Pubkey, + boosted_hex: Pubkey, + ) -> StartBoostV0 { + StartBoostV0 { + start_authority, + boost_config, + boosted_hex, + } + } + + let mut ixs = vec![]; + for update in updates { + let accounts = mk_accounts( + update.start_authority(), + update.boost_config(), + update.boosted_hex(), + ); + let ix = Instruction { + program_id: hexboosting::id(), + accounts: accounts.to_account_metas(None), + data: hexboosting::instruction::StartBoostV0 { + _args: hexboosting::StartBoostArgsV0 { + start_ts: update.activation_ts().timestamp(), + }, + } + .data(), + }; + ixs.push(ix); + } + + let recent_blockhash = client.as_ref().get_latest_blockhash().await?; + let tx = Transaction::new_signed_with_payer( + &ixs, + Some(&keypair.pubkey()), + &[keypair], + recent_blockhash, + ); + + Ok(tx) +} diff --git a/helium-lib/src/lib.rs b/helium-lib/src/lib.rs index 2446e0af..3a4aa543 100644 --- a/helium-lib/src/lib.rs +++ b/helium-lib/src/lib.rs @@ -2,6 +2,7 @@ pub mod asset; pub mod b64; pub mod client; +pub mod boosting; pub mod dao; pub mod dc; pub mod entity_key; @@ -20,7 +21,7 @@ pub use anchor_client::solana_client; pub use anchor_spl; pub use helium_anchor_gen::{ anchor_lang, circuit_breaker, data_credits, helium_entity_manager, helium_sub_daos, - lazy_distributor, + hexboosting, lazy_distributor, }; pub use solana_sdk; pub use solana_sdk::bs58; From b1734cc8a93291fa567db8fe4050a18a29aaf847 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Tue, 22 Oct 2024 14:46:27 -0700 Subject: [PATCH 05/49] merge imports --- helium-lib/src/boosting.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/helium-lib/src/boosting.rs b/helium-lib/src/boosting.rs index ad472f9b..18a0b82c 100644 --- a/helium-lib/src/boosting.rs +++ b/helium-lib/src/boosting.rs @@ -6,8 +6,7 @@ use crate::{ client::SolanaRpcClient, error::Error, hexboosting, - keypair::Keypair, - keypair::Pubkey, + keypair::{Keypair, Pubkey}, solana_sdk::{instruction::Instruction, signature::Signer, transaction::Transaction}, }; From c755093469dbf42096eef494d71844b6f3bfe811 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Tue, 22 Oct 2024 14:46:39 -0700 Subject: [PATCH 06/49] add Io error to encode error when attempting to write a keypair --- helium-lib/src/error.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helium-lib/src/error.rs b/helium-lib/src/error.rs index 02c85d87..b06b231d 100644 --- a/helium-lib/src/error.rs +++ b/helium-lib/src/error.rs @@ -72,6 +72,8 @@ impl Error { #[derive(Debug, Error)] pub enum EncodeError { + #[error("io: {0}")] + Io(#[from] std::io::Error), #[error("proto: {0}")] Proto(#[from] helium_proto::EncodeError), #[error("bincode: {0}")] From bd87fdd9d45408c4c42350bb2b70fbd00b7553ac Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Tue, 22 Oct 2024 14:47:16 -0700 Subject: [PATCH 07/49] Move ReadWrite trait to helium-lib You can directly read a helium_lib::Keypair from a file that is a solana keypair. --- helium-lib/src/keypair.rs | 14 ++++---- helium-lib/src/lib.rs | 1 + .../src/read_write.rs | 33 ++++++++++--------- helium-wallet/src/lib.rs | 1 - helium-wallet/src/wallet.rs | 16 ++++++--- 5 files changed, 37 insertions(+), 28 deletions(-) rename {helium-wallet => helium-lib}/src/read_write.rs (68%) diff --git a/helium-lib/src/keypair.rs b/helium-lib/src/keypair.rs index ee524fc4..fa354695 100644 --- a/helium-lib/src/keypair.rs +++ b/helium-lib/src/keypair.rs @@ -1,8 +1,9 @@ use crate::{ error::{DecodeError, Error}, + read_write::ReadWrite, solana_sdk::signature::SignerError, }; -use std::sync::Arc; +use std::{fs::File, path::Path, sync::Arc}; #[derive(PartialEq, Debug)] pub struct Keypair(solana_sdk::signer::keypair::Keypair); @@ -99,17 +100,16 @@ impl TryFrom<&[u8; 64]> for Keypair { } } -impl From for Keypair { - fn from(keypair: solana_sdk::signer::keypair::Keypair) -> Self { - Self(keypair) - } -} - impl Keypair { pub fn generate() -> Self { Keypair(solana_sdk::signer::keypair::Keypair::new()) } + pub fn read_from_file>(path: F) -> Result { + let mut file = File::open(path.as_ref())?; + Self::read(&mut file) + } + pub fn void() -> Arc { Arc::new(VoidKeypair) } diff --git a/helium-lib/src/lib.rs b/helium-lib/src/lib.rs index 3a4aa543..bb07a101 100644 --- a/helium-lib/src/lib.rs +++ b/helium-lib/src/lib.rs @@ -13,6 +13,7 @@ pub mod kta; pub mod onboarding; pub mod priority_fee; pub mod programs; +pub mod read_write; pub mod reward; pub mod token; diff --git a/helium-wallet/src/read_write.rs b/helium-lib/src/read_write.rs similarity index 68% rename from helium-wallet/src/read_write.rs rename to helium-lib/src/read_write.rs index b696ddab..f117b431 100644 --- a/helium-wallet/src/read_write.rs +++ b/helium-lib/src/read_write.rs @@ -1,29 +1,32 @@ -use crate::result::{bail, Result}; use helium_crypto::{ecc_compact, ed25519, multisig, KeyType}; use io::{Read, Write}; use std::io; +use crate::error::{DecodeError, EncodeError}; + pub trait ReadWrite { - fn read(reader: &mut dyn Read) -> Result + fn read(reader: &mut dyn Read) -> Result where Self: std::marker::Sized; - fn write(&self, writer: &mut dyn Write) -> Result; + fn write(&self, writer: &mut dyn Write) -> Result<(), EncodeError>; } impl ReadWrite for helium_crypto::PublicKey { - fn write(&self, writer: &mut dyn io::Write) -> Result { + fn write(&self, writer: &mut dyn io::Write) -> Result<(), EncodeError> { Ok(writer.write_all(&self.to_vec())?) } - fn read(reader: &mut dyn Read) -> Result { + fn read(reader: &mut dyn Read) -> Result { let mut data = vec![0u8; 1]; reader.read_exact(&mut data[0..1])?; let key_size = match KeyType::try_from(data[0])? { KeyType::Ed25519 => ed25519::PUBLIC_KEY_LENGTH, KeyType::EccCompact => ecc_compact::PUBLIC_KEY_LENGTH, KeyType::MultiSig => multisig::PUBLIC_KEY_LENGTH, - KeyType::Secp256k1 => bail!("Secp256k1 key type unsupported for read."), - KeyType::Rsa => bail!("RSA key type unsupported for read."), + KeyType::Secp256k1 => Err(DecodeError::other( + "Secp256k1 key type unsupported for read.", + ))?, + KeyType::Rsa => Err(DecodeError::other("RSA key type unsupported for read."))?, }; data.resize(key_size, 0); reader.read_exact(&mut data[1..])?; @@ -31,26 +34,26 @@ impl ReadWrite for helium_crypto::PublicKey { } } -impl ReadWrite for helium_lib::keypair::Pubkey { - fn write(&self, writer: &mut dyn io::Write) -> Result { +impl ReadWrite for crate::keypair::Pubkey { + fn write(&self, writer: &mut dyn io::Write) -> Result<(), EncodeError> { writer.write_all(&self.to_bytes())?; Ok(()) } - fn read(reader: &mut dyn Read) -> Result { - let mut data = [0u8; helium_lib::keypair::PUBKEY_BYTES]; + fn read(reader: &mut dyn Read) -> Result { + let mut data = [0u8; crate::keypair::PUBKEY_BYTES]; reader.read_exact(&mut data)?; Ok(Self::new_from_array(data)) } } -impl ReadWrite for helium_lib::keypair::Keypair { - fn write(&self, writer: &mut dyn io::Write) -> Result { +impl ReadWrite for crate::keypair::Keypair { + fn write(&self, writer: &mut dyn io::Write) -> Result<(), EncodeError> { writer.write_all(&self.to_bytes())?; Ok(()) } - fn read(reader: &mut dyn io::Read) -> Result { + fn read(reader: &mut dyn io::Read) -> Result { let mut sk_buf = [0u8; 64]; reader.read_exact(&mut sk_buf)?; Ok(Self::try_from(&sk_buf)?) @@ -60,7 +63,7 @@ impl ReadWrite for helium_lib::keypair::Keypair { #[cfg(test)] mod tests { use super::*; - use helium_lib::keypair::{Keypair, Pubkey, Signer}; + use crate::keypair::{Keypair, Pubkey, Signer}; use std::{io::Cursor, str::FromStr}; #[test] diff --git a/helium-wallet/src/lib.rs b/helium-wallet/src/lib.rs index 600807ea..77e13664 100644 --- a/helium-wallet/src/lib.rs +++ b/helium-wallet/src/lib.rs @@ -1,7 +1,6 @@ pub mod cmd; pub mod format; pub mod pwhash; -pub mod read_write; pub mod result; pub mod txn_envelope; pub mod wallet; diff --git a/helium-wallet/src/wallet.rs b/helium-wallet/src/wallet.rs index af7389fc..53c4e51f 100644 --- a/helium-wallet/src/wallet.rs +++ b/helium-wallet/src/wallet.rs @@ -1,12 +1,14 @@ use crate::{ format::{self, Format}, pwhash::PwHash, - read_write::ReadWrite, result::{anyhow, bail, Error, Result}, }; use aes_gcm::{aead::generic_array::GenericArray, AeadInPlace, Aes256Gcm, KeyInit}; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; -use helium_lib::keypair::{to_helium_pubkey, Keypair, Pubkey, Signer, PUBKEY_BYTES}; +use helium_lib::{ + keypair::{to_helium_pubkey, Keypair, Pubkey, Signer, PUBKEY_BYTES}, + read_write::ReadWrite, +}; use sodiumoxide::randombytes; use std::io::{self, Cursor}; use std::{ @@ -191,7 +193,9 @@ impl Wallet { let helium_pubkey = helium_crypto::PublicKey::read(reader)?; Pubkey::try_from(helium_pubkey).map_err(Error::from) } - WALLET_KIND_BASIC_V3 | WALLET_KIND_SHARDED_V3 => Pubkey::read(reader), + WALLET_KIND_BASIC_V3 | WALLET_KIND_SHARDED_V3 => { + Pubkey::read(reader).map_err(anyhow::Error::from) + } _ => bail!("Invalid wallet kind {kind}"), } } @@ -205,11 +209,13 @@ impl Wallet { | WALLET_KIND_SHARDED_V2 => { let tag = reader.read_u8()?; match KeyType::try_from(tag)? { - KeyType::Ed25519 => Keypair::read(reader), + KeyType::Ed25519 => Keypair::read(reader).map_err(anyhow::Error::from), _ => bail!("Unsupported key type: {tag}"), } } - WALLET_KIND_BASIC_V3 | WALLET_KIND_SHARDED_V3 => Keypair::read(reader), + WALLET_KIND_BASIC_V3 | WALLET_KIND_SHARDED_V3 => { + Keypair::read(reader).map_err(anyhow::Error::from) + } _ => bail!("Invalid wallet kind {kind}"), } } From db7f99821942729d6bdb30eb0624f9e6f2c5c5c9 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Tue, 22 Oct 2024 14:54:21 -0700 Subject: [PATCH 08/49] remove after bad merge --- helium-lib/src/hotspot/mod.rs | 204 ---------------------------------- 1 file changed, 204 deletions(-) diff --git a/helium-lib/src/hotspot/mod.rs b/helium-lib/src/hotspot/mod.rs index 68e3abd3..879b2508 100644 --- a/helium-lib/src/hotspot/mod.rs +++ b/helium-lib/src/hotspot/mod.rs @@ -272,210 +272,6 @@ pub async fn transfer + AsRef>( Ok(tx) } -pub mod dataonly { - use super::*; - use crate::programs::{ - SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID, TOKEN_METADATA_PROGRAM_ID, - }; - use helium_proto::{BlockchainTxnAddGatewayV1, Message}; - - pub async fn onboard + AsRef + GetAnchorAccount>( - client: &C, - hotspot_key: &helium_crypto::PublicKey, - assertion: HotspotInfoUpdate, - keypair: &Keypair, - ) -> Result { - use helium_entity_manager::accounts::OnboardDataOnlyIotHotspotV0; - fn mk_accounts( - config_account: helium_entity_manager::DataOnlyConfigV0, - owner: Pubkey, - hotspot_key: &helium_crypto::PublicKey, - ) -> OnboardDataOnlyIotHotspotV0 { - let dao = Dao::Hnt; - let entity_key = hotspot_key.as_entity_key(); - let data_only_config_key = dao.dataonly_config_key(); - OnboardDataOnlyIotHotspotV0 { - payer: owner, - dc_fee_payer: owner, - iot_info: SubDao::Iot.info_key(&entity_key), - hotspot_owner: owner, - merkle_tree: config_account.merkle_tree, - dc_burner: Token::Dc.associated_token_adress(&owner), - rewardable_entity_config: SubDao::Iot.rewardable_entity_config_key(), - data_only_config: data_only_config_key, - dao: dao.key(), - key_to_asset: dao.entity_key_to_kta_key(&entity_key), - sub_dao: SubDao::Iot.key(), - dc_mint: *Token::Dc.mint(), - dc: Dao::dc_key(), - compression_program: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, - data_credits_program: data_credits::id(), - helium_sub_daos_program: helium_sub_daos::id(), - token_program: anchor_spl::token::ID, - associated_token_program: spl_associated_token_account::id(), - system_program: solana_sdk::system_program::id(), - } - } - - let config_account = client - .anchor_account::( - &Dao::Hnt.dataonly_config_key(), - ) - .await?; - let kta = kta::for_entity_key(hotspot_key).await?; - let (asset, asset_proof) = asset::for_kta_with_proof(client, &kta).await?; - let mut onboard_accounts = - mk_accounts(config_account, keypair.pubkey(), hotspot_key).to_account_metas(None); - onboard_accounts.extend_from_slice(&asset_proof.proof(Some(3))?); - - let onboard_ix = solana_sdk::instruction::Instruction { - program_id: helium_entity_manager::id(), - accounts: onboard_accounts, - data: helium_entity_manager::instruction::OnboardDataOnlyIotHotspotV0 { - _args: helium_entity_manager::OnboardDataOnlyIotHotspotArgsV0 { - data_hash: asset.compression.data_hash, - creator_hash: asset.compression.creator_hash, - index: asset.compression.leaf_id()?, - root: asset_proof.root.to_bytes(), - elevation: *assertion.elevation(), - gain: assertion.gain_i32(), - location: assertion.location_u64(), - }, - } - .data(), - }; - - let ixs = &[ - priority_fee::compute_budget_instruction(300_000), - priority_fee::compute_price_instruction_for_accounts(client, &onboard_ix.accounts) - .await?, - onboard_ix, - ]; - - let blockhash = AsRef::::as_ref(client) - .get_latest_blockhash() - .await?; - let tx = - Transaction::new_signed_with_payer(ixs, Some(&keypair.pubkey()), &[keypair], blockhash); - Ok(tx) - } - - pub async fn issue + GetAnchorAccount>( - client: &C, - verifier: &str, - add_tx: &mut BlockchainTxnAddGatewayV1, - keypair: &Keypair, - ) -> Result { - use helium_entity_manager::accounts::IssueDataOnlyEntityV0; - fn mk_accounts( - config_account: helium_entity_manager::DataOnlyConfigV0, - owner: Pubkey, - entity_key: &[u8], - ) -> IssueDataOnlyEntityV0 { - let dao = Dao::Hnt; - let dataonly_config_key = dao.dataonly_config_key(); - IssueDataOnlyEntityV0 { - payer: owner, - ecc_verifier: ECC_VERIFIER, - collection: config_account.collection, - collection_metadata: dao.collection_metadata_key(&config_account.collection), - collection_master_edition: dao - .collection_master_edition_key(&config_account.collection), - data_only_config: dataonly_config_key, - entity_creator: dao.entity_creator_key(), - dao: dao.key(), - key_to_asset: dao.entity_key_to_kta_key(&entity_key), - tree_authority: dao.merkle_tree_authority(&config_account.merkle_tree), - recipient: owner, - merkle_tree: config_account.merkle_tree, - data_only_escrow: dao.dataonly_escrow_key(), - bubblegum_signer: dao.bubblegum_signer(), - token_metadata_program: TOKEN_METADATA_PROGRAM_ID, - log_wrapper: SPL_NOOP_PROGRAM_ID, - bubblegum_program: mpl_bubblegum::ID, - compression_program: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, - system_program: solana_sdk::system_program::id(), - } - } - - let config_account = client - .anchor_account::( - &Dao::Hnt.dataonly_config_key(), - ) - .await?; - let hotspot_key = helium_crypto::PublicKey::from_bytes(&add_tx.gateway)?; - let entity_key = hotspot_key.as_entity_key(); - let accounts = mk_accounts(config_account, keypair.pubkey(), &entity_key); - - let issue_ix = Instruction { - program_id: helium_entity_manager::id(), - accounts: accounts.to_account_metas(None), - data: helium_entity_manager::instruction::IssueDataOnlyEntityV0 { - _args: helium_entity_manager::IssueDataOnlyEntityArgsV0 { entity_key }, - } - .data(), - }; - - let ixs = &[ - priority_fee::compute_budget_instruction(300_000), - priority_fee::compute_price_instruction_for_accounts(client, &accounts).await?, - issue_ix, - ]; - let mut tx = Transaction::new_with_payer(ixs, Some(&keypair.pubkey())); - - let blockhash = AsRef::::as_ref(client) - .get_latest_blockhash() - .await?; - tx.try_partial_sign(&[keypair], blockhash)?; - - let sig = add_tx.gateway_signature.clone(); - add_tx.gateway_signature = vec![]; - let msg = add_tx.encode_to_vec(); - - let signed_tx = verify_helium_key(verifier, &msg, &sig, tx).await?; - Ok(signed_tx) - } - - async fn verify_helium_key( - verifier: &str, - msg: &[u8], - signature: &[u8], - tx: Transaction, - ) -> Result { - #[derive(Deserialize, Serialize, Default)] - struct VerifyRequest<'a> { - // hex encoded solana transaction - pub transaction: &'a str, - // hex encoded signed message - pub msg: &'a str, - // hex encoded signature - pub signature: &'a str, - } - #[derive(Deserialize, Serialize, Default)] - struct VerifyResponse { - // hex encoded solana transaction - pub transaction: String, - } - let client = reqwest::Client::new(); - let serialized_tx = hex::encode(bincode::serialize(&tx).map_err(EncodeError::from)?); - let response = client - .post(format!("{}/verify", verifier)) - .json(&VerifyRequest { - transaction: &serialized_tx, - msg: &hex::encode(msg), - signature: &hex::encode(signature), - }) - .send() - .await? - .json::() - .await?; - let signed_tx = - bincode::deserialize(&hex::decode(response.transaction).map_err(DecodeError::from)?) - .map_err(DecodeError::from)?; - Ok(signed_tx) - } -} - #[derive(Debug, Serialize, Clone, Copy, PartialEq, Eq, Default, Hash)] #[cfg_attr(feature = "clap", derive(clap::ValueEnum))] #[serde(rename_all = "kebab-case")] From 2031f39586260b104e4590217c0a3cb3fd7177eb Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Tue, 22 Oct 2024 14:54:26 -0700 Subject: [PATCH 09/49] update to use new dc_key location --- helium-lib/src/hotspot/dataonly.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helium-lib/src/hotspot/dataonly.rs b/helium-lib/src/hotspot/dataonly.rs index f604e093..c5b60462 100644 --- a/helium-lib/src/hotspot/dataonly.rs +++ b/helium-lib/src/hotspot/dataonly.rs @@ -54,7 +54,7 @@ mod iot { key_to_asset: dao.entity_key_to_kta_key(&entity_key), sub_dao: SubDao::Iot.key(), dc_mint: *Token::Dc.mint(), - dc: SubDao::dc_key(), + dc: Dao::dc_key(), compression_program: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, data_credits_program: data_credits::id(), helium_sub_daos_program: helium_sub_daos::id(), @@ -137,7 +137,7 @@ mod mobile { key_to_asset: dao.entity_key_to_kta_key(&entity_key), sub_dao: SubDao::Mobile.key(), dc_mint: *Token::Dc.mint(), - dc: SubDao::dc_key(), + dc: Dao::dc_key(), dnt_mint: *Token::Mobile.mint(), dnt_price: *Token::Mobile.price_key().unwrap(), // safe to unwrap dnt_burner: Token::Mobile.associated_token_adress(&owner), From b2f4780bdbe172153dcd4771837ced0bc4ff12fe Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Tue, 22 Oct 2024 14:56:11 -0700 Subject: [PATCH 10/49] remove useless ? and Ok --- helium-lib/src/read_write.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helium-lib/src/read_write.rs b/helium-lib/src/read_write.rs index f117b431..556b9737 100644 --- a/helium-lib/src/read_write.rs +++ b/helium-lib/src/read_write.rs @@ -56,7 +56,7 @@ impl ReadWrite for crate::keypair::Keypair { fn read(reader: &mut dyn io::Read) -> Result { let mut sk_buf = [0u8; 64]; reader.read_exact(&mut sk_buf)?; - Ok(Self::try_from(&sk_buf)?) + Self::try_from(&sk_buf) } } From 7a67eed5b0e4836ad2c293f337a63f8fd0004372 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Tue, 22 Oct 2024 15:46:59 -0700 Subject: [PATCH 11/49] move ReadWrite back to wallet. avoid file io in helium-lib --- helium-lib/src/keypair.rs | 8 +---- helium-lib/src/lib.rs | 1 - helium-wallet/src/lib.rs | 1 + .../src/read_write.rs | 35 +++++++++---------- helium-wallet/src/wallet.rs | 6 ++-- 5 files changed, 20 insertions(+), 31 deletions(-) rename {helium-lib => helium-wallet}/src/read_write.rs (67%) diff --git a/helium-lib/src/keypair.rs b/helium-lib/src/keypair.rs index fa354695..f328c949 100644 --- a/helium-lib/src/keypair.rs +++ b/helium-lib/src/keypair.rs @@ -1,9 +1,8 @@ use crate::{ error::{DecodeError, Error}, - read_write::ReadWrite, solana_sdk::signature::SignerError, }; -use std::{fs::File, path::Path, sync::Arc}; +use std::sync::Arc; #[derive(PartialEq, Debug)] pub struct Keypair(solana_sdk::signer::keypair::Keypair); @@ -105,11 +104,6 @@ impl Keypair { Keypair(solana_sdk::signer::keypair::Keypair::new()) } - pub fn read_from_file>(path: F) -> Result { - let mut file = File::open(path.as_ref())?; - Self::read(&mut file) - } - pub fn void() -> Arc { Arc::new(VoidKeypair) } diff --git a/helium-lib/src/lib.rs b/helium-lib/src/lib.rs index bb07a101..3a4aa543 100644 --- a/helium-lib/src/lib.rs +++ b/helium-lib/src/lib.rs @@ -13,7 +13,6 @@ pub mod kta; pub mod onboarding; pub mod priority_fee; pub mod programs; -pub mod read_write; pub mod reward; pub mod token; diff --git a/helium-wallet/src/lib.rs b/helium-wallet/src/lib.rs index 77e13664..600807ea 100644 --- a/helium-wallet/src/lib.rs +++ b/helium-wallet/src/lib.rs @@ -1,6 +1,7 @@ pub mod cmd; pub mod format; pub mod pwhash; +pub mod read_write; pub mod result; pub mod txn_envelope; pub mod wallet; diff --git a/helium-lib/src/read_write.rs b/helium-wallet/src/read_write.rs similarity index 67% rename from helium-lib/src/read_write.rs rename to helium-wallet/src/read_write.rs index 556b9737..27d77241 100644 --- a/helium-lib/src/read_write.rs +++ b/helium-wallet/src/read_write.rs @@ -1,32 +1,29 @@ +use anyhow::{bail, Result}; use helium_crypto::{ecc_compact, ed25519, multisig, KeyType}; use io::{Read, Write}; use std::io; -use crate::error::{DecodeError, EncodeError}; - pub trait ReadWrite { - fn read(reader: &mut dyn Read) -> Result + fn read(reader: &mut dyn Read) -> Result where Self: std::marker::Sized; - fn write(&self, writer: &mut dyn Write) -> Result<(), EncodeError>; + fn write(&self, writer: &mut dyn Write) -> Result<()>; } impl ReadWrite for helium_crypto::PublicKey { - fn write(&self, writer: &mut dyn io::Write) -> Result<(), EncodeError> { + fn write(&self, writer: &mut dyn io::Write) -> Result<()> { Ok(writer.write_all(&self.to_vec())?) } - fn read(reader: &mut dyn Read) -> Result { + fn read(reader: &mut dyn Read) -> Result { let mut data = vec![0u8; 1]; reader.read_exact(&mut data[0..1])?; let key_size = match KeyType::try_from(data[0])? { KeyType::Ed25519 => ed25519::PUBLIC_KEY_LENGTH, KeyType::EccCompact => ecc_compact::PUBLIC_KEY_LENGTH, KeyType::MultiSig => multisig::PUBLIC_KEY_LENGTH, - KeyType::Secp256k1 => Err(DecodeError::other( - "Secp256k1 key type unsupported for read.", - ))?, - KeyType::Rsa => Err(DecodeError::other("RSA key type unsupported for read."))?, + KeyType::Secp256k1 => bail!("Secp256k1 key type unsupported for read.",), + KeyType::Rsa => bail!("RSA key type unsupported for read."), }; data.resize(key_size, 0); reader.read_exact(&mut data[1..])?; @@ -34,36 +31,36 @@ impl ReadWrite for helium_crypto::PublicKey { } } -impl ReadWrite for crate::keypair::Pubkey { - fn write(&self, writer: &mut dyn io::Write) -> Result<(), EncodeError> { +impl ReadWrite for helium_lib::keypair::Pubkey { + fn write(&self, writer: &mut dyn io::Write) -> Result<()> { writer.write_all(&self.to_bytes())?; Ok(()) } - fn read(reader: &mut dyn Read) -> Result { - let mut data = [0u8; crate::keypair::PUBKEY_BYTES]; + fn read(reader: &mut dyn Read) -> Result { + let mut data = [0u8; helium_lib::keypair::PUBKEY_BYTES]; reader.read_exact(&mut data)?; Ok(Self::new_from_array(data)) } } -impl ReadWrite for crate::keypair::Keypair { - fn write(&self, writer: &mut dyn io::Write) -> Result<(), EncodeError> { +impl ReadWrite for helium_lib::keypair::Keypair { + fn write(&self, writer: &mut dyn io::Write) -> Result<()> { writer.write_all(&self.to_bytes())?; Ok(()) } - fn read(reader: &mut dyn io::Read) -> Result { + fn read(reader: &mut dyn io::Read) -> Result { let mut sk_buf = [0u8; 64]; reader.read_exact(&mut sk_buf)?; - Self::try_from(&sk_buf) + Ok(Self::try_from(&sk_buf)?) } } #[cfg(test)] mod tests { use super::*; - use crate::keypair::{Keypair, Pubkey, Signer}; + use helium_lib::keypair::{Keypair, Pubkey, Signer}; use std::{io::Cursor, str::FromStr}; #[test] diff --git a/helium-wallet/src/wallet.rs b/helium-wallet/src/wallet.rs index 53c4e51f..ec85c6d6 100644 --- a/helium-wallet/src/wallet.rs +++ b/helium-wallet/src/wallet.rs @@ -1,14 +1,12 @@ use crate::{ format::{self, Format}, pwhash::PwHash, + read_write::ReadWrite, result::{anyhow, bail, Error, Result}, }; use aes_gcm::{aead::generic_array::GenericArray, AeadInPlace, Aes256Gcm, KeyInit}; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; -use helium_lib::{ - keypair::{to_helium_pubkey, Keypair, Pubkey, Signer, PUBKEY_BYTES}, - read_write::ReadWrite, -}; +use helium_lib::keypair::{to_helium_pubkey, Keypair, Pubkey, Signer, PUBKEY_BYTES}; use sodiumoxide::randombytes; use std::io::{self, Cursor}; use std::{ From e827eebf66bc00a66a28cb37c1cec792b2013183 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Wed, 23 Oct 2024 09:54:22 -0700 Subject: [PATCH 12/49] upgrade spl-account-compression to version compatible with anchor-lang >0.30 --- Cargo.lock | 1441 +++++++++++++++++++++++----------------------------- 1 file changed, 631 insertions(+), 810 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 447fc19f..c33dea8f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,18 +14,18 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.24.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] [[package]] -name = "adler2" -version = "2.0.0" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aead" @@ -304,11 +304,11 @@ dependencies = [ [[package]] name = "anchor-client" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb48c4a7911038da546dc752655a29fa49f6bd50ebc1edca218bac8da1012acd" +checksum = "95b4397af9b7d6919df3342210d897c0ffda1a31d052abc8eee3e6035ee71567" dependencies = [ - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", "anyhow", "futures", "regex", @@ -350,7 +350,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" dependencies = [ "anchor-syn 0.29.0", - "borsh-derive-internal 0.10.4", + "borsh-derive-internal 0.10.3", "proc-macro2", "quote", "syn 1.0.109", @@ -363,7 +363,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0bb0e0911ad4a70cab880cdd6287fe1e880a1a9d8e4e6defa8e9044b9796a6c" dependencies = [ "anchor-syn 0.30.1", - "borsh-derive-internal 0.10.4", + "borsh-derive-internal 0.10.3", "proc-macro2", "quote", "syn 1.0.109", @@ -455,10 +455,10 @@ dependencies = [ "arrayref", "base64 0.13.1", "bincode", - "borsh 0.10.4", + "borsh 0.10.3", "bytemuck", "getrandom 0.2.15", - "solana-program 1.18.26", + "solana-program", "thiserror", ] @@ -480,10 +480,10 @@ dependencies = [ "arrayref", "base64 0.21.7", "bincode", - "borsh 0.10.4", + "borsh 0.10.3", "bytemuck", "getrandom 0.2.15", - "solana-program 1.18.26", + "solana-program", "thiserror", ] @@ -513,15 +513,17 @@ dependencies = [ [[package]] name = "anchor-spl" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" +checksum = "04bd077c34449319a1e4e0bc21cea572960c9ae0d0fefda0dd7c52fcc3c647a3" dependencies = [ - "anchor-lang 0.29.0", - "solana-program 1.18.26", - "spl-associated-token-account 2.3.0", + "anchor-lang 0.30.1", + "spl-associated-token-account 3.0.2", + "spl-pod 0.2.2", "spl-token", - "spl-token-2022 0.9.0", + "spl-token-2022 3.0.2", + "spl-token-group-interface 0.2.3", + "spl-token-metadata-interface 0.3.3", ] [[package]] @@ -614,9 +616,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.17" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", @@ -629,43 +631,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.9" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.91" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "ark-bn254" @@ -708,7 +710,7 @@ dependencies = [ "derivative", "digest 0.10.7", "itertools", - "num-bigint 0.4.6", + "num-bigint 0.4.5", "num-traits", "paste", "rustc_version", @@ -731,7 +733,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "num-bigint 0.4.6", + "num-bigint 0.4.5", "num-traits", "proc-macro2", "quote", @@ -760,7 +762,7 @@ dependencies = [ "ark-serialize-derive", "ark-std", "digest 0.10.7", - "num-bigint 0.4.6", + "num-bigint 0.4.5", ] [[package]] @@ -786,15 +788,15 @@ dependencies = [ [[package]] name = "arrayref" -version = "0.3.9" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" -version = "0.7.6" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "ascii" @@ -860,9 +862,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.17" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" +checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" dependencies = [ "brotli", "flate2", @@ -883,9 +885,9 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", @@ -894,24 +896,24 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -927,9 +929,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.4.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "axum" @@ -978,17 +980,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" dependencies = [ "addr2line", + "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", ] [[package]] @@ -1044,9 +1046,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ "serde", ] @@ -1145,12 +1147,12 @@ dependencies = [ [[package]] name = "borsh" -version = "0.10.4" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115e54d64eb62cdebad391c19efc9dce4981c690c85a33a12199d99bb9546fee" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" dependencies = [ - "borsh-derive 0.10.4", - "hashbrown 0.13.2", + "borsh-derive 0.10.3", + "hashbrown 0.12.3", ] [[package]] @@ -1178,12 +1180,12 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "0.10.4" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831213f80d9423998dd696e2c5345aba6be7a0bd8cd19e31c5243e13df1cef89" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" dependencies = [ - "borsh-derive-internal 0.10.4", - "borsh-schema-derive-internal 0.10.4", + "borsh-derive-internal 0.10.3", + "borsh-schema-derive-internal 0.10.3", "proc-macro-crate 0.1.5", "proc-macro2", "syn 1.0.109", @@ -1196,10 +1198,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" dependencies = [ "once_cell", - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", "syn_derive", ] @@ -1216,9 +1218,9 @@ dependencies = [ [[package]] name = "borsh-derive-internal" -version = "0.10.4" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65d6ba50644c98714aa2a70d13d7df3cd75cd2b523a2b452bf010443800976b3" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" dependencies = [ "proc-macro2", "quote", @@ -1238,9 +1240,9 @@ dependencies = [ [[package]] name = "borsh-schema-derive-internal" -version = "0.10.4" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276691d96f063427be83e6692b86148e488ebba9f48f77788724ca027ba3b6d4" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" dependencies = [ "proc-macro2", "quote", @@ -1249,9 +1251,9 @@ dependencies = [ [[package]] name = "brotli" -version = "7.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1339,13 +1341,13 @@ dependencies = [ [[package]] name = "bytemuck_derive" -version = "1.8.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcfcc3cd946cb52f0bbfdbbcfa2f4e24f75ebb6c0e1002f7c25904fada18b9ec" +checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -1356,9 +1358,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "caps" @@ -1372,13 +1374,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.31" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", - "shlex", + "once_cell", ] [[package]] @@ -1411,7 +1413,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -1445,10 +1447,10 @@ dependencies = [ [[package]] name = "circuit-breaker" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", ] [[package]] @@ -1484,9 +1486,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.20" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -1494,26 +1496,26 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", - "clap_lex 0.7.2", + "clap_lex 0.7.0", "strsim 0.11.1", ] [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -1527,15 +1529,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "combine" @@ -1641,9 +1643,9 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "core-foundation" @@ -1657,9 +1659,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.7" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core2" @@ -1672,9 +1674,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -1737,7 +1739,7 @@ dependencies = [ "bitflags 1.3.2", "crossterm_winapi", "libc", - "mio 0.8.11", + "mio", "parking_lot", "signal-hook", "signal-hook-mio", @@ -1804,9 +1806,9 @@ dependencies = [ [[package]] name = "ct-codecs" -version = "1.1.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "026ac6ceace6298d2c557ef5ed798894962296469ec7842288ea64674201a2d1" +checksum = "f3b7eb4404b8195a9abb6356f4ac07d8ba267045c8d6d220ac4dc992e6cc75df" [[package]] name = "ctr" @@ -1852,12 +1854,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "darling_core 0.20.9", + "darling_macro 0.20.9", ] [[package]] @@ -1876,16 +1878,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -1901,13 +1903,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ - "darling_core 0.20.10", + "darling_core 0.20.9", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -1926,10 +1928,10 @@ dependencies = [ [[package]] name = "data-credits" version = "0.2.2" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", ] [[package]] @@ -1956,7 +1958,7 @@ dependencies = [ "asn1-rs", "displaydoc", "nom", - "num-bigint 0.4.6", + "num-bigint 0.4.5", "num-traits", "rusticata-macros", ] @@ -2040,7 +2042,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -2063,7 +2065,7 @@ checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -2141,9 +2143,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" @@ -2171,9 +2173,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.35" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -2195,7 +2197,7 @@ checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -2236,10 +2238,10 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fanout" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", ] [[package]] @@ -2253,9 +2255,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "feature-probe" @@ -2281,9 +2283,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -2318,9 +2320,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -2333,9 +2335,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -2343,15 +2345,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -2360,38 +2362,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] name = "futures-sink" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -2464,9 +2466,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "goblin" @@ -2502,7 +2504,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.6.0", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -2572,12 +2574,6 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "heck" version = "0.3.3" @@ -2602,10 +2598,10 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "helium-anchor-gen" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", "circuit-breaker", "data-credits", "fanout", @@ -2631,7 +2627,7 @@ dependencies = [ "bs58 0.5.1", "byteorder", "ed25519-compact", - "getrandom 0.1.16", + "getrandom 0.2.15", "k256", "lazy_static", "multihash", @@ -2648,10 +2644,10 @@ dependencies = [ [[package]] name = "helium-entity-manager" version = "0.2.11" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", ] [[package]] @@ -2665,7 +2661,7 @@ dependencies = [ "base64 0.22.1", "bincode", "chrono", - "clap 4.5.20", + "clap 4.5.4", "futures", "h3o", "helium-anchor-gen", @@ -2685,11 +2681,11 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "solana-program 1.18.26", + "solana-program", "solana-sdk", "solana-transaction-status", "spl-account-compression", - "spl-associated-token-account 3.0.4", + "spl-associated-token-account 3.0.2", "thiserror", "tonic", "tracing", @@ -2701,7 +2697,7 @@ name = "helium-mnemonic" version = "0.0.0" dependencies = [ "bitvec", - "bs58 0.5.1", + "bs58 0.3.1", "lazy_static", "sha2 0.10.8", "thiserror", @@ -2710,7 +2706,7 @@ dependencies = [ [[package]] name = "helium-proto" version = "0.1.0" -source = "git+https://github.com/helium/proto?branch=master#ad18fa2ac0864a2ec0da1c362139778cfd512ce2" +source = "git+https://github.com/helium/proto?branch=master#197ff9c6cde7dc0d8334d6b4e27c58779e6a7ce0" dependencies = [ "bytes", "prost", @@ -2726,10 +2722,10 @@ dependencies = [ [[package]] name = "helium-sub-daos" version = "0.1.8" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", ] [[package]] @@ -2739,7 +2735,7 @@ dependencies = [ "aes-gcm", "anyhow", "byteorder", - "clap 4.5.20", + "clap 4.5.4", "dialoguer 0.8.0", "helium-crypto", "helium-lib", @@ -2790,10 +2786,10 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hexboosting" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", ] [[package]] @@ -2866,9 +2862,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.5" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -2884,9 +2880,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.31" +version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" dependencies = [ "bytes", "futures-channel", @@ -2934,9 +2930,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3005,12 +3001,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.14.5", ] [[package]] @@ -3046,15 +3042,15 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is_terminal_polyfill" -version = "1.70.1" +version = "1.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "itertools" @@ -3073,18 +3069,18 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -3147,7 +3143,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6dd100976df9dd59d0c3fecf6f9ad3f161a087374d1b2a77ebb4ad8920f11bb" dependencies = [ - "borsh 0.10.4", + "borsh 0.10.3", ] [[package]] @@ -3162,41 +3158,41 @@ dependencies = [ [[package]] name = "lazy-distributor" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", ] [[package]] name = "lazy-transactions" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", ] [[package]] name = "lazy_static" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin 0.9.8", + "spin 0.5.2", ] [[package]] name = "libc" -version = "0.2.161" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libm" -version = "0.2.10" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00419de735aac21d53b0de5ce2c03bd3627277cf471300f27ebc89f7d828047" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libsecp256k1" @@ -3266,7 +3262,7 @@ checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee" dependencies = [ "ark-bn254", "ark-ff", - "num-bigint 0.4.6", + "num-bigint 0.4.5", "thiserror", ] @@ -3288,9 +3284,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "matchit" @@ -3306,9 +3302,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memmap2" @@ -3363,11 +3359,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ - "adler2", + "adler", ] [[package]] @@ -3382,25 +3378,13 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "mio" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", -] - [[package]] name = "mobile-entity-manager" version = "0.1.3" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", ] [[package]] @@ -3409,11 +3393,11 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9eff5ae5cafd1acdf7e7c93359da1eec91dcaede318470d9f68b78e8b7469f4" dependencies = [ - "borsh 0.10.4", + "borsh 0.10.3", "kaigan", "num-derive 0.3.3", "num-traits", - "solana-program 1.18.26", + "solana-program", "thiserror", ] @@ -3484,24 +3468,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" dependencies = [ "num-bigint 0.2.6", - "num-complex 0.2.4", + "num-complex", "num-integer", "num-iter", - "num-rational 0.2.4", - "num-traits", -] - -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint 0.4.6", - "num-complex 0.4.6", - "num-integer", - "num-iter", - "num-rational 0.4.2", + "num-rational", "num-traits", ] @@ -3518,9 +3488,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ "num-integer", "num-traits", @@ -3553,15 +3523,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - [[package]] name = "num-conv" version = "0.1.0" @@ -3587,7 +3548,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -3622,17 +3583,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint 0.4.6", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -3664,11 +3614,11 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "num_enum_derive 0.7.3", + "num_enum_derive 0.7.2", ] [[package]] @@ -3680,19 +3630,19 @@ dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] name = "num_enum_derive" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -3703,9 +3653,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.36.5" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" dependencies = [ "memchr", ] @@ -3721,9 +3671,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -3775,7 +3725,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -3844,7 +3794,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd23b938276f14057220b707937bcb42fa76dda7560e57a2da30cb52d557937" dependencies = [ - "num 0.2.1", + "num", ] [[package]] @@ -3854,34 +3804,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.6.0", + "indexmap 2.2.6", ] [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -3902,9 +3852,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plain" @@ -3948,9 +3898,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.9.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "powerfmt" @@ -3960,30 +3910,27 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" dependencies = [ "proc-macro2", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] name = "price-oracle" version = "0.2.1" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", ] [[package]] @@ -4007,9 +3954,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ "toml_edit", ] @@ -4040,9 +3987,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -4087,7 +4034,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.85", + "syn 2.0.58", "tempfile", ] @@ -4101,7 +4048,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -4135,32 +4082,35 @@ dependencies = [ [[package]] name = "pyth-solana-receiver-sdk" -version = "0.3.1" -source = "git+https://github.com/madninja/pyth-crosschain.git?branch=madninja/cap_solana_dep#6576247294bde3ab7b62f7a2dfb4d4d48c401b35" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e6559643f0b377b6f293269251f6a804ae7332c37f7310371f50c833453cd0" dependencies = [ - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", "hex", "pythnet-sdk", - "solana-program 1.18.26", + "solana-program", ] [[package]] name = "pythnet-sdk" -version = "2.3.0" -source = "git+https://github.com/madninja/pyth-crosschain.git?branch=madninja/cap_solana_dep#6576247294bde3ab7b62f7a2dfb4d4d48c401b35" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bbbc0456f9f27c9ad16b6c3bf1b2a7fea61eebf900f4d024a0468b9a84fe0c1" dependencies = [ "anchor-lang 0.30.1", "bincode", - "borsh 0.10.4", + "borsh 0.10.3", "bytemuck", "byteorder", "fast-math", "hex", + "proc-macro2", "rustc_version", "serde", "sha3 0.10.8", "slow_primes", - "solana-program 2.0.14", + "solana-program", "thiserror", ] @@ -4200,7 +4150,7 @@ checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -4253,9 +4203,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -4380,18 +4330,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", ] [[package]] name = "regex" -version = "1.11.1" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -4401,9 +4351,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -4412,9 +4362,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "rend" @@ -4471,10 +4421,10 @@ dependencies = [ [[package]] name = "rewards-oracle" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", ] [[package]] @@ -4520,9 +4470,9 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.45" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" +checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" dependencies = [ "bitvec", "bytecheck", @@ -4538,9 +4488,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.45" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" +checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" dependencies = [ "proc-macro2", "quote", @@ -4590,9 +4540,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.36.0" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555" +checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a" dependencies = [ "arrayvec", "borsh 1.5.1", @@ -4618,9 +4568,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ "semver", ] @@ -4636,11 +4586,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.38" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -4692,9 +4642,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" @@ -4723,11 +4673,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.26" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -4753,7 +4703,7 @@ checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -4786,11 +4736,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -4799,9 +4749,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -4815,41 +4765,40 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.214" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.15" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", - "memchr", "ryu", "serde", ] @@ -4862,7 +4811,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -4893,10 +4842,10 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ - "darling 0.20.10", + "darling 0.20.9", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -4973,12 +4922,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - [[package]] name = "signal-hook" version = "0.3.17" @@ -4991,12 +4934,12 @@ dependencies = [ [[package]] name = "signal-hook-mio" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" dependencies = [ "libc", - "mio 0.8.11", + "mio", "signal-hook", ] @@ -5030,9 +4973,9 @@ dependencies = [ [[package]] name = "simdutf8" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] name = "simple_asn1" @@ -5041,7 +4984,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eb4ea60fb301dc81dfc113df680571045d375ab7345d171c5dc7d7e13107a80" dependencies = [ "chrono", - "num-bigint 0.4.6", + "num-bigint 0.4.5", "num-traits", "thiserror", ] @@ -5077,7 +5020,7 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58267dd2fbaa6dceecba9e3e106d2d90a2b02497c0e8b01b8759beccf5113938" dependencies = [ - "num 0.4.3", + "num", ] [[package]] @@ -5110,9 +5053,9 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b109fd3a106e079005167e5b0e6f6d2c88bbedec32530837b584791a8b5abf36" +checksum = "52346da8fbbac45fdfbb9c09f7a4e263fabd13f401352e1feedc55e1178a8ba2" dependencies = [ "Inflector", "base64 0.21.7", @@ -5135,9 +5078,9 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "074ef478856a45d5627270fbc6b331f91de9aae7128242d9e423931013fb8a2a" +checksum = "bafd11f1614edd414adb414b96a481152b01ac45c14c3ff56fc757412698b228" dependencies = [ "chrono", "clap 2.34.0", @@ -5152,16 +5095,16 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a9f32c42402c4b9484d5868ac74b7e0a746e3905d8bfd756e1203e50cbb87e" +checksum = "522922d51cc1fd3f0a6dd9ed0a8939f7ff46f5ebaa3a6d7eee3cd2516e6ac9e6" dependencies = [ "async-trait", "bincode", "dashmap", "futures", "futures-util", - "indexmap 2.6.0", + "indexmap 2.2.6", "indicatif", "log", "quinn", @@ -5185,9 +5128,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d75b803860c0098e021a26f0624129007c15badd5b0bc2fbd9f0e1a73060d3b" +checksum = "2010ba6fe2a1c4270ca3d3ef23ebfd893e3d2c980b9c0fc04451c4ce2f6b3deb" dependencies = [ "bincode", "chrono", @@ -5199,15 +5142,15 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9306ede13e8ceeab8a096bcf5fa7126731e44c201ca1721ea3c38d89bcd4111" +checksum = "0acaf8e98f3f30596d73173183a80d7f83e23df1429a889a68cfe7be69abe39b" dependencies = [ "async-trait", "bincode", "crossbeam-channel", "futures-util", - "indexmap 2.6.0", + "indexmap 2.2.6", "log", "rand 0.8.5", "rayon", @@ -5221,9 +5164,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ab2c30c15311b511c0d1151e4ab6bc9a3e080a37e7c6e7c2d96f5784cf9434" +checksum = "2c00a6aca244dfa904e2c4a26406ba7b0987344ceaec932f3cda0b35eff0babc" dependencies = [ "block-buffer 0.10.4", "bs58 0.4.0", @@ -5246,21 +5189,21 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c142f779c3633ac83c84d04ff06c70e1f558c876f13358bed77ba629c7417932" +checksum = "bed58b27b9b8877893f69bc5cfd1c62e984315e0229d83cf8a32ad0933c0d6c9" dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] name = "solana-logger" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121d36ffb3c6b958763312cbc697fbccba46ee837d3a0aa4fc0e90fcb3b884f3" +checksum = "bee2daf61ae582edf9634adf8e5021faf002df0d3f69078ecbcd6c7b41bdf833" dependencies = [ "env_logger", "lazy_static", @@ -5269,9 +5212,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c01a7f9cdc9d9d37a3d5651b2fe7ec9d433c2a3470b9f35897e373b421f0737" +checksum = "148512f384b82cf9e8bfe80503b688340d42a4cc17cfd572b88a6d803a488527" dependencies = [ "log", "solana-sdk", @@ -5279,9 +5222,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e36052aff6be1536bdf6f737c6e69aca9dbb6a2f3f582e14ecb0ddc0cd66ce" +checksum = "55d734099c26f81621bd1aaddb8788908e20fd7fac28fb00402d564964eae4ea" dependencies = [ "crossbeam-channel", "gethostname", @@ -5294,9 +5237,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1f5c6be9c5b272866673741e1ebc64b2ea2118e5c6301babbce526fdfb15f4" +checksum = "563911bb92bc6ae3ba4e7d9930dc560c61333ee57f7ba0421abe0cab14982e72" dependencies = [ "bincode", "clap 3.2.25", @@ -5316,9 +5259,9 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28acaf22477566a0fbddd67249ea5d859b39bacdb624aff3fadd3c5745e2643c" +checksum = "b21bd999096d156dd122aed05eb4601fbc9dba016e229be72ba838aa5ff2a7df" dependencies = [ "ahash 0.8.11", "bincode", @@ -5345,9 +5288,9 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c10f4588cefd716b24a1a40dd32c278e43a560ab8ce4de6b5805c9d113afdfa1" +checksum = "4f4908f360900d0a1aa81c7bad7937c78f0825c3f08ff0b22f1de0e43e5946f2" dependencies = [ "ark-bn254", "ark-ec", @@ -5355,9 +5298,9 @@ dependencies = [ "ark-serialize", "base64 0.21.7", "bincode", - "bitflags 2.6.0", + "bitflags 2.5.0", "blake3", - "borsh 0.10.4", + "borsh 0.10.3", "borsh 0.9.3", "borsh 1.5.1", "bs58 0.4.0", @@ -5376,7 +5319,7 @@ dependencies = [ "light-poseidon", "log", "memoffset 0.9.1", - "num-bigint 0.4.6", + "num-bigint 0.4.5", "num-derive 0.4.2", "num-traits", "parking_lot", @@ -5391,64 +5334,18 @@ dependencies = [ "sha3 0.10.8", "solana-frozen-abi", "solana-frozen-abi-macro", - "solana-sdk-macro 1.18.26", + "solana-sdk-macro", "thiserror", "tiny-bip39", "wasm-bindgen", "zeroize", ] -[[package]] -name = "solana-program" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2625a23c3813b620141ee447819b08d1b9a5f1c69a309754834e3f35798a21fb" -dependencies = [ - "ark-bn254", - "ark-ec", - "ark-ff", - "ark-serialize", - "base64 0.22.1", - "bincode", - "bitflags 2.6.0", - "blake3", - "borsh 0.10.4", - "borsh 1.5.1", - "bs58 0.5.1", - "bv", - "bytemuck", - "bytemuck_derive", - "console_error_panic_hook", - "console_log", - "curve25519-dalek", - "getrandom 0.2.15", - "js-sys", - "lazy_static", - "libsecp256k1", - "log", - "memoffset 0.9.1", - "num-bigint 0.4.6", - "num-derive 0.4.2", - "num-traits", - "parking_lot", - "rand 0.8.5", - "rustc_version", - "rustversion", - "serde", - "serde_bytes", - "serde_derive", - "sha2 0.10.8", - "sha3 0.10.8", - "solana-sdk-macro 2.0.14", - "thiserror", - "wasm-bindgen", -] - [[package]] name = "solana-program-runtime" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf0c3eab2a80f514289af1f422c121defb030937643c43b117959d6f1932fb5" +checksum = "47c8ace7f999a8278351ea86ed93f57e7833cb65fb04167a9ba9ea593e995288" dependencies = [ "base64 0.21.7", "bincode", @@ -5474,9 +5371,9 @@ dependencies = [ [[package]] name = "solana-pubsub-client" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b064e76909d33821b80fdd826e6757251934a52958220c92639f634bea90366d" +checksum = "dfaebabf56720238919d8d1699211240cca485bda3b12f6189c737679a935912" dependencies = [ "crossbeam-channel", "futures-util", @@ -5499,9 +5396,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a90e40ee593f6e9ddd722d296df56743514ae804975a76d47e7afed4e3da244" +checksum = "85f868c2bf7591835705298dd4350c38a8e9de07e53109fa243ebc55bbd33f03" dependencies = [ "async-mutex", "async-trait", @@ -5526,9 +5423,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66468f9c014992167de10cc68aad6ac8919a8c8ff428dc88c0d2b4da8c02b8b7" +checksum = "01c9c928e5b6b1e37296e139c757695f9540e2d4f04794a1ae1915eba7076e68" dependencies = [ "lazy_static", "num_cpus", @@ -5536,9 +5433,9 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c191019f4d4f84281a6d0dd9a43181146b33019627fc394e42e08ade8976b431" +checksum = "32d9f47fb9de096edd536bb39c1a8383372acf719f3fd49242bfe332ea216c3b" dependencies = [ "console 0.15.8", "dialoguer 0.10.4", @@ -5555,9 +5452,9 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ed4628e338077c195ddbf790693d410123d17dec0a319b5accb4aaee3fb15c" +checksum = "9f2259b63faca1132e3a0c8b98438fb60e5d25897260dd3655bcf4ec8c6f2bf8" dependencies = [ "async-trait", "base64 0.21.7", @@ -5581,9 +5478,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c913551faa4a1ae4bbfef6af19f3a5cf847285c05b4409e37c8993b3444229" +checksum = "b0aea25d581de77ba256b81f4ebd8d963b85ec01d70a74829365e85f6403d497" dependencies = [ "base64 0.21.7", "bs58 0.4.0", @@ -5603,9 +5500,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a47b6bb1834e6141a799db62bbdcf80d17a7d58d7bc1684c614e01a7293d7cf" +checksum = "3ef5cbfb47707599ccb5734aa70b5161a2d437df54044021870be3f575eb0f1a" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -5616,14 +5513,14 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "580ad66c2f7a4c3cb3244fe21440546bd500f5ecb955ad9826e92a78dded8009" +checksum = "c50ec330850953d4971b052ff98c74a8e67e7618b4aed9f4971b8d3b68fcd1cd" dependencies = [ "assert_matches", "base64 0.21.7", "bincode", - "bitflags 2.6.0", + "bitflags 2.5.0", "borsh 1.5.1", "bs58 0.4.0", "bytemuck", @@ -5643,7 +5540,7 @@ dependencies = [ "memmap2", "num-derive 0.4.2", "num-traits", - "num_enum 0.7.3", + "num_enum 0.7.2", "pbkdf2 0.11.0", "qstring", "qualifier_attr", @@ -5662,8 +5559,8 @@ dependencies = [ "solana-frozen-abi", "solana-frozen-abi-macro", "solana-logger", - "solana-program 1.18.26", - "solana-sdk-macro 1.18.26", + "solana-program", + "solana-sdk-macro", "thiserror", "uriparse", "wasm-bindgen", @@ -5671,28 +5568,15 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b75d0f193a27719257af19144fdaebec0415d1c9e9226ae4bd29b791be5e9bd" +checksum = "95ef2ea49002d1bf52a4a8509570b2c3b88e7b6d0a131b11bbd637ca1e1df0ff" dependencies = [ "bs58 0.4.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.85", -] - -[[package]] -name = "solana-sdk-macro" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93a5a1eabc890415d326707afe62cd7a2009236e8d899c1519566fc8f7e3977b" -dependencies = [ - "bs58 0.5.1", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -5703,16 +5587,16 @@ checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" [[package]] name = "solana-streamer" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8476e41ad94fe492e8c06697ee35912cf3080aae0c9e9ac6430835256ccf056" +checksum = "29de0561c0aa6249292a2602be31e812977ae223be031b3a9e0715d98fb19b06" dependencies = [ "async-channel", "bytes", "crossbeam-channel", "futures-util", "histogram", - "indexmap 2.6.0", + "indexmap 2.2.6", "itertools", "libc", "log", @@ -5736,9 +5620,9 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c02245d0d232430e79dc0d624aa42d50006097c3aec99ac82ac299eaa3a73f" +checksum = "d20b7c9b7214fe50e2e72090f833f11e07f3b00ba69b57872b6adcf5479cdf32" dependencies = [ "bincode", "log", @@ -5751,14 +5635,14 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67251506ed03de15f1347b46636b45c47da6be75015b4a13f0620b21beb00566" +checksum = "fcbfd83d8d7da758b10d6e1075322843dce591a75d15d611e9eec5508e9c7233" dependencies = [ "async-trait", "bincode", "futures-util", - "indexmap 2.6.0", + "indexmap 2.2.6", "indicatif", "log", "rayon", @@ -5775,14 +5659,14 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3d36db1b2ab2801afd5482aad9fb15ed7959f774c81a77299fdd0ddcf839d4" +checksum = "0439563ffb7471a0b51446f0fff5c8b2108e31248bf7dbab8b9efaa2af3a4c27" dependencies = [ "Inflector", "base64 0.21.7", "bincode", - "borsh 0.10.4", + "borsh 0.10.3", "bs58 0.4.0", "lazy_static", "log", @@ -5800,9 +5684,9 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a754a3c2265eb02e0c35aeaca96643951f03cee6b376afe12e0cf8860ffccd1" +checksum = "1160ce03865189e4c3327cc492aeacc8567863f195a269533d98f15485402b74" dependencies = [ "async-trait", "solana-connection-cache", @@ -5815,9 +5699,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f44776bd685cc02e67ba264384acc12ef2931d01d1a9f851cb8cdbd3ce455b9e" +checksum = "fb25449b519a334103778e2fc1c5c0e3ea7862ae2c1ffe90fc82ce3c96058171" dependencies = [ "log", "rustc_version", @@ -5831,9 +5715,9 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25810970c91feb579bd3f67dca215fce971522e42bfd59696af89c5dfebd997c" +checksum = "78899849d1131b2fbbe9f826080cc18cec5598da63a77357642c9cd8b1a86a86" dependencies = [ "bincode", "log", @@ -5845,7 +5729,7 @@ dependencies = [ "solana-frozen-abi", "solana-frozen-abi-macro", "solana-metrics", - "solana-program 1.18.26", + "solana-program", "solana-program-runtime", "solana-sdk", "thiserror", @@ -5853,9 +5737,9 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.18.26" +version = "1.18.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbdf4249b6dfcbba7d84e2b53313698043f60f8e22ce48286e6fbe8a17c8d16" +checksum = "5cafb3df56516086f65e2a08a8cd03f504236f3b5348299abd45415d1d18ba32" dependencies = [ "aes-gcm-siv", "base64 0.21.7", @@ -5873,7 +5757,7 @@ dependencies = [ "serde", "serde_json", "sha3 0.9.1", - "solana-program 1.18.26", + "solana-program", "solana-sdk", "subtle", "thiserror", @@ -5882,9 +5766,9 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.8.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da5d083187e3b3f453e140f292c09186881da8a02a7b5e27f645ee26de3d9cc5" +checksum = "3d457cc2ba742c120492a64b7fa60e22c575e891f6b55039f4d736568fb112a3" dependencies = [ "byteorder", "combine", @@ -5929,7 +5813,7 @@ checksum = "dfcf740e5242f2ad63325e600c368702f32db84608fc8b70d70633c68dd1486d" dependencies = [ "anchor-lang 0.29.0", "bytemuck", - "solana-program 1.18.26", + "solana-program", "solana-security-txt", "spl-concurrent-merkle-tree", "spl-noop", @@ -5942,10 +5826,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "992d9c64c2564cc8f63a4b508bf3ebcdf2254b0429b13cd1d31adb6162432a5f" dependencies = [ "assert_matches", - "borsh 0.10.4", + "borsh 0.10.3", "num-derive 0.4.2", "num-traits", - "solana-program 1.18.26", + "solana-program", "spl-token", "spl-token-2022 1.0.0", "thiserror", @@ -5953,17 +5837,17 @@ dependencies = [ [[package]] name = "spl-associated-token-account" -version = "3.0.4" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143109d789171379e6143ef23191786dfaac54289ad6e7917cfb26b36c432b10" +checksum = "a2e688554bac5838217ffd1fab7845c573ff106b6336bf7d290db7c98d5a8efd" dependencies = [ "assert_matches", "borsh 1.5.1", "num-derive 0.4.2", "num-traits", - "solana-program 1.18.26", + "solana-program", "spl-token", - "spl-token-2022 3.0.4", + "spl-token-2022 3.0.2", "thiserror", ] @@ -5974,29 +5858,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7f5f45b971d82cbb0416fdffad3c9098f259545d54072e83a0a482f60f8f689" dependencies = [ "bytemuck", - "solana-program 2.0.14", + "solana-program", "thiserror", ] [[package]] name = "spl-discriminator" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce5d563b58ef1bb2cdbbfe0dfb9ffdc24903b10ae6a4df2d8f425ece375033f" +checksum = "daa600f2fe56f32e923261719bae640d873edadbc5237681a39b8e37bfd4d263" dependencies = [ "bytemuck", - "solana-program 1.18.26", + "solana-program", "spl-discriminator-derive 0.1.2", ] [[package]] name = "spl-discriminator" -version = "0.2.5" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210101376962bb22bb13be6daea34656ea1cbc248fce2164b146e39203b55e03" +checksum = "34d1814406e98b08c5cd02c1126f83fd407ad084adce0b05fda5730677822eac" dependencies = [ "bytemuck", - "solana-program 1.18.26", + "solana-program", "spl-discriminator-derive 0.2.0", ] @@ -6008,7 +5892,7 @@ checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" dependencies = [ "quote", "spl-discriminator-syn 0.1.2", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -6019,7 +5903,7 @@ checksum = "d9e8418ea6269dcfb01c712f0444d2c75542c04448b480e87de59d2865edc750" dependencies = [ "quote", "spl-discriminator-syn 0.2.0", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -6031,7 +5915,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.85", + "syn 2.0.58", "thiserror", ] @@ -6044,7 +5928,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.85", + "syn 2.0.58", "thiserror", ] @@ -6054,7 +5938,7 @@ version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a" dependencies = [ - "solana-program 1.18.26", + "solana-program", ] [[package]] @@ -6063,57 +5947,57 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dd67ea3d0070a12ff141f5da46f9695f49384a03bce1203a5608f5739437950" dependencies = [ - "solana-program 1.18.26", + "solana-program", ] [[package]] name = "spl-pod" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2881dddfca792737c0706fa0175345ab282b1b0879c7d877bad129645737c079" +checksum = "85a5db7e4efb1107b0b8e52a13f035437cdcb36ef99c58f6d467f089d9b2915a" dependencies = [ - "borsh 0.10.4", + "borsh 0.10.3", "bytemuck", - "solana-program 1.18.26", + "solana-program", "solana-zk-token-sdk", - "spl-program-error 0.3.0", + "spl-program-error 0.3.1", ] [[package]] name = "spl-pod" -version = "0.2.5" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c52d84c55efeef8edcc226743dc089d7e3888b8e3474569aa3eff152b37b9996" +checksum = "046ce669f48cf2eca1ec518916d8725596bfb655beb1c74374cf71dc6cb773c9" dependencies = [ "borsh 1.5.1", "bytemuck", - "solana-program 1.18.26", + "solana-program", "solana-zk-token-sdk", - "spl-program-error 0.4.4", + "spl-program-error 0.4.1", ] [[package]] name = "spl-program-error" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "249e0318493b6bcf27ae9902600566c689b7dfba9f1bdff5893e92253374e78c" +checksum = "7e0657b6490196971d9e729520ba934911ff41fbb2cb9004463dbe23cf8b4b4f" dependencies = [ "num-derive 0.4.2", "num-traits", - "solana-program 1.18.26", + "solana-program", "spl-program-error-derive 0.3.2", "thiserror", ] [[package]] name = "spl-program-error" -version = "0.4.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45a49acb925db68aa501b926096b2164adbdcade7a0c24152af9f0742d0a602" +checksum = "49065093ea91f57b9b2bd81493ff705e2ad4e64507a07dbc02b085778e02770e" dependencies = [ "num-derive 0.4.2", "num-traits", - "solana-program 1.18.26", + "solana-program", "spl-program-error-derive 0.4.1", "thiserror", ] @@ -6127,7 +6011,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -6139,49 +6023,35 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.85", -] - -[[package]] -name = "spl-tlv-account-resolution" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" -dependencies = [ - "bytemuck", - "solana-program 1.18.26", - "spl-discriminator 0.1.0", - "spl-pod 0.1.0", - "spl-program-error 0.3.0", - "spl-type-length-value 0.3.0", + "syn 2.0.58", ] [[package]] name = "spl-tlv-account-resolution" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615d381f48ddd2bb3c57c7f7fb207591a2a05054639b18a62e785117dd7a8683" +checksum = "56f335787add7fa711819f9e7c573f8145a5358a709446fe2d24bf2a88117c90" dependencies = [ "bytemuck", - "solana-program 1.18.26", - "spl-discriminator 0.1.0", - "spl-pod 0.1.0", - "spl-program-error 0.3.0", - "spl-type-length-value 0.3.0", + "solana-program", + "spl-discriminator 0.1.1", + "spl-pod 0.1.1", + "spl-program-error 0.3.1", + "spl-type-length-value 0.3.1", ] [[package]] name = "spl-tlv-account-resolution" -version = "0.6.5" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fab8edfd37be5fa17c9e42c1bff86abbbaf0494b031b37957f2728ad2ff842ba" +checksum = "cace91ba08984a41556efe49cbf2edca4db2f577b649da7827d3621161784bf8" dependencies = [ "bytemuck", - "solana-program 1.18.26", - "spl-discriminator 0.2.5", - "spl-pod 0.2.5", - "spl-program-error 0.4.4", - "spl-type-length-value 0.4.6", + "solana-program", + "spl-discriminator 0.2.2", + "spl-pod 0.2.2", + "spl-program-error 0.4.1", + "spl-type-length-value 0.4.3", ] [[package]] @@ -6195,29 +6065,7 @@ dependencies = [ "num-derive 0.3.3", "num-traits", "num_enum 0.6.1", - "solana-program 1.18.26", - "thiserror", -] - -[[package]] -name = "spl-token-2022" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" -dependencies = [ - "arrayref", - "bytemuck", - "num-derive 0.4.2", - "num-traits", - "num_enum 0.7.3", - "solana-program 1.18.26", - "solana-zk-token-sdk", - "spl-memo", - "spl-pod 0.1.0", - "spl-token", - "spl-token-metadata-interface 0.2.0", - "spl-transfer-hook-interface 0.3.0", - "spl-type-length-value 0.3.0", + "solana-program", "thiserror", ] @@ -6231,41 +6079,41 @@ dependencies = [ "bytemuck", "num-derive 0.4.2", "num-traits", - "num_enum 0.7.3", - "solana-program 1.18.26", + "num_enum 0.7.2", + "solana-program", "solana-security-txt", "solana-zk-token-sdk", "spl-memo", - "spl-pod 0.1.0", + "spl-pod 0.1.1", "spl-token", "spl-token-group-interface 0.1.0", "spl-token-metadata-interface 0.2.0", "spl-transfer-hook-interface 0.4.1", - "spl-type-length-value 0.3.0", + "spl-type-length-value 0.3.1", "thiserror", ] [[package]] name = "spl-token-2022" -version = "3.0.4" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b01d1b2851964e257187c0bca43a0de38d0af59192479ca01ac3e2b58b1bd95a" +checksum = "e5412f99ae7ee6e0afde00defaa354e6228e47e30c0e3adf553e2e01e6abb584" dependencies = [ "arrayref", "bytemuck", "num-derive 0.4.2", "num-traits", - "num_enum 0.7.3", - "solana-program 1.18.26", + "num_enum 0.7.2", + "solana-program", "solana-security-txt", "solana-zk-token-sdk", "spl-memo", - "spl-pod 0.2.5", + "spl-pod 0.2.2", "spl-token", - "spl-token-group-interface 0.2.5", - "spl-token-metadata-interface 0.3.5", - "spl-transfer-hook-interface 0.6.5", - "spl-type-length-value 0.4.6", + "spl-token-group-interface 0.2.3", + "spl-token-metadata-interface 0.3.3", + "spl-transfer-hook-interface 0.6.3", + "spl-type-length-value 0.4.3", "thiserror", ] @@ -6276,23 +6124,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b889509d49fa74a4a033ca5dae6c2307e9e918122d97e58562f5c4ffa795c75d" dependencies = [ "bytemuck", - "solana-program 1.18.26", - "spl-discriminator 0.1.0", - "spl-pod 0.1.0", - "spl-program-error 0.3.0", + "solana-program", + "spl-discriminator 0.1.1", + "spl-pod 0.1.1", + "spl-program-error 0.3.1", ] [[package]] name = "spl-token-group-interface" -version = "0.2.5" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "014817d6324b1e20c4bbc883e8ee30a5faa13e59d91d1b2b95df98b920150c17" +checksum = "d419b5cfa3ee8e0f2386fd7e02a33b3ec8a7db4a9c7064a2ea24849dc4a273b6" dependencies = [ "bytemuck", - "solana-program 1.18.26", - "spl-discriminator 0.2.5", - "spl-pod 0.2.5", - "spl-program-error 0.4.4", + "solana-program", + "spl-discriminator 0.2.2", + "spl-pod 0.2.2", + "spl-program-error 0.4.1", ] [[package]] @@ -6301,42 +6149,26 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f" dependencies = [ - "borsh 0.10.4", - "solana-program 1.18.26", - "spl-discriminator 0.1.0", - "spl-pod 0.1.0", - "spl-program-error 0.3.0", - "spl-type-length-value 0.3.0", + "borsh 0.10.3", + "solana-program", + "spl-discriminator 0.1.1", + "spl-pod 0.1.1", + "spl-program-error 0.3.1", + "spl-type-length-value 0.3.1", ] [[package]] name = "spl-token-metadata-interface" -version = "0.3.5" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3da00495b602ebcf5d8ba8b3ecff1ee454ce4c125c9077747be49c2d62335ba" +checksum = "30179c47e93625680dabb620c6e7931bd12d62af390f447bc7beb4a3a9b5feee" dependencies = [ "borsh 1.5.1", - "solana-program 1.18.26", - "spl-discriminator 0.2.5", - "spl-pod 0.2.5", - "spl-program-error 0.4.4", - "spl-type-length-value 0.4.6", -] - -[[package]] -name = "spl-transfer-hook-interface" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" -dependencies = [ - "arrayref", - "bytemuck", - "solana-program 1.18.26", - "spl-discriminator 0.1.0", - "spl-pod 0.1.0", - "spl-program-error 0.3.0", - "spl-tlv-account-resolution 0.4.0", - "spl-type-length-value 0.3.0", + "solana-program", + "spl-discriminator 0.2.2", + "spl-pod 0.2.2", + "spl-program-error 0.4.1", + "spl-type-length-value 0.4.3", ] [[package]] @@ -6347,54 +6179,54 @@ checksum = "7aabdb7c471566f6ddcee724beb8618449ea24b399e58d464d6b5bc7db550259" dependencies = [ "arrayref", "bytemuck", - "solana-program 1.18.26", - "spl-discriminator 0.1.0", - "spl-pod 0.1.0", - "spl-program-error 0.3.0", - "spl-tlv-account-resolution 0.5.1", - "spl-type-length-value 0.3.0", + "solana-program", + "spl-discriminator 0.1.1", + "spl-pod 0.1.1", + "spl-program-error 0.3.1", + "spl-tlv-account-resolution 0.5.2", + "spl-type-length-value 0.3.1", ] [[package]] name = "spl-transfer-hook-interface" -version = "0.6.5" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b5c08a89838e5a2931f79b17f611857f281a14a2100968a3ccef352cb7414b" +checksum = "66a98359769cd988f7b35c02558daa56d496a7e3bd8626e61f90a7c757eedb9b" dependencies = [ "arrayref", "bytemuck", - "solana-program 1.18.26", - "spl-discriminator 0.2.5", - "spl-pod 0.2.5", - "spl-program-error 0.4.4", - "spl-tlv-account-resolution 0.6.5", - "spl-type-length-value 0.4.6", + "solana-program", + "spl-discriminator 0.2.2", + "spl-pod 0.2.2", + "spl-program-error 0.4.1", + "spl-tlv-account-resolution 0.6.3", + "spl-type-length-value 0.4.3", ] [[package]] name = "spl-type-length-value" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a468e6f6371f9c69aae760186ea9f1a01c2908351b06a5e0026d21cfc4d7ecac" +checksum = "8f9ebd75d29c5f48de5f6a9c114e08531030b75b8ac2c557600ac7da0b73b1e8" dependencies = [ "bytemuck", - "solana-program 1.18.26", - "spl-discriminator 0.1.0", - "spl-pod 0.1.0", - "spl-program-error 0.3.0", + "solana-program", + "spl-discriminator 0.1.1", + "spl-pod 0.1.1", + "spl-program-error 0.3.1", ] [[package]] name = "spl-type-length-value" -version = "0.4.6" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c872f93d0600e743116501eba2d53460e73a12c9a496875a42a7d70e034fe06d" +checksum = "422ce13429dbd41d2cee8a73931c05fda0b0c8ca156a8b0c19445642550bb61a" dependencies = [ "bytemuck", - "solana-program 1.18.26", - "spl-discriminator 0.2.5", - "spl-pod 0.2.5", - "spl-program-error 0.4.4", + "solana-program", + "spl-discriminator 0.2.2", + "spl-pod 0.2.2", + "spl-program-error 0.4.1", ] [[package]] @@ -6434,7 +6266,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -6456,9 +6288,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.85" +version = "2.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" dependencies = [ "proc-macro2", "quote", @@ -6474,7 +6306,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -6524,15 +6356,14 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.13.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -6586,7 +6417,7 @@ checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -6650,9 +6481,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -6665,20 +6496,21 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.2", + "mio", + "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -6693,13 +6525,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -6714,9 +6546,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -6740,9 +6572,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", @@ -6762,17 +6594,17 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.2.6", "toml_datetime", "winnow", ] @@ -6818,7 +6650,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -6843,15 +6675,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] name = "tower-service" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" @@ -6873,7 +6705,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -6888,10 +6720,10 @@ dependencies = [ [[package]] name = "treasury-management" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", ] [[package]] @@ -6929,42 +6761,42 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.17" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.24" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.12.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.14" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "unicode-xid" -version = "0.2.6" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "universal-hash" @@ -7025,9 +6857,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -7043,15 +6875,15 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8parse" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.11.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "vec_map" @@ -7061,9 +6893,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "void" @@ -7074,10 +6906,10 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "voter-stake-registry" version = "0.3.3" -source = "git+https://github.com/helium/helium-anchor-gen.git#a7e694d49245ca9830bcfef68cce34f230c91011" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" dependencies = [ "anchor-gen", - "anchor-lang 0.29.0", + "anchor-lang 0.30.1", ] [[package]] @@ -7113,35 +6945,34 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", - "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -7151,9 +6982,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7161,28 +6992,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -7221,11 +7052,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.9" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -7240,7 +7071,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -7258,16 +7089,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -7287,18 +7109,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -7309,9 +7131,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -7321,9 +7143,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -7333,15 +7155,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" [[package]] name = "windows_i686_gnullvm" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -7351,9 +7173,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -7363,9 +7185,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -7375,9 +7197,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -7387,15 +7209,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.20" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] @@ -7468,23 +7290,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ - "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -7504,7 +7325,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.58", ] [[package]] @@ -7528,9 +7349,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", From dc470494ed729c705c7ed6d7dd67030e106de234 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Wed, 23 Oct 2024 11:08:47 -0700 Subject: [PATCH 13/49] move back to anchor-lang 0.29 --- Cargo.lock | 332 +++++++++++++----------------------------- helium-lib/Cargo.toml | 6 +- 2 files changed, 105 insertions(+), 233 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c33dea8f..2cb849a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -168,18 +168,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-attribute-access-control" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47fe28365b33e8334dd70ae2f34a43892363012fe239cf37d2ee91693575b1f8" -dependencies = [ - "anchor-syn 0.30.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "anchor-attribute-account" version = "0.29.0" @@ -193,19 +181,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-attribute-account" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c288d496168268d198d9b53ee9f4f9d260a55ba4df9877ea1d4486ad6109e0f" -dependencies = [ - "anchor-syn 0.30.1", - "bs58 0.5.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "anchor-attribute-constant" version = "0.29.0" @@ -217,17 +192,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-attribute-constant" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b77b6948d0eeaaa129ce79eea5bbbb9937375a9241d909ca8fb9e006bb6e90" -dependencies = [ - "anchor-syn 0.30.1", - "quote", - "syn 1.0.109", -] - [[package]] name = "anchor-attribute-error" version = "0.29.0" @@ -239,17 +203,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-attribute-error" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d20bb569c5a557c86101b944721d865e1fd0a4c67c381d31a44a84f07f84828" -dependencies = [ - "anchor-syn 0.30.1", - "quote", - "syn 1.0.109", -] - [[package]] name = "anchor-attribute-event" version = "0.29.0" @@ -262,18 +215,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-attribute-event" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cebd8d0671a3a9dc3160c48598d652c34c77de6be4d44345b8b514323284d57" -dependencies = [ - "anchor-syn 0.30.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "anchor-attribute-program" version = "0.29.0" @@ -285,30 +226,13 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-attribute-program" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb2a5eb0860e661ab31aff7bb5e0288357b176380e985bade4ccb395981b42d" -dependencies = [ - "anchor-lang-idl", - "anchor-syn 0.30.1", - "anyhow", - "bs58 0.5.1", - "heck 0.3.3", - "proc-macro2", - "quote", - "serde_json", - "syn 1.0.109", -] - [[package]] name = "anchor-client" -version = "0.30.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b4397af9b7d6919df3342210d897c0ffda1a31d052abc8eee3e6035ee71567" +checksum = "cb48c4a7911038da546dc752655a29fa49f6bd50ebc1edca218bac8da1012acd" dependencies = [ - "anchor-lang 0.30.1", + "anchor-lang", "anyhow", "futures", "regex", @@ -332,17 +256,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-derive-accounts" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04368b5abef4266250ca8d1d12f4dff860242681e4ec22b885dcfe354fd35aa1" -dependencies = [ - "anchor-syn 0.30.1", - "quote", - "syn 1.0.109", -] - [[package]] name = "anchor-derive-serde" version = "0.29.0" @@ -356,19 +269,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-derive-serde" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0bb0e0911ad4a70cab880cdd6287fe1e880a1a9d8e4e6defa8e9044b9796a6c" -dependencies = [ - "anchor-syn 0.30.1", - "borsh-derive-internal 0.10.3", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "anchor-derive-space" version = "0.29.0" @@ -380,17 +280,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-derive-space" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef415ff156dc82e9ecb943189b0cb241b3a6bfc26a180234dc21bd3ef3ce0cb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "anchor-gen" version = "0.3.1" @@ -443,15 +332,15 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" dependencies = [ - "anchor-attribute-access-control 0.29.0", - "anchor-attribute-account 0.29.0", - "anchor-attribute-constant 0.29.0", - "anchor-attribute-error 0.29.0", - "anchor-attribute-event 0.29.0", - "anchor-attribute-program 0.29.0", - "anchor-derive-accounts 0.29.0", - "anchor-derive-serde 0.29.0", - "anchor-derive-space 0.29.0", + "anchor-attribute-access-control", + "anchor-attribute-account", + "anchor-attribute-constant", + "anchor-attribute-error", + "anchor-attribute-event", + "anchor-attribute-program", + "anchor-derive-accounts", + "anchor-derive-serde", + "anchor-derive-space", "arrayref", "base64 0.13.1", "bincode", @@ -462,68 +351,17 @@ dependencies = [ "thiserror", ] -[[package]] -name = "anchor-lang" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6620c9486d9d36a4389cab5e37dc34a42ed0bfaa62e6a75a2999ce98f8f2e373" -dependencies = [ - "anchor-attribute-access-control 0.30.1", - "anchor-attribute-account 0.30.1", - "anchor-attribute-constant 0.30.1", - "anchor-attribute-error 0.30.1", - "anchor-attribute-event 0.30.1", - "anchor-attribute-program 0.30.1", - "anchor-derive-accounts 0.30.1", - "anchor-derive-serde 0.30.1", - "anchor-derive-space 0.30.1", - "arrayref", - "base64 0.21.7", - "bincode", - "borsh 0.10.3", - "bytemuck", - "getrandom 0.2.15", - "solana-program", - "thiserror", -] - -[[package]] -name = "anchor-lang-idl" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31cf97b4e6f7d6144a05e435660fcf757dbc3446d38d0e2b851d11ed13625bba" -dependencies = [ - "anchor-lang-idl-spec", - "anyhow", - "heck 0.3.3", - "serde", - "serde_json", - "sha2 0.10.8", -] - -[[package]] -name = "anchor-lang-idl-spec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bdf143115440fe621bdac3a29a1f7472e09f6cd82b2aa569429a0c13f103838" -dependencies = [ - "anyhow", - "serde", -] - [[package]] name = "anchor-spl" -version = "0.30.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04bd077c34449319a1e4e0bc21cea572960c9ae0d0fefda0dd7c52fcc3c647a3" +checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" dependencies = [ - "anchor-lang 0.30.1", - "spl-associated-token-account 3.0.2", - "spl-pod 0.2.2", + "anchor-lang", + "solana-program", + "spl-associated-token-account 2.3.0", "spl-token", - "spl-token-2022 3.0.2", - "spl-token-group-interface 0.2.3", - "spl-token-metadata-interface 0.3.3", + "spl-token-2022 0.9.0", ] [[package]] @@ -563,24 +401,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "anchor-syn" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f99daacb53b55cfd37ce14d6c9905929721137fd4c67bbab44a19802aecb622f" -dependencies = [ - "anyhow", - "bs58 0.5.1", - "heck 0.3.3", - "proc-macro2", - "quote", - "serde", - "serde_json", - "sha2 0.10.8", - "syn 1.0.109", - "thiserror", -] - [[package]] name = "android-tzdata" version = "0.1.1" @@ -1447,10 +1267,10 @@ dependencies = [ [[package]] name = "circuit-breaker" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", ] [[package]] @@ -1928,10 +1748,10 @@ dependencies = [ [[package]] name = "data-credits" version = "0.2.2" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", ] [[package]] @@ -2238,10 +2058,10 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fanout" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", ] [[package]] @@ -2598,10 +2418,10 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "helium-anchor-gen" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", "circuit-breaker", "data-credits", "fanout", @@ -2644,10 +2464,10 @@ dependencies = [ [[package]] name = "helium-entity-manager" version = "0.2.11" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", ] [[package]] @@ -2722,10 +2542,10 @@ dependencies = [ [[package]] name = "helium-sub-daos" version = "0.1.8" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", ] [[package]] @@ -2786,10 +2606,10 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hexboosting" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", ] [[package]] @@ -3158,19 +2978,19 @@ dependencies = [ [[package]] name = "lazy-distributor" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", ] [[package]] name = "lazy-transactions" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", ] [[package]] @@ -3381,10 +3201,10 @@ dependencies = [ [[package]] name = "mobile-entity-manager" version = "0.1.3" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", ] [[package]] @@ -3927,10 +3747,10 @@ dependencies = [ [[package]] name = "price-oracle" version = "0.2.1" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", ] [[package]] @@ -4024,7 +3844,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", - "heck 0.4.1", + "heck 0.5.0", "itertools", "log", "multimap", @@ -4086,7 +3906,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91e6559643f0b377b6f293269251f6a804ae7332c37f7310371f50c833453cd0" dependencies = [ - "anchor-lang 0.30.1", + "anchor-lang", "hex", "pythnet-sdk", "solana-program", @@ -4098,7 +3918,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bbbc0456f9f27c9ad16b6c3bf1b2a7fea61eebf900f4d024a0468b9a84fe0c1" dependencies = [ - "anchor-lang 0.30.1", + "anchor-lang", "bincode", "borsh 0.10.3", "bytemuck", @@ -4421,10 +4241,10 @@ dependencies = [ [[package]] name = "rewards-oracle" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", ] [[package]] @@ -5811,7 +5631,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfcf740e5242f2ad63325e600c368702f32db84608fc8b70d70633c68dd1486d" dependencies = [ - "anchor-lang 0.29.0", + "anchor-lang", "bytemuck", "solana-program", "solana-security-txt", @@ -6026,6 +5846,20 @@ dependencies = [ "syn 2.0.58", ] +[[package]] +name = "spl-tlv-account-resolution" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator 0.1.1", + "spl-pod 0.1.1", + "spl-program-error 0.3.1", + "spl-type-length-value 0.3.1", +] + [[package]] name = "spl-tlv-account-resolution" version = "0.5.2" @@ -6069,6 +5903,28 @@ dependencies = [ "thiserror", ] +[[package]] +name = "spl-token-2022" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.4.2", + "num-traits", + "num_enum 0.7.2", + "solana-program", + "solana-zk-token-sdk", + "spl-memo", + "spl-pod 0.1.1", + "spl-token", + "spl-token-metadata-interface 0.2.0", + "spl-transfer-hook-interface 0.3.0", + "spl-type-length-value 0.3.1", + "thiserror", +] + [[package]] name = "spl-token-2022" version = "1.0.0" @@ -6171,6 +6027,22 @@ dependencies = [ "spl-type-length-value 0.4.3", ] +[[package]] +name = "spl-transfer-hook-interface" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" +dependencies = [ + "arrayref", + "bytemuck", + "solana-program", + "spl-discriminator 0.1.1", + "spl-pod 0.1.1", + "spl-program-error 0.3.1", + "spl-tlv-account-resolution 0.4.0", + "spl-type-length-value 0.3.1", +] + [[package]] name = "spl-transfer-hook-interface" version = "0.4.1" @@ -6720,10 +6592,10 @@ dependencies = [ [[package]] name = "treasury-management" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", ] [[package]] @@ -6906,10 +6778,10 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "voter-stake-registry" version = "0.3.3" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=main#84c3ab37be04d65d15bba3a723ef51cd59d10da0" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" dependencies = [ "anchor-gen", - "anchor-lang 0.30.1", + "anchor-lang", ] [[package]] diff --git a/helium-lib/Cargo.toml b/helium-lib/Cargo.toml index a8a35a06..0d475421 100644 --- a/helium-lib/Cargo.toml +++ b/helium-lib/Cargo.toml @@ -29,13 +29,13 @@ bincode = "1.3.3" reqwest = { version = "0", default-features = false, features = [ "rustls-tls", ] } -helium-anchor-gen = {git = "https://github.com/helium/helium-anchor-gen.git" } +helium-anchor-gen = {git = "https://github.com/helium/helium-anchor-gen.git", branch = "mj/unbump-anchor-lang" } spl-associated-token-account = { version = "*", features = ["no-entrypoint"] } spl-account-compression = { version = "0.3", features = ["no-entrypoint"] } tonic = { version = "0", features = ["tls", "tls-roots"] } mpl-bubblegum = "1" -solana-program = ">=1.18,<2" -pyth-solana-receiver-sdk = { git = "https://github.com/madninja/pyth-crosschain.git", branch = "madninja/cap_solana_dep" } +pyth-solana-receiver-sdk = "0" +solana-program = "*" solana-transaction-status = "*" serde = {workspace = true} serde_json = {workspace = true} From 040fc93ece4a8a8eb82ce43f53484a3ef50475be Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Wed, 23 Oct 2024 11:49:07 -0700 Subject: [PATCH 14/49] update helium-anchor-gen with looser dep around anchor-client we can not go all the way back to 0.28 because of solana-sdk. So we go back as far as we can without causing problems for upstream things like oracles. --- Cargo.lock | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2cb849a1..7f07d3c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -972,7 +972,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" dependencies = [ "borsh-derive 0.10.3", - "hashbrown 0.12.3", + "hashbrown 0.13.2", ] [[package]] @@ -1267,7 +1267,7 @@ dependencies = [ [[package]] name = "circuit-breaker" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", @@ -1748,7 +1748,7 @@ dependencies = [ [[package]] name = "data-credits" version = "0.2.2" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", @@ -2058,7 +2058,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fanout" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", @@ -2418,7 +2418,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "helium-anchor-gen" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", @@ -2464,7 +2464,7 @@ dependencies = [ [[package]] name = "helium-entity-manager" version = "0.2.11" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", @@ -2517,7 +2517,7 @@ name = "helium-mnemonic" version = "0.0.0" dependencies = [ "bitvec", - "bs58 0.3.1", + "bs58 0.5.1", "lazy_static", "sha2 0.10.8", "thiserror", @@ -2542,7 +2542,7 @@ dependencies = [ [[package]] name = "helium-sub-daos" version = "0.1.8" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", @@ -2606,7 +2606,7 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hexboosting" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", @@ -2978,7 +2978,7 @@ dependencies = [ [[package]] name = "lazy-distributor" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", @@ -2987,7 +2987,7 @@ dependencies = [ [[package]] name = "lazy-transactions" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", @@ -3201,7 +3201,7 @@ dependencies = [ [[package]] name = "mobile-entity-manager" version = "0.1.3" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", @@ -3747,7 +3747,7 @@ dependencies = [ [[package]] name = "price-oracle" version = "0.2.1" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", @@ -4241,7 +4241,7 @@ dependencies = [ [[package]] name = "rewards-oracle" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", @@ -6592,7 +6592,7 @@ dependencies = [ [[package]] name = "treasury-management" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", @@ -6778,7 +6778,7 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "voter-stake-registry" version = "0.3.3" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#8b020a8f8a5d9bfefbd5ed4179a56179c8f4943a" +source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" dependencies = [ "anchor-gen", "anchor-lang", From 0e750c95e7d5483ca52d0ef18593db93a855c0d9 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Wed, 23 Oct 2024 11:55:16 -0700 Subject: [PATCH 15/49] go back to master helium-anchor-gen that has updated anchor-lang >=0.28 --- Cargo.lock | 30 +++++++++++++++--------------- helium-lib/Cargo.toml | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f07d3c5..aaf8b5a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -972,7 +972,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" dependencies = [ "borsh-derive 0.10.3", - "hashbrown 0.13.2", + "hashbrown 0.12.3", ] [[package]] @@ -1267,7 +1267,7 @@ dependencies = [ [[package]] name = "circuit-breaker" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -1748,7 +1748,7 @@ dependencies = [ [[package]] name = "data-credits" version = "0.2.2" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2058,7 +2058,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fanout" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2418,7 +2418,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "helium-anchor-gen" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2464,7 +2464,7 @@ dependencies = [ [[package]] name = "helium-entity-manager" version = "0.2.11" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2542,7 +2542,7 @@ dependencies = [ [[package]] name = "helium-sub-daos" version = "0.1.8" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2606,7 +2606,7 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hexboosting" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2978,7 +2978,7 @@ dependencies = [ [[package]] name = "lazy-distributor" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2987,7 +2987,7 @@ dependencies = [ [[package]] name = "lazy-transactions" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -3201,7 +3201,7 @@ dependencies = [ [[package]] name = "mobile-entity-manager" version = "0.1.3" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -3747,7 +3747,7 @@ dependencies = [ [[package]] name = "price-oracle" version = "0.2.1" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -4241,7 +4241,7 @@ dependencies = [ [[package]] name = "rewards-oracle" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -6592,7 +6592,7 @@ dependencies = [ [[package]] name = "treasury-management" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -6778,7 +6778,7 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "voter-stake-registry" version = "0.3.3" -source = "git+https://github.com/helium/helium-anchor-gen.git?branch=mj/unbump-anchor-lang#f92aa9f45f669fd3f43ef5868991e1547210caa7" +source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", diff --git a/helium-lib/Cargo.toml b/helium-lib/Cargo.toml index 0d475421..cd48c174 100644 --- a/helium-lib/Cargo.toml +++ b/helium-lib/Cargo.toml @@ -29,7 +29,7 @@ bincode = "1.3.3" reqwest = { version = "0", default-features = false, features = [ "rustls-tls", ] } -helium-anchor-gen = {git = "https://github.com/helium/helium-anchor-gen.git", branch = "mj/unbump-anchor-lang" } +helium-anchor-gen = {git = "https://github.com/helium/helium-anchor-gen.git" } spl-associated-token-account = { version = "*", features = ["no-entrypoint"] } spl-account-compression = { version = "0.3", features = ["no-entrypoint"] } tonic = { version = "0", features = ["tls", "tls-roots"] } From 9ee2bb85b11797758fd83546e981e7fb3f624184 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 30 Oct 2024 16:52:54 -0500 Subject: [PATCH 16/49] wip moving iot_routing_manager sdk here --- Cargo.lock | 24 ++--- Cargo.toml | 3 + helium-lib/Cargo.toml | 5 +- helium-lib/src/client.rs | 14 ++- helium-lib/src/iot_routing_manager.rs | 139 ++++++++++++++++++++++++++ helium-lib/src/lib.rs | 1 + helium-lib/src/programs.rs | 2 + 7 files changed, 168 insertions(+), 20 deletions(-) create mode 100644 helium-lib/src/iot_routing_manager.rs diff --git a/Cargo.lock b/Cargo.lock index aaf8b5a6..93074c7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1267,7 +1267,6 @@ dependencies = [ [[package]] name = "circuit-breaker" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -1748,7 +1747,6 @@ dependencies = [ [[package]] name = "data-credits" version = "0.2.2" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2058,7 +2056,6 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fanout" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2418,7 +2415,6 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "helium-anchor-gen" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2428,6 +2424,7 @@ dependencies = [ "helium-entity-manager", "helium-sub-daos", "hexboosting", + "iot-routing-manager", "lazy-distributor", "lazy-transactions", "mobile-entity-manager", @@ -2464,7 +2461,6 @@ dependencies = [ [[package]] name = "helium-entity-manager" version = "0.2.11" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2475,6 +2471,7 @@ name = "helium-lib" version = "0.0.0" dependencies = [ "anchor-client", + "anchor-lang", "anchor-spl", "angry-purple-tiger", "async-trait", @@ -2542,7 +2539,6 @@ dependencies = [ [[package]] name = "helium-sub-daos" version = "0.1.8" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2606,7 +2602,6 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hexboosting" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2860,6 +2855,14 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "iot-routing-manager" +version = "0.1.2" +dependencies = [ + "anchor-gen", + "anchor-lang", +] + [[package]] name = "ipnet" version = "2.9.0" @@ -2978,7 +2981,6 @@ dependencies = [ [[package]] name = "lazy-distributor" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -2987,7 +2989,6 @@ dependencies = [ [[package]] name = "lazy-transactions" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -3201,7 +3202,6 @@ dependencies = [ [[package]] name = "mobile-entity-manager" version = "0.1.3" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -3747,7 +3747,6 @@ dependencies = [ [[package]] name = "price-oracle" version = "0.2.1" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -4241,7 +4240,6 @@ dependencies = [ [[package]] name = "rewards-oracle" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -6592,7 +6590,6 @@ dependencies = [ [[package]] name = "treasury-management" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", @@ -6778,7 +6775,6 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "voter-stake-registry" version = "0.3.3" -source = "git+https://github.com/helium/helium-anchor-gen.git#b92afcd8dbc7d64d3c164e31c0be6ec13c030003" dependencies = [ "anchor-gen", "anchor-lang", diff --git a/Cargo.toml b/Cargo.toml index 48ba6c76..ea07cb51 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,3 +23,6 @@ helium-proto = { git = "https://github.com/helium/proto", branch = "master", fea "services", ] } clap = { version = "4", features = ["derive"] } + +[patch.'https://github.com/helium/helium-anchor-gen.git'] +helium-anchor-gen = { path = "../helium-anchor-gen" } diff --git a/helium-lib/Cargo.toml b/helium-lib/Cargo.toml index cd48c174..54d79986 100644 --- a/helium-lib/Cargo.toml +++ b/helium-lib/Cargo.toml @@ -16,6 +16,7 @@ thiserror = "1" async-trait = "0" anchor-client = {version = "0.29.0", features = ["async"] } anchor-spl = { version = "0.29.0", features = ["mint", "token"] } +anchor-lang = { version = "0.29.0" } url = {version = "2", features = ["serde"]} h3o = {version = "0", features = ["serde"]} helium-crypto = {workspace = true} @@ -29,7 +30,7 @@ bincode = "1.3.3" reqwest = { version = "0", default-features = false, features = [ "rustls-tls", ] } -helium-anchor-gen = {git = "https://github.com/helium/helium-anchor-gen.git" } +helium-anchor-gen = { git = "https://github.com/helium/helium-anchor-gen.git" } spl-associated-token-account = { version = "*", features = ["no-entrypoint"] } spl-account-compression = { version = "0.3", features = ["no-entrypoint"] } tonic = { version = "0", features = ["tls", "tls-roots"] } @@ -48,4 +49,4 @@ clap = {workspace = true, optional = true} helium-mnemonic = { path = "../helium-mnemonic", optional = true } [dev-dependencies] -rand = "0.8" +rand = "0.8" \ No newline at end of file diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index 1f3a1cb6..9c32190c 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -31,7 +31,10 @@ pub struct Client { #[async_trait::async_trait] pub trait GetAnchorAccount { - async fn anchor_account(&self, pubkey: &Pubkey) -> Result; + async fn anchor_account( + &self, + pubkey: &Pubkey, + ) -> Result, Error>; async fn anchor_accounts( &self, pubkeys: &[Pubkey], @@ -40,10 +43,13 @@ pub trait GetAnchorAccount { #[async_trait::async_trait] impl GetAnchorAccount for SolanaRpcClient { - async fn anchor_account(&self, pubkey: &Pubkey) -> Result { + async fn anchor_account( + &self, + pubkey: &Pubkey, + ) -> Result, Error> { let account = self.get_account(pubkey).await?; let decoded = T::try_deserialize(&mut account.data.as_ref())?; - Ok(decoded) + Ok(Some(decoded)) } async fn anchor_accounts( @@ -84,7 +90,7 @@ impl GetAnchorAccount for Client { async fn anchor_account( &self, pubkey: &keypair::Pubkey, - ) -> Result { + ) -> Result, Error> { self.solana_client.anchor_account(pubkey).await } async fn anchor_accounts( diff --git a/helium-lib/src/iot_routing_manager.rs b/helium-lib/src/iot_routing_manager.rs new file mode 100644 index 00000000..0c69cd8d --- /dev/null +++ b/helium-lib/src/iot_routing_manager.rs @@ -0,0 +1,139 @@ +use crate::{client::GetAnchorAccount, error::Error, programs::TOKEN_METADATA_PROGRAM_ID}; +use anchor_lang::{prelude::*, InstructionData}; +use futures::{future::BoxFuture, Stream, StreamExt}; +use itertools::Itertools; +use solana_sdk::{hash::hash, instruction::Instruction}; +use spl_associated_token_account::get_associated_token_address; +use std::{ops::Range, result::Result, sync::Arc}; + +use helium_anchor_gen::iot_routing_manager::{self, typedefs::*}; + +declare_id!("irtjLnjCMmyowq2m3KWqpuFB3M9gdNA9A4t4d6VWmzB"); + +pub fn routing_manager_key(sub_dao: &Pubkey) -> Pubkey { + Pubkey::find_program_address(&[b"routing_manager", sub_dao.as_ref()], &ID).0 +} + +pub fn organization_key(routing_manager: &Pubkey, oui: u64) -> Pubkey { + Pubkey::find_program_address( + &[ + b"organization", + routing_manager.as_ref(), + &oui.to_le_bytes(), + ], + &ID, + ) + .0 +} + +pub fn devaddr_constraint_key(organization: &Pubkey, start_addr: u64) -> Pubkey { + Pubkey::find_program_address( + &[ + b"devaddr_constraint", + organization.as_ref(), + &start_addr.to_le_bytes(), + ], + &ID, + ) + .0 +} + +pub fn net_id_key(routing_manager: &Pubkey, net_id: u32) -> Pubkey { + Pubkey::find_program_address( + &[b"net_id", routing_manager.as_ref(), &net_id.to_le_bytes()], + &ID, + ) + .0 +} + +pub fn organization_delegate_key(organization: &Pubkey, delegate: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[ + b"organization_delegate", + organization.as_ref(), + delegate.as_ref(), + ], + &ID, + ) + .0 +} + +pub fn routing_manager_collection_key(routing_manager: &Pubkey) -> Pubkey { + Pubkey::find_program_address(&[b"collection", routing_manager.as_ref()], &ID).0 +} + +pub fn routing_manager_collection_metadata_key(collection: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[ + b"metadata", + TOKEN_METADATA_PROGRAM_ID.as_ref(), + collection.as_ref(), + ], + &TOKEN_METADATA_PROGRAM_ID, + ) + .0 +} + +pub fn routing_manager_collection_master_edition_key(collection: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[ + b"metadata", + TOKEN_METADATA_PROGRAM_ID.as_ref(), + collection.as_ref(), + b"edition", + ], + &TOKEN_METADATA_PROGRAM_ID, + ) + .0 +} + +pub mod organization { + use super::*; + use crate::{ + client::GetAnchorAccount, + error::Error, + programs::{BUBBLEGUM_PROGRAM_ID, SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, + }; + use iot_routing_manager::IotRoutingManagerV0; + + pub async fn create( + client: &C, + payer: Pubkey, + authority: Option, + routing_manager_key: Pubkey, + ) -> Result<(Pubkey, Instruction), Error> { + let routing_manager: IotRoutingManagerV0 = client + .anchor_account(&routing_manager_key) + .await? + .ok_or_else(|| Error::account_not_found())?; + + let oui = routing_manager.next_oui_id; + let organization_key = organization_key(&routing_manager_key, oui); + + Ok(( + organization_key, + Instruction { + program_id: ID, + accounts: iot_routing_manager::accounts::InitializeOrganizationV0 { + payer, + organization: organization_key, + + bubblegum_program: BUBBLEGUM_PROGRAM_ID, + token_metadata_program: TOKEN_METADATA_PROGRAM_ID, + log_wrapper: SPL_NOOP_PROGRAM_ID, + compression_program: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, + token_program: anchor_spl::token::ID, + system_program: solana_sdk::system_program::ID, + } + .to_account_metas(None), + data: iot_routing_manager::instruction::InitializeOrganizationV0 {}.data(), + }, + )) + } +} + +pub mod orgainization_delegate {} + +pub mod net_id {} + +pub mod devaddr_constraint {} diff --git a/helium-lib/src/lib.rs b/helium-lib/src/lib.rs index 3a4aa543..ebf33e85 100644 --- a/helium-lib/src/lib.rs +++ b/helium-lib/src/lib.rs @@ -8,6 +8,7 @@ pub mod dc; pub mod entity_key; pub mod error; pub mod hotspot; +pub mod iot_routing_manager; pub mod keypair; pub mod kta; pub mod onboarding; diff --git a/helium-lib/src/programs.rs b/helium-lib/src/programs.rs index 521bdf72..66f8c8a5 100644 --- a/helium-lib/src/programs.rs +++ b/helium-lib/src/programs.rs @@ -1,5 +1,7 @@ use crate::keypair::{pubkey, Pubkey}; +pub const BUBBLEGUM_PROGRAM_ID: Pubkey = pubkey!("BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY"); + pub const TOKEN_METADATA_PROGRAM_ID: Pubkey = pubkey!("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"); From 3b38d76b7e10d331837fc152498d6c301fb57ddf Mon Sep 17 00:00:00 2001 From: bry Date: Fri, 1 Nov 2024 16:57:12 -0500 Subject: [PATCH 17/49] Pdas and instructions creators for iot_routing_manager plus a refactor --- helium-lib/src/dao.rs | 95 ++----- helium-lib/src/dc.rs | 1 + helium-lib/src/entity_key.rs | 2 +- helium-lib/src/epoch.rs | 5 + helium-lib/src/error.rs | 6 + helium-lib/src/helium_entity_manager.rs | 110 ++++++++ helium-lib/src/helium_sub_daos.rs | 49 ++++ helium-lib/src/hotspot/dataonly.rs | 12 +- helium-lib/src/hotspot/info.rs | 29 +-- helium-lib/src/iot_routing_manager.rs | 318 ++++++++++++++++++++++-- helium-lib/src/lib.rs | 7 +- helium-lib/src/metaplex.rs | 36 +++ helium-lib/src/programs.rs | 2 - helium-lib/src/reward.rs | 5 +- 14 files changed, 555 insertions(+), 122 deletions(-) create mode 100644 helium-lib/src/epoch.rs create mode 100644 helium-lib/src/helium_entity_manager.rs create mode 100644 helium-lib/src/helium_sub_daos.rs create mode 100644 helium-lib/src/metaplex.rs diff --git a/helium-lib/src/dao.rs b/helium-lib/src/dao.rs index 4989d406..bd8ee8f7 100644 --- a/helium-lib/src/dao.rs +++ b/helium-lib/src/dao.rs @@ -1,6 +1,6 @@ use crate::{ data_credits, entity_key::AsEntityKey, helium_entity_manager, helium_sub_daos, keypair::Pubkey, - lazy_distributor, programs::TOKEN_METADATA_PROGRAM_ID, token::Token, + lazy_distributor, metaplex, token::Token, }; use chrono::Timelike; use sha2::{Digest, Sha256}; @@ -24,79 +24,40 @@ impl Dao { let mint = match self { Self::Hnt => Token::Hnt.mint(), }; - let (dao_key, _) = - Pubkey::find_program_address(&[b"dao", mint.as_ref()], &helium_sub_daos::id()); - dao_key + helium_sub_daos::dao_key(mint) } pub fn dataonly_config_key(&self) -> Pubkey { - let (key, _) = Pubkey::find_program_address( - &[b"data_only_config", self.key().as_ref()], - &helium_entity_manager::id(), - ); - key + helium_entity_manager::data_only_config_key(&self.key()) } pub fn dataonly_escrow_key(&self) -> Pubkey { - let (data_only_escrow, _doe_bump) = Pubkey::find_program_address( - &[b"data_only_escrow", self.dataonly_config_key().as_ref()], - &helium_entity_manager::id(), - ); - data_only_escrow + helium_entity_manager::data_only_escrow_key(&self.dataonly_config_key()) } pub fn collection_metadata_key(&self, collection_key: &Pubkey) -> Pubkey { - let (collection_metadata, _bump) = Pubkey::find_program_address( - &[ - b"metadata", - TOKEN_METADATA_PROGRAM_ID.as_ref(), - collection_key.as_ref(), - ], - &TOKEN_METADATA_PROGRAM_ID, - ); - collection_metadata + metaplex::collection_metadata_key(collection_key) } pub fn collection_master_edition_key(&self, collection_key: &Pubkey) -> Pubkey { - let (collection_master_edition, _cme_bump) = Pubkey::find_program_address( - &[ - b"metadata", - TOKEN_METADATA_PROGRAM_ID.as_ref(), - collection_key.as_ref(), - b"edition", - ], - &TOKEN_METADATA_PROGRAM_ID, - ); - collection_master_edition + metaplex::collection_master_edition_key(collection_key) } pub fn merkle_tree_authority(&self, merkle_tree: &Pubkey) -> Pubkey { - let (tree_authority, _ta_bump) = - Pubkey::find_program_address(&[merkle_tree.as_ref()], &mpl_bubblegum::ID); - tree_authority + metaplex::merkle_tree_authority_key(merkle_tree) } pub fn bubblegum_signer(&self) -> Pubkey { - let (bubblegum_signer, _bs_bump) = - Pubkey::find_program_address(&[b"collection_cpi"], &mpl_bubblegum::ID); - bubblegum_signer + metaplex::bubblegum_signer_key() } pub fn entity_creator_key(&self) -> Pubkey { - let (key, _) = Pubkey::find_program_address( - &[b"entity_creator", self.key().as_ref()], - &helium_entity_manager::id(), - ); - key + helium_entity_manager::entity_creator_key(&self.key()) } pub fn entity_key_to_kta_key(&self, entity_key: &E) -> Pubkey { let hash = Sha256::digest(entity_key.as_entity_key()); - let (key, _) = Pubkey::find_program_address( - &[b"key_to_asset", self.key().as_ref(), hash.as_ref()], - &helium_entity_manager::id(), - ); - key + helium_entity_manager::key_to_asset_key_raw(&self.key(), &hash) } pub fn dc_account_payer() -> Pubkey { @@ -136,9 +97,7 @@ impl SubDao { pub fn key(&self) -> Pubkey { let mint = self.mint(); - let (subdao_key, _) = - Pubkey::find_program_address(&[b"sub_dao", mint.as_ref()], &helium_sub_daos::id()); - subdao_key + helium_sub_daos::sub_dao_key(mint) } pub fn mint(&self) -> &Pubkey { @@ -181,29 +140,23 @@ impl SubDao { } pub fn rewardable_entity_config_key(&self) -> Pubkey { - let suffix = match self { - Self::Iot => b"IOT".as_ref(), - Self::Mobile => b"MOBILE".as_ref(), - }; - let (key, _) = Pubkey::find_program_address( - &[b"rewardable_entity_config", self.key().as_ref(), suffix], - &helium_entity_manager::id(), - ); - key + let sub_dao = self.key(); + match self { + Self::Iot => helium_entity_manager::rewardable_entity_config_key(&sub_dao, "IOT"), + Self::Mobile => helium_entity_manager::rewardable_entity_config_key(&sub_dao, "MOBILE"), + } } pub fn info_key(&self, entity_key: &E) -> Pubkey { - let hash = Sha256::digest(entity_key.as_entity_key()); let config_key = self.rewardable_entity_config_key(); - let prefix = match self { - Self::Iot => "iot_info", - Self::Mobile => "mobile_info", - }; - let (key, _) = Pubkey::find_program_address( - &[prefix.as_bytes(), config_key.as_ref(), &hash], - &helium_entity_manager::id(), - ); - key + match self { + Self::Iot => { + helium_entity_manager::iot_info_key(&config_key, &entity_key.as_entity_key()) + } + Self::Mobile => { + helium_entity_manager::mobile_info_key(&config_key, &entity_key.as_entity_key()) + } + } } pub fn lazy_distributor_key(&self) -> Pubkey { diff --git a/helium-lib/src/dc.rs b/helium-lib/src/dc.rs index 7e140e60..5091ed30 100644 --- a/helium-lib/src/dc.rs +++ b/helium-lib/src/dc.rs @@ -64,6 +64,7 @@ pub async fn mint>( .as_ref() .anchor_account::(&Dao::dc_key()) .await? + .ok_or_else(|| Error::account_not_found())? .hnt_price_oracle; let mint_ix = Instruction { diff --git a/helium-lib/src/entity_key.rs b/helium-lib/src/entity_key.rs index 6c6412ea..ad8fce9a 100644 --- a/helium-lib/src/entity_key.rs +++ b/helium-lib/src/entity_key.rs @@ -37,7 +37,7 @@ impl AsEntityKey for helium_crypto::PublicKey { } } -pub use helium_anchor_gen::helium_entity_manager::KeySerialization; +pub use crate::helium_entity_manager::KeySerialization; pub fn from_str(str: &str, encoding: KeySerialization) -> Result, DecodeError> { let entity_key = match encoding { diff --git a/helium-lib/src/epoch.rs b/helium-lib/src/epoch.rs new file mode 100644 index 00000000..bed80cd4 --- /dev/null +++ b/helium-lib/src/epoch.rs @@ -0,0 +1,5 @@ +const EPOCH_LENGTH: u64 = 60 * 60 * 24; + +pub fn get_current_epoch(unix_time: u64) -> u64 { + unix_time / EPOCH_LENGTH +} diff --git a/helium-lib/src/error.rs b/helium-lib/src/error.rs index b06b231d..e520f55c 100644 --- a/helium-lib/src/error.rs +++ b/helium-lib/src/error.rs @@ -13,6 +13,8 @@ pub enum Error { Anchor(#[from] anchor_client::ClientError), #[error("anchor lang: {0}")] AnchorLang(#[from] helium_anchor_gen::anchor_lang::error::Error), + #[error("Account already exists")] + AccountExists, #[error("DAS client: {0}")] Das(#[from] client::DasClientError), #[error("grpc: {0}")] @@ -50,6 +52,10 @@ impl Error { anchor_client::ClientError::AccountNotFound.into() } + pub fn account_exists() -> Self { + Self::AccountExists.into() + } + pub fn is_account_not_found(&self) -> bool { use solana_client::{ client_error::{ diff --git a/helium-lib/src/helium_entity_manager.rs b/helium-lib/src/helium_entity_manager.rs new file mode 100644 index 00000000..5cca5cb5 --- /dev/null +++ b/helium-lib/src/helium_entity_manager.rs @@ -0,0 +1,110 @@ +use anchor_lang::prelude::*; +use sha2::{Digest, Sha256}; + +pub use helium_anchor_gen::helium_entity_manager::*; + +pub fn shared_merkle_key(proof_size: u8) -> Pubkey { + Pubkey::find_program_address( + &[b"shared_merkle", &[proof_size]], + &helium_anchor_gen::helium_entity_manager::id(), + ) + .0 +} + +pub fn entity_creator_key(dao: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[b"entity_creator", dao.as_ref()], + &helium_anchor_gen::helium_entity_manager::id(), + ) + .0 +} + +pub fn rewardable_entity_config_key(sub_dao: &Pubkey, symbol: &str) -> Pubkey { + Pubkey::find_program_address( + &[ + b"rewardable_entity_config", + sub_dao.as_ref(), + symbol.as_bytes(), + ], + &helium_anchor_gen::helium_entity_manager::id(), + ) + .0 +} + +pub fn hotspot_collection_key(maker_or_data_only: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[b"collection", maker_or_data_only.as_ref()], + &helium_anchor_gen::helium_entity_manager::id(), + ) + .0 +} + +pub fn data_only_config_key(dao: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[b"data_only_config", dao.as_ref()], + &helium_anchor_gen::helium_entity_manager::id(), + ) + .0 +} + +pub fn data_only_escrow_key(data_only: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[b"data_only_escrow", data_only.as_ref()], + &helium_anchor_gen::helium_entity_manager::id(), + ) + .0 +} + +pub fn maker_key(dao: &Pubkey, name: &str) -> Pubkey { + Pubkey::find_program_address( + &[b"maker", dao.as_ref(), name.as_bytes()], + &helium_anchor_gen::helium_entity_manager::id(), + ) + .0 +} + +pub fn program_approval_key(dao: &Pubkey, program: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[b"program_approval", dao.as_ref(), program.as_ref()], + &helium_anchor_gen::helium_entity_manager::id(), + ) + .0 +} + +pub fn maker_approval_key(rewardable_entity_config: &Pubkey, maker: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[ + b"maker_approval", + rewardable_entity_config.as_ref(), + maker.as_ref(), + ], + &helium_anchor_gen::helium_entity_manager::id(), + ) + .0 +} + +pub fn key_to_asset_key_raw(dao: &Pubkey, hashed_entity_key: &[u8]) -> Pubkey { + Pubkey::find_program_address( + &[b"key_to_asset", dao.as_ref(), hashed_entity_key], + &helium_anchor_gen::helium_entity_manager::id(), + ) + .0 +} + +pub fn iot_info_key(rewardable_entity_config: &Pubkey, entity_key: &[u8]) -> Pubkey { + let hash = Sha256::digest(entity_key); + Pubkey::find_program_address( + &[b"iot_info", rewardable_entity_config.as_ref(), &hash], + &helium_anchor_gen::helium_entity_manager::id(), + ) + .0 +} + +pub fn mobile_info_key(rewardable_entity_config: &Pubkey, entity_key: &[u8]) -> Pubkey { + let hash = Sha256::digest(entity_key); + Pubkey::find_program_address( + &[b"mobile_info", rewardable_entity_config.as_ref(), &hash], + &helium_anchor_gen::helium_entity_manager::id(), + ) + .0 +} diff --git a/helium-lib/src/helium_sub_daos.rs b/helium-lib/src/helium_sub_daos.rs new file mode 100644 index 00000000..142c645b --- /dev/null +++ b/helium-lib/src/helium_sub_daos.rs @@ -0,0 +1,49 @@ +use anchor_lang::prelude::*; + +use crate::epoch::get_current_epoch; + +pub use helium_anchor_gen::helium_sub_daos::*; + +pub fn sub_dao_epoch_info_key(sub_dao: &Pubkey, unix_time: u64) -> Pubkey { + let epoch = get_current_epoch(unix_time); + let b_u64 = epoch.to_le_bytes(); + Pubkey::find_program_address( + &[b"sub_dao_epoch_info", sub_dao.as_ref(), &b_u64], + &helium_anchor_gen::helium_sub_daos::ID, + ) + .0 +} + +pub fn dao_epoch_info_key(dao: &Pubkey, unix_time: u64) -> Pubkey { + let epoch = get_current_epoch(unix_time); + let b_u64 = epoch.to_le_bytes(); + Pubkey::find_program_address( + &[b"dao_epoch_info", dao.as_ref(), &b_u64], + &helium_anchor_gen::helium_sub_daos::ID, + ) + .0 +} + +pub fn dao_key(mint: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[b"dao", mint.as_ref()], + &helium_anchor_gen::helium_sub_daos::ID, + ) + .0 +} + +pub fn sub_dao_key(mint: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[b"sub_dao", mint.as_ref()], + &helium_anchor_gen::helium_sub_daos::ID, + ) + .0 +} + +pub fn delegated_position_key(position: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[b"delegated_position", position.as_ref()], + &helium_anchor_gen::helium_sub_daos::ID, + ) + .0 +} diff --git a/helium-lib/src/hotspot/dataonly.rs b/helium-lib/src/hotspot/dataonly.rs index c5b60462..8a8684be 100644 --- a/helium-lib/src/hotspot/dataonly.rs +++ b/helium-lib/src/hotspot/dataonly.rs @@ -68,7 +68,9 @@ mod iot { .anchor_account::( &Dao::Hnt.dataonly_config_key(), ) - .await?; + .await? + .ok_or_else(|| Error::account_not_found())?; + let kta = kta::for_entity_key(hotspot_key).await?; let (asset, asset_proof) = asset::for_kta_with_proof(client, &kta).await?; let mut onboard_accounts = @@ -154,7 +156,9 @@ mod mobile { .anchor_account::( &Dao::Hnt.dataonly_config_key(), ) - .await?; + .await? + .ok_or_else(|| Error::account_not_found())?; + let kta = kta::for_entity_key(hotspot_key).await?; let (asset, asset_proof) = asset::for_kta_with_proof(client, &kta).await?; let mut onboard_accounts = @@ -262,7 +266,9 @@ pub async fn issue_transaction + GetAnchorAccount>( let config_account = client .anchor_account::(&Dao::Hnt.dataonly_config_key()) - .await?; + .await? + .ok_or_else(|| Error::account_not_found())?; + let hotspot_key = helium_crypto::PublicKey::from_bytes(&add_tx.gateway)?; let entity_key = hotspot_key.as_entity_key(); let accounts = mk_accounts(config_account, owner, &entity_key); diff --git a/helium-lib/src/hotspot/info.rs b/helium-lib/src/hotspot/info.rs index dc032cf6..14c46ea1 100644 --- a/helium-lib/src/hotspot/info.rs +++ b/helium-lib/src/hotspot/info.rs @@ -6,8 +6,17 @@ use crate::{ client::{GetAnchorAccount, SolanaRpcClient}, dao::SubDao, entity_key::AsEntityKey, - error::{DecodeError, Error}, - helium_entity_manager, + error::Error, + helium_entity_manager::{ + self, + instruction::{ + OnboardDataOnlyIotHotspotV0, OnboardDataOnlyMobileHotspotV0, OnboardIotHotspotV0, + OnboardMobileHotspotV0, UpdateIotInfoV0, UpdateMobileInfoV0, + }, + OnboardDataOnlyIotHotspotArgsV0, OnboardDataOnlyMobileHotspotArgsV0, + OnboardIotHotspotArgsV0, OnboardMobileHotspotArgsV0, UpdateIotInfoArgsV0, + UpdateMobileInfoArgsV0, + }, hotspot::{CommittedHotspotInfoUpdate, HotspotInfo, HotspotInfoUpdate}, keypair::Pubkey, solana_sdk::{commitment_config::CommitmentConfig, signature::Signature}, @@ -17,14 +26,6 @@ use futures::{ stream::{self, StreamExt, TryStreamExt}, TryFutureExt, }; -use helium_anchor_gen::helium_entity_manager::{ - instruction::{ - OnboardDataOnlyIotHotspotV0, OnboardDataOnlyMobileHotspotV0, OnboardIotHotspotV0, - OnboardMobileHotspotV0, UpdateIotInfoV0, UpdateMobileInfoV0, - }, - OnboardDataOnlyIotHotspotArgsV0, OnboardDataOnlyMobileHotspotArgsV0, OnboardIotHotspotArgsV0, - OnboardMobileHotspotArgsV0, UpdateIotInfoArgsV0, UpdateMobileInfoArgsV0, -}; use serde::{Deserialize, Serialize}; use solana_transaction_status::{ EncodedConfirmedTransactionWithStatusMeta, EncodedTransaction, UiInstruction, UiMessage, @@ -40,14 +41,14 @@ pub async fn get( let hotspot_info = match subdao { SubDao::Iot => client .anchor_account::(info_key) - .await + .await? .map(Into::into), SubDao::Mobile => client .anchor_account::(info_key) - .await + .await? .map(Into::into), - } - .ok(); + }; + Ok(hotspot_info) } diff --git a/helium-lib/src/iot_routing_manager.rs b/helium-lib/src/iot_routing_manager.rs index 0c69cd8d..722c842d 100644 --- a/helium-lib/src/iot_routing_manager.rs +++ b/helium-lib/src/iot_routing_manager.rs @@ -1,17 +1,19 @@ -use crate::{client::GetAnchorAccount, error::Error, programs::TOKEN_METADATA_PROGRAM_ID}; use anchor_lang::{prelude::*, InstructionData}; -use futures::{future::BoxFuture, Stream, StreamExt}; -use itertools::Itertools; -use solana_sdk::{hash::hash, instruction::Instruction}; +use sha2::{Digest, Sha256}; +use solana_sdk::instruction::Instruction; use spl_associated_token_account::get_associated_token_address; -use std::{ops::Range, result::Result, sync::Arc}; +use std::result::Result; -use helium_anchor_gen::iot_routing_manager::{self, typedefs::*}; +use crate::{helium_entity_manager, programs::TOKEN_METADATA_PROGRAM_ID}; -declare_id!("irtjLnjCMmyowq2m3KWqpuFB3M9gdNA9A4t4d6VWmzB"); +pub use helium_anchor_gen::iot_routing_manager::*; pub fn routing_manager_key(sub_dao: &Pubkey) -> Pubkey { - Pubkey::find_program_address(&[b"routing_manager", sub_dao.as_ref()], &ID).0 + Pubkey::find_program_address( + &[b"routing_manager", sub_dao.as_ref()], + &helium_anchor_gen::iot_routing_manager::ID, + ) + .0 } pub fn organization_key(routing_manager: &Pubkey, oui: u64) -> Pubkey { @@ -21,7 +23,7 @@ pub fn organization_key(routing_manager: &Pubkey, oui: u64) -> Pubkey { routing_manager.as_ref(), &oui.to_le_bytes(), ], - &ID, + &helium_anchor_gen::iot_routing_manager::ID, ) .0 } @@ -33,7 +35,7 @@ pub fn devaddr_constraint_key(organization: &Pubkey, start_addr: u64) -> Pubkey organization.as_ref(), &start_addr.to_le_bytes(), ], - &ID, + &helium_anchor_gen::iot_routing_manager::ID, ) .0 } @@ -41,7 +43,7 @@ pub fn devaddr_constraint_key(organization: &Pubkey, start_addr: u64) -> Pubkey pub fn net_id_key(routing_manager: &Pubkey, net_id: u32) -> Pubkey { Pubkey::find_program_address( &[b"net_id", routing_manager.as_ref(), &net_id.to_le_bytes()], - &ID, + &helium_anchor_gen::iot_routing_manager::ID, ) .0 } @@ -53,16 +55,20 @@ pub fn organization_delegate_key(organization: &Pubkey, delegate: &Pubkey) -> Pu organization.as_ref(), delegate.as_ref(), ], - &ID, + &helium_anchor_gen::iot_routing_manager::ID, ) .0 } -pub fn routing_manager_collection_key(routing_manager: &Pubkey) -> Pubkey { - Pubkey::find_program_address(&[b"collection", routing_manager.as_ref()], &ID).0 +pub fn organization_collection_key(routing_manager: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[b"collection", routing_manager.as_ref()], + &helium_anchor_gen::iot_routing_manager::ID, + ) + .0 } -pub fn routing_manager_collection_metadata_key(collection: &Pubkey) -> Pubkey { +pub fn organization_collection_metadata_key(collection: &Pubkey) -> Pubkey { Pubkey::find_program_address( &[ b"metadata", @@ -74,7 +80,7 @@ pub fn routing_manager_collection_metadata_key(collection: &Pubkey) -> Pubkey { .0 } -pub fn routing_manager_collection_master_edition_key(collection: &Pubkey) -> Pubkey { +pub fn organization_collection_master_edition_key(collection: &Pubkey) -> Pubkey { Pubkey::find_program_address( &[ b"metadata", @@ -87,38 +93,92 @@ pub fn routing_manager_collection_master_edition_key(collection: &Pubkey) -> Pub .0 } +pub fn organization_key_to_asset(dao: &Pubkey, oui: u64) -> Pubkey { + let seed_str = format!("OUI_{}", oui); + let hash = Sha256::digest(seed_str.as_bytes()); + helium_entity_manager::key_to_asset_key_raw(dao, &hash) +} + pub mod organization { use super::*; + use crate::{ client::GetAnchorAccount, error::Error, - programs::{BUBBLEGUM_PROGRAM_ID, SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, + helium_entity_manager, helium_sub_daos, iot_routing_manager, metaplex, + programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, + token::Token, }; - use iot_routing_manager::IotRoutingManagerV0; pub async fn create( client: &C, payer: Pubkey, + net_id_key: Pubkey, authority: Option, - routing_manager_key: Pubkey, + recipient: Option, ) -> Result<(Pubkey, Instruction), Error> { - let routing_manager: IotRoutingManagerV0 = client - .anchor_account(&routing_manager_key) + let dao_key = helium_sub_daos::dao_key(Token::Hnt.mint()); + let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); + + let program_approval_key = + helium_entity_manager::program_approval_key(&dao_key, &iot_routing_manager::ID); + + client + .anchor_account::(&program_approval_key) + .await? + .ok_or_else(|| Error::account_not_found())?; + + let shared_merkle_key = helium_entity_manager::shared_merkle_key(3); + let shared_merkle = client + .anchor_account::(&shared_merkle_key) + .await? + .ok_or_else(|| Error::account_not_found())?; + + let routing_manager_key = routing_manager_key(&sub_dao); + let routing_manager = client + .anchor_account::(&routing_manager_key) + .await? + .ok_or_else(|| Error::account_not_found())?; + + client + .anchor_account::(&net_id_key) .await? .ok_or_else(|| Error::account_not_found())?; let oui = routing_manager.next_oui_id; let organization_key = organization_key(&routing_manager_key, oui); + let collection_key = organization_collection_key(&routing_manager_key); Ok(( organization_key, Instruction { - program_id: ID, + program_id: iot_routing_manager::ID, accounts: iot_routing_manager::accounts::InitializeOrganizationV0 { payer, + program_approval: program_approval_key, + routing_manager: routing_manager_key, + net_id: net_id_key, + iot_mint: Token::Iot.mint().clone(), + payer_iot_account: get_associated_token_address(&payer, Token::Iot.mint()), + iot_price_oracle: Token::Iot.price_key().unwrap().clone(), + authority: authority.unwrap_or(payer.clone()), + bubblegum_signer: metaplex::bubblegum_signer_key(), + shared_merkle: shared_merkle_key, + helium_entity_manager_program: helium_entity_manager::ID, + dao: dao_key, + sub_dao: routing_manager.sub_dao, organization: organization_key, - - bubblegum_program: BUBBLEGUM_PROGRAM_ID, + collection: collection_key, + collection_metadata: organization_collection_metadata_key(&collection_key), + collection_master_edition: organization_collection_master_edition_key( + &collection_key, + ), + entity_creator: helium_entity_manager::entity_creator_key(&dao_key), + key_to_asset: organization_key_to_asset(&dao_key, oui), + tree_authority: metaplex::merkle_tree_authority_key(&shared_merkle.merkle_tree), + recipient: recipient.unwrap_or(payer.clone()), + merkle_tree: shared_merkle.merkle_tree, + bubblegum_program: mpl_bubblegum::ID, token_metadata_program: TOKEN_METADATA_PROGRAM_ID, log_wrapper: SPL_NOOP_PROGRAM_ID, compression_program: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, @@ -130,10 +190,214 @@ pub mod organization { }, )) } + + pub async fn approve( + _client: &C, + authority: Pubkey, + organizaion_key: Pubkey, + net_id_key: Pubkey, + ) -> Result { + Ok(Instruction { + program_id: iot_routing_manager::ID, + accounts: iot_routing_manager::accounts::ApproveOrganizationV0 { + authority, + organization: organizaion_key, + net_id: net_id_key, + system_program: solana_sdk::system_program::ID, + } + .to_account_metas(None), + data: iot_routing_manager::instruction::ApproveOrganizationV0 {}.data(), + }) + } + + // pub async fn update( + // client: &C, + // payer: Pubkey, + // organization: Pubkey, + // ) -> Result<(Pubkey, Instruction), Error> {} } -pub mod orgainization_delegate {} +pub mod orgainization_delegate { + use super::*; -pub mod net_id {} + use crate::{client::GetAnchorAccount, error::Error, iot_routing_manager}; -pub mod devaddr_constraint {} + pub async fn create( + _client: &C, + payer: Pubkey, + delegate: Pubkey, + organization_key: Pubkey, + authority: Option, + ) -> Result<(Pubkey, Instruction), Error> { + let orgainization_delegate_key = organization_delegate_key(&organization_key, &delegate); + + Ok(( + orgainization_delegate_key, + Instruction { + program_id: iot_routing_manager::ID, + accounts: iot_routing_manager::accounts::InitializeOrganizationDelegateV0 { + payer, + authority: authority.unwrap_or(payer.clone()), + delegate, + organization: organization_key, + organization_delegate: orgainization_delegate_key, + system_program: solana_sdk::system_program::ID, + } + .to_account_metas(None), + data: iot_routing_manager::instruction::InitializeOrganizationDelegateV0 {}.data(), + }, + )) + } + + pub async fn remove( + _client: &C, + rent_refund: Pubkey, + delegate: Pubkey, + organization_key: Pubkey, + authority: Option, + ) -> Result { + let orgainization_delegate_key = organization_delegate_key(&organization_key, &delegate); + + Ok(Instruction { + program_id: iot_routing_manager::ID, + accounts: iot_routing_manager::accounts::RemoveOrganizationDelegateV0 { + rent_refund, + authority: authority.unwrap_or(rent_refund.clone()), + organization: organization_key, + organization_delegate: orgainization_delegate_key, + } + .to_account_metas(None), + data: iot_routing_manager::instruction::RemoveOrganizationDelegateV0 {}.data(), + }) + } +} + +pub mod net_id { + use super::*; + + use crate::{ + client::GetAnchorAccount, error::Error, helium_sub_daos, iot_routing_manager, token::Token, + }; + + pub async fn create( + client: &C, + payer: Pubkey, + net_id: u32, + authority: Option, + ) -> Result<(Pubkey, Instruction), Error> { + let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); + let routing_manager_key = routing_manager_key(&sub_dao); + let routing_manager = client + .anchor_account::(&routing_manager_key) + .await? + .ok_or_else(|| Error::account_not_found())?; + + let net_id_key = net_id_key(&routing_manager_key, net_id); + let net_id_exists = client + .anchor_account::(&net_id_key) + .await? + .is_some(); + + if net_id_exists { + return Err(Error::account_exists()); + } + + Ok(( + net_id_key, + Instruction { + program_id: iot_routing_manager::ID, + accounts: iot_routing_manager::accounts::InitializeNetIdV0 { + payer, + routing_manager: routing_manager_key, + net_id_authority: routing_manager.net_id_authority, + authority: authority.unwrap_or(payer.clone()), + net_id: net_id_key, + system_program: solana_sdk::system_program::ID, + } + .to_account_metas(None), + data: iot_routing_manager::instruction::InitializeNetIdV0 { + _args: InitializeNetIdArgsV0 { net_id }, + } + .data(), + }, + )) + } +} + +pub mod devaddr_constraint { + use super::*; + + use crate::{client::GetAnchorAccount, error::Error, iot_routing_manager, token::Token}; + + pub async fn create( + client: &C, + payer: Pubkey, + args: InitializeDevaddrConstraintArgsV0, + organization_key: Pubkey, + authority: Option, + ) -> Result<(Pubkey, Instruction), Error> { + let organization = client + .anchor_account::(&organization_key) + .await? + .ok_or_else(|| Error::account_not_found())?; + + let net_id = client + .anchor_account::(&organization.net_id) + .await? + .ok_or_else(|| Error::account_not_found())?; + + let devaddr_constarint_key = devaddr_constraint_key( + &organization_key, + args.start_addr.unwrap_or(net_id.current_addr_offset), + ); + + Ok(( + devaddr_constarint_key, + Instruction { + program_id: iot_routing_manager::ID, + accounts: iot_routing_manager::accounts::InitializeDevaddrConstraintV0 { + payer, + authority: authority.unwrap_or(payer.clone()), + net_id: organization.net_id, + routing_manager: organization.routing_manager, + organization: organization_key, + iot_mint: Token::Iot.mint().clone(), + payer_iot_account: get_associated_token_address(&payer, Token::Iot.mint()), + iot_price_oracle: Token::Iot.price_key().unwrap().clone(), + devaddr_constraint: devaddr_constarint_key, + token_program: anchor_spl::token::ID, + system_program: solana_sdk::system_program::ID, + } + .to_account_metas(None), + data: iot_routing_manager::instruction::InitializeDevaddrConstraintV0 { + _args: args, + } + .data(), + }, + )) + } + + pub async fn remove( + client: &C, + rent_refund: Pubkey, + devaddr_constraint_key: Pubkey, + authority: Option, + ) -> Result { + let devaddr_constraint = client + .anchor_account::(&devaddr_constraint_key) + .await? + .ok_or_else(|| Error::account_not_found())?; + + Ok(Instruction { + program_id: iot_routing_manager::ID, + accounts: iot_routing_manager::accounts::RemoveDevaddrConstraintV0 { + rent_refund, + authority: authority.unwrap_or(rent_refund.clone()), + net_id: devaddr_constraint.net_id, + devaddr_constraint: devaddr_constraint_key, + } + .to_account_metas(None), + data: iot_routing_manager::instruction::RemoveDevaddrConstraintV0 {}.data(), + }) + } +} diff --git a/helium-lib/src/lib.rs b/helium-lib/src/lib.rs index ebf33e85..3e693a8b 100644 --- a/helium-lib/src/lib.rs +++ b/helium-lib/src/lib.rs @@ -6,11 +6,15 @@ pub mod boosting; pub mod dao; pub mod dc; pub mod entity_key; +pub mod epoch; pub mod error; +pub mod helium_entity_manager; +pub mod helium_sub_daos; pub mod hotspot; pub mod iot_routing_manager; pub mod keypair; pub mod kta; +pub mod metaplex; pub mod onboarding; pub mod priority_fee; pub mod programs; @@ -21,8 +25,7 @@ pub use anchor_client; pub use anchor_client::solana_client; pub use anchor_spl; pub use helium_anchor_gen::{ - anchor_lang, circuit_breaker, data_credits, helium_entity_manager, helium_sub_daos, - hexboosting, lazy_distributor, + anchor_lang, circuit_breaker, data_credits, hexboosting, lazy_distributor, }; pub use solana_sdk; pub use solana_sdk::bs58; diff --git a/helium-lib/src/metaplex.rs b/helium-lib/src/metaplex.rs new file mode 100644 index 00000000..fc05542b --- /dev/null +++ b/helium-lib/src/metaplex.rs @@ -0,0 +1,36 @@ +use anchor_lang::prelude::*; + +use crate::programs::TOKEN_METADATA_PROGRAM_ID; + +pub fn bubblegum_signer_key() -> Pubkey { + Pubkey::find_program_address(&[b"collection_cpi"], &mpl_bubblegum::ID).0 +} + +pub fn collection_metadata_key(collection_key: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[ + b"metadata", + TOKEN_METADATA_PROGRAM_ID.as_ref(), + collection_key.as_ref(), + ], + &TOKEN_METADATA_PROGRAM_ID, + ) + .0 +} + +pub fn collection_master_edition_key(collection_key: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[ + b"metadata", + TOKEN_METADATA_PROGRAM_ID.as_ref(), + collection_key.as_ref(), + b"edition", + ], + &TOKEN_METADATA_PROGRAM_ID, + ) + .0 +} + +pub fn merkle_tree_authority_key(merkle_tree: &Pubkey) -> Pubkey { + Pubkey::find_program_address(&[merkle_tree.as_ref()], &mpl_bubblegum::ID).0 +} diff --git a/helium-lib/src/programs.rs b/helium-lib/src/programs.rs index 66f8c8a5..521bdf72 100644 --- a/helium-lib/src/programs.rs +++ b/helium-lib/src/programs.rs @@ -1,7 +1,5 @@ use crate::keypair::{pubkey, Pubkey}; -pub const BUBBLEGUM_PROGRAM_ID: Pubkey = pubkey!("BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY"); - pub const TOKEN_METADATA_PROGRAM_ID: Pubkey = pubkey!("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"); diff --git a/helium-lib/src/reward.rs b/helium-lib/src/reward.rs index 3c648cca..91b9de54 100644 --- a/helium-lib/src/reward.rs +++ b/helium-lib/src/reward.rs @@ -37,7 +37,8 @@ pub async fn lazy_distributor( ) -> Result { client .anchor_account::(&subdao.lazy_distributor()) - .await + .await? + .ok_or_else(|| Error::account_not_found()) } pub fn lazy_distributor_circuit_breaker( @@ -327,7 +328,7 @@ pub mod recipient { kta: &helium_entity_manager::KeyToAssetV0, ) -> Result, Error> { let recipient_key = subdao.receipient_key_from_kta(kta); - Ok(client.anchor_account(&recipient_key).await.ok()) + Ok(client.anchor_account(&recipient_key).await?) } pub async fn init + AsRef>( From 74c9d3406fc8be6e59e7bb0fead34514557fbf42 Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 4 Nov 2024 10:14:18 -0600 Subject: [PATCH 18/49] added update org --- helium-lib/src/hotspot/info.rs | 2 +- helium-lib/src/iot_routing_manager.rs | 30 +++++++++++++++++---------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/helium-lib/src/hotspot/info.rs b/helium-lib/src/hotspot/info.rs index 14c46ea1..4601b02d 100644 --- a/helium-lib/src/hotspot/info.rs +++ b/helium-lib/src/hotspot/info.rs @@ -6,7 +6,7 @@ use crate::{ client::{GetAnchorAccount, SolanaRpcClient}, dao::SubDao, entity_key::AsEntityKey, - error::Error, + error::{DecodeError, Error}, helium_entity_manager::{ self, instruction::{ diff --git a/helium-lib/src/iot_routing_manager.rs b/helium-lib/src/iot_routing_manager.rs index 722c842d..20363b22 100644 --- a/helium-lib/src/iot_routing_manager.rs +++ b/helium-lib/src/iot_routing_manager.rs @@ -210,11 +210,22 @@ pub mod organization { }) } - // pub async fn update( - // client: &C, - // payer: Pubkey, - // organization: Pubkey, - // ) -> Result<(Pubkey, Instruction), Error> {} + pub async fn update( + _client: &C, + authority: Pubkey, + organization_key: Pubkey, + args: UpdateOrganizationArgsV0, + ) -> Result { + Ok(Instruction { + program_id: iot_routing_manager::ID, + accounts: iot_routing_manager::accounts::UpdateOrganizationV0 { + authority, + organization: organization_key, + } + .to_account_metas(None), + data: iot_routing_manager::instruction::UpdateOrganizationV0 { _args: args }.data(), + }) + } } pub mod orgainization_delegate { @@ -282,7 +293,7 @@ pub mod net_id { pub async fn create( client: &C, payer: Pubkey, - net_id: u32, + args: InitializeNetIdArgsV0, authority: Option, ) -> Result<(Pubkey, Instruction), Error> { let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); @@ -292,7 +303,7 @@ pub mod net_id { .await? .ok_or_else(|| Error::account_not_found())?; - let net_id_key = net_id_key(&routing_manager_key, net_id); + let net_id_key = net_id_key(&routing_manager_key, args.net_id); let net_id_exists = client .anchor_account::(&net_id_key) .await? @@ -315,10 +326,7 @@ pub mod net_id { system_program: solana_sdk::system_program::ID, } .to_account_metas(None), - data: iot_routing_manager::instruction::InitializeNetIdV0 { - _args: InitializeNetIdArgsV0 { net_id }, - } - .data(), + data: iot_routing_manager::instruction::InitializeNetIdV0 { _args: args }.data(), }, )) } From 381423aee6ccfec11cafb016a17bd55e82a9180e Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 4 Nov 2024 13:39:10 -0600 Subject: [PATCH 19/49] move config key to hem --- helium-lib/src/dao.rs | 30 +++++-------------- helium-lib/src/helium_entity_manager.rs | 40 +++++++++++++++++-------- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/helium-lib/src/dao.rs b/helium-lib/src/dao.rs index bd8ee8f7..aa08b549 100644 --- a/helium-lib/src/dao.rs +++ b/helium-lib/src/dao.rs @@ -2,7 +2,6 @@ use crate::{ data_credits, entity_key::AsEntityKey, helium_entity_manager, helium_sub_daos, keypair::Pubkey, lazy_distributor, metaplex, token::Token, }; -use chrono::Timelike; use sha2::{Digest, Sha256}; #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize)] @@ -180,29 +179,16 @@ impl SubDao { } pub fn config_key(&self) -> Pubkey { - let prefix = match self { - Self::Iot => "iot_config", - Self::Mobile => "mobile_config", - }; - let (key, _) = Pubkey::find_program_address( - &[prefix.as_bytes(), self.key().as_ref()], - &helium_entity_manager::id(), - ); - key + let sub_dao = self.key(); + match self { + Self::Iot => helium_entity_manager::iot_config_key(&sub_dao), + Self::Mobile => helium_entity_manager::mobile_config_key(&sub_dao), + } } pub fn epoch_info_key(&self) -> Pubkey { - const EPOCH_LENGTH: u32 = 60 * 60 * 24; - let epoch = chrono::Utc::now().second() / EPOCH_LENGTH; - - let (key, _) = Pubkey::find_program_address( - &[ - "sub_dao_epoch_info".as_bytes(), - self.key().as_ref(), - &epoch.to_le_bytes(), - ], - &helium_sub_daos::ID, - ); - key + let sub_dao = self.key(); + let unix_time = chrono::Utc::now().timestamp() as u64; + helium_sub_daos::sub_dao_epoch_info_key(&sub_dao, unix_time) } } diff --git a/helium-lib/src/helium_entity_manager.rs b/helium-lib/src/helium_entity_manager.rs index 5cca5cb5..3452d17d 100644 --- a/helium-lib/src/helium_entity_manager.rs +++ b/helium-lib/src/helium_entity_manager.rs @@ -6,7 +6,7 @@ pub use helium_anchor_gen::helium_entity_manager::*; pub fn shared_merkle_key(proof_size: u8) -> Pubkey { Pubkey::find_program_address( &[b"shared_merkle", &[proof_size]], - &helium_anchor_gen::helium_entity_manager::id(), + &helium_anchor_gen::helium_entity_manager::ID, ) .0 } @@ -14,7 +14,7 @@ pub fn shared_merkle_key(proof_size: u8) -> Pubkey { pub fn entity_creator_key(dao: &Pubkey) -> Pubkey { Pubkey::find_program_address( &[b"entity_creator", dao.as_ref()], - &helium_anchor_gen::helium_entity_manager::id(), + &helium_anchor_gen::helium_entity_manager::ID, ) .0 } @@ -26,7 +26,7 @@ pub fn rewardable_entity_config_key(sub_dao: &Pubkey, symbol: &str) -> Pubkey { sub_dao.as_ref(), symbol.as_bytes(), ], - &helium_anchor_gen::helium_entity_manager::id(), + &helium_anchor_gen::helium_entity_manager::ID, ) .0 } @@ -34,7 +34,7 @@ pub fn rewardable_entity_config_key(sub_dao: &Pubkey, symbol: &str) -> Pubkey { pub fn hotspot_collection_key(maker_or_data_only: &Pubkey) -> Pubkey { Pubkey::find_program_address( &[b"collection", maker_or_data_only.as_ref()], - &helium_anchor_gen::helium_entity_manager::id(), + &helium_anchor_gen::helium_entity_manager::ID, ) .0 } @@ -42,7 +42,7 @@ pub fn hotspot_collection_key(maker_or_data_only: &Pubkey) -> Pubkey { pub fn data_only_config_key(dao: &Pubkey) -> Pubkey { Pubkey::find_program_address( &[b"data_only_config", dao.as_ref()], - &helium_anchor_gen::helium_entity_manager::id(), + &helium_anchor_gen::helium_entity_manager::ID, ) .0 } @@ -50,7 +50,7 @@ pub fn data_only_config_key(dao: &Pubkey) -> Pubkey { pub fn data_only_escrow_key(data_only: &Pubkey) -> Pubkey { Pubkey::find_program_address( &[b"data_only_escrow", data_only.as_ref()], - &helium_anchor_gen::helium_entity_manager::id(), + &helium_anchor_gen::helium_entity_manager::ID, ) .0 } @@ -58,7 +58,7 @@ pub fn data_only_escrow_key(data_only: &Pubkey) -> Pubkey { pub fn maker_key(dao: &Pubkey, name: &str) -> Pubkey { Pubkey::find_program_address( &[b"maker", dao.as_ref(), name.as_bytes()], - &helium_anchor_gen::helium_entity_manager::id(), + &helium_anchor_gen::helium_entity_manager::ID, ) .0 } @@ -66,7 +66,7 @@ pub fn maker_key(dao: &Pubkey, name: &str) -> Pubkey { pub fn program_approval_key(dao: &Pubkey, program: &Pubkey) -> Pubkey { Pubkey::find_program_address( &[b"program_approval", dao.as_ref(), program.as_ref()], - &helium_anchor_gen::helium_entity_manager::id(), + &helium_anchor_gen::helium_entity_manager::ID, ) .0 } @@ -78,7 +78,7 @@ pub fn maker_approval_key(rewardable_entity_config: &Pubkey, maker: &Pubkey) -> rewardable_entity_config.as_ref(), maker.as_ref(), ], - &helium_anchor_gen::helium_entity_manager::id(), + &helium_anchor_gen::helium_entity_manager::ID, ) .0 } @@ -86,7 +86,15 @@ pub fn maker_approval_key(rewardable_entity_config: &Pubkey, maker: &Pubkey) -> pub fn key_to_asset_key_raw(dao: &Pubkey, hashed_entity_key: &[u8]) -> Pubkey { Pubkey::find_program_address( &[b"key_to_asset", dao.as_ref(), hashed_entity_key], - &helium_anchor_gen::helium_entity_manager::id(), + &helium_anchor_gen::helium_entity_manager::ID, + ) + .0 +} + +pub fn iot_config_key(sub_dao: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[b"iot_config", sub_dao.as_ref()], + &helium_anchor_gen::helium_entity_manager::ID, ) .0 } @@ -95,7 +103,15 @@ pub fn iot_info_key(rewardable_entity_config: &Pubkey, entity_key: &[u8]) -> Pub let hash = Sha256::digest(entity_key); Pubkey::find_program_address( &[b"iot_info", rewardable_entity_config.as_ref(), &hash], - &helium_anchor_gen::helium_entity_manager::id(), + &helium_anchor_gen::helium_entity_manager::ID, + ) + .0 +} + +pub fn mobile_config_key(sub_dao: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[b"mobile_config", sub_dao.as_ref()], + &helium_anchor_gen::helium_entity_manager::ID, ) .0 } @@ -104,7 +120,7 @@ pub fn mobile_info_key(rewardable_entity_config: &Pubkey, entity_key: &[u8]) -> let hash = Sha256::digest(entity_key); Pubkey::find_program_address( &[b"mobile_info", rewardable_entity_config.as_ref(), &hash], - &helium_anchor_gen::helium_entity_manager::id(), + &helium_anchor_gen::helium_entity_manager::ID, ) .0 } From 1e6ee0676728eb6cbab8840c219fa6afbcbecd51 Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 4 Nov 2024 14:07:14 -0600 Subject: [PATCH 20/49] Us as_ref for solana client --- helium-lib/src/iot_routing_manager.rs | 41 +++++++++++++++++++-------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/helium-lib/src/iot_routing_manager.rs b/helium-lib/src/iot_routing_manager.rs index 20363b22..6ddb98c8 100644 --- a/helium-lib/src/iot_routing_manager.rs +++ b/helium-lib/src/iot_routing_manager.rs @@ -103,14 +103,14 @@ pub mod organization { use super::*; use crate::{ - client::GetAnchorAccount, + client::{GetAnchorAccount, SolanaRpcClient}, error::Error, helium_entity_manager, helium_sub_daos, iot_routing_manager, metaplex, programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, token::Token, }; - pub async fn create( + pub async fn create>( client: &C, payer: Pubkey, net_id_key: Pubkey, @@ -124,23 +124,27 @@ pub mod organization { helium_entity_manager::program_approval_key(&dao_key, &iot_routing_manager::ID); client + .as_ref() .anchor_account::(&program_approval_key) .await? .ok_or_else(|| Error::account_not_found())?; let shared_merkle_key = helium_entity_manager::shared_merkle_key(3); let shared_merkle = client + .as_ref() .anchor_account::(&shared_merkle_key) .await? .ok_or_else(|| Error::account_not_found())?; let routing_manager_key = routing_manager_key(&sub_dao); let routing_manager = client + .as_ref() .anchor_account::(&routing_manager_key) .await? .ok_or_else(|| Error::account_not_found())?; client + .as_ref() .anchor_account::(&net_id_key) .await? .ok_or_else(|| Error::account_not_found())?; @@ -191,7 +195,7 @@ pub mod organization { )) } - pub async fn approve( + pub async fn approve>( _client: &C, authority: Pubkey, organizaion_key: Pubkey, @@ -210,7 +214,7 @@ pub mod organization { }) } - pub async fn update( + pub async fn update>( _client: &C, authority: Pubkey, organization_key: Pubkey, @@ -231,9 +235,9 @@ pub mod organization { pub mod orgainization_delegate { use super::*; - use crate::{client::GetAnchorAccount, error::Error, iot_routing_manager}; + use crate::{client::SolanaRpcClient, error::Error, iot_routing_manager}; - pub async fn create( + pub async fn create>( _client: &C, payer: Pubkey, delegate: Pubkey, @@ -260,7 +264,7 @@ pub mod orgainization_delegate { )) } - pub async fn remove( + pub async fn remove>( _client: &C, rent_refund: Pubkey, delegate: Pubkey, @@ -287,10 +291,13 @@ pub mod net_id { use super::*; use crate::{ - client::GetAnchorAccount, error::Error, helium_sub_daos, iot_routing_manager, token::Token, + client::{GetAnchorAccount, SolanaRpcClient}, + error::Error, + helium_sub_daos, iot_routing_manager, + token::Token, }; - pub async fn create( + pub async fn create>( client: &C, payer: Pubkey, args: InitializeNetIdArgsV0, @@ -299,12 +306,14 @@ pub mod net_id { let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); let routing_manager_key = routing_manager_key(&sub_dao); let routing_manager = client + .as_ref() .anchor_account::(&routing_manager_key) .await? .ok_or_else(|| Error::account_not_found())?; let net_id_key = net_id_key(&routing_manager_key, args.net_id); let net_id_exists = client + .as_ref() .anchor_account::(&net_id_key) .await? .is_some(); @@ -335,9 +344,14 @@ pub mod net_id { pub mod devaddr_constraint { use super::*; - use crate::{client::GetAnchorAccount, error::Error, iot_routing_manager, token::Token}; + use crate::{ + client::{GetAnchorAccount, SolanaRpcClient}, + error::Error, + iot_routing_manager, + token::Token, + }; - pub async fn create( + pub async fn create>( client: &C, payer: Pubkey, args: InitializeDevaddrConstraintArgsV0, @@ -345,11 +359,13 @@ pub mod devaddr_constraint { authority: Option, ) -> Result<(Pubkey, Instruction), Error> { let organization = client + .as_ref() .anchor_account::(&organization_key) .await? .ok_or_else(|| Error::account_not_found())?; let net_id = client + .as_ref() .anchor_account::(&organization.net_id) .await? .ok_or_else(|| Error::account_not_found())?; @@ -385,13 +401,14 @@ pub mod devaddr_constraint { )) } - pub async fn remove( + pub async fn remove>( client: &C, rent_refund: Pubkey, devaddr_constraint_key: Pubkey, authority: Option, ) -> Result { let devaddr_constraint = client + .as_ref() .anchor_account::(&devaddr_constraint_key) .await? .ok_or_else(|| Error::account_not_found())?; From 3f245d416bad3bf1fb0db17f15b7517a68de89ff Mon Sep 17 00:00:00 2001 From: bry Date: Tue, 5 Nov 2024 16:00:20 -0600 Subject: [PATCH 21/49] added send instructions and restructured sol transaction utils --- Cargo.lock | 54 ++++- Cargo.toml | 1 + helium-lib/Cargo.toml | 2 + helium-lib/src/asset.rs | 7 +- helium-lib/src/client.rs | 133 +++++++++++- helium-lib/src/dc.rs | 2 +- helium-lib/src/epoch.rs | 5 - helium-lib/src/error.rs | 6 + helium-lib/src/helium_sub_daos.rs | 2 +- helium-lib/src/hotspot/dataonly.rs | 12 +- helium-lib/src/hotspot/mod.rs | 29 +-- helium-lib/src/iot_routing_manager.rs | 2 +- helium-lib/src/lib.rs | 4 +- helium-lib/src/priority_fee.rs | 90 --------- helium-lib/src/reward.rs | 19 +- .../src/solana_transaction_utils/mod.rs | 3 + .../src/solana_transaction_utils/pack.rs | 49 +++++ .../solana_transaction_utils/priority_fee.rs | 190 ++++++++++++++++++ .../src/solana_transaction_utils/queue.rs | 140 +++++++++++++ helium-lib/src/utils.rs | 21 ++ helium-wallet/Cargo.toml | 2 +- 21 files changed, 634 insertions(+), 139 deletions(-) delete mode 100644 helium-lib/src/epoch.rs delete mode 100644 helium-lib/src/priority_fee.rs create mode 100644 helium-lib/src/solana_transaction_utils/mod.rs create mode 100644 helium-lib/src/solana_transaction_utils/pack.rs create mode 100644 helium-lib/src/solana_transaction_utils/priority_fee.rs create mode 100644 helium-lib/src/solana_transaction_utils/queue.rs create mode 100644 helium-lib/src/utils.rs diff --git a/Cargo.lock b/Cargo.lock index 93074c7f..e58d5224 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -972,7 +972,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" dependencies = [ "borsh-derive 0.10.3", - "hashbrown 0.12.3", + "hashbrown 0.13.2", ] [[package]] @@ -1852,6 +1852,27 @@ dependencies = [ "subtle", ] +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "displaydoc" version = "0.2.5" @@ -2479,6 +2500,7 @@ dependencies = [ "bincode", "chrono", "clap 4.5.4", + "dirs", "futures", "h3o", "helium-anchor-gen", @@ -2504,6 +2526,7 @@ dependencies = [ "spl-account-compression", "spl-associated-token-account 3.0.2", "thiserror", + "tokio", "tonic", "tracing", "url", @@ -3015,6 +3038,16 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", +] + [[package]] name = "libsecp256k1" version = "0.6.0" @@ -3459,7 +3492,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 2.0.58", @@ -3507,6 +3540,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "os_str_bytes" version = "6.6.1" @@ -4156,6 +4195,17 @@ dependencies = [ "bitflags 2.5.0", ] +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror", +] + [[package]] name = "regex" version = "1.10.4" diff --git a/Cargo.toml b/Cargo.toml index ea07cb51..2abfa4ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,7 @@ helium-proto = { git = "https://github.com/helium/proto", branch = "master", fea "services", ] } clap = { version = "4", features = ["derive"] } +tokio = {version = "1.0", features = ["full"]} [patch.'https://github.com/helium/helium-anchor-gen.git'] helium-anchor-gen = { path = "../helium-anchor-gen" } diff --git a/helium-lib/Cargo.toml b/helium-lib/Cargo.toml index 54d79986..cce346ed 100644 --- a/helium-lib/Cargo.toml +++ b/helium-lib/Cargo.toml @@ -47,6 +47,8 @@ angry-purple-tiger = "0" sha2 = {workspace = true} clap = {workspace = true, optional = true} helium-mnemonic = { path = "../helium-mnemonic", optional = true } +tokio = {workspace = true} +dirs = "5.0.1" [dev-dependencies] rand = "0.8" \ No newline at end of file diff --git a/helium-lib/src/asset.rs b/helium-lib/src/asset.rs index bd540e13..517a0b0c 100644 --- a/helium-lib/src/asset.rs +++ b/helium-lib/src/asset.rs @@ -1,3 +1,7 @@ +use itertools::Itertools; +use serde::{Deserialize, Serialize}; +use std::{collections::HashMap, result::Result as StdResult, str::FromStr}; + use crate::{ bs58, client::{DasClient, DasSearchAssetsParams, SolanaRpcClient}, @@ -9,9 +13,6 @@ use crate::{ kta, solana_sdk::instruction::AccountMeta, }; -use itertools::Itertools; -use serde::{Deserialize, Serialize}; -use std::{collections::HashMap, result::Result as StdResult, str::FromStr}; pub async fn for_entity_key>( client: &C, diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index 9c32190c..3277f8c3 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -1,16 +1,33 @@ +use futures::{stream, StreamExt, TryStreamExt}; +use itertools::Itertools; +use jsonrpc_client::{JsonRpcError, SendRequest}; +use solana_sdk::{ + commitment_config::CommitmentConfig, + instruction::Instruction, + message::Message, + signature::{Keypair, Signer}, +}; +use std::{marker::Send, sync::Arc}; +use tracing::instrument; + use crate::{ anchor_lang::AccountDeserialize, asset, error::{DecodeError, Error}, is_zero, keypair::{self, Pubkey}, - solana_client, + solana_client::{ + self, + nonblocking::tpu_client::TpuClient, + send_and_confirm_transactions_in_parallel::{ + send_and_confirm_transactions_in_parallel, SendAndConfirmConfig, + }, + tpu_client::TpuClientConfig, + }, + solana_transaction_utils::{ + pack::pack_instructions_into_transactions, priority_fee::auto_compute_limit_and_price, + }, }; -use futures::{stream, StreamExt, TryStreamExt}; -use itertools::Itertools; -use jsonrpc_client::{JsonRpcError, SendRequest}; -use std::{marker::Send, sync::Arc}; -use tracing::instrument; pub static ONBOARDING_URL_MAINNET: &str = "https://onboarding.dewi.org/api/v3"; pub static ONBOARDING_URL_DEVNET: &str = "https://onboarding.web.test-helium.com/api/v3"; @@ -101,6 +118,110 @@ impl GetAnchorAccount for Client { } } +#[async_trait::async_trait] +pub trait SolanaRpcClientExt { + async fn send_instructions( + &self, + ixs: Vec, + wallet: Keypair, + extra_signers: &[Keypair], + sequentially: bool, + ) -> Result<(), Error>; + + fn ws_url(&self) -> String; +} + +#[async_trait::async_trait] +impl SolanaRpcClientExt for Client { + fn ws_url(&self) -> String { + self.solana_client + .url() + .replace("https", "wss") + .replace("http", "ws") + .replace("127.0.0.1:8899", "127.0.0.1:8900") + } + + async fn send_instructions( + &self, + ixs: Vec, + wallet: Keypair, + extra_signers: &[Keypair], + sequentially: bool, + ) -> Result<(), Error> { + let (blockhash, _) = self + .solana_client + .get_latest_blockhash_with_commitment(CommitmentConfig::finalized()) + .await + .expect("Failed to get latest blockhash"); + + let txs = pack_instructions_into_transactions(vec![ixs], &wallet); + let mut with_auto_compute: Vec = Vec::new(); + let keys: Vec<&dyn Signer> = std::iter::once(&wallet as &dyn Signer) + .chain(extra_signers.iter().map(|k| k as &dyn Signer)) + .collect(); + + for (tx, _) in &txs { + // This is just a tx with compute ixs. Skip it + if tx.len() == 2 { + continue; + } + + let computed = auto_compute_limit_and_price( + &self.solana_client, + tx.clone(), + &keys, + 1.2, + Some(&wallet.pubkey()), + Some(blockhash), + ) + .await + .unwrap(); + + with_auto_compute.push(Message::new(&computed, Some(&wallet.pubkey()))); + } + + if with_auto_compute.is_empty() { + return Ok(()); + } + + let results; + let tpu_client = TpuClient::new( + "helium-lib", + self.solana_client.clone(), + &self.ws_url(), + TpuClientConfig::default(), + ) + .await?; + + match sequentially { + true => { + results = tpu_client + .send_and_confirm_messages_with_spinner(&with_auto_compute, &keys) + .await?; + } + false => { + results = send_and_confirm_transactions_in_parallel( + self.solana_client, + Some(tpu_client), + &with_auto_compute, + &keys, + SendAndConfirmConfig { + with_spinner: true, + resign_txs_count: Some(5), + }, + ) + .await?; + } + } + + if let Some(err) = results.into_iter().flatten().next() { + return Err(Error::from(err)); + } + + Ok(()) + } +} + impl TryFrom<&str> for Client { type Error = Error; fn try_from(value: &str) -> Result { diff --git a/helium-lib/src/dc.rs b/helium-lib/src/dc.rs index 5091ed30..6de81927 100644 --- a/helium-lib/src/dc.rs +++ b/helium-lib/src/dc.rs @@ -12,8 +12,8 @@ use crate::{ data_credits, error::{DecodeError, Error}, keypair::{Keypair, Pubkey}, - priority_fee, solana_sdk::{instruction::Instruction, signer::Signer, transaction::Transaction}, + solana_transaction_utils::priority_fee, token::{Token, TokenAmount}, }; diff --git a/helium-lib/src/epoch.rs b/helium-lib/src/epoch.rs deleted file mode 100644 index bed80cd4..00000000 --- a/helium-lib/src/epoch.rs +++ /dev/null @@ -1,5 +0,0 @@ -const EPOCH_LENGTH: u64 = 60 * 60 * 24; - -pub fn get_current_epoch(unix_time: u64) -> u64 { - unix_time / EPOCH_LENGTH -} diff --git a/helium-lib/src/error.rs b/helium-lib/src/error.rs index e520f55c..75008571 100644 --- a/helium-lib/src/error.rs +++ b/helium-lib/src/error.rs @@ -31,6 +31,12 @@ pub enum Error { Program(#[from] solana_program::program_error::ProgramError), #[error("solana: {0}")] Solana(Box), + #[error("solana transaction: {0}")] + SolanaTransaction(#[from] solana_sdk::transaction::TransactionError), + #[error("solana pubsub: {0}")] + SolanaPubsub(#[from] solana_client::pubsub_client::PubsubClientError), + #[error("tpu sender: {0}")] + TPUSender(#[from] solana_client::tpu_client::TpuSenderError), #[error("signing: {0}")] Signing(#[from] solana_sdk::signer::SignerError), #[error("crypto: {0}")] diff --git a/helium-lib/src/helium_sub_daos.rs b/helium-lib/src/helium_sub_daos.rs index 142c645b..665e3cb7 100644 --- a/helium-lib/src/helium_sub_daos.rs +++ b/helium-lib/src/helium_sub_daos.rs @@ -1,6 +1,6 @@ use anchor_lang::prelude::*; -use crate::epoch::get_current_epoch; +use crate::utils::get_current_epoch; pub use helium_anchor_gen::helium_sub_daos::*; diff --git a/helium-lib/src/hotspot/dataonly.rs b/helium-lib/src/hotspot/dataonly.rs index 8a8684be..69cd132f 100644 --- a/helium-lib/src/hotspot/dataonly.rs +++ b/helium-lib/src/hotspot/dataonly.rs @@ -1,3 +1,8 @@ +use anchor_client::solana_client::rpc_client::SerializableTransaction; +use helium_crypto::{PublicKey, Sign}; +use helium_proto::{BlockchainTxn, BlockchainTxnAddGatewayV1, Message, Txn}; +use serde::{Deserialize, Serialize}; + use crate::{ anchor_lang::{InstructionData, ToAccountMetas}, asset, b64, @@ -9,17 +14,14 @@ use crate::{ helium_entity_manager, helium_sub_daos, hotspot, hotspot::{HotspotInfoUpdate, ECC_VERIFIER}, keypair::{Keypair, Pubkey}, - kta, priority_fee, + kta, programs::{ SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID, TOKEN_METADATA_PROGRAM_ID, }, solana_sdk::{instruction::Instruction, signature::Signer, transaction::Transaction}, + solana_transaction_utils::priority_fee, token::Token, }; -use anchor_client::solana_client::rpc_client::SerializableTransaction; -use helium_crypto::{PublicKey, Sign}; -use helium_proto::{BlockchainTxn, BlockchainTxnAddGatewayV1, Message, Txn}; -use serde::{Deserialize, Serialize}; mod iot { use super::*; diff --git a/helium-lib/src/hotspot/mod.rs b/helium-lib/src/hotspot/mod.rs index 879b2508..a3b66708 100644 --- a/helium-lib/src/hotspot/mod.rs +++ b/helium-lib/src/hotspot/mod.rs @@ -1,3 +1,14 @@ +use angry_purple_tiger::AnimalName; +use chrono::Utc; +use futures::{ + stream::{self, StreamExt, TryStreamExt}, + TryFutureExt, +}; +use itertools::Itertools; +use rust_decimal::prelude::*; +use serde::Serialize; +use std::{collections::HashMap, hash::Hash, str::FromStr}; + use crate::{ anchor_lang::{InstructionData, ToAccountMetas}, anchor_spl, asset, bs58, @@ -8,24 +19,16 @@ use crate::{ helium_entity_manager, is_zero, keypair::{pubkey, serde_pubkey, Keypair, Pubkey}, kta, onboarding, - priority_fee::{self, compute_budget_instruction, compute_price_instruction_for_accounts}, programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, solana_sdk::{ instruction::AccountMeta, instruction::Instruction, signer::Signer, transaction::Transaction, }, + solana_transaction_utils::priority_fee::{ + compute_budget_instruction, compute_price_instruction_for_accounts, + }, token::Token, }; -use angry_purple_tiger::AnimalName; -use chrono::Utc; -use futures::{ - stream::{self, StreamExt, TryStreamExt}, - TryFutureExt, -}; -use itertools::Itertools; -use rust_decimal::prelude::*; -use serde::Serialize; -use std::{collections::HashMap, hash::Hash, str::FromStr}; pub mod dataonly; pub mod info; @@ -171,8 +174,8 @@ pub async fn direct_update + AsRef>( }; let ixs = &[ - priority_fee::compute_budget_instruction(200_000), - priority_fee::compute_price_instruction_for_accounts(client, &accounts).await?, + compute_budget_instruction(200_000), + compute_price_instruction_for_accounts(client, &accounts).await?, update_ix, ]; diff --git a/helium-lib/src/iot_routing_manager.rs b/helium-lib/src/iot_routing_manager.rs index 6ddb98c8..d1967cb9 100644 --- a/helium-lib/src/iot_routing_manager.rs +++ b/helium-lib/src/iot_routing_manager.rs @@ -103,7 +103,7 @@ pub mod organization { use super::*; use crate::{ - client::{GetAnchorAccount, SolanaRpcClient}, + client::{GetAnchorAccount, SolanaRpcClient, SolanaRpcClientExt}, error::Error, helium_entity_manager, helium_sub_daos, iot_routing_manager, metaplex, programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, diff --git a/helium-lib/src/lib.rs b/helium-lib/src/lib.rs index 3e693a8b..850c46fb 100644 --- a/helium-lib/src/lib.rs +++ b/helium-lib/src/lib.rs @@ -6,7 +6,6 @@ pub mod boosting; pub mod dao; pub mod dc; pub mod entity_key; -pub mod epoch; pub mod error; pub mod helium_entity_manager; pub mod helium_sub_daos; @@ -16,10 +15,11 @@ pub mod keypair; pub mod kta; pub mod metaplex; pub mod onboarding; -pub mod priority_fee; pub mod programs; pub mod reward; +pub mod solana_transaction_utils; pub mod token; +pub mod utils; pub use anchor_client; pub use anchor_client::solana_client; diff --git a/helium-lib/src/priority_fee.rs b/helium-lib/src/priority_fee.rs deleted file mode 100644 index 77f99f6d..00000000 --- a/helium-lib/src/priority_fee.rs +++ /dev/null @@ -1,90 +0,0 @@ -use crate::{ - anchor_client::RequestBuilder, anchor_lang::ToAccountMetas, client::SolanaRpcClient, - error::Error, solana_sdk::signer::Signer, -}; -use itertools::Itertools; -use std::ops::Deref; - -pub const MAX_RECENT_PRIORITY_FEE_ACCOUNTS: usize = 128; -pub const MIN_PRIORITY_FEE: u64 = 1; - -pub async fn get_estimate>( - client: &C, - accounts: &impl ToAccountMetas, -) -> Result { - get_estimate_with_min(client, accounts, MIN_PRIORITY_FEE).await -} - -pub async fn get_estimate_with_min>( - client: &C, - accounts: &impl ToAccountMetas, - min_priority_fee: u64, -) -> Result { - let account_keys: Vec<_> = accounts - .to_account_metas(None) - .into_iter() - .filter(|account_meta| account_meta.is_writable) - .map(|x| x.pubkey) - .unique() - .take(MAX_RECENT_PRIORITY_FEE_ACCOUNTS) - .collect(); - let recent_fees = client - .as_ref() - .get_recent_prioritization_fees(&account_keys) - .await?; - let mut max_per_slot = Vec::new(); - for (slot, fees) in &recent_fees.into_iter().group_by(|x| x.slot) { - let Some(maximum) = fees.map(|x| x.prioritization_fee).max() else { - continue; - }; - max_per_slot.push((slot, maximum)); - } - // Only take the most recent 20 maximum fees: - max_per_slot.sort_by(|a, b| a.0.cmp(&b.0).reverse()); - let mut max_per_slot: Vec<_> = max_per_slot.into_iter().take(20).map(|x| x.1).collect(); - max_per_slot.sort(); - // Get the median: - let num_recent_fees = max_per_slot.len(); - let mid = num_recent_fees / 2; - let estimate = if num_recent_fees == 0 { - min_priority_fee - } else if num_recent_fees % 2 == 0 { - // If the number of samples is even, taken the mean of the two median fees - (max_per_slot[mid - 1] + max_per_slot[mid]) / 2 - } else { - max_per_slot[mid] - } - .max(min_priority_fee); - Ok(estimate) -} - -pub trait SetPriorityFees { - fn compute_budget(self, limit: u32) -> Self; - fn compute_price(self, priority_fee: u64) -> Self; -} - -pub fn compute_budget_instruction(compute_limit: u32) -> solana_sdk::instruction::Instruction { - solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit(compute_limit) -} - -pub fn compute_price_instruction(priority_fee: u64) -> solana_sdk::instruction::Instruction { - solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_price(priority_fee) -} - -pub async fn compute_price_instruction_for_accounts>( - client: &C, - accounts: &impl ToAccountMetas, -) -> Result { - let priority_fee = get_estimate(client, accounts).await?; - Ok(compute_price_instruction(priority_fee)) -} - -impl + Clone> SetPriorityFees for RequestBuilder<'_, C> { - fn compute_budget(self, compute_limit: u32) -> Self { - self.instruction(compute_budget_instruction(compute_limit)) - } - - fn compute_price(self, priority_fee: u64) -> Self { - self.instruction(compute_price_instruction(priority_fee)) - } -} diff --git a/helium-lib/src/reward.rs b/helium-lib/src/reward.rs index 91b9de54..88d1458c 100644 --- a/helium-lib/src/reward.rs +++ b/helium-lib/src/reward.rs @@ -1,3 +1,12 @@ +use futures::{ + stream::{self, StreamExt, TryStreamExt}, + TryFutureExt, +}; +use itertools::Itertools; +use serde::{Deserialize, Serialize}; +use solana_sdk::signer::Signer; +use std::collections::HashMap; + use crate::{ anchor_lang::{InstructionData, ToAccountMetas}, asset, circuit_breaker, @@ -9,19 +18,11 @@ use crate::{ keypair::{Keypair, Pubkey}, kta, lazy_distributor::{self, OracleConfigV0}, - priority_fee, programs::SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, solana_sdk::{instruction::Instruction, transaction::Transaction}, + solana_transaction_utils::priority_fee, token::TokenAmount, }; -use futures::{ - stream::{self, StreamExt, TryStreamExt}, - TryFutureExt, -}; -use itertools::Itertools; -use serde::{Deserialize, Serialize}; -use solana_sdk::signer::Signer; -use std::collections::HashMap; #[derive(Debug, Serialize, Clone)] pub struct OracleReward { diff --git a/helium-lib/src/solana_transaction_utils/mod.rs b/helium-lib/src/solana_transaction_utils/mod.rs new file mode 100644 index 00000000..5280151f --- /dev/null +++ b/helium-lib/src/solana_transaction_utils/mod.rs @@ -0,0 +1,3 @@ +pub mod pack; +pub mod priority_fee; +pub mod queue; diff --git a/helium-lib/src/solana_transaction_utils/pack.rs b/helium-lib/src/solana_transaction_utils/pack.rs new file mode 100644 index 00000000..d68959f8 --- /dev/null +++ b/helium-lib/src/solana_transaction_utils/pack.rs @@ -0,0 +1,49 @@ +use solana_sdk::{ + compute_budget::ComputeBudgetInstruction, instruction::Instruction, signature::Keypair, + signer::Signer, transaction::Transaction, +}; + +const MAX_TRANSACTION_SIZE: usize = 1232; // Maximum transaction size in bytes + +// Returns packed txs with the indices in instructions that were used in that tx. +pub fn pack_instructions_into_transactions( + instructions: Vec>, + payer: &Keypair, +) -> Vec<(Vec, Vec)> { + // Change return type + let mut transactions = Vec::new(); + let compute_ixs = vec![ + ComputeBudgetInstruction::set_compute_unit_limit(200000), + ComputeBudgetInstruction::set_compute_unit_price(1), + ]; + let mut curr_instructions: Vec = compute_ixs.clone(); + let mut curr_indices: Vec = Vec::new(); // Track indices of instructions + let mut ix_queue: Vec<(Instruction, usize)> = instructions + .iter() + .enumerate() + .flat_map(|(i, group)| group.iter().map(move |ix| (ix.clone(), i))) + .collect(); + ix_queue.reverse(); + + while let Some((ix, index)) = ix_queue.pop() { + curr_instructions.push(ix); + curr_indices.push(index); + let tx = Transaction::new_with_payer(&curr_instructions, Some(&payer.pubkey())); + let len = bincode::serialize(&tx).unwrap().len(); + if len > MAX_TRANSACTION_SIZE { + ix_queue.push(( + curr_instructions.pop().unwrap(), + curr_indices.pop().unwrap(), + )); + transactions.push((curr_instructions.clone(), curr_indices.clone())); + curr_instructions = compute_ixs.clone(); + curr_indices.clear(); + } + } + + if !curr_instructions.is_empty() { + transactions.push((curr_instructions.clone(), curr_indices.clone())); + } + + transactions +} diff --git a/helium-lib/src/solana_transaction_utils/priority_fee.rs b/helium-lib/src/solana_transaction_utils/priority_fee.rs new file mode 100644 index 00000000..a465ed58 --- /dev/null +++ b/helium-lib/src/solana_transaction_utils/priority_fee.rs @@ -0,0 +1,190 @@ +use anchor_lang::prelude::AccountMeta; +use itertools::Itertools; +use solana_sdk::{ + instruction::Instruction, message::Message, pubkey::Pubkey, signers::Signers, + transaction::Transaction, +}; +use std::ops::Deref; + +use crate::{ + anchor_client::RequestBuilder, anchor_lang::ToAccountMetas, client::SolanaRpcClient, + error::Error, solana_sdk::signer::Signer, utils::replace_or_insert_instruction, +}; + +pub const MAX_RECENT_PRIORITY_FEE_ACCOUNTS: usize = 128; +pub const MIN_PRIORITY_FEE: u64 = 1; + +pub async fn get_estimate>( + client: &C, + accounts: &impl ToAccountMetas, +) -> Result { + get_estimate_with_min(client, accounts, MIN_PRIORITY_FEE).await +} + +pub async fn get_estimate_with_min>( + client: &C, + accounts: &impl ToAccountMetas, + min_priority_fee: u64, +) -> Result { + let account_keys: Vec<_> = accounts + .to_account_metas(None) + .into_iter() + .filter(|account_meta| account_meta.is_writable) + .map(|x| x.pubkey) + .unique() + .take(MAX_RECENT_PRIORITY_FEE_ACCOUNTS) + .collect(); + + let recent_fees = client + .as_ref() + .get_recent_prioritization_fees(&account_keys) + .await?; + + let mut max_per_slot: Vec<_> = recent_fees + .into_iter() + .group_by(|x| x.slot) + .into_iter() + .filter_map(|(slot, fees)| { + fees.map(|x| x.prioritization_fee) + .max() + .map(|max_fee| (slot, max_fee)) + }) + .collect(); + + // Only take the most recent 20 maximum fees: + max_per_slot.sort_unstable_by(|a, b| b.0.cmp(&a.0)); + let mut max_fees: Vec<_> = max_per_slot + .into_iter() + .take(20) + .map(|(_, fee)| fee) + .collect(); + max_fees.sort(); + + // Calculate the median fee + let estimate = match max_fees.len() { + 0 => min_priority_fee, + len if len % 2 == 0 => (max_fees[len / 2 - 1] + max_fees[len / 2]) / 2, + len => max_fees[len / 2], + } + .max(min_priority_fee); + + Ok(estimate) +} + +pub trait SetPriorityFees { + fn compute_budget(self, limit: u32) -> Self; + fn compute_price(self, priority_fee: u64) -> Self; +} + +pub fn compute_budget_instruction(compute_limit: u32) -> solana_sdk::instruction::Instruction { + solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit(compute_limit) +} + +pub fn compute_price_instruction(priority_fee: u64) -> solana_sdk::instruction::Instruction { + solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_price(priority_fee) +} + +pub async fn compute_price_instruction_for_accounts>( + client: &C, + accounts: &impl ToAccountMetas, +) -> Result { + let priority_fee = get_estimate(client, accounts).await?; + Ok(compute_price_instruction(priority_fee)) +} + +impl + Clone> SetPriorityFees for RequestBuilder<'_, C> { + fn compute_budget(self, compute_limit: u32) -> Self { + self.instruction(compute_budget_instruction(compute_limit)) + } + + fn compute_price(self, priority_fee: u64) -> Self { + self.instruction(compute_price_instruction(priority_fee)) + } +} + +pub async fn compute_budget_for_instructions, T: Signers + ?Sized>( + client: &C, + instructions: Vec, + signers: &T, + compute_multiplier: f32, + payer: Option<&Pubkey>, + blockhash: Option, +) -> Result { + // Check for existing compute unit limit instruction and replace it if found + let mut updated_instructions = instructions.clone(); + for ix in &mut updated_instructions { + if ix.program_id == solana_sdk::compute_budget::id() + && ix.data.first() + == solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit(0) + .data + .first() + { + ix.data = solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit( + 1900000, + ) + .data; // Replace limit + } + } + + let blockhash_actual = match blockhash { + Some(hash) => hash, + None => client.as_ref().get_latest_blockhash().await?, + }; + + let snub_tx = Transaction::new( + signers, + Message::new(&updated_instructions, payer), + blockhash_actual, + ); + + // Simulate the transaction to get the actual compute used + let simulation_result = client.as_ref().simulate_transaction(&snub_tx).await?; + if let Some(err) = simulation_result.value.err { + println!("Error: {}", err); + if let Some(logs) = simulation_result.value.logs { + for log in logs { + println!("Log: {}", log); + } + } + } + + let actual_compute_used = simulation_result.value.units_consumed.unwrap_or(200000); + let final_compute_budget = (actual_compute_used as f32 * compute_multiplier) as u32; + Ok(compute_budget_instruction(final_compute_budget)) +} + +pub async fn auto_compute_limit_and_price, T: Signers + ?Sized>( + client: &C, + instructions: Vec, + signers: &T, + compute_multiplier: f32, + payer: Option<&Pubkey>, + blockhash: Option, +) -> Result, Error> { + let mut updated_instructions = instructions.clone(); + + // Compute budget instruction + let compute_budget_ix = compute_budget_for_instructions( + client, + instructions.clone(), + signers, + compute_multiplier, + payer, + blockhash, + ) + .await?; + + // Compute price instruction + let accounts: Vec = instructions + .iter() + .flat_map(|i| i.accounts.iter().map(|a| a.pubkey)) + .unique() + .map(|pk| AccountMeta::new(pk, false)) + .collect(); + + let compute_price_ix = compute_price_instruction_for_accounts(client, &accounts).await?; + + replace_or_insert_instruction(&mut updated_instructions, compute_budget_ix, 0); + replace_or_insert_instruction(&mut updated_instructions, compute_price_ix, 1); + Ok(updated_instructions) +} diff --git a/helium-lib/src/solana_transaction_utils/queue.rs b/helium-lib/src/solana_transaction_utils/queue.rs new file mode 100644 index 00000000..d51c7bac --- /dev/null +++ b/helium-lib/src/solana_transaction_utils/queue.rs @@ -0,0 +1,140 @@ +use solana_sdk::{ + commitment_config::CommitmentConfig, instruction::Instruction, message::Message, + signature::Keypair, signer::Signer, transaction::TransactionError, +}; +use std::{sync::Arc, time::Duration}; +use tokio::{ + sync::mpsc::{channel, Receiver, Sender}, + task::JoinHandle, + time::interval, +}; + +use crate::{ + solana_client::{ + nonblocking::{rpc_client::RpcClient, tpu_client::TpuClient}, + send_and_confirm_transactions_in_parallel::{ + send_and_confirm_transactions_in_parallel, SendAndConfirmConfig, + }, + tpu_client::TpuClientConfig, + }, + solana_transaction_utils::{ + pack::pack_instructions_into_transactions, priority_fee::auto_compute_limit_and_price, + }, +}; + +#[derive(Debug, Clone)] +pub struct TransactionTask { + pub task: T, + pub instructions: Vec, +} + +#[derive(Debug)] +pub struct CompletedTransactionTask { + pub err: Option, + pub task: TransactionTask, +} + +pub struct TransactionQueueArgs { + pub rpc_client: Arc, + pub ws_url: String, + pub payer: Arc, + pub batch_duration: Duration, + pub receiver: Receiver>, + pub result_sender: Sender>, +} + +pub struct TransactionQueueHandles { + pub sender: Sender>, + pub receiver: Receiver>, + pub result_sender: Sender>, + pub result_receiver: Receiver>, +} + +pub fn create_transaction_queue_handles( + channel_capacity: usize, +) -> TransactionQueueHandles { + let (tx, rx) = channel::>(channel_capacity); + let (result_tx, result_rx) = channel::>(channel_capacity); + TransactionQueueHandles { + sender: tx, + receiver: rx, + result_sender: result_tx, + result_receiver: result_rx, + } +} + +pub fn create_transaction_queue( + args: TransactionQueueArgs, +) -> JoinHandle<()> { + let TransactionQueueArgs { + rpc_client, + payer, + batch_duration, + ws_url, + receiver: mut rx, + result_sender: result_tx, + } = args; + let thread: JoinHandle<()> = tokio::spawn(async move { + let mut tasks: Vec> = Vec::new(); + let mut interval = interval(batch_duration); + loop { + tokio::select! { + _ = interval.tick() => { + if tasks.is_empty() { + continue; + } + let rpc_client = rpc_client.clone(); + let blockhash = rpc_client.get_latest_blockhash_with_commitment(CommitmentConfig::finalized()).await.expect("Failed to get latest blockhash"); + let tpu_client = TpuClient::new("helium-transaction-queue", rpc_client.clone(), ws_url.as_str(), TpuClientConfig::default()).await.expect("Failed to create TPU client"); + // Process the collected tasks here + let ix_groups: Vec> = tasks.clone().into_iter().map(|t| t.instructions).collect(); + let txs = pack_instructions_into_transactions(ix_groups, &payer); + let mut with_auto_compute: Vec = Vec::new(); + for (tx, _) in &txs { + // This is just a tx with compute ixs. Skip it + if tx.len() == 2 { + continue; + } + let computed = auto_compute_limit_and_price(&rpc_client, tx.clone(), &[&payer], 1.2, Some(&payer.pubkey()), Some(blockhash.0)).await.unwrap(); + with_auto_compute.push(Message::new(&computed, Some(&payer.pubkey()))); + } + if with_auto_compute.is_empty() { + continue; + } + let results = send_and_confirm_transactions_in_parallel( + rpc_client.clone(), + Some(tpu_client), + &with_auto_compute, + &[&payer], + SendAndConfirmConfig { + with_spinner: true, + resign_txs_count: Some(5), + }, + ).await.expect("Failed to send txs"); + let mut task_results: std::collections::HashMap> = std::collections::HashMap::new(); + for (i, result) in results.iter().enumerate() { + for task_id in &txs[i].1 { + if let Some(err) = result { + task_results.insert(*task_id, Some(err.clone())); + } else if !task_results.contains_key(task_id) { + task_results.insert(*task_id, None); + } + } + } + for (task_id, err) in task_results { + result_tx.send(CompletedTransactionTask { + err, + task: tasks[task_id].clone(), + }).await.unwrap(); + } + tasks.clear(); + } + + Some(task) = rx.recv() => { + tasks.push(task); + } + } + } + }); + thread +} diff --git a/helium-lib/src/utils.rs b/helium-lib/src/utils.rs new file mode 100644 index 00000000..99c56b7e --- /dev/null +++ b/helium-lib/src/utils.rs @@ -0,0 +1,21 @@ +use solana_sdk::instruction::Instruction; + +const EPOCH_LENGTH: u64 = 60 * 60 * 24; +pub fn get_current_epoch(unix_time: u64) -> u64 { + unix_time / EPOCH_LENGTH +} + +pub fn replace_or_insert_instruction( + instructions: &mut Vec, + new_instruction: Instruction, + insert_pos: usize, +) { + if let Some(pos) = instructions + .iter() + .position(|ix| ix.program_id == solana_sdk::compute_budget::id()) + { + instructions[pos + insert_pos] = new_instruction; + } else { + instructions.insert(insert_pos, new_instruction); + } +} diff --git a/helium-wallet/Cargo.toml b/helium-wallet/Cargo.toml index 8ffebc85..a013e10b 100644 --- a/helium-wallet/Cargo.toml +++ b/helium-wallet/Cargo.toml @@ -28,7 +28,7 @@ serde_json = {workspace = true} clap = { workspace = true } qr2term = "0.2" rust_decimal = {workspace = true} -tokio = {version = "1.0", features = ["full"]} +tokio = {workspace = true} helium-lib = { path = "../helium-lib", features = ["clap", "mnemonic"] } helium-mnemonic = { path = "../helium-mnemonic" } helium-proto = {workspace = true} From 3b7f815f4e1aa509bb960a2fbe06f4f1730c61c1 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 6 Nov 2024 14:00:13 -0600 Subject: [PATCH 22/49] structure client better --- helium-lib/src/client.rs | 293 +++++++++--------- .../src/solana_transaction_utils/mod.rs | 1 - .../src/solana_transaction_utils/queue.rs | 140 --------- 3 files changed, 150 insertions(+), 284 deletions(-) delete mode 100644 helium-lib/src/solana_transaction_utils/queue.rs diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index 3277f8c3..c1d78cd8 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -1,12 +1,6 @@ use futures::{stream, StreamExt, TryStreamExt}; use itertools::Itertools; use jsonrpc_client::{JsonRpcError, SendRequest}; -use solana_sdk::{ - commitment_config::CommitmentConfig, - instruction::Instruction, - message::Message, - signature::{Keypair, Signer}, -}; use std::{marker::Send, sync::Arc}; use tracing::instrument; @@ -24,11 +18,17 @@ use crate::{ }, tpu_client::TpuClientConfig, }, + solana_sdk::{ + commitment_config::CommitmentConfig, instruction::Instruction, message::Message, + signature::Keypair, signer::Signer, + }, solana_transaction_utils::{ pack::pack_instructions_into_transactions, priority_fee::auto_compute_limit_and_price, }, }; +pub use solana_client::nonblocking::rpc_client::RpcClient as SolanaRpcClient; + pub static ONBOARDING_URL_MAINNET: &str = "https://onboarding.dewi.org/api/v3"; pub static ONBOARDING_URL_DEVNET: &str = "https://onboarding.web.test-helium.com/api/v3"; @@ -38,118 +38,52 @@ pub static VERIFIER_URL_DEVNET: &str = "https://ecc-verifier.web.test-helium.com pub static SOLANA_URL_MAINNET: &str = "https://solana-rpc.web.helium.io:443?session-key=Pluto"; pub static SOLANA_URL_DEVNET: &str = "https://solana-rpc.web.test-helium.com?session-key=Pluto"; -pub use solana_client::nonblocking::rpc_client::RpcClient as SolanaRpcClient; +static USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"),); #[derive(Clone)] -pub struct Client { - pub solana_client: Arc, - pub das_client: Arc, -} - -#[async_trait::async_trait] -pub trait GetAnchorAccount { - async fn anchor_account( - &self, - pubkey: &Pubkey, - ) -> Result, Error>; - async fn anchor_accounts( - &self, - pubkeys: &[Pubkey], - ) -> Result>, Error>; -} - -#[async_trait::async_trait] -impl GetAnchorAccount for SolanaRpcClient { - async fn anchor_account( - &self, - pubkey: &Pubkey, - ) -> Result, Error> { - let account = self.get_account(pubkey).await?; - let decoded = T::try_deserialize(&mut account.data.as_ref())?; - Ok(Some(decoded)) - } - - async fn anchor_accounts( - &self, - pubkeys: &[Pubkey], - ) -> Result>, Error> { - async fn get_accounts( - client: &SolanaRpcClient, - pubkeys: &[Pubkey], - ) -> Result>, Error> { - let accounts = client.get_multiple_accounts(pubkeys).await?; - accounts - .into_iter() - .map(|maybe_account| { - maybe_account - .map(|account| A::try_deserialize(&mut account.data.as_ref())) - .transpose() - .map_err(Error::from) - }) - .try_collect() - } - - let accounts = stream::iter(pubkeys.to_vec()) - .chunks(100) - .map(|key_chunk| async move { get_accounts::(self, &key_chunk).await }) - .buffered(5) - .try_collect::>>>() - .await? - .into_iter() - .flatten() - .collect_vec(); - Ok(accounts) - } +pub struct SolanaClient { + inner: Arc, + base_url: String, } -#[async_trait::async_trait] -impl GetAnchorAccount for Client { - async fn anchor_account( - &self, - pubkey: &keypair::Pubkey, - ) -> Result, Error> { - self.solana_client.anchor_account(pubkey).await - } - async fn anchor_accounts( - &self, - pubkeys: &[Pubkey], - ) -> Result>, Error> { - self.solana_client.anchor_accounts(pubkeys).await +impl Default for SolanaClient { + fn default() -> Self { + Self::with_base_url(SOLANA_URL_MAINNET).unwrap() } } -#[async_trait::async_trait] -pub trait SolanaRpcClientExt { - async fn send_instructions( - &self, - ixs: Vec, - wallet: Keypair, - extra_signers: &[Keypair], - sequentially: bool, - ) -> Result<(), Error>; +impl SolanaClient { + pub fn with_base_url(url: &str) -> Result { + let client = Arc::new( + solana_client::nonblocking::rpc_client::RpcClient::new_with_commitment( + url.to_string(), + CommitmentConfig::finalized(), + ), + ); - fn ws_url(&self) -> String; -} + Ok(Self { + inner: client, + base_url: url.to_string(), + }) + } -#[async_trait::async_trait] -impl SolanaRpcClientExt for Client { - fn ws_url(&self) -> String { - self.solana_client - .url() + pub fn ws_url(&self) -> String { + self.base_url .replace("https", "wss") .replace("http", "ws") .replace("127.0.0.1:8899", "127.0.0.1:8900") } - async fn send_instructions( + pub async fn send_instructions( &self, - ixs: Vec, wallet: Keypair, + ixs: Vec, extra_signers: &[Keypair], sequentially: bool, ) -> Result<(), Error> { let (blockhash, _) = self - .solana_client + .inner + .as_ref() .get_latest_blockhash_with_commitment(CommitmentConfig::finalized()) .await .expect("Failed to get latest blockhash"); @@ -167,7 +101,7 @@ impl SolanaRpcClientExt for Client { } let computed = auto_compute_limit_and_price( - &self.solana_client, + &self.inner, tx.clone(), &keys, 1.2, @@ -186,8 +120,8 @@ impl SolanaRpcClientExt for Client { let results; let tpu_client = TpuClient::new( - "helium-lib", - self.solana_client.clone(), + "helium-config-service-cli", + self.inner.clone(), &self.ws_url(), TpuClientConfig::default(), ) @@ -201,7 +135,7 @@ impl SolanaRpcClientExt for Client { } false => { results = send_and_confirm_transactions_in_parallel( - self.solana_client, + self.inner.clone(), Some(tpu_client), &with_auto_compute, &keys, @@ -222,6 +156,12 @@ impl SolanaRpcClientExt for Client { } } +#[derive(Clone)] +pub struct Client { + pub solana_client: Arc, + pub das_client: Arc, +} + impl TryFrom<&str> for Client { type Error = Error; fn try_from(value: &str) -> Result { @@ -231,18 +171,16 @@ impl TryFrom<&str> for Client { url => url, }; - let das_client = Arc::new(DasClient::with_base_url(url)?); - let solana_client = Arc::new(SolanaRpcClient::new(url.to_string())); Ok(Self { - solana_client, - das_client, + solana_client: Arc::new(SolanaClient::with_base_url(url)?), + das_client: Arc::new(DasClient::with_base_url(url)?), }) } } -impl AsRef for Client { - fn as_ref(&self) -> &SolanaRpcClient { - &self.solana_client +impl AsRef for Client { + fn as_ref(&self) -> &solana_client::nonblocking::rpc_client::RpcClient { + &self.solana_client.inner } } @@ -252,38 +190,75 @@ impl AsRef for Client { } } -#[derive( - serde::Serialize, Default, Debug, Clone, std::hash::Hash, PartialEq, Eq, PartialOrd, Ord, -)] -#[serde(rename_all = "camelCase")] -pub struct DasSearchAssetsParams { - #[serde(skip_serializing_if = "std::ops::Not::not")] - pub creator_verified: bool, - #[serde( - with = "keypair::serde_opt_pubkey", - skip_serializing_if = "Option::is_none" - )] - pub creator_address: Option, - #[serde( - with = "keypair::serde_opt_pubkey", - skip_serializing_if = "Option::is_none" - )] - pub owner_address: Option, - #[serde(skip_serializing_if = "is_zero")] - pub page: u32, - #[serde(skip_serializing_if = "is_zero")] - pub limit: u32, +#[async_trait::async_trait] +pub trait GetAnchorAccount { + async fn anchor_account( + &self, + pubkey: &Pubkey, + ) -> Result, Error>; + async fn anchor_accounts( + &self, + pubkeys: &[Pubkey], + ) -> Result>, Error>; } -impl DasSearchAssetsParams { - pub fn for_owner(owner_address: Pubkey, creator_address: Pubkey) -> Self { - Self { - owner_address: Some(owner_address), - creator_address: Some(creator_address), - creator_verified: true, - page: 1, - ..Default::default() +#[async_trait::async_trait] +impl GetAnchorAccount for solana_client::nonblocking::rpc_client::RpcClient { + async fn anchor_account( + &self, + pubkey: &Pubkey, + ) -> Result, Error> { + let account = self.get_account(pubkey).await?; + let decoded = T::try_deserialize(&mut account.data.as_ref())?; + Ok(Some(decoded)) + } + + async fn anchor_accounts( + &self, + pubkeys: &[Pubkey], + ) -> Result>, Error> { + async fn get_accounts( + client: &solana_client::nonblocking::rpc_client::RpcClient, + pubkeys: &[Pubkey], + ) -> Result>, Error> { + let accounts = client.get_multiple_accounts(pubkeys).await?; + accounts + .into_iter() + .map(|maybe_account| { + maybe_account + .map(|account| A::try_deserialize(&mut account.data.as_ref())) + .transpose() + .map_err(Error::from) + }) + .try_collect() } + + let accounts = stream::iter(pubkeys.to_vec()) + .chunks(100) + .map(|key_chunk| async move { get_accounts::(self, &key_chunk).await }) + .buffered(5) + .try_collect::>>>() + .await? + .into_iter() + .flatten() + .collect_vec(); + Ok(accounts) + } +} + +#[async_trait::async_trait] +impl GetAnchorAccount for Client { + async fn anchor_account( + &self, + pubkey: &keypair::Pubkey, + ) -> Result, Error> { + self.solana_client.inner.anchor_account(pubkey).await + } + async fn anchor_accounts( + &self, + pubkeys: &[Pubkey], + ) -> Result>, Error> { + self.solana_client.inner.anchor_accounts(pubkeys).await } } @@ -322,8 +297,6 @@ impl DasClientError { #[jsonrpc_client::api] pub trait DAS {} -static USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"),); - #[jsonrpc_client::implement(DAS)] #[derive(Debug, Clone)] pub struct DasClient { @@ -333,7 +306,6 @@ pub struct DasClient { impl Default for DasClient { fn default() -> Self { - // safe to unwrap Self::with_base_url(SOLANA_URL_MAINNET).unwrap() } } @@ -424,6 +396,41 @@ impl jsonrpc_client::SendRequest for DasClient { } } +#[derive( + serde::Serialize, Default, Debug, Clone, std::hash::Hash, PartialEq, Eq, PartialOrd, Ord, +)] +#[serde(rename_all = "camelCase")] +pub struct DasSearchAssetsParams { + #[serde(skip_serializing_if = "std::ops::Not::not")] + pub creator_verified: bool, + #[serde( + with = "keypair::serde_opt_pubkey", + skip_serializing_if = "Option::is_none" + )] + pub creator_address: Option, + #[serde( + with = "keypair::serde_opt_pubkey", + skip_serializing_if = "Option::is_none" + )] + pub owner_address: Option, + #[serde(skip_serializing_if = "is_zero")] + pub page: u32, + #[serde(skip_serializing_if = "is_zero")] + pub limit: u32, +} + +impl DasSearchAssetsParams { + pub fn for_owner(owner_address: Pubkey, creator_address: Pubkey) -> Self { + Self { + owner_address: Some(owner_address), + creator_address: Some(creator_address), + creator_verified: true, + page: 1, + ..Default::default() + } + } +} + pub mod config { use super::*; use crate::{ @@ -492,12 +499,12 @@ pub mod config { } #[derive(Clone)] - pub enum Client { + pub enum ClientType { Iot(iot::Client), Mobile(mobile::Client), } - impl Client { + impl ClientType { pub fn for_subdao( subdao: SubDao, config: &str, diff --git a/helium-lib/src/solana_transaction_utils/mod.rs b/helium-lib/src/solana_transaction_utils/mod.rs index 5280151f..ef7f5e71 100644 --- a/helium-lib/src/solana_transaction_utils/mod.rs +++ b/helium-lib/src/solana_transaction_utils/mod.rs @@ -1,3 +1,2 @@ pub mod pack; pub mod priority_fee; -pub mod queue; diff --git a/helium-lib/src/solana_transaction_utils/queue.rs b/helium-lib/src/solana_transaction_utils/queue.rs deleted file mode 100644 index d51c7bac..00000000 --- a/helium-lib/src/solana_transaction_utils/queue.rs +++ /dev/null @@ -1,140 +0,0 @@ -use solana_sdk::{ - commitment_config::CommitmentConfig, instruction::Instruction, message::Message, - signature::Keypair, signer::Signer, transaction::TransactionError, -}; -use std::{sync::Arc, time::Duration}; -use tokio::{ - sync::mpsc::{channel, Receiver, Sender}, - task::JoinHandle, - time::interval, -}; - -use crate::{ - solana_client::{ - nonblocking::{rpc_client::RpcClient, tpu_client::TpuClient}, - send_and_confirm_transactions_in_parallel::{ - send_and_confirm_transactions_in_parallel, SendAndConfirmConfig, - }, - tpu_client::TpuClientConfig, - }, - solana_transaction_utils::{ - pack::pack_instructions_into_transactions, priority_fee::auto_compute_limit_and_price, - }, -}; - -#[derive(Debug, Clone)] -pub struct TransactionTask { - pub task: T, - pub instructions: Vec, -} - -#[derive(Debug)] -pub struct CompletedTransactionTask { - pub err: Option, - pub task: TransactionTask, -} - -pub struct TransactionQueueArgs { - pub rpc_client: Arc, - pub ws_url: String, - pub payer: Arc, - pub batch_duration: Duration, - pub receiver: Receiver>, - pub result_sender: Sender>, -} - -pub struct TransactionQueueHandles { - pub sender: Sender>, - pub receiver: Receiver>, - pub result_sender: Sender>, - pub result_receiver: Receiver>, -} - -pub fn create_transaction_queue_handles( - channel_capacity: usize, -) -> TransactionQueueHandles { - let (tx, rx) = channel::>(channel_capacity); - let (result_tx, result_rx) = channel::>(channel_capacity); - TransactionQueueHandles { - sender: tx, - receiver: rx, - result_sender: result_tx, - result_receiver: result_rx, - } -} - -pub fn create_transaction_queue( - args: TransactionQueueArgs, -) -> JoinHandle<()> { - let TransactionQueueArgs { - rpc_client, - payer, - batch_duration, - ws_url, - receiver: mut rx, - result_sender: result_tx, - } = args; - let thread: JoinHandle<()> = tokio::spawn(async move { - let mut tasks: Vec> = Vec::new(); - let mut interval = interval(batch_duration); - loop { - tokio::select! { - _ = interval.tick() => { - if tasks.is_empty() { - continue; - } - let rpc_client = rpc_client.clone(); - let blockhash = rpc_client.get_latest_blockhash_with_commitment(CommitmentConfig::finalized()).await.expect("Failed to get latest blockhash"); - let tpu_client = TpuClient::new("helium-transaction-queue", rpc_client.clone(), ws_url.as_str(), TpuClientConfig::default()).await.expect("Failed to create TPU client"); - // Process the collected tasks here - let ix_groups: Vec> = tasks.clone().into_iter().map(|t| t.instructions).collect(); - let txs = pack_instructions_into_transactions(ix_groups, &payer); - let mut with_auto_compute: Vec = Vec::new(); - for (tx, _) in &txs { - // This is just a tx with compute ixs. Skip it - if tx.len() == 2 { - continue; - } - let computed = auto_compute_limit_and_price(&rpc_client, tx.clone(), &[&payer], 1.2, Some(&payer.pubkey()), Some(blockhash.0)).await.unwrap(); - with_auto_compute.push(Message::new(&computed, Some(&payer.pubkey()))); - } - if with_auto_compute.is_empty() { - continue; - } - let results = send_and_confirm_transactions_in_parallel( - rpc_client.clone(), - Some(tpu_client), - &with_auto_compute, - &[&payer], - SendAndConfirmConfig { - with_spinner: true, - resign_txs_count: Some(5), - }, - ).await.expect("Failed to send txs"); - let mut task_results: std::collections::HashMap> = std::collections::HashMap::new(); - for (i, result) in results.iter().enumerate() { - for task_id in &txs[i].1 { - if let Some(err) = result { - task_results.insert(*task_id, Some(err.clone())); - } else if !task_results.contains_key(task_id) { - task_results.insert(*task_id, None); - } - } - } - for (task_id, err) in task_results { - result_tx.send(CompletedTransactionTask { - err, - task: tasks[task_id].clone(), - }).await.unwrap(); - } - tasks.clear(); - } - - Some(task) = rx.recv() => { - tasks.push(task); - } - } - } - }); - thread -} From 1ea9ba306023bab10d038fe31d52b32a3f7f56fd Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 6 Nov 2024 14:13:52 -0600 Subject: [PATCH 23/49] add wrapper fn for getting the SolanaRpcClient --- helium-lib/src/client.rs | 8 ++++++-- helium-lib/src/iot_routing_manager.rs | 2 +- helium-lib/src/lib.rs | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index c1d78cd8..f5b9ec67 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -42,8 +42,8 @@ static USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_V #[derive(Clone)] pub struct SolanaClient { - inner: Arc, - base_url: String, + pub inner: Arc, + pub base_url: String, } impl Default for SolanaClient { @@ -67,6 +67,10 @@ impl SolanaClient { }) } + pub fn solana_rpc_client(&self) -> Arc { + self.inner.clone() + } + pub fn ws_url(&self) -> String { self.base_url .replace("https", "wss") diff --git a/helium-lib/src/iot_routing_manager.rs b/helium-lib/src/iot_routing_manager.rs index d1967cb9..6ddb98c8 100644 --- a/helium-lib/src/iot_routing_manager.rs +++ b/helium-lib/src/iot_routing_manager.rs @@ -103,7 +103,7 @@ pub mod organization { use super::*; use crate::{ - client::{GetAnchorAccount, SolanaRpcClient, SolanaRpcClientExt}, + client::{GetAnchorAccount, SolanaRpcClient}, error::Error, helium_entity_manager, helium_sub_daos, iot_routing_manager, metaplex, programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, diff --git a/helium-lib/src/lib.rs b/helium-lib/src/lib.rs index 850c46fb..f038f170 100644 --- a/helium-lib/src/lib.rs +++ b/helium-lib/src/lib.rs @@ -50,6 +50,6 @@ where use std::sync::Arc; -pub fn init(solana_client: Arc) -> Result<(), error::Error> { - kta::init(solana_client) +pub fn init(solana_client: Arc) -> Result<(), error::Error> { + kta::init(solana_client.solana_rpc_client()) } From 02d579100a7f275d68d87fcc53ba6aaecc4bcd75 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 6 Nov 2024 14:19:16 -0600 Subject: [PATCH 24/49] . --- helium-lib/src/client.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index f5b9ec67..773d1abb 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -105,7 +105,7 @@ impl SolanaClient { } let computed = auto_compute_limit_and_price( - &self.inner, + &self.solana_rpc_client(), tx.clone(), &keys, 1.2, @@ -125,7 +125,7 @@ impl SolanaClient { let results; let tpu_client = TpuClient::new( "helium-config-service-cli", - self.inner.clone(), + self.solana_rpc_client(), &self.ws_url(), TpuClientConfig::default(), ) @@ -139,7 +139,7 @@ impl SolanaClient { } false => { results = send_and_confirm_transactions_in_parallel( - self.inner.clone(), + self.solana_rpc_client(), Some(tpu_client), &with_auto_compute, &keys, From 3abf8a901cd45b075e357140a2feda86e9dd7992 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 6 Nov 2024 16:10:35 -0600 Subject: [PATCH 25/49] added wallet/payer logic to solana_client --- helium-lib/src/client.rs | 33 ++++++++++++++++++++++++++++----- helium-lib/src/error.rs | 8 ++++++++ 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index 773d1abb..261ad2dc 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -1,7 +1,8 @@ use futures::{stream, StreamExt, TryStreamExt}; use itertools::Itertools; use jsonrpc_client::{JsonRpcError, SendRequest}; -use std::{marker::Send, sync::Arc}; +use solana_sdk::signer::EncodableKey; +use std::{marker::Send, path::PathBuf, sync::Arc}; use tracing::instrument; use crate::{ @@ -44,16 +45,17 @@ static USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_V pub struct SolanaClient { pub inner: Arc, pub base_url: String, + pub wallet: Option>, } impl Default for SolanaClient { fn default() -> Self { - Self::with_base_url(SOLANA_URL_MAINNET).unwrap() + Self::new(SOLANA_URL_MAINNET, None).unwrap() } } impl SolanaClient { - pub fn with_base_url(url: &str) -> Result { + pub fn new(url: &str, wallet_path: Option) -> Result { let client = Arc::new( solana_client::nonblocking::rpc_client::RpcClient::new_with_commitment( url.to_string(), @@ -61,9 +63,18 @@ impl SolanaClient { ), ); + let wallet = if let Some(path) = wallet_path { + Some(Arc::new( + Keypair::read_from_file(&path).map_err(Error::from)?, + )) + } else { + None + }; + Ok(Self { inner: client, base_url: url.to_string(), + wallet, }) } @@ -78,13 +89,25 @@ impl SolanaClient { .replace("127.0.0.1:8899", "127.0.0.1:8900") } + pub fn payer(&self) -> Option { + if let Some(ref wallet) = self.wallet { + Some(wallet.pubkey()) + } else { + None + } + } + pub async fn send_instructions( &self, - wallet: Keypair, ixs: Vec, extra_signers: &[Keypair], sequentially: bool, ) -> Result<(), Error> { + let wallet = self + .wallet + .as_ref() + .ok_or_else(|| Error::Other("Wallet not configured".to_string()))?; + let (blockhash, _) = self .inner .as_ref() @@ -176,7 +199,7 @@ impl TryFrom<&str> for Client { }; Ok(Self { - solana_client: Arc::new(SolanaClient::with_base_url(url)?), + solana_client: Arc::new(SolanaClient::new(url, None)?), das_client: Arc::new(DasClient::with_base_url(url)?), }) } diff --git a/helium-lib/src/error.rs b/helium-lib/src/error.rs index 75008571..68dcb102 100644 --- a/helium-lib/src/error.rs +++ b/helium-lib/src/error.rs @@ -45,6 +45,14 @@ pub enum Error { Decode(#[from] DecodeError), #[error("encode: {0}")] Encode(#[from] EncodeError), + #[error("other: {0}")] + Other(String), +} + +impl From> for Error { + fn from(err: Box) -> Self { + Self::Other(err.to_string()) + } } impl From for Error { From e14d61a4240d515e0089c083ea9224772314510b Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 6 Nov 2024 16:13:14 -0600 Subject: [PATCH 26/49] Pass tpu helium-lib --- helium-lib/src/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index 261ad2dc..1c27c4b7 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -147,7 +147,7 @@ impl SolanaClient { let results; let tpu_client = TpuClient::new( - "helium-config-service-cli", + "helium-lib", self.solana_rpc_client(), &self.ws_url(), TpuClientConfig::default(), From 174b779d24970a51df9021390a0194b5a12a3358 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 7 Nov 2024 12:58:38 -0600 Subject: [PATCH 27/49] add AsRef for SolanaClient --- helium-lib/src/client.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index 1c27c4b7..653fc96c 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -205,8 +205,14 @@ impl TryFrom<&str> for Client { } } -impl AsRef for Client { - fn as_ref(&self) -> &solana_client::nonblocking::rpc_client::RpcClient { +impl AsRef for Client { + fn as_ref(&self) -> &SolanaClient { + &self.solana_client + } +} + +impl AsRef for Client { + fn as_ref(&self) -> &SolanaRpcClient { &self.solana_client.inner } } From 3d10078f92a5969140a8c6430ece6d0eadbea968 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 7 Nov 2024 15:24:58 -0600 Subject: [PATCH 28/49] Building --- Cargo.lock | 1881 ++++++++++++++++++++++++++--------------- helium-lib/Cargo.toml | 64 +- 2 files changed, 1253 insertions(+), 692 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e58d5224..5980b0ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,18 +14,18 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aead" @@ -168,6 +168,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-attribute-access-control" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47fe28365b33e8334dd70ae2f34a43892363012fe239cf37d2ee91693575b1f8" +dependencies = [ + "anchor-syn 0.30.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-attribute-account" version = "0.29.0" @@ -181,6 +193,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-attribute-account" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c288d496168268d198d9b53ee9f4f9d260a55ba4df9877ea1d4486ad6109e0f" +dependencies = [ + "anchor-syn 0.30.1", + "bs58 0.5.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-attribute-constant" version = "0.29.0" @@ -192,6 +217,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-attribute-constant" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49b77b6948d0eeaaa129ce79eea5bbbb9937375a9241d909ca8fb9e006bb6e90" +dependencies = [ + "anchor-syn 0.30.1", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-attribute-error" version = "0.29.0" @@ -203,6 +239,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-attribute-error" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d20bb569c5a557c86101b944721d865e1fd0a4c67c381d31a44a84f07f84828" +dependencies = [ + "anchor-syn 0.30.1", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-attribute-event" version = "0.29.0" @@ -215,6 +262,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-attribute-event" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cebd8d0671a3a9dc3160c48598d652c34c77de6be4d44345b8b514323284d57" +dependencies = [ + "anchor-syn 0.30.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-attribute-program" version = "0.29.0" @@ -226,13 +285,30 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-attribute-program" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb2a5eb0860e661ab31aff7bb5e0288357b176380e985bade4ccb395981b42d" +dependencies = [ + "anchor-lang-idl", + "anchor-syn 0.30.1", + "anyhow", + "bs58 0.5.1", + "heck 0.3.3", + "proc-macro2", + "quote", + "serde_json", + "syn 1.0.109", +] + [[package]] name = "anchor-client" version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb48c4a7911038da546dc752655a29fa49f6bd50ebc1edca218bac8da1012acd" dependencies = [ - "anchor-lang", + "anchor-lang 0.29.0", "anyhow", "futures", "regex", @@ -256,6 +332,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-derive-accounts" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04368b5abef4266250ca8d1d12f4dff860242681e4ec22b885dcfe354fd35aa1" +dependencies = [ + "anchor-syn 0.30.1", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-derive-serde" version = "0.29.0" @@ -263,7 +350,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" dependencies = [ "anchor-syn 0.29.0", - "borsh-derive-internal 0.10.3", + "borsh-derive-internal 0.10.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-serde" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0bb0e0911ad4a70cab880cdd6287fe1e880a1a9d8e4e6defa8e9044b9796a6c" +dependencies = [ + "anchor-syn 0.30.1", + "borsh-derive-internal 0.10.4", "proc-macro2", "quote", "syn 1.0.109", @@ -280,6 +380,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-derive-space" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef415ff156dc82e9ecb943189b0cb241b3a6bfc26a180234dc21bd3ef3ce0cb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-gen" version = "0.3.1" @@ -332,33 +443,82 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" dependencies = [ - "anchor-attribute-access-control", - "anchor-attribute-account", - "anchor-attribute-constant", - "anchor-attribute-error", - "anchor-attribute-event", - "anchor-attribute-program", - "anchor-derive-accounts", - "anchor-derive-serde", - "anchor-derive-space", + "anchor-attribute-access-control 0.29.0", + "anchor-attribute-account 0.29.0", + "anchor-attribute-constant 0.29.0", + "anchor-attribute-error 0.29.0", + "anchor-attribute-event 0.29.0", + "anchor-attribute-program 0.29.0", + "anchor-derive-accounts 0.29.0", + "anchor-derive-serde 0.29.0", + "anchor-derive-space 0.29.0", "arrayref", "base64 0.13.1", "bincode", - "borsh 0.10.3", + "borsh 0.10.4", + "bytemuck", + "getrandom 0.2.15", + "solana-program 1.18.26", + "thiserror", +] + +[[package]] +name = "anchor-lang" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6620c9486d9d36a4389cab5e37dc34a42ed0bfaa62e6a75a2999ce98f8f2e373" +dependencies = [ + "anchor-attribute-access-control 0.30.1", + "anchor-attribute-account 0.30.1", + "anchor-attribute-constant 0.30.1", + "anchor-attribute-error 0.30.1", + "anchor-attribute-event 0.30.1", + "anchor-attribute-program 0.30.1", + "anchor-derive-accounts 0.30.1", + "anchor-derive-serde 0.30.1", + "anchor-derive-space 0.30.1", + "arrayref", + "base64 0.21.7", + "bincode", + "borsh 0.10.4", "bytemuck", "getrandom 0.2.15", - "solana-program", + "solana-program 1.18.26", "thiserror", ] +[[package]] +name = "anchor-lang-idl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31cf97b4e6f7d6144a05e435660fcf757dbc3446d38d0e2b851d11ed13625bba" +dependencies = [ + "anchor-lang-idl-spec", + "anyhow", + "heck 0.3.3", + "serde", + "serde_json", + "sha2 0.10.8", +] + +[[package]] +name = "anchor-lang-idl-spec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdf143115440fe621bdac3a29a1f7472e09f6cd82b2aa569429a0c13f103838" +dependencies = [ + "anyhow", + "serde", +] + [[package]] name = "anchor-spl" version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" dependencies = [ - "anchor-lang", - "solana-program", + "anchor-lang 0.29.0", + "solana-program 1.18.26", "spl-associated-token-account 2.3.0", "spl-token", "spl-token-2022 0.9.0", @@ -401,6 +561,24 @@ dependencies = [ "thiserror", ] +[[package]] +name = "anchor-syn" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f99daacb53b55cfd37ce14d6c9905929721137fd4c67bbab44a19802aecb622f" +dependencies = [ + "anyhow", + "bs58 0.5.1", + "heck 0.3.3", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2 0.10.8", + "syn 1.0.109", + "thiserror", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -436,9 +614,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -451,43 +629,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "ark-bn254" @@ -512,7 +690,7 @@ dependencies = [ "ark-std", "derivative", "hashbrown 0.13.2", - "itertools", + "itertools 0.10.5", "num-traits", "zeroize", ] @@ -529,8 +707,8 @@ dependencies = [ "ark-std", "derivative", "digest 0.10.7", - "itertools", - "num-bigint 0.4.5", + "itertools 0.10.5", + "num-bigint 0.4.6", "num-traits", "paste", "rustc_version", @@ -553,7 +731,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "proc-macro2", "quote", @@ -582,7 +760,7 @@ dependencies = [ "ark-serialize-derive", "ark-std", "digest 0.10.7", - "num-bigint 0.4.5", + "num-bigint 0.4.6", ] [[package]] @@ -608,15 +786,15 @@ dependencies = [ [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii" @@ -649,7 +827,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -682,9 +860,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.11" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" +checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" dependencies = [ "brotli", "flate2", @@ -705,9 +883,9 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -716,24 +894,24 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -749,9 +927,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" @@ -800,17 +978,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.72" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -866,9 +1044,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] @@ -967,11 +1145,11 @@ dependencies = [ [[package]] name = "borsh" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +checksum = "115e54d64eb62cdebad391c19efc9dce4981c690c85a33a12199d99bb9546fee" dependencies = [ - "borsh-derive 0.10.3", + "borsh-derive 0.10.4", "hashbrown 0.13.2", ] @@ -1000,12 +1178,12 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +checksum = "831213f80d9423998dd696e2c5345aba6be7a0bd8cd19e31c5243e13df1cef89" dependencies = [ - "borsh-derive-internal 0.10.3", - "borsh-schema-derive-internal 0.10.3", + "borsh-derive-internal 0.10.4", + "borsh-schema-derive-internal 0.10.4", "proc-macro-crate 0.1.5", "proc-macro2", "syn 1.0.109", @@ -1018,10 +1196,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" dependencies = [ "once_cell", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", "syn_derive", ] @@ -1038,9 +1216,9 @@ dependencies = [ [[package]] name = "borsh-derive-internal" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +checksum = "65d6ba50644c98714aa2a70d13d7df3cd75cd2b523a2b452bf010443800976b3" dependencies = [ "proc-macro2", "quote", @@ -1060,9 +1238,9 @@ dependencies = [ [[package]] name = "borsh-schema-derive-internal" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +checksum = "276691d96f063427be83e6692b86148e488ebba9f48f77788724ca027ba3b6d4" dependencies = [ "proc-macro2", "quote", @@ -1071,9 +1249,9 @@ dependencies = [ [[package]] name = "brotli" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1161,13 +1339,13 @@ dependencies = [ [[package]] name = "bytemuck_derive" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" +checksum = "bcfcc3cd946cb52f0bbfdbbcfa2f4e24f75ebb6c0e1002f7c25904fada18b9ec" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -1178,9 +1356,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "caps" @@ -1194,13 +1372,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.98" +version = "1.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "baee610e9452a8f6f0a1b6194ec09ff9e2d85dea54432acdae41aa0761c95d70" dependencies = [ "jobserver", "libc", - "once_cell", + "shlex", ] [[package]] @@ -1233,7 +1411,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -1269,7 +1447,7 @@ name = "circuit-breaker" version = "0.1.0" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] @@ -1305,9 +1483,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -1315,26 +1493,26 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", - "clap_lex 0.7.0", + "clap_lex 0.7.2", "strsim 0.11.1", ] [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -1348,15 +1526,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "combine" @@ -1462,9 +1640,9 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "core-foundation" @@ -1478,9 +1656,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core2" @@ -1493,9 +1671,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -1558,7 +1736,7 @@ dependencies = [ "bitflags 1.3.2", "crossterm_winapi", "libc", - "mio", + "mio 0.8.11", "parking_lot", "signal-hook", "signal-hook-mio", @@ -1625,9 +1803,9 @@ dependencies = [ [[package]] name = "ct-codecs" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3b7eb4404b8195a9abb6356f4ac07d8ba267045c8d6d220ac4dc992e6cc75df" +checksum = "026ac6ceace6298d2c557ef5ed798894962296469ec7842288ea64674201a2d1" [[package]] name = "ctr" @@ -1673,12 +1851,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.9", - "darling_macro 0.20.9", + "darling_core 0.20.10", + "darling_macro 0.20.10", ] [[package]] @@ -1697,16 +1875,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -1722,13 +1900,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.9", + "darling_core 0.20.10", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -1749,7 +1927,7 @@ name = "data-credits" version = "0.2.2" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] @@ -1776,7 +1954,7 @@ dependencies = [ "asn1-rs", "displaydoc", "nom", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "rusticata-macros", ] @@ -1881,7 +2059,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -1904,7 +2082,7 @@ checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -1982,9 +2160,9 @@ dependencies = [ [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" @@ -2012,9 +2190,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -2036,7 +2214,7 @@ checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -2079,7 +2257,7 @@ name = "fanout" version = "0.1.0" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] @@ -2093,9 +2271,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "feature-probe" @@ -2121,9 +2299,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "miniz_oxide", @@ -2158,9 +2336,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -2173,9 +2351,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -2183,15 +2361,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -2200,38 +2378,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -2304,9 +2482,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "goblin" @@ -2342,7 +2520,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.6", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -2412,6 +2590,12 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "hashbrown" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" + [[package]] name = "heck" version = "0.3.3" @@ -2438,7 +2622,7 @@ name = "helium-anchor-gen" version = "0.1.0" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", "circuit-breaker", "data-credits", "fanout", @@ -2484,7 +2668,7 @@ name = "helium-entity-manager" version = "0.2.11" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] @@ -2492,14 +2676,14 @@ name = "helium-lib" version = "0.0.0" dependencies = [ "anchor-client", - "anchor-lang", + "anchor-lang 0.29.0", "anchor-spl", "angry-purple-tiger", "async-trait", "base64 0.22.1", "bincode", "chrono", - "clap 4.5.4", + "clap 4.5.20", "dirs", "futures", "h3o", @@ -2509,7 +2693,7 @@ dependencies = [ "helium-proto", "hex", "hex-literal", - "itertools", + "itertools 0.10.5", "jsonrpc_client", "lazy_static", "mpl-bubblegum", @@ -2520,11 +2704,11 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "solana-program", + "solana-program 1.18.26", "solana-sdk", "solana-transaction-status", "spl-account-compression", - "spl-associated-token-account 3.0.2", + "spl-associated-token-account 3.0.4", "thiserror", "tokio", "tonic", @@ -2546,7 +2730,7 @@ dependencies = [ [[package]] name = "helium-proto" version = "0.1.0" -source = "git+https://github.com/helium/proto?branch=master#197ff9c6cde7dc0d8334d6b4e27c58779e6a7ce0" +source = "git+https://github.com/helium/proto?branch=master#bf91f4602cf46001b758f869bbaa863eeae03d05" dependencies = [ "bytes", "prost", @@ -2564,7 +2748,7 @@ name = "helium-sub-daos" version = "0.1.8" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] @@ -2574,7 +2758,7 @@ dependencies = [ "aes-gcm", "anyhow", "byteorder", - "clap 4.5.4", + "clap 4.5.20", "dialoguer 0.8.0", "helium-crypto", "helium-lib", @@ -2627,7 +2811,7 @@ name = "hexboosting" version = "0.1.0" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] @@ -2700,9 +2884,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -2718,9 +2902,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.29" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -2768,9 +2952,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -2789,6 +2973,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -2797,12 +3099,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -2839,12 +3152,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.1", ] [[package]] @@ -2883,20 +3196,20 @@ name = "iot-routing-manager" version = "0.1.2" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -2907,6 +3220,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -2915,18 +3237,18 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -2989,7 +3311,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6dd100976df9dd59d0c3fecf6f9ad3f161a087374d1b2a77ebb4ad8920f11bb" dependencies = [ - "borsh 0.10.3", + "borsh 0.10.4", ] [[package]] @@ -3006,7 +3328,7 @@ name = "lazy-distributor" version = "0.2.0" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] @@ -3014,29 +3336,29 @@ name = "lazy-transactions" version = "0.2.0" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin 0.9.8", ] [[package]] name = "libc" -version = "0.2.155" +version = "0.2.162" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libredox" @@ -3044,7 +3366,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -3116,7 +3438,7 @@ checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee" dependencies = [ "ark-bn254", "ark-ff", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "thiserror", ] @@ -3126,6 +3448,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -3138,9 +3466,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "matchit" @@ -3156,9 +3484,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -3213,11 +3541,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -3232,12 +3560,24 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + [[package]] name = "mobile-entity-manager" version = "0.1.3" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] @@ -3246,11 +3586,11 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9eff5ae5cafd1acdf7e7c93359da1eec91dcaede318470d9f68b78e8b7469f4" dependencies = [ - "borsh 0.10.3", + "borsh 0.10.4", "kaigan", "num-derive 0.3.3", "num-traits", - "solana-program", + "solana-program 1.18.26", "thiserror", ] @@ -3282,7 +3622,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -3316,15 +3656,29 @@ dependencies = [ [[package]] name = "num" -version = "0.2.1" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +dependencies = [ + "num-bigint 0.2.6", + "num-complex 0.2.4", + "num-integer", + "num-iter", + "num-rational 0.2.4", + "num-traits", +] + +[[package]] +name = "num" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ - "num-bigint 0.2.6", - "num-complex", + "num-bigint 0.4.6", + "num-complex 0.4.6", "num-integer", "num-iter", - "num-rational", + "num-rational 0.4.2", "num-traits", ] @@ -3341,9 +3695,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", @@ -3376,6 +3730,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -3401,7 +3764,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -3436,6 +3799,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint 0.4.6", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -3467,11 +3841,11 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ - "num_enum_derive 0.7.2", + "num_enum_derive 0.7.3", ] [[package]] @@ -3483,19 +3857,19 @@ dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] name = "num_enum_derive" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -3506,9 +3880,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.35.0" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] @@ -3524,9 +3898,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "opaque-debug" @@ -3584,7 +3958,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -3653,7 +4027,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd23b938276f14057220b707937bcb42fa76dda7560e57a2da30cb52d557937" dependencies = [ - "num", + "num 0.2.1", ] [[package]] @@ -3663,34 +4037,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "indexmap 2.6.0", ] [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -3711,9 +4085,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "plain" @@ -3757,9 +4131,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" [[package]] name = "powerfmt" @@ -3769,18 +4143,21 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "prettyplease" -version = "0.2.17" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -3788,7 +4165,7 @@ name = "price-oracle" version = "0.2.1" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] @@ -3812,9 +4189,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ "toml_edit", ] @@ -3845,9 +4222,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -3883,7 +4260,7 @@ checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", "heck 0.5.0", - "itertools", + "itertools 0.12.1", "log", "multimap", "once_cell", @@ -3892,7 +4269,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.58", + "syn 2.0.87", "tempfile", ] @@ -3903,10 +4280,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -3940,35 +4317,32 @@ dependencies = [ [[package]] name = "pyth-solana-receiver-sdk" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e6559643f0b377b6f293269251f6a804ae7332c37f7310371f50c833453cd0" +version = "0.3.1" +source = "git+https://github.com/madninja/pyth-crosschain.git?branch=madninja/cap_solana_dep#6576247294bde3ab7b62f7a2dfb4d4d48c401b35" dependencies = [ - "anchor-lang", + "anchor-lang 0.29.0", "hex", "pythnet-sdk", - "solana-program", + "solana-program 1.18.26", ] [[package]] name = "pythnet-sdk" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbbc0456f9f27c9ad16b6c3bf1b2a7fea61eebf900f4d024a0468b9a84fe0c1" +version = "2.3.0" +source = "git+https://github.com/madninja/pyth-crosschain.git?branch=madninja/cap_solana_dep#6576247294bde3ab7b62f7a2dfb4d4d48c401b35" dependencies = [ - "anchor-lang", + "anchor-lang 0.30.1", "bincode", - "borsh 0.10.3", + "borsh 0.10.4", "bytemuck", "byteorder", "fast-math", "hex", - "proc-macro2", "rustc_version", "serde", "sha3 0.10.8", "slow_primes", - "solana-program", + "solana-program 2.0.15", "thiserror", ] @@ -4008,7 +4382,7 @@ checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -4061,9 +4435,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -4188,11 +4562,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -4208,9 +4582,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -4220,9 +4594,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -4231,9 +4605,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rend" @@ -4292,7 +4666,7 @@ name = "rewards-oracle" version = "0.2.0" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] @@ -4338,9 +4712,9 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ "bitvec", "bytecheck", @@ -4356,9 +4730,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" dependencies = [ "proc-macro2", "quote", @@ -4408,9 +4782,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.35.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a" +checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555" dependencies = [ "arrayvec", "borsh 1.5.1", @@ -4436,9 +4810,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] @@ -4454,11 +4828,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -4510,9 +4884,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -4541,11 +4915,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4571,7 +4945,7 @@ checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -4604,11 +4978,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -4617,9 +4991,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -4633,40 +5007,41 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.203" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -4679,7 +5054,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -4710,10 +5085,10 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ - "darling 0.20.9", + "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -4790,6 +5165,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.3.17" @@ -4802,12 +5183,12 @@ dependencies = [ [[package]] name = "signal-hook-mio" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" dependencies = [ "libc", - "mio", + "mio 0.8.11", "signal-hook", ] @@ -4841,9 +5222,9 @@ dependencies = [ [[package]] name = "simdutf8" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "simple_asn1" @@ -4852,7 +5233,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eb4ea60fb301dc81dfc113df680571045d375ab7345d171c5dc7d7e13107a80" dependencies = [ "chrono", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "thiserror", ] @@ -4888,7 +5269,7 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58267dd2fbaa6dceecba9e3e106d2d90a2b02497c0e8b01b8759beccf5113938" dependencies = [ - "num", + "num 0.4.3", ] [[package]] @@ -4921,9 +5302,9 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52346da8fbbac45fdfbb9c09f7a4e263fabd13f401352e1feedc55e1178a8ba2" +checksum = "b109fd3a106e079005167e5b0e6f6d2c88bbedec32530837b584791a8b5abf36" dependencies = [ "Inflector", "base64 0.21.7", @@ -4946,9 +5327,9 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bafd11f1614edd414adb414b96a481152b01ac45c14c3ff56fc757412698b228" +checksum = "074ef478856a45d5627270fbc6b331f91de9aae7128242d9e423931013fb8a2a" dependencies = [ "chrono", "clap 2.34.0", @@ -4963,16 +5344,16 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "522922d51cc1fd3f0a6dd9ed0a8939f7ff46f5ebaa3a6d7eee3cd2516e6ac9e6" +checksum = "24a9f32c42402c4b9484d5868ac74b7e0a746e3905d8bfd756e1203e50cbb87e" dependencies = [ "async-trait", "bincode", "dashmap", "futures", "futures-util", - "indexmap 2.2.6", + "indexmap 2.6.0", "indicatif", "log", "quinn", @@ -4996,9 +5377,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2010ba6fe2a1c4270ca3d3ef23ebfd893e3d2c980b9c0fc04451c4ce2f6b3deb" +checksum = "9d75b803860c0098e021a26f0624129007c15badd5b0bc2fbd9f0e1a73060d3b" dependencies = [ "bincode", "chrono", @@ -5010,15 +5391,15 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0acaf8e98f3f30596d73173183a80d7f83e23df1429a889a68cfe7be69abe39b" +checksum = "b9306ede13e8ceeab8a096bcf5fa7126731e44c201ca1721ea3c38d89bcd4111" dependencies = [ "async-trait", "bincode", "crossbeam-channel", "futures-util", - "indexmap 2.2.6", + "indexmap 2.6.0", "log", "rand 0.8.5", "rayon", @@ -5032,9 +5413,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c00a6aca244dfa904e2c4a26406ba7b0987344ceaec932f3cda0b35eff0babc" +checksum = "03ab2c30c15311b511c0d1151e4ab6bc9a3e080a37e7c6e7c2d96f5784cf9434" dependencies = [ "block-buffer 0.10.4", "bs58 0.4.0", @@ -5057,21 +5438,21 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bed58b27b9b8877893f69bc5cfd1c62e984315e0229d83cf8a32ad0933c0d6c9" +checksum = "c142f779c3633ac83c84d04ff06c70e1f558c876f13358bed77ba629c7417932" dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] name = "solana-logger" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee2daf61ae582edf9634adf8e5021faf002df0d3f69078ecbcd6c7b41bdf833" +checksum = "121d36ffb3c6b958763312cbc697fbccba46ee837d3a0aa4fc0e90fcb3b884f3" dependencies = [ "env_logger", "lazy_static", @@ -5080,9 +5461,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "148512f384b82cf9e8bfe80503b688340d42a4cc17cfd572b88a6d803a488527" +checksum = "5c01a7f9cdc9d9d37a3d5651b2fe7ec9d433c2a3470b9f35897e373b421f0737" dependencies = [ "log", "solana-sdk", @@ -5090,9 +5471,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55d734099c26f81621bd1aaddb8788908e20fd7fac28fb00402d564964eae4ea" +checksum = "71e36052aff6be1536bdf6f737c6e69aca9dbb6a2f3f582e14ecb0ddc0cd66ce" dependencies = [ "crossbeam-channel", "gethostname", @@ -5105,9 +5486,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "563911bb92bc6ae3ba4e7d9930dc560c61333ee57f7ba0421abe0cab14982e72" +checksum = "2a1f5c6be9c5b272866673741e1ebc64b2ea2118e5c6301babbce526fdfb15f4" dependencies = [ "bincode", "clap 3.2.25", @@ -5127,9 +5508,9 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b21bd999096d156dd122aed05eb4601fbc9dba016e229be72ba838aa5ff2a7df" +checksum = "28acaf22477566a0fbddd67249ea5d859b39bacdb624aff3fadd3c5745e2643c" dependencies = [ "ahash 0.8.11", "bincode", @@ -5156,9 +5537,9 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4908f360900d0a1aa81c7bad7937c78f0825c3f08ff0b22f1de0e43e5946f2" +checksum = "c10f4588cefd716b24a1a40dd32c278e43a560ab8ce4de6b5805c9d113afdfa1" dependencies = [ "ark-bn254", "ark-ec", @@ -5166,9 +5547,9 @@ dependencies = [ "ark-serialize", "base64 0.21.7", "bincode", - "bitflags 2.5.0", + "bitflags 2.6.0", "blake3", - "borsh 0.10.3", + "borsh 0.10.4", "borsh 0.9.3", "borsh 1.5.1", "bs58 0.4.0", @@ -5179,7 +5560,7 @@ dependencies = [ "console_log", "curve25519-dalek", "getrandom 0.2.15", - "itertools", + "itertools 0.10.5", "js-sys", "lazy_static", "libc", @@ -5187,7 +5568,7 @@ dependencies = [ "light-poseidon", "log", "memoffset 0.9.1", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-derive 0.4.2", "num-traits", "parking_lot", @@ -5202,24 +5583,70 @@ dependencies = [ "sha3 0.10.8", "solana-frozen-abi", "solana-frozen-abi-macro", - "solana-sdk-macro", + "solana-sdk-macro 1.18.26", "thiserror", "tiny-bip39", "wasm-bindgen", "zeroize", ] +[[package]] +name = "solana-program" +version = "2.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "867b550685b9036a6595e85c5b9bd67f1648ecdecd20fbc5816292eb09ed676f" +dependencies = [ + "ark-bn254", + "ark-ec", + "ark-ff", + "ark-serialize", + "base64 0.22.1", + "bincode", + "bitflags 2.6.0", + "blake3", + "borsh 0.10.4", + "borsh 1.5.1", + "bs58 0.5.1", + "bv", + "bytemuck", + "bytemuck_derive", + "console_error_panic_hook", + "console_log", + "curve25519-dalek", + "getrandom 0.2.15", + "js-sys", + "lazy_static", + "libsecp256k1", + "log", + "memoffset 0.9.1", + "num-bigint 0.4.6", + "num-derive 0.4.2", + "num-traits", + "parking_lot", + "rand 0.8.5", + "rustc_version", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "sha2 0.10.8", + "sha3 0.10.8", + "solana-sdk-macro 2.0.15", + "thiserror", + "wasm-bindgen", +] + [[package]] name = "solana-program-runtime" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c8ace7f999a8278351ea86ed93f57e7833cb65fb04167a9ba9ea593e995288" +checksum = "fbf0c3eab2a80f514289af1f422c121defb030937643c43b117959d6f1932fb5" dependencies = [ "base64 0.21.7", "bincode", "eager", "enum-iterator", - "itertools", + "itertools 0.10.5", "libc", "log", "num-derive 0.4.2", @@ -5239,9 +5666,9 @@ dependencies = [ [[package]] name = "solana-pubsub-client" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfaebabf56720238919d8d1699211240cca485bda3b12f6189c737679a935912" +checksum = "b064e76909d33821b80fdd826e6757251934a52958220c92639f634bea90366d" dependencies = [ "crossbeam-channel", "futures-util", @@ -5264,14 +5691,14 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85f868c2bf7591835705298dd4350c38a8e9de07e53109fa243ebc55bbd33f03" +checksum = "5a90e40ee593f6e9ddd722d296df56743514ae804975a76d47e7afed4e3da244" dependencies = [ "async-mutex", "async-trait", "futures", - "itertools", + "itertools 0.10.5", "lazy_static", "log", "quinn", @@ -5291,9 +5718,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c9c928e5b6b1e37296e139c757695f9540e2d4f04794a1ae1915eba7076e68" +checksum = "66468f9c014992167de10cc68aad6ac8919a8c8ff428dc88c0d2b4da8c02b8b7" dependencies = [ "lazy_static", "num_cpus", @@ -5301,9 +5728,9 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d9f47fb9de096edd536bb39c1a8383372acf719f3fd49242bfe332ea216c3b" +checksum = "c191019f4d4f84281a6d0dd9a43181146b33019627fc394e42e08ade8976b431" dependencies = [ "console 0.15.8", "dialoguer 0.10.4", @@ -5320,9 +5747,9 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2259b63faca1132e3a0c8b98438fb60e5d25897260dd3655bcf4ec8c6f2bf8" +checksum = "36ed4628e338077c195ddbf790693d410123d17dec0a319b5accb4aaee3fb15c" dependencies = [ "async-trait", "base64 0.21.7", @@ -5346,9 +5773,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0aea25d581de77ba256b81f4ebd8d963b85ec01d70a74829365e85f6403d497" +checksum = "83c913551faa4a1ae4bbfef6af19f3a5cf847285c05b4409e37c8993b3444229" dependencies = [ "base64 0.21.7", "bs58 0.4.0", @@ -5368,9 +5795,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef5cbfb47707599ccb5734aa70b5161a2d437df54044021870be3f575eb0f1a" +checksum = "1a47b6bb1834e6141a799db62bbdcf80d17a7d58d7bc1684c614e01a7293d7cf" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -5381,14 +5808,14 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50ec330850953d4971b052ff98c74a8e67e7618b4aed9f4971b8d3b68fcd1cd" +checksum = "580ad66c2f7a4c3cb3244fe21440546bd500f5ecb955ad9826e92a78dded8009" dependencies = [ "assert_matches", "base64 0.21.7", "bincode", - "bitflags 2.5.0", + "bitflags 2.6.0", "borsh 1.5.1", "bs58 0.4.0", "bytemuck", @@ -5400,7 +5827,7 @@ dependencies = [ "ed25519-dalek-bip32", "generic-array", "hmac 0.12.1", - "itertools", + "itertools 0.10.5", "js-sys", "lazy_static", "libsecp256k1", @@ -5408,7 +5835,7 @@ dependencies = [ "memmap2", "num-derive 0.4.2", "num-traits", - "num_enum 0.7.2", + "num_enum 0.7.3", "pbkdf2 0.11.0", "qstring", "qualifier_attr", @@ -5427,8 +5854,8 @@ dependencies = [ "solana-frozen-abi", "solana-frozen-abi-macro", "solana-logger", - "solana-program", - "solana-sdk-macro", + "solana-program 1.18.26", + "solana-sdk-macro 1.18.26", "thiserror", "uriparse", "wasm-bindgen", @@ -5436,15 +5863,28 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ef2ea49002d1bf52a4a8509570b2c3b88e7b6d0a131b11bbd637ca1e1df0ff" +checksum = "1b75d0f193a27719257af19144fdaebec0415d1c9e9226ae4bd29b791be5e9bd" dependencies = [ "bs58 0.4.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.58", + "syn 2.0.87", +] + +[[package]] +name = "solana-sdk-macro" +version = "2.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90d3fae96ed892397f91ead42a2c6d06141778bd491c9fd85195eebe190099c9" +dependencies = [ + "bs58 0.5.1", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", ] [[package]] @@ -5455,17 +5895,17 @@ checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" [[package]] name = "solana-streamer" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29de0561c0aa6249292a2602be31e812977ae223be031b3a9e0715d98fb19b06" +checksum = "f8476e41ad94fe492e8c06697ee35912cf3080aae0c9e9ac6430835256ccf056" dependencies = [ "async-channel", "bytes", "crossbeam-channel", "futures-util", "histogram", - "indexmap 2.2.6", - "itertools", + "indexmap 2.6.0", + "itertools 0.10.5", "libc", "log", "nix", @@ -5488,9 +5928,9 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d20b7c9b7214fe50e2e72090f833f11e07f3b00ba69b57872b6adcf5479cdf32" +checksum = "d8c02245d0d232430e79dc0d624aa42d50006097c3aec99ac82ac299eaa3a73f" dependencies = [ "bincode", "log", @@ -5503,14 +5943,14 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcbfd83d8d7da758b10d6e1075322843dce591a75d15d611e9eec5508e9c7233" +checksum = "67251506ed03de15f1347b46636b45c47da6be75015b4a13f0620b21beb00566" dependencies = [ "async-trait", "bincode", "futures-util", - "indexmap 2.2.6", + "indexmap 2.6.0", "indicatif", "log", "rayon", @@ -5527,14 +5967,14 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0439563ffb7471a0b51446f0fff5c8b2108e31248bf7dbab8b9efaa2af3a4c27" +checksum = "2d3d36db1b2ab2801afd5482aad9fb15ed7959f774c81a77299fdd0ddcf839d4" dependencies = [ "Inflector", "base64 0.21.7", "bincode", - "borsh 0.10.3", + "borsh 0.10.4", "bs58 0.4.0", "lazy_static", "log", @@ -5552,9 +5992,9 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1160ce03865189e4c3327cc492aeacc8567863f195a269533d98f15485402b74" +checksum = "3a754a3c2265eb02e0c35aeaca96643951f03cee6b376afe12e0cf8860ffccd1" dependencies = [ "async-trait", "solana-connection-cache", @@ -5567,9 +6007,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb25449b519a334103778e2fc1c5c0e3ea7862ae2c1ffe90fc82ce3c96058171" +checksum = "f44776bd685cc02e67ba264384acc12ef2931d01d1a9f851cb8cdbd3ce455b9e" dependencies = [ "log", "rustc_version", @@ -5583,9 +6023,9 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78899849d1131b2fbbe9f826080cc18cec5598da63a77357642c9cd8b1a86a86" +checksum = "25810970c91feb579bd3f67dca215fce971522e42bfd59696af89c5dfebd997c" dependencies = [ "bincode", "log", @@ -5597,7 +6037,7 @@ dependencies = [ "solana-frozen-abi", "solana-frozen-abi-macro", "solana-metrics", - "solana-program", + "solana-program 1.18.26", "solana-program-runtime", "solana-sdk", "thiserror", @@ -5605,9 +6045,9 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.18.15" +version = "1.18.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cafb3df56516086f65e2a08a8cd03f504236f3b5348299abd45415d1d18ba32" +checksum = "7cbdf4249b6dfcbba7d84e2b53313698043f60f8e22ce48286e6fbe8a17c8d16" dependencies = [ "aes-gcm-siv", "base64 0.21.7", @@ -5616,7 +6056,7 @@ dependencies = [ "byteorder", "curve25519-dalek", "getrandom 0.1.16", - "itertools", + "itertools 0.10.5", "lazy_static", "merlin", "num-derive 0.4.2", @@ -5625,7 +6065,7 @@ dependencies = [ "serde", "serde_json", "sha3 0.9.1", - "solana-program", + "solana-program 1.18.26", "solana-sdk", "subtle", "thiserror", @@ -5634,9 +6074,9 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.8.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d457cc2ba742c120492a64b7fa60e22c575e891f6b55039f4d736568fb112a3" +checksum = "da5d083187e3b3f453e140f292c09186881da8a02a7b5e27f645ee26de3d9cc5" dependencies = [ "byteorder", "combine", @@ -5679,9 +6119,9 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfcf740e5242f2ad63325e600c368702f32db84608fc8b70d70633c68dd1486d" dependencies = [ - "anchor-lang", + "anchor-lang 0.29.0", "bytemuck", - "solana-program", + "solana-program 1.18.26", "solana-security-txt", "spl-concurrent-merkle-tree", "spl-noop", @@ -5694,10 +6134,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "992d9c64c2564cc8f63a4b508bf3ebcdf2254b0429b13cd1d31adb6162432a5f" dependencies = [ "assert_matches", - "borsh 0.10.3", + "borsh 0.10.4", "num-derive 0.4.2", "num-traits", - "solana-program", + "solana-program 1.18.26", "spl-token", "spl-token-2022 1.0.0", "thiserror", @@ -5705,17 +6145,17 @@ dependencies = [ [[package]] name = "spl-associated-token-account" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2e688554bac5838217ffd1fab7845c573ff106b6336bf7d290db7c98d5a8efd" +checksum = "143109d789171379e6143ef23191786dfaac54289ad6e7917cfb26b36c432b10" dependencies = [ "assert_matches", "borsh 1.5.1", "num-derive 0.4.2", "num-traits", - "solana-program", + "solana-program 1.18.26", "spl-token", - "spl-token-2022 3.0.2", + "spl-token-2022 3.0.4", "thiserror", ] @@ -5726,29 +6166,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7f5f45b971d82cbb0416fdffad3c9098f259545d54072e83a0a482f60f8f689" dependencies = [ "bytemuck", - "solana-program", + "solana-program 2.0.15", "thiserror", ] [[package]] name = "spl-discriminator" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa600f2fe56f32e923261719bae640d873edadbc5237681a39b8e37bfd4d263" +checksum = "cce5d563b58ef1bb2cdbbfe0dfb9ffdc24903b10ae6a4df2d8f425ece375033f" dependencies = [ "bytemuck", - "solana-program", + "solana-program 1.18.26", "spl-discriminator-derive 0.1.2", ] [[package]] name = "spl-discriminator" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34d1814406e98b08c5cd02c1126f83fd407ad084adce0b05fda5730677822eac" +checksum = "210101376962bb22bb13be6daea34656ea1cbc248fce2164b146e39203b55e03" dependencies = [ "bytemuck", - "solana-program", + "solana-program 1.18.26", "spl-discriminator-derive 0.2.0", ] @@ -5760,7 +6200,7 @@ checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" dependencies = [ "quote", "spl-discriminator-syn 0.1.2", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -5771,7 +6211,7 @@ checksum = "d9e8418ea6269dcfb01c712f0444d2c75542c04448b480e87de59d2865edc750" dependencies = [ "quote", "spl-discriminator-syn 0.2.0", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -5783,7 +6223,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.58", + "syn 2.0.87", "thiserror", ] @@ -5796,7 +6236,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.58", + "syn 2.0.87", "thiserror", ] @@ -5806,7 +6246,7 @@ version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a" dependencies = [ - "solana-program", + "solana-program 1.18.26", ] [[package]] @@ -5815,57 +6255,57 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dd67ea3d0070a12ff141f5da46f9695f49384a03bce1203a5608f5739437950" dependencies = [ - "solana-program", + "solana-program 1.18.26", ] [[package]] name = "spl-pod" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85a5db7e4efb1107b0b8e52a13f035437cdcb36ef99c58f6d467f089d9b2915a" +checksum = "2881dddfca792737c0706fa0175345ab282b1b0879c7d877bad129645737c079" dependencies = [ - "borsh 0.10.3", + "borsh 0.10.4", "bytemuck", - "solana-program", + "solana-program 1.18.26", "solana-zk-token-sdk", - "spl-program-error 0.3.1", + "spl-program-error 0.3.0", ] [[package]] name = "spl-pod" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046ce669f48cf2eca1ec518916d8725596bfb655beb1c74374cf71dc6cb773c9" +checksum = "c52d84c55efeef8edcc226743dc089d7e3888b8e3474569aa3eff152b37b9996" dependencies = [ "borsh 1.5.1", "bytemuck", - "solana-program", + "solana-program 1.18.26", "solana-zk-token-sdk", - "spl-program-error 0.4.1", + "spl-program-error 0.4.4", ] [[package]] name = "spl-program-error" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0657b6490196971d9e729520ba934911ff41fbb2cb9004463dbe23cf8b4b4f" +checksum = "249e0318493b6bcf27ae9902600566c689b7dfba9f1bdff5893e92253374e78c" dependencies = [ "num-derive 0.4.2", "num-traits", - "solana-program", + "solana-program 1.18.26", "spl-program-error-derive 0.3.2", "thiserror", ] [[package]] name = "spl-program-error" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49065093ea91f57b9b2bd81493ff705e2ad4e64507a07dbc02b085778e02770e" +checksum = "e45a49acb925db68aa501b926096b2164adbdcade7a0c24152af9f0742d0a602" dependencies = [ "num-derive 0.4.2", "num-traits", - "solana-program", + "solana-program 1.18.26", "spl-program-error-derive 0.4.1", "thiserror", ] @@ -5879,7 +6319,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -5891,7 +6331,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -5901,39 +6341,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" dependencies = [ "bytemuck", - "solana-program", - "spl-discriminator 0.1.1", - "spl-pod 0.1.1", - "spl-program-error 0.3.1", - "spl-type-length-value 0.3.1", + "solana-program 1.18.26", + "spl-discriminator 0.1.0", + "spl-pod 0.1.0", + "spl-program-error 0.3.0", + "spl-type-length-value 0.3.0", ] [[package]] name = "spl-tlv-account-resolution" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f335787add7fa711819f9e7c573f8145a5358a709446fe2d24bf2a88117c90" +checksum = "615d381f48ddd2bb3c57c7f7fb207591a2a05054639b18a62e785117dd7a8683" dependencies = [ "bytemuck", - "solana-program", - "spl-discriminator 0.1.1", - "spl-pod 0.1.1", - "spl-program-error 0.3.1", - "spl-type-length-value 0.3.1", + "solana-program 1.18.26", + "spl-discriminator 0.1.0", + "spl-pod 0.1.0", + "spl-program-error 0.3.0", + "spl-type-length-value 0.3.0", ] [[package]] name = "spl-tlv-account-resolution" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cace91ba08984a41556efe49cbf2edca4db2f577b649da7827d3621161784bf8" +checksum = "fab8edfd37be5fa17c9e42c1bff86abbbaf0494b031b37957f2728ad2ff842ba" dependencies = [ "bytemuck", - "solana-program", - "spl-discriminator 0.2.2", - "spl-pod 0.2.2", - "spl-program-error 0.4.1", - "spl-type-length-value 0.4.3", + "solana-program 1.18.26", + "spl-discriminator 0.2.5", + "spl-pod 0.2.5", + "spl-program-error 0.4.4", + "spl-type-length-value 0.4.6", ] [[package]] @@ -5947,7 +6387,7 @@ dependencies = [ "num-derive 0.3.3", "num-traits", "num_enum 0.6.1", - "solana-program", + "solana-program 1.18.26", "thiserror", ] @@ -5961,15 +6401,15 @@ dependencies = [ "bytemuck", "num-derive 0.4.2", "num-traits", - "num_enum 0.7.2", - "solana-program", + "num_enum 0.7.3", + "solana-program 1.18.26", "solana-zk-token-sdk", "spl-memo", - "spl-pod 0.1.1", + "spl-pod 0.1.0", "spl-token", "spl-token-metadata-interface 0.2.0", "spl-transfer-hook-interface 0.3.0", - "spl-type-length-value 0.3.1", + "spl-type-length-value 0.3.0", "thiserror", ] @@ -5983,41 +6423,41 @@ dependencies = [ "bytemuck", "num-derive 0.4.2", "num-traits", - "num_enum 0.7.2", - "solana-program", + "num_enum 0.7.3", + "solana-program 1.18.26", "solana-security-txt", "solana-zk-token-sdk", "spl-memo", - "spl-pod 0.1.1", + "spl-pod 0.1.0", "spl-token", "spl-token-group-interface 0.1.0", "spl-token-metadata-interface 0.2.0", "spl-transfer-hook-interface 0.4.1", - "spl-type-length-value 0.3.1", + "spl-type-length-value 0.3.0", "thiserror", ] [[package]] name = "spl-token-2022" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5412f99ae7ee6e0afde00defaa354e6228e47e30c0e3adf553e2e01e6abb584" +checksum = "b01d1b2851964e257187c0bca43a0de38d0af59192479ca01ac3e2b58b1bd95a" dependencies = [ "arrayref", "bytemuck", "num-derive 0.4.2", "num-traits", - "num_enum 0.7.2", - "solana-program", + "num_enum 0.7.3", + "solana-program 1.18.26", "solana-security-txt", "solana-zk-token-sdk", "spl-memo", - "spl-pod 0.2.2", + "spl-pod 0.2.5", "spl-token", - "spl-token-group-interface 0.2.3", - "spl-token-metadata-interface 0.3.3", - "spl-transfer-hook-interface 0.6.3", - "spl-type-length-value 0.4.3", + "spl-token-group-interface 0.2.5", + "spl-token-metadata-interface 0.3.5", + "spl-transfer-hook-interface 0.6.5", + "spl-type-length-value 0.4.6", "thiserror", ] @@ -6028,23 +6468,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b889509d49fa74a4a033ca5dae6c2307e9e918122d97e58562f5c4ffa795c75d" dependencies = [ "bytemuck", - "solana-program", - "spl-discriminator 0.1.1", - "spl-pod 0.1.1", - "spl-program-error 0.3.1", + "solana-program 1.18.26", + "spl-discriminator 0.1.0", + "spl-pod 0.1.0", + "spl-program-error 0.3.0", ] [[package]] name = "spl-token-group-interface" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d419b5cfa3ee8e0f2386fd7e02a33b3ec8a7db4a9c7064a2ea24849dc4a273b6" +checksum = "014817d6324b1e20c4bbc883e8ee30a5faa13e59d91d1b2b95df98b920150c17" dependencies = [ "bytemuck", - "solana-program", - "spl-discriminator 0.2.2", - "spl-pod 0.2.2", - "spl-program-error 0.4.1", + "solana-program 1.18.26", + "spl-discriminator 0.2.5", + "spl-pod 0.2.5", + "spl-program-error 0.4.4", ] [[package]] @@ -6053,26 +6493,26 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f" dependencies = [ - "borsh 0.10.3", - "solana-program", - "spl-discriminator 0.1.1", - "spl-pod 0.1.1", - "spl-program-error 0.3.1", - "spl-type-length-value 0.3.1", + "borsh 0.10.4", + "solana-program 1.18.26", + "spl-discriminator 0.1.0", + "spl-pod 0.1.0", + "spl-program-error 0.3.0", + "spl-type-length-value 0.3.0", ] [[package]] name = "spl-token-metadata-interface" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30179c47e93625680dabb620c6e7931bd12d62af390f447bc7beb4a3a9b5feee" +checksum = "f3da00495b602ebcf5d8ba8b3ecff1ee454ce4c125c9077747be49c2d62335ba" dependencies = [ "borsh 1.5.1", - "solana-program", - "spl-discriminator 0.2.2", - "spl-pod 0.2.2", - "spl-program-error 0.4.1", - "spl-type-length-value 0.4.3", + "solana-program 1.18.26", + "spl-discriminator 0.2.5", + "spl-pod 0.2.5", + "spl-program-error 0.4.4", + "spl-type-length-value 0.4.6", ] [[package]] @@ -6083,12 +6523,12 @@ checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" dependencies = [ "arrayref", "bytemuck", - "solana-program", - "spl-discriminator 0.1.1", - "spl-pod 0.1.1", - "spl-program-error 0.3.1", + "solana-program 1.18.26", + "spl-discriminator 0.1.0", + "spl-pod 0.1.0", + "spl-program-error 0.3.0", "spl-tlv-account-resolution 0.4.0", - "spl-type-length-value 0.3.1", + "spl-type-length-value 0.3.0", ] [[package]] @@ -6099,56 +6539,62 @@ checksum = "7aabdb7c471566f6ddcee724beb8618449ea24b399e58d464d6b5bc7db550259" dependencies = [ "arrayref", "bytemuck", - "solana-program", - "spl-discriminator 0.1.1", - "spl-pod 0.1.1", - "spl-program-error 0.3.1", - "spl-tlv-account-resolution 0.5.2", - "spl-type-length-value 0.3.1", + "solana-program 1.18.26", + "spl-discriminator 0.1.0", + "spl-pod 0.1.0", + "spl-program-error 0.3.0", + "spl-tlv-account-resolution 0.5.1", + "spl-type-length-value 0.3.0", ] [[package]] name = "spl-transfer-hook-interface" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a98359769cd988f7b35c02558daa56d496a7e3bd8626e61f90a7c757eedb9b" +checksum = "a9b5c08a89838e5a2931f79b17f611857f281a14a2100968a3ccef352cb7414b" dependencies = [ "arrayref", "bytemuck", - "solana-program", - "spl-discriminator 0.2.2", - "spl-pod 0.2.2", - "spl-program-error 0.4.1", - "spl-tlv-account-resolution 0.6.3", - "spl-type-length-value 0.4.3", + "solana-program 1.18.26", + "spl-discriminator 0.2.5", + "spl-pod 0.2.5", + "spl-program-error 0.4.4", + "spl-tlv-account-resolution 0.6.5", + "spl-type-length-value 0.4.6", ] [[package]] name = "spl-type-length-value" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f9ebd75d29c5f48de5f6a9c114e08531030b75b8ac2c557600ac7da0b73b1e8" +checksum = "a468e6f6371f9c69aae760186ea9f1a01c2908351b06a5e0026d21cfc4d7ecac" dependencies = [ "bytemuck", - "solana-program", - "spl-discriminator 0.1.1", - "spl-pod 0.1.1", - "spl-program-error 0.3.1", + "solana-program 1.18.26", + "spl-discriminator 0.1.0", + "spl-pod 0.1.0", + "spl-program-error 0.3.0", ] [[package]] name = "spl-type-length-value" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422ce13429dbd41d2cee8a73931c05fda0b0c8ca156a8b0c19445642550bb61a" +checksum = "c872f93d0600e743116501eba2d53460e73a12c9a496875a42a7d70e034fe06d" dependencies = [ "bytemuck", - "solana-program", - "spl-discriminator 0.2.2", - "spl-pod 0.2.2", - "spl-program-error 0.4.1", + "solana-program 1.18.26", + "spl-discriminator 0.2.5", + "spl-pod 0.2.5", + "spl-program-error 0.4.4", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "strsim" version = "0.8.0" @@ -6186,7 +6632,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -6208,9 +6654,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.58" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -6226,7 +6672,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -6247,6 +6693,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -6276,14 +6733,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6322,22 +6780,22 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.65" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -6399,11 +6857,21 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -6416,21 +6884,20 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", "libc", - "mio", - "num_cpus", + "mio 1.0.2", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -6445,13 +6912,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -6466,9 +6933,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -6492,9 +6959,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -6514,17 +6981,17 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "toml_datetime", "winnow", ] @@ -6570,7 +7037,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -6595,15 +7062,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -6625,7 +7092,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", ] [[package]] @@ -6642,7 +7109,7 @@ name = "treasury-management" version = "0.2.0" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] @@ -6678,44 +7145,38 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "universal-hash" @@ -6776,9 +7237,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.0" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", "idna", @@ -6792,17 +7253,29 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.8.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" [[package]] name = "vec_map" @@ -6812,9 +7285,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "void" @@ -6827,7 +7300,7 @@ name = "voter-stake-registry" version = "0.3.3" dependencies = [ "anchor-gen", - "anchor-lang", + "anchor-lang 0.29.0", ] [[package]] @@ -6863,34 +7336,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -6900,9 +7374,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6910,28 +7384,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -6970,11 +7444,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6989,7 +7463,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -7007,7 +7481,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -7027,18 +7510,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -7049,9 +7532,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -7061,9 +7544,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -7073,15 +7556,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -7091,9 +7574,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -7103,9 +7586,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -7115,9 +7598,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -7127,15 +7610,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -7150,6 +7633,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -7206,24 +7701,70 @@ dependencies = [ "time", ] +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure 0.13.1", +] + [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", + "synstructure 0.13.1", ] [[package]] @@ -7243,7 +7784,29 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.87", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] @@ -7267,9 +7830,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", diff --git a/helium-lib/Cargo.toml b/helium-lib/Cargo.toml index cce346ed..0e75215f 100644 --- a/helium-lib/Cargo.toml +++ b/helium-lib/Cargo.toml @@ -9,46 +9,44 @@ clap = ["dep:clap"] mnemonic = ["helium-mnemonic"] [dependencies] -hex = "0.4" -hex-literal = "0" -chrono = {version = "0", features = ["serde"]} -thiserror = "1" -async-trait = "0" -anchor-client = {version = "0.29.0", features = ["async"] } +anchor-lang = "=0.29" +anchor-client = { version = "0.29.0", features = ["async"] } anchor-spl = { version = "0.29.0", features = ["mint", "token"] } -anchor-lang = { version = "0.29.0" } -url = {version = "2", features = ["serde"]} -h3o = {version = "0", features = ["serde"]} -helium-crypto = {workspace = true} -itertools = "0.10.5" -jsonrpc_client = {version = "0.7", features = ["reqwest"]} -futures = "*" -tracing = "0" -base64 = {workspace = true} solana-sdk = "1.18" -bincode = "1.3.3" -reqwest = { version = "0", default-features = false, features = [ - "rustls-tls", -] } -helium-anchor-gen = { git = "https://github.com/helium/helium-anchor-gen.git" } +solana-program = ">=1.18,<2" +solana-transaction-status = "*" +mpl-bubblegum = "1" spl-associated-token-account = { version = "*", features = ["no-entrypoint"] } spl-account-compression = { version = "0.3", features = ["no-entrypoint"] } +pyth-solana-receiver-sdk = { git = "https://github.com/madninja/pyth-crosschain.git", branch = "madninja/cap_solana_dep" } +helium-crypto = { workspace = true } +helium-proto = { workspace = true } +helium-anchor-gen = { git = "https://github.com/helium/helium-anchor-gen.git" } +helium-mnemonic = { path = "../helium-mnemonic", optional = true } +serde = { workspace = true } +serde_json = { workspace = true } +bincode = "1.3.3" +base64 = { workspace = true } +hex = "0.4" +hex-literal = "0" +tokio = { workspace = true } +futures = "*" tonic = { version = "0", features = ["tls", "tls-roots"] } -mpl-bubblegum = "1" -pyth-solana-receiver-sdk = "0" -solana-program = "*" -solana-transaction-status = "*" -serde = {workspace = true} -serde_json = {workspace = true} -lazy_static = "1" -rust_decimal = {workspace = true} -helium-proto = {workspace= true} +reqwest = { version = "0", default-features = false, features = ["rustls-tls"] } +jsonrpc_client = { version = "0.7", features = ["reqwest"] } +chrono = { version = "0", features = ["serde"] } +url = { version = "2", features = ["serde"] } +h3o = { version = "0", features = ["serde"] } +rust_decimal = { workspace = true } +itertools = "0.10.5" +thiserror = "1" +async-trait = "0" +sha2 = { workspace = true } angry-purple-tiger = "0" -sha2 = {workspace = true} -clap = {workspace = true, optional = true} -helium-mnemonic = { path = "../helium-mnemonic", optional = true } -tokio = {workspace = true} +lazy_static = "1" dirs = "5.0.1" +tracing = "0" +clap = { workspace = true, optional = true } [dev-dependencies] rand = "0.8" \ No newline at end of file From 3b2249d3de9954d1ccd94ffae686fbf17b9936f5 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 7 Nov 2024 15:29:25 -0600 Subject: [PATCH 29/49] bump bubblegum --- helium-lib/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helium-lib/Cargo.toml b/helium-lib/Cargo.toml index 0e75215f..6722796a 100644 --- a/helium-lib/Cargo.toml +++ b/helium-lib/Cargo.toml @@ -15,7 +15,7 @@ anchor-spl = { version = "0.29.0", features = ["mint", "token"] } solana-sdk = "1.18" solana-program = ">=1.18,<2" solana-transaction-status = "*" -mpl-bubblegum = "1" +mpl-bubblegum = { version = "1.4.0" } spl-associated-token-account = { version = "*", features = ["no-entrypoint"] } spl-account-compression = { version = "0.3", features = ["no-entrypoint"] } pyth-solana-receiver-sdk = { git = "https://github.com/madninja/pyth-crosschain.git", branch = "madninja/cap_solana_dep" } From 0a36e98f6c1819dc88d112e7d9b4c259f3ffa02b Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 11 Nov 2024 12:19:59 -0600 Subject: [PATCH 30/49] wip --- Cargo.lock | 49 +++++++++-------------- Cargo.toml | 2 +- helium-lib/Cargo.toml | 2 +- helium-lib/src/client.rs | 19 +++++---- helium-lib/src/iot_routing_manager.rs | 56 ++++++++++++++++++++++----- 5 files changed, 75 insertions(+), 53 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5980b0ce..9be7f7c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1155,11 +1155,11 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" +checksum = "f5327f6c99920069d1fe374aa743be1af0031dea9f250852cdf1ae6a0861ee24" dependencies = [ - "borsh-derive 1.5.1", + "borsh-derive 1.5.2", "cfg_aliases", ] @@ -1191,16 +1191,15 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" +checksum = "10aedd8f1a81a8aafbfde924b0e3061cd6fedd6f6bbcfc6a76e6fd426d7bfe26" dependencies = [ "once_cell", "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.87", - "syn_derive", ] [[package]] @@ -1372,9 +1371,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.36" +version = "1.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baee610e9452a8f6f0a1b6194ec09ff9e2d85dea54432acdae41aa0761c95d70" +checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" dependencies = [ "jobserver", "libc", @@ -2271,9 +2270,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "feature-probe" @@ -4787,7 +4786,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555" dependencies = [ "arrayvec", - "borsh 1.5.1", + "borsh 1.5.2", "bytes", "num-traits", "rand 0.8.5", @@ -5551,7 +5550,7 @@ dependencies = [ "blake3", "borsh 0.10.4", "borsh 0.9.3", - "borsh 1.5.1", + "borsh 1.5.2", "bs58 0.4.0", "bv", "bytemuck", @@ -5605,7 +5604,7 @@ dependencies = [ "bitflags 2.6.0", "blake3", "borsh 0.10.4", - "borsh 1.5.1", + "borsh 1.5.2", "bs58 0.5.1", "bv", "bytemuck", @@ -5816,7 +5815,7 @@ dependencies = [ "base64 0.21.7", "bincode", "bitflags 2.6.0", - "borsh 1.5.1", + "borsh 1.5.2", "bs58 0.4.0", "bytemuck", "byteorder", @@ -6150,7 +6149,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "143109d789171379e6143ef23191786dfaac54289ad6e7917cfb26b36c432b10" dependencies = [ "assert_matches", - "borsh 1.5.1", + "borsh 1.5.2", "num-derive 0.4.2", "num-traits", "solana-program 1.18.26", @@ -6277,7 +6276,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c52d84c55efeef8edcc226743dc089d7e3888b8e3474569aa3eff152b37b9996" dependencies = [ - "borsh 1.5.1", + "borsh 1.5.2", "bytemuck", "solana-program 1.18.26", "solana-zk-token-sdk", @@ -6507,7 +6506,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3da00495b602ebcf5d8ba8b3ecff1ee454ce4c125c9077747be49c2d62335ba" dependencies = [ - "borsh 1.5.1", + "borsh 1.5.2", "solana-program 1.18.26", "spl-discriminator 0.2.5", "spl-pod 0.2.5", @@ -6663,18 +6662,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "syn_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "sync_wrapper" version = "0.1.2" @@ -6733,9 +6720,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", diff --git a/Cargo.toml b/Cargo.toml index 2abfa4ba..6cf97ca0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ helium-proto = { git = "https://github.com/helium/proto", branch = "master", fea "services", ] } clap = { version = "4", features = ["derive"] } -tokio = {version = "1.0", features = ["full"]} +tokio = { version = "1.0", features = ["full"] } [patch.'https://github.com/helium/helium-anchor-gen.git'] helium-anchor-gen = { path = "../helium-anchor-gen" } diff --git a/helium-lib/Cargo.toml b/helium-lib/Cargo.toml index 6722796a..0e75215f 100644 --- a/helium-lib/Cargo.toml +++ b/helium-lib/Cargo.toml @@ -15,7 +15,7 @@ anchor-spl = { version = "0.29.0", features = ["mint", "token"] } solana-sdk = "1.18" solana-program = ">=1.18,<2" solana-transaction-status = "*" -mpl-bubblegum = { version = "1.4.0" } +mpl-bubblegum = "1" spl-associated-token-account = { version = "*", features = ["no-entrypoint"] } spl-account-compression = { version = "0.3", features = ["no-entrypoint"] } pyth-solana-receiver-sdk = { git = "https://github.com/madninja/pyth-crosschain.git", branch = "madninja/cap_solana_dep" } diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index 653fc96c..0f8ff223 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -89,12 +89,11 @@ impl SolanaClient { .replace("127.0.0.1:8899", "127.0.0.1:8900") } - pub fn payer(&self) -> Option { - if let Some(ref wallet) = self.wallet { - Some(wallet.pubkey()) - } else { - None - } + pub fn wallet(&self) -> Result { + self.wallet + .as_ref() + .map(|wallet| wallet.pubkey()) + .ok_or_else(|| Error::Other("Wallet not configured".to_string())) } pub async fn send_instructions( @@ -205,9 +204,9 @@ impl TryFrom<&str> for Client { } } -impl AsRef for Client { - fn as_ref(&self) -> &SolanaClient { - &self.solana_client +impl AsRef for SolanaClient { + fn as_ref(&self) -> &SolanaRpcClient { + &self.inner } } @@ -236,7 +235,7 @@ pub trait GetAnchorAccount { } #[async_trait::async_trait] -impl GetAnchorAccount for solana_client::nonblocking::rpc_client::RpcClient { +impl GetAnchorAccount for SolanaRpcClient { async fn anchor_account( &self, pubkey: &Pubkey, diff --git a/helium-lib/src/iot_routing_manager.rs b/helium-lib/src/iot_routing_manager.rs index 6ddb98c8..a56a7b0a 100644 --- a/helium-lib/src/iot_routing_manager.rs +++ b/helium-lib/src/iot_routing_manager.rs @@ -110,6 +110,24 @@ pub mod organization { token::Token, }; + pub async fn ensure_exists>( + client: &C, + oui: u64, + ) -> Result<(Pubkey, OrganizationV0), Error> { + let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); + let routing_manager_key = routing_manager_key(&sub_dao); + let organization_key = organization_key(&routing_manager_key, oui); + + match client + .as_ref() + .anchor_account::(&organization_key) + .await? + { + Some(organization) => Ok((organization_key, organization)), + None => Err(Error::account_not_found()), + } + } + pub async fn create>( client: &C, payer: Pubkey, @@ -198,14 +216,14 @@ pub mod organization { pub async fn approve>( _client: &C, authority: Pubkey, - organizaion_key: Pubkey, + organization_key: Pubkey, net_id_key: Pubkey, ) -> Result { Ok(Instruction { program_id: iot_routing_manager::ID, accounts: iot_routing_manager::accounts::ApproveOrganizationV0 { authority, - organization: organizaion_key, + organization: organization_key, net_id: net_id_key, system_program: solana_sdk::system_program::ID, } @@ -266,18 +284,17 @@ pub mod orgainization_delegate { pub async fn remove>( _client: &C, - rent_refund: Pubkey, + authority: Pubkey, delegate: Pubkey, organization_key: Pubkey, - authority: Option, ) -> Result { let orgainization_delegate_key = organization_delegate_key(&organization_key, &delegate); Ok(Instruction { program_id: iot_routing_manager::ID, accounts: iot_routing_manager::accounts::RemoveOrganizationDelegateV0 { - rent_refund, - authority: authority.unwrap_or(rent_refund.clone()), + authority, + rent_refund: authority, organization: organization_key, organization_delegate: orgainization_delegate_key, } @@ -297,6 +314,24 @@ pub mod net_id { token::Token, }; + pub async fn ensure_exists>( + client: &C, + net_id: u32, + ) -> Result<(Pubkey, NetIdV0), Error> { + let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); + let routing_manager_key = routing_manager_key(&sub_dao); + let net_id_key = net_id_key(&routing_manager_key, net_id); + + match client + .as_ref() + .anchor_account::(&net_id_key) + .await? + { + Some(net_id) => Ok((net_id_key, net_id)), + None => Err(Error::account_not_found()), + } + } + pub async fn create>( client: &C, payer: Pubkey, @@ -342,6 +377,8 @@ pub mod net_id { } pub mod devaddr_constraint { + use helium_anchor_gen::helium_entity_manager::MobileDeploymentInfoV0; + use super::*; use crate::{ @@ -403,9 +440,8 @@ pub mod devaddr_constraint { pub async fn remove>( client: &C, - rent_refund: Pubkey, + authority: Pubkey, devaddr_constraint_key: Pubkey, - authority: Option, ) -> Result { let devaddr_constraint = client .as_ref() @@ -416,8 +452,8 @@ pub mod devaddr_constraint { Ok(Instruction { program_id: iot_routing_manager::ID, accounts: iot_routing_manager::accounts::RemoveDevaddrConstraintV0 { - rent_refund, - authority: authority.unwrap_or(rent_refund.clone()), + authority, + rent_refund: authority, net_id: devaddr_constraint.net_id, devaddr_constraint: devaddr_constraint_key, } From b5ababb2a4a46ca3fcceb56738c1f2c1cd33c0d5 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 20 Nov 2024 16:14:54 -0600 Subject: [PATCH 31/49] Fix logic for existing account --- helium-lib/src/error.rs | 2 +- helium-lib/src/iot_routing_manager.rs | 62 +++++++++++++++++++-------- 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/helium-lib/src/error.rs b/helium-lib/src/error.rs index 68dcb102..1bfea7c3 100644 --- a/helium-lib/src/error.rs +++ b/helium-lib/src/error.rs @@ -20,7 +20,7 @@ pub enum Error { #[error("grpc: {0}")] Grpc(#[from] tonic::Status), #[error("service: {0}")] - Servcice(#[from] helium_proto::services::Error), + Service(#[from] helium_proto::services::Error), #[error("price client: {0}")] Price(#[from] token::price::PriceError), #[error("rest client: {0}")] diff --git a/helium-lib/src/iot_routing_manager.rs b/helium-lib/src/iot_routing_manager.rs index a56a7b0a..d581b06b 100644 --- a/helium-lib/src/iot_routing_manager.rs +++ b/helium-lib/src/iot_routing_manager.rs @@ -110,13 +110,21 @@ pub mod organization { token::Token, }; + pub enum OrgIdentifier { + Oui(u64), + Pubkey(Pubkey), + } + pub async fn ensure_exists>( client: &C, - oui: u64, + identifier: OrgIdentifier, ) -> Result<(Pubkey, OrganizationV0), Error> { let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); let routing_manager_key = routing_manager_key(&sub_dao); - let organization_key = organization_key(&routing_manager_key, oui); + let organization_key = match identifier { + OrgIdentifier::Oui(oui) => organization_key(&routing_manager_key, oui), + OrgIdentifier::Pubkey(pubkey) => pubkey, + }; match client .as_ref() @@ -135,12 +143,19 @@ pub mod organization { authority: Option, recipient: Option, ) -> Result<(Pubkey, Instruction), Error> { + let payer_iot_ata_key = get_associated_token_address(&payer, Token::Iot.mint()); let dao_key = helium_sub_daos::dao_key(Token::Hnt.mint()); let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); let program_approval_key = helium_entity_manager::program_approval_key(&dao_key, &iot_routing_manager::ID); + client + .as_ref() + .get_account(&payer_iot_ata_key) + .await + .map_err(|_| Error::Other("Payer IOT token account non existent.".to_string()))?; + client .as_ref() .anchor_account::(&program_approval_key) @@ -181,7 +196,7 @@ pub mod organization { routing_manager: routing_manager_key, net_id: net_id_key, iot_mint: Token::Iot.mint().clone(), - payer_iot_account: get_associated_token_address(&payer, Token::Iot.mint()), + payer_iot_account: payer_iot_ata_key, iot_price_oracle: Token::Iot.price_key().unwrap().clone(), authority: authority.unwrap_or(payer.clone()), bubblegum_signer: metaplex::bubblegum_signer_key(), @@ -314,13 +329,21 @@ pub mod net_id { token::Token, }; + pub enum NetIdIdentifier { + Id(u32), + Pubkey(Pubkey), + } + pub async fn ensure_exists>( client: &C, - net_id: u32, + identifier: NetIdIdentifier, ) -> Result<(Pubkey, NetIdV0), Error> { let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); let routing_manager_key = routing_manager_key(&sub_dao); - let net_id_key = net_id_key(&routing_manager_key, net_id); + let net_id_key = match identifier { + NetIdIdentifier::Id(id) => net_id_key(&routing_manager_key, id), + NetIdIdentifier::Pubkey(pubkey) => pubkey, + }; match client .as_ref() @@ -350,8 +373,8 @@ pub mod net_id { let net_id_exists = client .as_ref() .anchor_account::(&net_id_key) - .await? - .is_some(); + .await + .is_ok(); if net_id_exists { return Err(Error::account_exists()); @@ -377,14 +400,12 @@ pub mod net_id { } pub mod devaddr_constraint { - use helium_anchor_gen::helium_entity_manager::MobileDeploymentInfoV0; - use super::*; use crate::{ client::{GetAnchorAccount, SolanaRpcClient}, error::Error, - iot_routing_manager, + helium_sub_daos, iot_routing_manager, token::Token, }; @@ -393,17 +414,22 @@ pub mod devaddr_constraint { payer: Pubkey, args: InitializeDevaddrConstraintArgsV0, organization_key: Pubkey, + net_id_key: Pubkey, authority: Option, ) -> Result<(Pubkey, Instruction), Error> { - let organization = client + let payer_iot_ata_key = get_associated_token_address(&payer, Token::Iot.mint()); + let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); + let routing_manager_key = routing_manager_key(&sub_dao); + + client .as_ref() - .anchor_account::(&organization_key) - .await? - .ok_or_else(|| Error::account_not_found())?; + .get_account(&payer_iot_ata_key) + .await + .map_err(|_| Error::Other("Payer IOT token account non existent.".to_string()))?; let net_id = client .as_ref() - .anchor_account::(&organization.net_id) + .anchor_account::(&&net_id_key) .await? .ok_or_else(|| Error::account_not_found())?; @@ -419,11 +445,11 @@ pub mod devaddr_constraint { accounts: iot_routing_manager::accounts::InitializeDevaddrConstraintV0 { payer, authority: authority.unwrap_or(payer.clone()), - net_id: organization.net_id, - routing_manager: organization.routing_manager, + net_id: net_id_key, + routing_manager: routing_manager_key, organization: organization_key, iot_mint: Token::Iot.mint().clone(), - payer_iot_account: get_associated_token_address(&payer, Token::Iot.mint()), + payer_iot_account: payer_iot_ata_key, iot_price_oracle: Token::Iot.price_key().unwrap().clone(), devaddr_constraint: devaddr_constarint_key, token_program: anchor_spl::token::ID, From 0623a99c489b6a35dec349b3cd54c7e31e30ab44 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 5 Dec 2024 16:50:38 -0600 Subject: [PATCH 32/49] Fix errors after merging master --- Cargo.lock | 58 -------------- Cargo.toml | 3 - helium-lib/src/client.rs | 80 +++---------------- helium-lib/src/dao.rs | 27 ------- helium-lib/src/dc.rs | 7 -- helium-lib/src/helium_entity_manager.rs | 2 +- helium-lib/src/helium_sub_daos.rs | 4 +- helium-lib/src/hotspot/dataonly.rs | 5 -- helium-lib/src/hotspot/mod.rs | 4 +- helium-lib/src/iot_routing_manager.rs | 5 +- helium-lib/src/lib.rs | 3 +- helium-lib/src/metaplex.rs | 4 +- helium-lib/src/reward.rs | 15 +--- .../solana_transaction_utils/priority_fee.rs | 20 +++-- 14 files changed, 33 insertions(+), 204 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bd2e5b3a..5f4f3895 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2027,27 +2027,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - [[package]] name = "displaydoc" version = "0.2.5" @@ -2628,7 +2607,6 @@ dependencies = [ "helium-entity-manager", "helium-sub-daos", "hexboosting", - "iot-routing-manager", "lazy-distributor", "lazy-transactions", "mobile-entity-manager", @@ -2676,7 +2654,6 @@ name = "helium-lib" version = "0.0.0" dependencies = [ "anchor-client", - "anchor-lang 0.29.0", "anchor-spl", "angry-purple-tiger", "async-trait", @@ -2709,7 +2686,6 @@ dependencies = [ "spl-associated-token-account 3.0.4", "spl-memo", "thiserror", - "tokio", "tonic", "tracing", "url", @@ -3177,23 +3153,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "iot-routing-manager" -version = "0.1.2" -dependencies = [ - "anchor-gen", - "anchor-lang 0.29.0", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -3902,12 +3861,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - [[package]] name = "os_str_bytes" version = "6.6.1" @@ -4558,17 +4511,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom 0.2.15", - "libredox", - "thiserror", -] - [[package]] name = "regex" version = "1.11.1" diff --git a/Cargo.toml b/Cargo.toml index 6cf97ca0..959d7bf6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,3 @@ helium-proto = { git = "https://github.com/helium/proto", branch = "master", fea ] } clap = { version = "4", features = ["derive"] } tokio = { version = "1.0", features = ["full"] } - -[patch.'https://github.com/helium/helium-anchor-gen.git'] -helium-anchor-gen = { path = "../helium-anchor-gen" } diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index ebe0d5fd..8d31d08a 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -193,15 +193,20 @@ pub struct Client { impl TryFrom<&str> for Client { type Error = Error; fn try_from(value: &str) -> Result { + fn env_or(key: &str, default: &str) -> String { + std::env::var(key).unwrap_or_else(|_| default.to_string()) + } let url = match value { - "m" | "mainnet-beta" => SOLANA_URL_MAINNET, - "d" | "devnet" => SOLANA_URL_DEVNET, + "m" | "mainnet-beta" => &env_or(SOLANA_URL_MAINNET_ENV, SOLANA_URL_MAINNET), + "d" | "devnet" => &env_or(SOLANA_URL_DEVNET_ENV, SOLANA_URL_DEVNET), url => url, }; + let das_client = Arc::new(DasClient::with_base_url(url)?); + let solana_client = Arc::new(SolanaClient::new(url, None)?); Ok(Self { - solana_client: Arc::new(SolanaClient::new(url, None)?), - das_client: Arc::new(DasClient::with_base_url(url)?), + solana_client, + das_client, }) } } @@ -296,38 +301,6 @@ impl GetAnchorAccount for Client { } } -impl TryFrom<&str> for Client { - type Error = Error; - fn try_from(value: &str) -> Result { - fn env_or(key: &str, default: &str) -> String { - std::env::var(key).unwrap_or_else(|_| default.to_string()) - } - let url = match value { - "m" | "mainnet-beta" => &env_or(SOLANA_URL_MAINNET_ENV, SOLANA_URL_MAINNET), - "d" | "devnet" => &env_or(SOLANA_URL_DEVNET_ENV, SOLANA_URL_DEVNET), - url => url, - }; - let das_client = Arc::new(DasClient::with_base_url(url)?); - let solana_client = Arc::new(SolanaRpcClient::new(url.to_string())); - Ok(Self { - solana_client, - das_client, - }) - } -} - -impl AsRef for Client { - fn as_ref(&self) -> &SolanaRpcClient { - &self.solana_client - } -} - -impl AsRef for Client { - fn as_ref(&self) -> &DasClient { - &self.das_client - } -} - #[derive( serde::Serialize, Default, Debug, Clone, std::hash::Hash, PartialEq, Eq, PartialOrd, Ord, )] @@ -497,41 +470,6 @@ impl jsonrpc_client::SendRequest for DasClient { } } -#[derive( - serde::Serialize, Default, Debug, Clone, std::hash::Hash, PartialEq, Eq, PartialOrd, Ord, -)] -#[serde(rename_all = "camelCase")] -pub struct DasSearchAssetsParams { - #[serde(skip_serializing_if = "std::ops::Not::not")] - pub creator_verified: bool, - #[serde( - with = "keypair::serde_opt_pubkey", - skip_serializing_if = "Option::is_none" - )] - pub creator_address: Option, - #[serde( - with = "keypair::serde_opt_pubkey", - skip_serializing_if = "Option::is_none" - )] - pub owner_address: Option, - #[serde(skip_serializing_if = "is_zero")] - pub page: u32, - #[serde(skip_serializing_if = "is_zero")] - pub limit: u32, -} - -impl DasSearchAssetsParams { - pub fn for_owner(owner_address: Pubkey, creator_address: Pubkey) -> Self { - Self { - owner_address: Some(owner_address), - creator_address: Some(creator_address), - creator_verified: true, - page: 1, - ..Default::default() - } - } -} - pub mod config { use super::*; use crate::{ diff --git a/helium-lib/src/dao.rs b/helium-lib/src/dao.rs index 6331f8d2..039c3218 100644 --- a/helium-lib/src/dao.rs +++ b/helium-lib/src/dao.rs @@ -2,7 +2,6 @@ use crate::{ data_credits, entity_key::AsEntityKey, helium_entity_manager, helium_sub_daos, keypair::Pubkey, lazy_distributor, metaplex, rewards_oracle, token::Token, }; -use chrono::Timelike; use sha2::{Digest, Sha256}; #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize)] @@ -75,17 +74,6 @@ impl Dao { let (key, _) = Pubkey::find_program_address(&[b"oracle_signer"], &rewards_oracle::id()); key } - - pub fn dc_account_payer() -> Pubkey { - let (key, _) = Pubkey::find_program_address(&[b"account_payer"], &data_credits::id()); - key - } - - pub fn dc_key() -> Pubkey { - let (key, _) = - Pubkey::find_program_address(&[b"dc", Token::Dc.mint().as_ref()], &data_credits::id()); - key - } } #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize)] @@ -208,19 +196,4 @@ impl SubDao { let unix_time = chrono::Utc::now().timestamp() as u64; helium_sub_daos::sub_dao_epoch_info_key(&sub_dao, unix_time) } - - pub fn epoch_info_key(&self) -> Pubkey { - const EPOCH_LENGTH: u32 = 60 * 60 * 24; - let epoch = chrono::Utc::now().second() / EPOCH_LENGTH; - - let (key, _) = Pubkey::find_program_address( - &[ - "sub_dao_epoch_info".as_bytes(), - self.key().as_ref(), - &epoch.to_le_bytes(), - ], - &helium_sub_daos::ID, - ); - key - } } diff --git a/helium-lib/src/dc.rs b/helium-lib/src/dc.rs index 3ef93a9c..ef34aba2 100644 --- a/helium-lib/src/dc.rs +++ b/helium-lib/src/dc.rs @@ -1,9 +1,3 @@ -use anchor_client::anchor_lang::AccountDeserialize; -use helium_anchor_gen::{ - data_credits::accounts::BurnDelegatedDataCreditsV0, - helium_sub_daos::{self, DaoV0, SubDaoV0}, -}; - use crate::{ anchor_lang::{InstructionData, ToAccountMetas}, anchor_spl, circuit_breaker, @@ -12,7 +6,6 @@ use crate::{ data_credits, error::{DecodeError, Error}, keypair::{Keypair, Pubkey}, - priority_fee, solana_sdk::{instruction::Instruction, signer::Signer, transaction::Transaction}, solana_transaction_utils::priority_fee, token::{Token, TokenAmount}, diff --git a/helium-lib/src/helium_entity_manager.rs b/helium-lib/src/helium_entity_manager.rs index 3452d17d..962bb71c 100644 --- a/helium-lib/src/helium_entity_manager.rs +++ b/helium-lib/src/helium_entity_manager.rs @@ -1,4 +1,4 @@ -use anchor_lang::prelude::*; +use crate::keypair::Pubkey; use sha2::{Digest, Sha256}; pub use helium_anchor_gen::helium_entity_manager::*; diff --git a/helium-lib/src/helium_sub_daos.rs b/helium-lib/src/helium_sub_daos.rs index 665e3cb7..3088f778 100644 --- a/helium-lib/src/helium_sub_daos.rs +++ b/helium-lib/src/helium_sub_daos.rs @@ -1,6 +1,4 @@ -use anchor_lang::prelude::*; - -use crate::utils::get_current_epoch; +use crate::{keypair::Pubkey, utils::get_current_epoch}; pub use helium_anchor_gen::helium_sub_daos::*; diff --git a/helium-lib/src/hotspot/dataonly.rs b/helium-lib/src/hotspot/dataonly.rs index d0da887c..b298e048 100644 --- a/helium-lib/src/hotspot/dataonly.rs +++ b/helium-lib/src/hotspot/dataonly.rs @@ -1,8 +1,3 @@ -use anchor_client::solana_client::rpc_client::SerializableTransaction; -use helium_crypto::{PublicKey, Sign}; -use helium_proto::{BlockchainTxn, BlockchainTxnAddGatewayV1, Message, Txn}; -use serde::{Deserialize, Serialize}; - use crate::{ anchor_lang::{InstructionData, ToAccountMetas}, asset, b64, diff --git a/helium-lib/src/hotspot/mod.rs b/helium-lib/src/hotspot/mod.rs index 47ef8f43..7e132699 100644 --- a/helium-lib/src/hotspot/mod.rs +++ b/helium-lib/src/hotspot/mod.rs @@ -15,9 +15,7 @@ use crate::{ signer::Signer, transaction::Transaction, }, - solana_transaction_utils::priority_fee::{ - compute_budget_instruction, compute_price_instruction_for_accounts, - }, + solana_transaction_utils::priority_fee, token::Token, TransactionOpts, }; diff --git a/helium-lib/src/iot_routing_manager.rs b/helium-lib/src/iot_routing_manager.rs index d581b06b..21c1b62f 100644 --- a/helium-lib/src/iot_routing_manager.rs +++ b/helium-lib/src/iot_routing_manager.rs @@ -1,4 +1,7 @@ -use anchor_lang::{prelude::*, InstructionData}; +use crate::{ + anchor_lang::{InstructionData, ToAccountMetas}, + keypair::Pubkey, +}; use sha2::{Digest, Sha256}; use solana_sdk::instruction::Instruction; use spl_associated_token_account::get_associated_token_address; diff --git a/helium-lib/src/lib.rs b/helium-lib/src/lib.rs index f35d4adc..23c9dc85 100644 --- a/helium-lib/src/lib.rs +++ b/helium-lib/src/lib.rs @@ -26,8 +26,7 @@ pub use anchor_client; pub use anchor_client::solana_client; pub use anchor_spl; pub use helium_anchor_gen::{ - anchor_lang, circuit_breaker, data_credits, helium_entity_manager, helium_sub_daos, - hexboosting, lazy_distributor, rewards_oracle, + anchor_lang, circuit_breaker, data_credits, hexboosting, lazy_distributor, rewards_oracle, }; pub use solana_sdk; pub use solana_sdk::bs58; diff --git a/helium-lib/src/metaplex.rs b/helium-lib/src/metaplex.rs index fc05542b..f0a25a6c 100644 --- a/helium-lib/src/metaplex.rs +++ b/helium-lib/src/metaplex.rs @@ -1,6 +1,4 @@ -use anchor_lang::prelude::*; - -use crate::programs::TOKEN_METADATA_PROGRAM_ID; +use crate::{keypair::Pubkey, programs::TOKEN_METADATA_PROGRAM_ID}; pub fn bubblegum_signer_key() -> Pubkey { Pubkey::find_program_address(&[b"collection_cpi"], &mpl_bubblegum::ID).0 diff --git a/helium-lib/src/reward.rs b/helium-lib/src/reward.rs index 45b1dc47..c482972b 100644 --- a/helium-lib/src/reward.rs +++ b/helium-lib/src/reward.rs @@ -1,12 +1,3 @@ -use futures::{ - stream::{self, StreamExt, TryStreamExt}, - TryFutureExt, -}; -use itertools::Itertools; -use serde::{Deserialize, Serialize}; -use solana_sdk::signer::Signer; -use std::collections::HashMap; - use crate::{ anchor_lang::{InstructionData, ToAccountMetas}, asset, circuit_breaker, @@ -16,8 +7,7 @@ use crate::{ error::{DecodeError, EncodeError, Error}, helium_entity_manager, keypair::{Keypair, Pubkey}, - kta, - lazy_distributor::{self, OracleConfigV0}, + kta, lazy_distributor, programs::SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, rewards_oracle, solana_sdk::{instruction::Instruction, transaction::Transaction}, @@ -110,7 +100,8 @@ pub async fn max_claim( let ld_account = lazy_distributor(client, subdao).await?; let circuit_breaker_account: circuit_breaker::AccountWindowedCircuitBreakerV0 = client .anchor_account(&lazy_distributor_circuit_breaker(&ld_account)) - .await?; + .await? + .ok_or_else(|| Error::account_not_found())?; let threshold = match circuit_breaker_account.config { circuit_breaker::WindowedCircuitBreakerConfigV0 { threshold_type: circuit_breaker::ThresholdType::Absolute, diff --git a/helium-lib/src/solana_transaction_utils/priority_fee.rs b/helium-lib/src/solana_transaction_utils/priority_fee.rs index 31bdacf5..88a3d889 100644 --- a/helium-lib/src/solana_transaction_utils/priority_fee.rs +++ b/helium-lib/src/solana_transaction_utils/priority_fee.rs @@ -1,14 +1,18 @@ -use anchor_lang::prelude::AccountMeta; use itertools::Itertools; -use solana_sdk::{ - instruction::Instruction, message::Message, pubkey::Pubkey, signers::Signers, - transaction::Transaction, -}; -use std::ops::Deref; use crate::{ - anchor_client::RequestBuilder, anchor_lang::ToAccountMetas, client::SolanaRpcClient, - error::Error, solana_sdk::signer::Signer, utils::replace_or_insert_instruction, + anchor_lang::ToAccountMetas, + client::SolanaRpcClient, + error::Error, + keypair::Pubkey, + solana_client, + solana_sdk::{ + instruction::{AccountMeta, Instruction}, + message::Message, + signers::Signers, + transaction::Transaction, + }, + utils::replace_or_insert_instruction, }; pub const MAX_RECENT_PRIORITY_FEE_ACCOUNTS: usize = 128; From c8a587f945e56cfb0703b858563de9c0e3c178d1 Mon Sep 17 00:00:00 2001 From: bry Date: Fri, 6 Dec 2024 10:33:00 -0600 Subject: [PATCH 33/49] testing --- Cargo.lock | 23 +++++++++-------------- Cargo.toml | 3 +++ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f4f3895..06a93a91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1440,7 +1440,6 @@ dependencies = [ [[package]] name = "circuit-breaker" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -1921,7 +1920,6 @@ dependencies = [ [[package]] name = "data-credits" version = "0.2.2" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2231,7 +2229,6 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fanout" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2597,7 +2594,6 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "helium-anchor-gen" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2607,6 +2603,7 @@ dependencies = [ "helium-entity-manager", "helium-sub-daos", "hexboosting", + "iot-routing-manager", "lazy-distributor", "lazy-transactions", "mobile-entity-manager", @@ -2643,7 +2640,6 @@ dependencies = [ [[package]] name = "helium-entity-manager" version = "0.2.11" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2721,7 +2717,6 @@ dependencies = [ [[package]] name = "helium-sub-daos" version = "0.1.8" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2779,7 +2774,6 @@ dependencies = [ [[package]] name = "hexboosting" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -3153,6 +3147,14 @@ dependencies = [ "generic-array", ] +[[package]] +name = "iot-routing-manager" +version = "0.1.2" +dependencies = [ + "anchor-gen", + "anchor-lang 0.29.0", +] + [[package]] name = "ipnet" version = "2.10.1" @@ -3280,7 +3282,6 @@ dependencies = [ [[package]] name = "lazy-distributor" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -3289,7 +3290,6 @@ dependencies = [ [[package]] name = "lazy-transactions" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -3521,7 +3521,6 @@ dependencies = [ [[package]] name = "mobile-entity-manager" version = "0.1.3" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -4104,7 +4103,6 @@ dependencies = [ [[package]] name = "price-oracle" version = "0.2.1" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -4595,7 +4593,6 @@ dependencies = [ [[package]] name = "rewards-oracle" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -7027,7 +7024,6 @@ dependencies = [ [[package]] name = "treasury-management" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -7225,7 +7221,6 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "voter-stake-registry" version = "0.3.3" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", diff --git a/Cargo.toml b/Cargo.toml index 959d7bf6..6cf97ca0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,3 +24,6 @@ helium-proto = { git = "https://github.com/helium/proto", branch = "master", fea ] } clap = { version = "4", features = ["derive"] } tokio = { version = "1.0", features = ["full"] } + +[patch.'https://github.com/helium/helium-anchor-gen.git'] +helium-anchor-gen = { path = "../helium-anchor-gen" } From d4ef2c9ceac13a39cc9fc5e42352a0b15421a4da Mon Sep 17 00:00:00 2001 From: bry Date: Fri, 6 Dec 2024 13:05:20 -0600 Subject: [PATCH 34/49] remove cargo patches --- Cargo.lock | 23 ++++++++++++++--------- Cargo.toml | 3 --- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 06a93a91..5f4f3895 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1440,6 +1440,7 @@ dependencies = [ [[package]] name = "circuit-breaker" version = "0.1.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -1920,6 +1921,7 @@ dependencies = [ [[package]] name = "data-credits" version = "0.2.2" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2229,6 +2231,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fanout" version = "0.1.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2594,6 +2597,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "helium-anchor-gen" version = "0.1.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2603,7 +2607,6 @@ dependencies = [ "helium-entity-manager", "helium-sub-daos", "hexboosting", - "iot-routing-manager", "lazy-distributor", "lazy-transactions", "mobile-entity-manager", @@ -2640,6 +2643,7 @@ dependencies = [ [[package]] name = "helium-entity-manager" version = "0.2.11" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2717,6 +2721,7 @@ dependencies = [ [[package]] name = "helium-sub-daos" version = "0.1.8" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2774,6 +2779,7 @@ dependencies = [ [[package]] name = "hexboosting" version = "0.1.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -3147,14 +3153,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "iot-routing-manager" -version = "0.1.2" -dependencies = [ - "anchor-gen", - "anchor-lang 0.29.0", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -3282,6 +3280,7 @@ dependencies = [ [[package]] name = "lazy-distributor" version = "0.2.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -3290,6 +3289,7 @@ dependencies = [ [[package]] name = "lazy-transactions" version = "0.2.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -3521,6 +3521,7 @@ dependencies = [ [[package]] name = "mobile-entity-manager" version = "0.1.3" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -4103,6 +4104,7 @@ dependencies = [ [[package]] name = "price-oracle" version = "0.2.1" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -4593,6 +4595,7 @@ dependencies = [ [[package]] name = "rewards-oracle" version = "0.2.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -7024,6 +7027,7 @@ dependencies = [ [[package]] name = "treasury-management" version = "0.2.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -7221,6 +7225,7 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "voter-stake-registry" version = "0.3.3" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", diff --git a/Cargo.toml b/Cargo.toml index 6cf97ca0..959d7bf6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,3 @@ helium-proto = { git = "https://github.com/helium/proto", branch = "master", fea ] } clap = { version = "4", features = ["derive"] } tokio = { version = "1.0", features = ["full"] } - -[patch.'https://github.com/helium/helium-anchor-gen.git'] -helium-anchor-gen = { path = "../helium-anchor-gen" } From ca0308cab4a59eba5ff574b4108049b6305b6023 Mon Sep 17 00:00:00 2001 From: bry Date: Fri, 6 Dec 2024 14:03:30 -0600 Subject: [PATCH 35/49] self review --- helium-lib/src/asset.rs | 7 +++---- helium-lib/src/client.rs | 14 +++++++------- helium-lib/src/dao.rs | 10 +++++----- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/helium-lib/src/asset.rs b/helium-lib/src/asset.rs index f81bd02a..efb5687d 100644 --- a/helium-lib/src/asset.rs +++ b/helium-lib/src/asset.rs @@ -1,7 +1,3 @@ -use itertools::Itertools; -use serde::{Deserialize, Serialize}; -use std::{collections::HashMap, result::Result as StdResult, str::FromStr}; - use crate::{ bs58, client::{DasClient, DasSearchAssetsParams, SolanaRpcClient}, @@ -16,6 +12,9 @@ use crate::{ solana_sdk::{instruction::AccountMeta, transaction::Transaction}, TransactionOpts, }; +use itertools::Itertools; +use serde::{Deserialize, Serialize}; +use std::{collections::HashMap, result::Result as StdResult, str::FromStr}; pub async fn for_entity_key>( client: &C, diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index 8d31d08a..2c97f493 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -1,10 +1,3 @@ -use futures::{stream, StreamExt, TryStreamExt}; -use itertools::Itertools; -use jsonrpc_client::{JsonRpcError, SendRequest}; -use solana_sdk::signer::EncodableKey; -use std::{marker::Send, path::PathBuf, sync::Arc}; -use tracing::instrument; - use crate::{ anchor_lang::AccountDeserialize, asset, @@ -28,6 +21,13 @@ use crate::{ }, }; +use futures::{stream, StreamExt, TryStreamExt}; +use itertools::Itertools; +use jsonrpc_client::{JsonRpcError, SendRequest}; +use solana_sdk::signer::EncodableKey; +use std::{marker::Send, path::PathBuf, sync::Arc}; +use tracing::instrument; + pub use solana_client::nonblocking::rpc_client::RpcClient as SolanaRpcClient; pub static ONBOARDING_URL_MAINNET: &str = "https://onboarding.dewi.org/api/v3"; diff --git a/helium-lib/src/dao.rs b/helium-lib/src/dao.rs index 039c3218..d35d3401 100644 --- a/helium-lib/src/dao.rs +++ b/helium-lib/src/dao.rs @@ -59,6 +59,11 @@ impl Dao { helium_entity_manager::key_to_asset_key_raw(&self.key(), &hash) } + pub fn oracle_signer_key() -> Pubkey { + let (key, _) = Pubkey::find_program_address(&[b"oracle_signer"], &rewards_oracle::id()); + key + } + pub fn dc_account_payer() -> Pubkey { let (key, _) = Pubkey::find_program_address(&[b"account_payer"], &data_credits::id()); key @@ -69,11 +74,6 @@ impl Dao { Pubkey::find_program_address(&[b"dc", Token::Dc.mint().as_ref()], &data_credits::id()); key } - - pub fn oracle_signer_key() -> Pubkey { - let (key, _) = Pubkey::find_program_address(&[b"oracle_signer"], &rewards_oracle::id()); - key - } } #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize)] From c9431eac6af9936fdba8c80e138b00ab7a72e70c Mon Sep 17 00:00:00 2001 From: bry Date: Tue, 10 Dec 2024 15:43:39 -0600 Subject: [PATCH 36/49] remove unused priority_fee --- helium-lib/src/priority_fee.rs | 121 --------------------------------- 1 file changed, 121 deletions(-) delete mode 100644 helium-lib/src/priority_fee.rs diff --git a/helium-lib/src/priority_fee.rs b/helium-lib/src/priority_fee.rs deleted file mode 100644 index 4e9d376c..00000000 --- a/helium-lib/src/priority_fee.rs +++ /dev/null @@ -1,121 +0,0 @@ -use crate::{ - anchor_lang::ToAccountMetas, client::SolanaRpcClient, error::Error, keypair::Pubkey, - solana_client, -}; -use itertools::Itertools; - -pub const MAX_RECENT_PRIORITY_FEE_ACCOUNTS: usize = 128; -pub const MIN_PRIORITY_FEE: u64 = 1; - -pub async fn get_estimate_with_min>( - client: &C, - accounts: &impl ToAccountMetas, - min_priority_fee: u64, -) -> Result { - let client_url = client.as_ref().url(); - if client_url.contains("mainnet.helius") { - helius::get_estimate_with_min(client, accounts, min_priority_fee).await - } else { - base::get_estimate_with_min(client, accounts, min_priority_fee).await - } -} - -fn account_keys(accounts: &impl ToAccountMetas) -> impl Iterator { - accounts - .to_account_metas(None) - .into_iter() - .filter(|account_meta| account_meta.is_writable) - .map(|x| x.pubkey) - .unique() - .take(MAX_RECENT_PRIORITY_FEE_ACCOUNTS) -} - -mod helius { - use super::*; - use serde::Deserialize; - use serde_json::json; - - pub async fn get_estimate_with_min>( - client: &C, - accounts: &impl ToAccountMetas, - min_priority_fee: u64, - ) -> Result { - #[derive(Debug, Deserialize)] - #[serde(rename_all = "camelCase")] - struct Response { - priority_fee_estimate: f64, - } - let request = solana_client::rpc_request::RpcRequest::Custom { - method: "getPriorityFeeEstimate", - }; - let account_keys: Vec<_> = account_keys(accounts).map(|v| v.to_string()).collect(); - let params = json!([ - { - "accountKeys": account_keys, - "options": { - "recommended": true, - } - } - ]); - - let response: Response = client.as_ref().send(request, params).await?; - Ok((response.priority_fee_estimate.ceil() as u64).max(min_priority_fee)) - } -} - -mod base { - use super::*; - - pub async fn get_estimate_with_min>( - client: &C, - accounts: &impl ToAccountMetas, - min_priority_fee: u64, - ) -> Result { - let account_keys: Vec<_> = account_keys(accounts).collect(); - let recent_fees = client - .as_ref() - .get_recent_prioritization_fees(&account_keys) - .await?; - let mut max_per_slot = Vec::new(); - for (slot, fees) in &recent_fees.into_iter().group_by(|x| x.slot) { - let Some(maximum) = fees.map(|x| x.prioritization_fee).max() else { - continue; - }; - max_per_slot.push((slot, maximum)); - } - // Only take the most recent 20 maximum fees: - max_per_slot.sort_by(|a, b| a.0.cmp(&b.0).reverse()); - let mut max_per_slot: Vec<_> = max_per_slot.into_iter().take(20).map(|x| x.1).collect(); - max_per_slot.sort(); - // Get the median: - let num_recent_fees = max_per_slot.len(); - let mid = num_recent_fees / 2; - let estimate = if num_recent_fees == 0 { - min_priority_fee - } else if num_recent_fees % 2 == 0 { - // If the number of samples is even, taken the mean of the two median fees - (max_per_slot[mid - 1] + max_per_slot[mid]) / 2 - } else { - max_per_slot[mid] - } - .max(min_priority_fee); - Ok(estimate) - } -} - -pub fn compute_budget_instruction(compute_limit: u32) -> solana_sdk::instruction::Instruction { - solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit(compute_limit) -} - -pub fn compute_price_instruction(priority_fee: u64) -> solana_sdk::instruction::Instruction { - solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_price(priority_fee) -} - -pub async fn compute_price_instruction_for_accounts>( - client: &C, - accounts: &impl ToAccountMetas, - min_priority_fee: u64, -) -> Result { - let priority_fee = get_estimate_with_min(client, accounts, min_priority_fee).await?; - Ok(compute_price_instruction(priority_fee)) -} From e79b80250b46c3084bb2c8dca4b060434d746163 Mon Sep 17 00:00:00 2001 From: bry Date: Tue, 10 Dec 2024 16:49:17 -0600 Subject: [PATCH 37/49] pr feedback --- helium-lib/src/client.rs | 5 ----- helium-lib/src/iot_routing_manager.rs | 12 ++++++------ .../src/solana_transaction_utils/priority_fee.rs | 9 --------- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index 2c97f493..b0444001 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -123,11 +123,6 @@ impl SolanaClient { .collect(); for (tx, _) in &txs { - // This is just a tx with compute ixs. Skip it - if tx.len() == 2 { - continue; - } - let computed = auto_compute_limit_and_price( &self.solana_rpc_client(), tx.clone(), diff --git a/helium-lib/src/iot_routing_manager.rs b/helium-lib/src/iot_routing_manager.rs index 21c1b62f..d7cb2aea 100644 --- a/helium-lib/src/iot_routing_manager.rs +++ b/helium-lib/src/iot_routing_manager.rs @@ -268,7 +268,7 @@ pub mod organization { } } -pub mod orgainization_delegate { +pub mod organization_delegate { use super::*; use crate::{client::SolanaRpcClient, error::Error, iot_routing_manager}; @@ -280,10 +280,10 @@ pub mod orgainization_delegate { organization_key: Pubkey, authority: Option, ) -> Result<(Pubkey, Instruction), Error> { - let orgainization_delegate_key = organization_delegate_key(&organization_key, &delegate); + let organization_delegate_key = organization_delegate_key(&organization_key, &delegate); Ok(( - orgainization_delegate_key, + organization_delegate_key, Instruction { program_id: iot_routing_manager::ID, accounts: iot_routing_manager::accounts::InitializeOrganizationDelegateV0 { @@ -291,7 +291,7 @@ pub mod orgainization_delegate { authority: authority.unwrap_or(payer.clone()), delegate, organization: organization_key, - organization_delegate: orgainization_delegate_key, + organization_delegate: organization_delegate_key, system_program: solana_sdk::system_program::ID, } .to_account_metas(None), @@ -306,7 +306,7 @@ pub mod orgainization_delegate { delegate: Pubkey, organization_key: Pubkey, ) -> Result { - let orgainization_delegate_key = organization_delegate_key(&organization_key, &delegate); + let organization_delegate_key = organization_delegate_key(&organization_key, &delegate); Ok(Instruction { program_id: iot_routing_manager::ID, @@ -314,7 +314,7 @@ pub mod orgainization_delegate { authority, rent_refund: authority, organization: organization_key, - organization_delegate: orgainization_delegate_key, + organization_delegate: organization_delegate_key, } .to_account_metas(None), data: iot_routing_manager::instruction::RemoveOrganizationDelegateV0 {}.data(), diff --git a/helium-lib/src/solana_transaction_utils/priority_fee.rs b/helium-lib/src/solana_transaction_utils/priority_fee.rs index 88a3d889..9c449611 100644 --- a/helium-lib/src/solana_transaction_utils/priority_fee.rs +++ b/helium-lib/src/solana_transaction_utils/priority_fee.rs @@ -168,15 +168,6 @@ pub async fn compute_budget_for_instructions, T: Signe // Simulate the transaction to get the actual compute used let simulation_result = client.as_ref().simulate_transaction(&snub_tx).await?; - if let Some(err) = simulation_result.value.err { - println!("Error: {}", err); - if let Some(logs) = simulation_result.value.logs { - for log in logs { - println!("Log: {}", log); - } - } - } - let actual_compute_used = simulation_result.value.units_consumed.unwrap_or(200000); let final_compute_budget = (actual_compute_used as f32 * compute_multiplier) as u32; Ok(compute_budget_instruction(final_compute_budget)) From 7557c35e557170eac7135012377d932a6083ed8a Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 18 Dec 2024 16:35:30 -0600 Subject: [PATCH 38/49] fold helium_sub_daos back into dao --- helium-lib/src/client.rs | 6 +- helium-lib/src/dao.rs | 106 +++++++++++++++--- helium-lib/src/helium_entity_manager.rs | 106 ------------------ helium-lib/src/helium_sub_daos.rs | 47 -------- .../src/{iot_routing_manager.rs => iot.rs} | 22 ++-- helium-lib/src/lib.rs | 7 +- helium-lib/src/priority_fee.rs | 0 helium-lib/src/transaction.rs | 0 8 files changed, 111 insertions(+), 183 deletions(-) delete mode 100644 helium-lib/src/helium_sub_daos.rs rename helium-lib/src/{iot_routing_manager.rs => iot.rs} (97%) create mode 100644 helium-lib/src/priority_fee.rs create mode 100644 helium-lib/src/transaction.rs diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index b0444001..8f5b554e 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -91,7 +91,7 @@ impl SolanaClient { .replace("127.0.0.1:8899", "127.0.0.1:8900") } - pub fn wallet(&self) -> Result { + pub fn pubkey(&self) -> Result { self.wallet .as_ref() .map(|wallet| wallet.pubkey()) @@ -533,12 +533,12 @@ pub mod config { } #[derive(Clone)] - pub enum ClientType { + pub enum Client { Iot(iot::Client), Mobile(mobile::Client), } - impl ClientType { + impl Client { pub fn for_subdao( subdao: SubDao, config: &str, diff --git a/helium-lib/src/dao.rs b/helium-lib/src/dao.rs index d35d3401..2db64516 100644 --- a/helium-lib/src/dao.rs +++ b/helium-lib/src/dao.rs @@ -1,7 +1,8 @@ use crate::{ data_credits, entity_key::AsEntityKey, helium_entity_manager, helium_sub_daos, keypair::Pubkey, - lazy_distributor, metaplex, rewards_oracle, token::Token, + lazy_distributor, metaplex, rewards_oracle, token::Token, utils::get_current_epoch, }; + use sha2::{Digest, Sha256}; #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize)] @@ -23,15 +24,24 @@ impl Dao { let mint = match self { Self::Hnt => Token::Hnt.mint(), }; - helium_sub_daos::dao_key(mint) + + Pubkey::find_program_address(&[b"dao", mint.as_ref()], &helium_sub_daos::ID).0 } pub fn dataonly_config_key(&self) -> Pubkey { - helium_entity_manager::data_only_config_key(&self.key()) + Pubkey::find_program_address( + &[b"data_only_config", &self.key().as_ref()], + &helium_entity_manager::ID, + ) + .0 } pub fn dataonly_escrow_key(&self) -> Pubkey { - helium_entity_manager::data_only_escrow_key(&self.dataonly_config_key()) + Pubkey::find_program_address( + &[b"data_only_escrow", &self.dataonly_config_key().as_ref()], + &helium_entity_manager::ID, + ) + .0 } pub fn collection_metadata_key(&self, collection_key: &Pubkey) -> Pubkey { @@ -51,12 +61,21 @@ impl Dao { } pub fn entity_creator_key(&self) -> Pubkey { - helium_entity_manager::entity_creator_key(&self.key()) + Pubkey::find_program_address( + &[b"entity_creator", &self.key().as_ref()], + &helium_entity_manager::ID, + ) + .0 } pub fn entity_key_to_kta_key(&self, entity_key: &E) -> Pubkey { let hash = Sha256::digest(entity_key.as_entity_key()); - helium_entity_manager::key_to_asset_key_raw(&self.key(), &hash) + + Pubkey::find_program_address( + &[b"key_to_asset", &self.key().as_ref(), &hash], + &helium_entity_manager::ID, + ) + .0 } pub fn oracle_signer_key() -> Pubkey { @@ -74,6 +93,18 @@ impl Dao { Pubkey::find_program_address(&[b"dc", Token::Dc.mint().as_ref()], &data_credits::id()); key } + + pub fn epoch_info_key(&self) -> Pubkey { + let dao = self.key(); + let unix_time = chrono::Utc::now().timestamp() as u64; + let epoch = get_current_epoch(unix_time); + let b_u64 = epoch.to_le_bytes(); + Pubkey::find_program_address( + &[b"dao_epoch_info", &dao.as_ref(), &b_u64], + &helium_sub_daos::ID, + ) + .0 + } } #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize)] @@ -101,7 +132,7 @@ impl SubDao { pub fn key(&self) -> Pubkey { let mint = self.mint(); - helium_sub_daos::sub_dao_key(mint) + Pubkey::find_program_address(&[b"sub_dao", mint.as_ref()], &helium_sub_daos::ID).0 } pub fn mint(&self) -> &Pubkey { @@ -146,19 +177,48 @@ impl SubDao { pub fn rewardable_entity_config_key(&self) -> Pubkey { let sub_dao = self.key(); match self { - Self::Iot => helium_entity_manager::rewardable_entity_config_key(&sub_dao, "IOT"), - Self::Mobile => helium_entity_manager::rewardable_entity_config_key(&sub_dao, "MOBILE"), + Self::Iot => { + Pubkey::find_program_address( + &[ + b"rewardable_entity_config", + &sub_dao.as_ref(), + "IOT".as_bytes(), + ], + &helium_entity_manager::ID, + ) + .0 + } + Self::Mobile => { + Pubkey::find_program_address( + &[ + b"rewardable_entity_config", + &sub_dao.as_ref(), + "MOBILE".as_bytes(), + ], + &helium_entity_manager::ID, + ) + .0 + } } } pub fn info_key(&self, entity_key: &E) -> Pubkey { let config_key = self.rewardable_entity_config_key(); + let hash = Sha256::digest(&entity_key.as_entity_key()); match self { Self::Iot => { - helium_entity_manager::iot_info_key(&config_key, &entity_key.as_entity_key()) + Pubkey::find_program_address( + &[b"iot_info", &config_key.as_ref(), &hash], + &helium_entity_manager::ID, + ) + .0 } Self::Mobile => { - helium_entity_manager::mobile_info_key(&config_key, &entity_key.as_entity_key()) + Pubkey::find_program_address( + &[b"mobile_info", &config_key.as_ref(), &hash], + &helium_entity_manager::ID, + ) + .0 } } } @@ -186,14 +246,32 @@ impl SubDao { pub fn config_key(&self) -> Pubkey { let sub_dao = self.key(); match self { - Self::Iot => helium_entity_manager::iot_config_key(&sub_dao), - Self::Mobile => helium_entity_manager::mobile_config_key(&sub_dao), + Self::Iot => { + Pubkey::find_program_address( + &[b"iot_config", &sub_dao.as_ref()], + &helium_entity_manager::ID, + ) + .0 + } + Self::Mobile => { + Pubkey::find_program_address( + &[b"mobile_config", sub_dao.as_ref()], + &helium_entity_manager::ID, + ) + .0 + } } } pub fn epoch_info_key(&self) -> Pubkey { let sub_dao = self.key(); let unix_time = chrono::Utc::now().timestamp() as u64; - helium_sub_daos::sub_dao_epoch_info_key(&sub_dao, unix_time) + let epoch = get_current_epoch(unix_time); + let b_u64 = epoch.to_le_bytes(); + Pubkey::find_program_address( + &[b"sub_dao_epoch_info", &sub_dao.as_ref(), &b_u64], + &helium_sub_daos::ID, + ) + .0 } } diff --git a/helium-lib/src/helium_entity_manager.rs b/helium-lib/src/helium_entity_manager.rs index 962bb71c..8b432156 100644 --- a/helium-lib/src/helium_entity_manager.rs +++ b/helium-lib/src/helium_entity_manager.rs @@ -11,58 +11,6 @@ pub fn shared_merkle_key(proof_size: u8) -> Pubkey { .0 } -pub fn entity_creator_key(dao: &Pubkey) -> Pubkey { - Pubkey::find_program_address( - &[b"entity_creator", dao.as_ref()], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} - -pub fn rewardable_entity_config_key(sub_dao: &Pubkey, symbol: &str) -> Pubkey { - Pubkey::find_program_address( - &[ - b"rewardable_entity_config", - sub_dao.as_ref(), - symbol.as_bytes(), - ], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} - -pub fn hotspot_collection_key(maker_or_data_only: &Pubkey) -> Pubkey { - Pubkey::find_program_address( - &[b"collection", maker_or_data_only.as_ref()], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} - -pub fn data_only_config_key(dao: &Pubkey) -> Pubkey { - Pubkey::find_program_address( - &[b"data_only_config", dao.as_ref()], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} - -pub fn data_only_escrow_key(data_only: &Pubkey) -> Pubkey { - Pubkey::find_program_address( - &[b"data_only_escrow", data_only.as_ref()], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} - -pub fn maker_key(dao: &Pubkey, name: &str) -> Pubkey { - Pubkey::find_program_address( - &[b"maker", dao.as_ref(), name.as_bytes()], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} - pub fn program_approval_key(dao: &Pubkey, program: &Pubkey) -> Pubkey { Pubkey::find_program_address( &[b"program_approval", dao.as_ref(), program.as_ref()], @@ -70,57 +18,3 @@ pub fn program_approval_key(dao: &Pubkey, program: &Pubkey) -> Pubkey { ) .0 } - -pub fn maker_approval_key(rewardable_entity_config: &Pubkey, maker: &Pubkey) -> Pubkey { - Pubkey::find_program_address( - &[ - b"maker_approval", - rewardable_entity_config.as_ref(), - maker.as_ref(), - ], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} - -pub fn key_to_asset_key_raw(dao: &Pubkey, hashed_entity_key: &[u8]) -> Pubkey { - Pubkey::find_program_address( - &[b"key_to_asset", dao.as_ref(), hashed_entity_key], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} - -pub fn iot_config_key(sub_dao: &Pubkey) -> Pubkey { - Pubkey::find_program_address( - &[b"iot_config", sub_dao.as_ref()], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} - -pub fn iot_info_key(rewardable_entity_config: &Pubkey, entity_key: &[u8]) -> Pubkey { - let hash = Sha256::digest(entity_key); - Pubkey::find_program_address( - &[b"iot_info", rewardable_entity_config.as_ref(), &hash], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} - -pub fn mobile_config_key(sub_dao: &Pubkey) -> Pubkey { - Pubkey::find_program_address( - &[b"mobile_config", sub_dao.as_ref()], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} - -pub fn mobile_info_key(rewardable_entity_config: &Pubkey, entity_key: &[u8]) -> Pubkey { - let hash = Sha256::digest(entity_key); - Pubkey::find_program_address( - &[b"mobile_info", rewardable_entity_config.as_ref(), &hash], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} diff --git a/helium-lib/src/helium_sub_daos.rs b/helium-lib/src/helium_sub_daos.rs deleted file mode 100644 index 3088f778..00000000 --- a/helium-lib/src/helium_sub_daos.rs +++ /dev/null @@ -1,47 +0,0 @@ -use crate::{keypair::Pubkey, utils::get_current_epoch}; - -pub use helium_anchor_gen::helium_sub_daos::*; - -pub fn sub_dao_epoch_info_key(sub_dao: &Pubkey, unix_time: u64) -> Pubkey { - let epoch = get_current_epoch(unix_time); - let b_u64 = epoch.to_le_bytes(); - Pubkey::find_program_address( - &[b"sub_dao_epoch_info", sub_dao.as_ref(), &b_u64], - &helium_anchor_gen::helium_sub_daos::ID, - ) - .0 -} - -pub fn dao_epoch_info_key(dao: &Pubkey, unix_time: u64) -> Pubkey { - let epoch = get_current_epoch(unix_time); - let b_u64 = epoch.to_le_bytes(); - Pubkey::find_program_address( - &[b"dao_epoch_info", dao.as_ref(), &b_u64], - &helium_anchor_gen::helium_sub_daos::ID, - ) - .0 -} - -pub fn dao_key(mint: &Pubkey) -> Pubkey { - Pubkey::find_program_address( - &[b"dao", mint.as_ref()], - &helium_anchor_gen::helium_sub_daos::ID, - ) - .0 -} - -pub fn sub_dao_key(mint: &Pubkey) -> Pubkey { - Pubkey::find_program_address( - &[b"sub_dao", mint.as_ref()], - &helium_anchor_gen::helium_sub_daos::ID, - ) - .0 -} - -pub fn delegated_position_key(position: &Pubkey) -> Pubkey { - Pubkey::find_program_address( - &[b"delegated_position", position.as_ref()], - &helium_anchor_gen::helium_sub_daos::ID, - ) - .0 -} diff --git a/helium-lib/src/iot_routing_manager.rs b/helium-lib/src/iot.rs similarity index 97% rename from helium-lib/src/iot_routing_manager.rs rename to helium-lib/src/iot.rs index d7cb2aea..5ed1ae00 100644 --- a/helium-lib/src/iot_routing_manager.rs +++ b/helium-lib/src/iot.rs @@ -1,5 +1,7 @@ use crate::{ anchor_lang::{InstructionData, ToAccountMetas}, + dao::Dao, + iot_routing_manager, keypair::Pubkey, }; use sha2::{Digest, Sha256}; @@ -9,12 +11,10 @@ use std::result::Result; use crate::{helium_entity_manager, programs::TOKEN_METADATA_PROGRAM_ID}; -pub use helium_anchor_gen::iot_routing_manager::*; - pub fn routing_manager_key(sub_dao: &Pubkey) -> Pubkey { Pubkey::find_program_address( &[b"routing_manager", sub_dao.as_ref()], - &helium_anchor_gen::iot_routing_manager::ID, + &iot_routing_manager::ID, ) .0 } @@ -26,7 +26,7 @@ pub fn organization_key(routing_manager: &Pubkey, oui: u64) -> Pubkey { routing_manager.as_ref(), &oui.to_le_bytes(), ], - &helium_anchor_gen::iot_routing_manager::ID, + &iot_routing_manager::ID, ) .0 } @@ -38,7 +38,7 @@ pub fn devaddr_constraint_key(organization: &Pubkey, start_addr: u64) -> Pubkey organization.as_ref(), &start_addr.to_le_bytes(), ], - &helium_anchor_gen::iot_routing_manager::ID, + &iot_routing_manager::ID, ) .0 } @@ -46,7 +46,7 @@ pub fn devaddr_constraint_key(organization: &Pubkey, start_addr: u64) -> Pubkey pub fn net_id_key(routing_manager: &Pubkey, net_id: u32) -> Pubkey { Pubkey::find_program_address( &[b"net_id", routing_manager.as_ref(), &net_id.to_le_bytes()], - &helium_anchor_gen::iot_routing_manager::ID, + &iot_routing_manager::ID, ) .0 } @@ -58,7 +58,7 @@ pub fn organization_delegate_key(organization: &Pubkey, delegate: &Pubkey) -> Pu organization.as_ref(), delegate.as_ref(), ], - &helium_anchor_gen::iot_routing_manager::ID, + &iot_routing_manager::ID, ) .0 } @@ -66,7 +66,7 @@ pub fn organization_delegate_key(organization: &Pubkey, delegate: &Pubkey) -> Pu pub fn organization_collection_key(routing_manager: &Pubkey) -> Pubkey { Pubkey::find_program_address( &[b"collection", routing_manager.as_ref()], - &helium_anchor_gen::iot_routing_manager::ID, + &iot_routing_manager::ID, ) .0 } @@ -99,7 +99,11 @@ pub fn organization_collection_master_edition_key(collection: &Pubkey) -> Pubkey pub fn organization_key_to_asset(dao: &Pubkey, oui: u64) -> Pubkey { let seed_str = format!("OUI_{}", oui); let hash = Sha256::digest(seed_str.as_bytes()); - helium_entity_manager::key_to_asset_key_raw(dao, &hash) + Pubkey::find_program_address( + &[b"key_to_asset", dao.as_ref(), &hash], + &helium_entity_manager::ID, + ) + .0 } pub mod organization { diff --git a/helium-lib/src/lib.rs b/helium-lib/src/lib.rs index 23c9dc85..be1cbc63 100644 --- a/helium-lib/src/lib.rs +++ b/helium-lib/src/lib.rs @@ -7,10 +7,8 @@ pub mod dao; pub mod dc; pub mod entity_key; pub mod error; -pub mod helium_entity_manager; -pub mod helium_sub_daos; pub mod hotspot; -pub mod iot_routing_manager; +pub mod iot; pub mod keypair; pub mod kta; pub mod memo; @@ -26,7 +24,8 @@ pub use anchor_client; pub use anchor_client::solana_client; pub use anchor_spl; pub use helium_anchor_gen::{ - anchor_lang, circuit_breaker, data_credits, hexboosting, lazy_distributor, rewards_oracle, + anchor_lang, circuit_breaker, data_credits, helium_entity_manager, helium_sub_daos, + hexboosting, iot_routing_manager, lazy_distributor, rewards_oracle, }; pub use solana_sdk; pub use solana_sdk::bs58; diff --git a/helium-lib/src/priority_fee.rs b/helium-lib/src/priority_fee.rs new file mode 100644 index 00000000..e69de29b diff --git a/helium-lib/src/transaction.rs b/helium-lib/src/transaction.rs new file mode 100644 index 00000000..e69de29b From 9c907a8d84d22884764b8f27ce9f577d27ef893b Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 18 Dec 2024 17:43:21 -0600 Subject: [PATCH 39/49] fold helium_entity_manger back into dao/asset --- helium-lib/src/asset.rs | 9 +++++++++ helium-lib/src/dao.rs | 8 ++++++++ helium-lib/src/helium_entity_manager.rs | 20 -------------------- helium-lib/src/iot.rs | 24 ++++++++++-------------- 4 files changed, 27 insertions(+), 34 deletions(-) delete mode 100644 helium-lib/src/helium_entity_manager.rs diff --git a/helium-lib/src/asset.rs b/helium-lib/src/asset.rs index efb5687d..0ac4491b 100644 --- a/helium-lib/src/asset.rs +++ b/helium-lib/src/asset.rs @@ -16,6 +16,14 @@ use itertools::Itertools; use serde::{Deserialize, Serialize}; use std::{collections::HashMap, result::Result as StdResult, str::FromStr}; +pub fn shared_merkle_key(proof_size: u8) -> Pubkey { + Pubkey::find_program_address( + &[b"shared_merkle", &[proof_size]], + &helium_entity_manager::ID, + ) + .0 +} + pub async fn for_entity_key>( client: &C, entity_key: &E, @@ -53,6 +61,7 @@ pub async fn get_with_proof>( let (asset, asset_proof) = futures::try_join!(get(client, pubkey), proof::get(client, pubkey))?; Ok((asset, asset_proof)) } + pub mod canopy { use super::*; use spl_account_compression::state::{merkle_tree_get_size, ConcurrentMerkleTreeHeader}; diff --git a/helium-lib/src/dao.rs b/helium-lib/src/dao.rs index 2db64516..0f66e964 100644 --- a/helium-lib/src/dao.rs +++ b/helium-lib/src/dao.rs @@ -28,6 +28,14 @@ impl Dao { Pubkey::find_program_address(&[b"dao", mint.as_ref()], &helium_sub_daos::ID).0 } + pub fn program_approval_key(&self, program: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[b"program_approval", &self.key().as_ref(), program.as_ref()], + &helium_entity_manager::ID, + ) + .0 + } + pub fn dataonly_config_key(&self) -> Pubkey { Pubkey::find_program_address( &[b"data_only_config", &self.key().as_ref()], diff --git a/helium-lib/src/helium_entity_manager.rs b/helium-lib/src/helium_entity_manager.rs deleted file mode 100644 index 8b432156..00000000 --- a/helium-lib/src/helium_entity_manager.rs +++ /dev/null @@ -1,20 +0,0 @@ -use crate::keypair::Pubkey; -use sha2::{Digest, Sha256}; - -pub use helium_anchor_gen::helium_entity_manager::*; - -pub fn shared_merkle_key(proof_size: u8) -> Pubkey { - Pubkey::find_program_address( - &[b"shared_merkle", &[proof_size]], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} - -pub fn program_approval_key(dao: &Pubkey, program: &Pubkey) -> Pubkey { - Pubkey::find_program_address( - &[b"program_approval", dao.as_ref(), program.as_ref()], - &helium_anchor_gen::helium_entity_manager::ID, - ) - .0 -} diff --git a/helium-lib/src/iot.rs b/helium-lib/src/iot.rs index 5ed1ae00..f4a108d5 100644 --- a/helium-lib/src/iot.rs +++ b/helium-lib/src/iot.rs @@ -1,15 +1,17 @@ use crate::{ anchor_lang::{InstructionData, ToAccountMetas}, - dao::Dao, + dao::{Dao, SubDao}, iot_routing_manager, + helium_entity_manager, + programs::TOKEN_METADATA_PROGRAM_ID, keypair::Pubkey, }; + use sha2::{Digest, Sha256}; use solana_sdk::instruction::Instruction; use spl_associated_token_account::get_associated_token_address; use std::result::Result; -use crate::{helium_entity_manager, programs::TOKEN_METADATA_PROGRAM_ID}; pub fn routing_manager_key(sub_dao: &Pubkey) -> Pubkey { Pubkey::find_program_address( @@ -110,11 +112,7 @@ pub mod organization { use super::*; use crate::{ - client::{GetAnchorAccount, SolanaRpcClient}, - error::Error, - helium_entity_manager, helium_sub_daos, iot_routing_manager, metaplex, - programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, - token::Token, + asset, client::{GetAnchorAccount, SolanaRpcClient}, error::Error, helium_entity_manager, helium_sub_daos, iot_routing_manager, metaplex, programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, token::Token }; pub enum OrgIdentifier { @@ -126,7 +124,7 @@ pub mod organization { client: &C, identifier: OrgIdentifier, ) -> Result<(Pubkey, OrganizationV0), Error> { - let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); + let sub_dao = SubDao::Iot.key(); let routing_manager_key = routing_manager_key(&sub_dao); let organization_key = match identifier { OrgIdentifier::Oui(oui) => organization_key(&routing_manager_key, oui), @@ -151,11 +149,9 @@ pub mod organization { recipient: Option, ) -> Result<(Pubkey, Instruction), Error> { let payer_iot_ata_key = get_associated_token_address(&payer, Token::Iot.mint()); - let dao_key = helium_sub_daos::dao_key(Token::Hnt.mint()); - let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); - - let program_approval_key = - helium_entity_manager::program_approval_key(&dao_key, &iot_routing_manager::ID); + let dao_key = Dao::Hnt.key(); + let sub_dao = SubDao::Iot.key(); + let program_approval_key = Dao::Hnt.program_approval_key(&iot_routing_manager::ID) client .as_ref() @@ -169,7 +165,7 @@ pub mod organization { .await? .ok_or_else(|| Error::account_not_found())?; - let shared_merkle_key = helium_entity_manager::shared_merkle_key(3); + let shared_merkle_key = asset::shared_merkle_key(3); let shared_merkle = client .as_ref() .anchor_account::(&shared_merkle_key) From 4642b8fd11f5a763ace36bb9451469601519679b Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 18 Dec 2024 17:47:47 -0600 Subject: [PATCH 40/49] Use dao/asset in iot --- helium-lib/src/iot.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/helium-lib/src/iot.rs b/helium-lib/src/iot.rs index f4a108d5..41de1ff1 100644 --- a/helium-lib/src/iot.rs +++ b/helium-lib/src/iot.rs @@ -112,7 +112,7 @@ pub mod organization { use super::*; use crate::{ - asset, client::{GetAnchorAccount, SolanaRpcClient}, error::Error, helium_entity_manager, helium_sub_daos, iot_routing_manager, metaplex, programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, token::Token + asset, client::{GetAnchorAccount, SolanaRpcClient}, error::Error, helium_entity_manager, dao, iot_routing_manager, metaplex, programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, token::Token }; pub enum OrgIdentifier { @@ -161,7 +161,7 @@ pub mod organization { client .as_ref() - .anchor_account::(&program_approval_key) + .anchor_account::(&program_approval_key) .await? .ok_or_else(|| Error::account_not_found())?; @@ -213,7 +213,7 @@ pub mod organization { collection_master_edition: organization_collection_master_edition_key( &collection_key, ), - entity_creator: helium_entity_manager::entity_creator_key(&dao_key), + entity_creator: Dao::Hnt.entity_creator_key(), key_to_asset: organization_key_to_asset(&dao_key, oui), tree_authority: metaplex::merkle_tree_authority_key(&shared_merkle.merkle_tree), recipient: recipient.unwrap_or(payer.clone()), @@ -364,7 +364,7 @@ pub mod net_id { args: InitializeNetIdArgsV0, authority: Option, ) -> Result<(Pubkey, Instruction), Error> { - let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); + let sub_dao = SubDao::Iot.key(); let routing_manager_key = routing_manager_key(&sub_dao); let routing_manager = client .as_ref() @@ -421,7 +421,7 @@ pub mod devaddr_constraint { authority: Option, ) -> Result<(Pubkey, Instruction), Error> { let payer_iot_ata_key = get_associated_token_address(&payer, Token::Iot.mint()); - let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); + let sub_dao = SubDao::Iot.key(); let routing_manager_key = routing_manager_key(&sub_dao); client From 8fde91eab51439c212dd6cfdf15b6e3b7b2bbd89 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 19 Dec 2024 10:46:20 -0600 Subject: [PATCH 41/49] update refrences of helium_entity_manger --- helium-lib/src/iot.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/helium-lib/src/iot.rs b/helium-lib/src/iot.rs index 41de1ff1..c7ecdc65 100644 --- a/helium-lib/src/iot.rs +++ b/helium-lib/src/iot.rs @@ -1,6 +1,5 @@ use crate::{ anchor_lang::{InstructionData, ToAccountMetas}, - dao::{Dao, SubDao}, iot_routing_manager, helium_entity_manager, programs::TOKEN_METADATA_PROGRAM_ID, @@ -112,7 +111,11 @@ pub mod organization { use super::*; use crate::{ - asset, client::{GetAnchorAccount, SolanaRpcClient}, error::Error, helium_entity_manager, dao, iot_routing_manager, metaplex, programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, token::Token + asset, client::{GetAnchorAccount, SolanaRpcClient}, + error::Error, helium_entity_manager, dao::{Dao, SubDao}, + iot_routing_manager, metaplex, + programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, + token::Token }; pub enum OrgIdentifier { @@ -271,7 +274,9 @@ pub mod organization { pub mod organization_delegate { use super::*; - use crate::{client::SolanaRpcClient, error::Error, iot_routing_manager}; + use crate::{ + client::SolanaRpcClient, error::Error, iot_routing_manager + }; pub async fn create>( _client: &C, @@ -328,8 +333,8 @@ pub mod net_id { use crate::{ client::{GetAnchorAccount, SolanaRpcClient}, error::Error, - helium_sub_daos, iot_routing_manager, - token::Token, + dao::SubDao, + iot_routing_manager, }; pub enum NetIdIdentifier { @@ -341,7 +346,7 @@ pub mod net_id { client: &C, identifier: NetIdIdentifier, ) -> Result<(Pubkey, NetIdV0), Error> { - let sub_dao = helium_sub_daos::sub_dao_key(Token::Iot.mint()); + let sub_dao = SubDao::Iot.key(); let routing_manager_key = routing_manager_key(&sub_dao); let net_id_key = match identifier { NetIdIdentifier::Id(id) => net_id_key(&routing_manager_key, id), @@ -408,7 +413,8 @@ pub mod devaddr_constraint { use crate::{ client::{GetAnchorAccount, SolanaRpcClient}, error::Error, - helium_sub_daos, iot_routing_manager, + dao::SubDao, + iot_routing_manager, token::Token, }; From fbdf4d37387a1ccded5b3804a74de93bd1454aec Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 19 Dec 2024 15:32:41 -0600 Subject: [PATCH 42/49] PR feedback --- Cargo.toml | 1 - helium-lib/Cargo.toml | 2 +- helium-lib/src/client.rs | 120 +--------- helium-lib/src/dao.rs | 4 +- helium-lib/src/dc.rs | 2 +- helium-lib/src/error.rs | 16 +- helium-lib/src/hotspot/dataonly.rs | 3 +- helium-lib/src/hotspot/mod.rs | 3 +- helium-lib/src/iot.rs | 4 +- helium-lib/src/lib.rs | 10 +- helium-lib/src/priority_fee.rs | 210 +++++++++++++++++ helium-lib/src/reward.rs | 3 +- .../src/solana_transaction_utils/mod.rs | 2 - .../src/solana_transaction_utils/pack.rs | 49 ---- .../solana_transaction_utils/priority_fee.rs | 211 ------------------ helium-lib/src/transaction.rs | 157 +++++++++++++ helium-lib/src/utils.rs | 21 -- helium-wallet/Cargo.toml | 2 +- 18 files changed, 403 insertions(+), 417 deletions(-) delete mode 100644 helium-lib/src/solana_transaction_utils/mod.rs delete mode 100644 helium-lib/src/solana_transaction_utils/pack.rs delete mode 100644 helium-lib/src/solana_transaction_utils/priority_fee.rs delete mode 100644 helium-lib/src/utils.rs diff --git a/Cargo.toml b/Cargo.toml index 959d7bf6..48ba6c76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,4 +23,3 @@ helium-proto = { git = "https://github.com/helium/proto", branch = "master", fea "services", ] } clap = { version = "4", features = ["derive"] } -tokio = { version = "1.0", features = ["full"] } diff --git a/helium-lib/Cargo.toml b/helium-lib/Cargo.toml index 17924659..0baab8f3 100644 --- a/helium-lib/Cargo.toml +++ b/helium-lib/Cargo.toml @@ -41,7 +41,7 @@ serde = {workspace = true} serde_json = {workspace = true} lazy_static = "1" rust_decimal = {workspace = true} -helium-proto = {workspace= true} +helium-proto = {workspace = true} angry-purple-tiger = "0" sha2 = {workspace = true} clap = {workspace = true, optional = true} diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index 8f5b554e..d03e0d8b 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -3,29 +3,15 @@ use crate::{ asset, error::{DecodeError, Error}, is_zero, - keypair::{self, Pubkey}, - solana_client::{ - self, - nonblocking::tpu_client::TpuClient, - send_and_confirm_transactions_in_parallel::{ - send_and_confirm_transactions_in_parallel, SendAndConfirmConfig, - }, - tpu_client::TpuClientConfig, - }, - solana_sdk::{ - commitment_config::CommitmentConfig, instruction::Instruction, message::Message, - signature::Keypair, signer::Signer, - }, - solana_transaction_utils::{ - pack::pack_instructions_into_transactions, priority_fee::auto_compute_limit_and_price, - }, + keypair::{self, Keypair, Pubkey}, + solana_client, + solana_sdk::{commitment_config::CommitmentConfig, signer::Signer}, }; use futures::{stream, StreamExt, TryStreamExt}; use itertools::Itertools; use jsonrpc_client::{JsonRpcError, SendRequest}; -use solana_sdk::signer::EncodableKey; -use std::{marker::Send, path::PathBuf, sync::Arc}; +use std::{marker::Send, sync::Arc}; use tracing::instrument; pub use solana_client::nonblocking::rpc_client::RpcClient as SolanaRpcClient; @@ -52,12 +38,13 @@ pub struct SolanaClient { impl Default for SolanaClient { fn default() -> Self { + // safe to unwrap Self::new(SOLANA_URL_MAINNET, None).unwrap() } } impl SolanaClient { - pub fn new(url: &str, wallet_path: Option) -> Result { + pub fn new(url: &str, wallet: Option>) -> Result { let client = Arc::new( solana_client::nonblocking::rpc_client::RpcClient::new_with_commitment( url.to_string(), @@ -65,14 +52,6 @@ impl SolanaClient { ), ); - let wallet = if let Some(path) = wallet_path { - Some(Arc::new( - Keypair::read_from_file(&path).map_err(Error::from)?, - )) - } else { - None - }; - Ok(Self { inner: client, base_url: url.to_string(), @@ -80,10 +59,6 @@ impl SolanaClient { }) } - pub fn solana_rpc_client(&self) -> Arc { - self.inner.clone() - } - pub fn ws_url(&self) -> String { self.base_url .replace("https", "wss") @@ -95,87 +70,7 @@ impl SolanaClient { self.wallet .as_ref() .map(|wallet| wallet.pubkey()) - .ok_or_else(|| Error::Other("Wallet not configured".to_string())) - } - - pub async fn send_instructions( - &self, - ixs: Vec, - extra_signers: &[Keypair], - sequentially: bool, - ) -> Result<(), Error> { - let wallet = self - .wallet - .as_ref() - .ok_or_else(|| Error::Other("Wallet not configured".to_string()))?; - - let (blockhash, _) = self - .inner - .as_ref() - .get_latest_blockhash_with_commitment(CommitmentConfig::finalized()) - .await - .expect("Failed to get latest blockhash"); - - let txs = pack_instructions_into_transactions(vec![ixs], &wallet); - let mut with_auto_compute: Vec = Vec::new(); - let keys: Vec<&dyn Signer> = std::iter::once(&wallet as &dyn Signer) - .chain(extra_signers.iter().map(|k| k as &dyn Signer)) - .collect(); - - for (tx, _) in &txs { - let computed = auto_compute_limit_and_price( - &self.solana_rpc_client(), - tx.clone(), - &keys, - 1.2, - Some(&wallet.pubkey()), - Some(blockhash), - ) - .await - .unwrap(); - - with_auto_compute.push(Message::new(&computed, Some(&wallet.pubkey()))); - } - - if with_auto_compute.is_empty() { - return Ok(()); - } - - let results; - let tpu_client = TpuClient::new( - "helium-lib", - self.solana_rpc_client(), - &self.ws_url(), - TpuClientConfig::default(), - ) - .await?; - - match sequentially { - true => { - results = tpu_client - .send_and_confirm_messages_with_spinner(&with_auto_compute, &keys) - .await?; - } - false => { - results = send_and_confirm_transactions_in_parallel( - self.solana_rpc_client(), - Some(tpu_client), - &with_auto_compute, - &keys, - SendAndConfirmConfig { - with_spinner: true, - resign_txs_count: Some(5), - }, - ) - .await?; - } - } - - if let Some(err) = results.into_iter().flatten().next() { - return Err(Error::from(err)); - } - - Ok(()) + .ok_or_else(|| Error::WalletUnconfigured) } } @@ -375,6 +270,7 @@ pub struct DasClient { impl Default for DasClient { fn default() -> Self { + // safe to unwrap Self::with_base_url(SOLANA_URL_MAINNET).unwrap() } } diff --git a/helium-lib/src/dao.rs b/helium-lib/src/dao.rs index 0f66e964..7103a756 100644 --- a/helium-lib/src/dao.rs +++ b/helium-lib/src/dao.rs @@ -1,6 +1,6 @@ use crate::{ - data_credits, entity_key::AsEntityKey, helium_entity_manager, helium_sub_daos, keypair::Pubkey, - lazy_distributor, metaplex, rewards_oracle, token::Token, utils::get_current_epoch, + data_credits, entity_key::AsEntityKey, get_current_epoch, helium_entity_manager, + helium_sub_daos, keypair::Pubkey, lazy_distributor, metaplex, rewards_oracle, token::Token, }; use sha2::{Digest, Sha256}; diff --git a/helium-lib/src/dc.rs b/helium-lib/src/dc.rs index ef34aba2..b46a9766 100644 --- a/helium-lib/src/dc.rs +++ b/helium-lib/src/dc.rs @@ -6,8 +6,8 @@ use crate::{ data_credits, error::{DecodeError, Error}, keypair::{Keypair, Pubkey}, + priority_fee, solana_sdk::{instruction::Instruction, signer::Signer, transaction::Transaction}, - solana_transaction_utils::priority_fee, token::{Token, TokenAmount}, TransactionOpts, }; diff --git a/helium-lib/src/error.rs b/helium-lib/src/error.rs index 1bfea7c3..8850ed1e 100644 --- a/helium-lib/src/error.rs +++ b/helium-lib/src/error.rs @@ -15,6 +15,8 @@ pub enum Error { AnchorLang(#[from] helium_anchor_gen::anchor_lang::error::Error), #[error("Account already exists")] AccountExists, + #[error("Account non existent: {0}")] + AccountAbsent(String), #[error("DAS client: {0}")] Das(#[from] client::DasClientError), #[error("grpc: {0}")] @@ -45,13 +47,15 @@ pub enum Error { Decode(#[from] DecodeError), #[error("encode: {0}")] Encode(#[from] EncodeError), - #[error("other: {0}")] - Other(String), + #[error("Wallet is not configured")] + WalletUnconfigured, + #[error("error: {0}")] + Error(String), } impl From> for Error { fn from(err: Box) -> Self { - Self::Other(err.to_string()) + Self::other(err.to_string()) } } @@ -88,12 +92,14 @@ impl Error { _ => false, } } + + pub fn other(reason: S) -> Self { + Self::Error(reason.to_string()) + } } #[derive(Debug, Error)] pub enum EncodeError { - #[error("io: {0}")] - Io(#[from] std::io::Error), #[error("proto: {0}")] Proto(#[from] helium_proto::EncodeError), #[error("bincode: {0}")] diff --git a/helium-lib/src/hotspot/dataonly.rs b/helium-lib/src/hotspot/dataonly.rs index b298e048..353f03a6 100644 --- a/helium-lib/src/hotspot/dataonly.rs +++ b/helium-lib/src/hotspot/dataonly.rs @@ -9,13 +9,12 @@ use crate::{ helium_entity_manager, helium_sub_daos, hotspot, hotspot::{HotspotInfoUpdate, ECC_VERIFIER}, keypair::{Keypair, Pubkey}, - kta, + kta, priority_fee, programs::{ SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID, TOKEN_METADATA_PROGRAM_ID, }, solana_client::rpc_client::SerializableTransaction, solana_sdk::{instruction::Instruction, signature::Signer, transaction::Transaction}, - solana_transaction_utils::priority_fee, token::Token, TransactionOpts, }; diff --git a/helium-lib/src/hotspot/mod.rs b/helium-lib/src/hotspot/mod.rs index 7e132699..82027942 100644 --- a/helium-lib/src/hotspot/mod.rs +++ b/helium-lib/src/hotspot/mod.rs @@ -7,7 +7,7 @@ use crate::{ error::{DecodeError, EncodeError, Error}, helium_entity_manager, is_zero, keypair::{pubkey, serde_pubkey, Keypair, Pubkey}, - kta, onboarding, + kta, onboarding, priority_fee, programs::SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, solana_client::rpc_client::SerializableTransaction, solana_sdk::{ @@ -15,7 +15,6 @@ use crate::{ signer::Signer, transaction::Transaction, }, - solana_transaction_utils::priority_fee, token::Token, TransactionOpts, }; diff --git a/helium-lib/src/iot.rs b/helium-lib/src/iot.rs index c7ecdc65..8b529127 100644 --- a/helium-lib/src/iot.rs +++ b/helium-lib/src/iot.rs @@ -160,7 +160,7 @@ pub mod organization { .as_ref() .get_account(&payer_iot_ata_key) .await - .map_err(|_| Error::Other("Payer IOT token account non existent.".to_string()))?; + .map_err(|_| Error::AccountAbsent(format!("Payer IOT token account.")))?; client .as_ref() @@ -434,7 +434,7 @@ pub mod devaddr_constraint { .as_ref() .get_account(&payer_iot_ata_key) .await - .map_err(|_| Error::Other("Payer IOT token account non existent.".to_string()))?; + .map_err(|_| Error::AccountAbsent(format!("Payer IOT token account.")))?; let net_id = client .as_ref() diff --git a/helium-lib/src/lib.rs b/helium-lib/src/lib.rs index be1cbc63..c68cf618 100644 --- a/helium-lib/src/lib.rs +++ b/helium-lib/src/lib.rs @@ -14,11 +14,11 @@ pub mod kta; pub mod memo; pub mod metaplex; pub mod onboarding; +pub mod priority_fee; pub mod programs; pub mod reward; -pub mod solana_transaction_utils; pub mod token; -pub mod utils; +pub mod transaction; pub use anchor_client; pub use anchor_client::solana_client; @@ -29,7 +29,6 @@ pub use helium_anchor_gen::{ }; pub use solana_sdk; pub use solana_sdk::bs58; -pub use solana_transaction_utils::priority_fee; pub(crate) trait Zero { const ZERO: Self; @@ -75,3 +74,8 @@ impl Default for TransactionOpts { } } } + +const EPOCH_LENGTH: u64 = 60 * 60 * 24; +pub fn get_current_epoch(unix_time: u64) -> u64 { + unix_time / EPOCH_LENGTH +} diff --git a/helium-lib/src/priority_fee.rs b/helium-lib/src/priority_fee.rs index e69de29b..18eabef6 100644 --- a/helium-lib/src/priority_fee.rs +++ b/helium-lib/src/priority_fee.rs @@ -0,0 +1,210 @@ +use crate::{ + anchor_lang::ToAccountMetas, + client::SolanaRpcClient, + error::Error, + keypair::Pubkey, + solana_client, + solana_sdk::{ + instruction::{AccountMeta, Instruction}, + message::Message, + signers::Signers, + transaction::Transaction, + }, + transaction::replace_or_insert_instruction, +}; +use itertools::Itertools; + +pub const MAX_RECENT_PRIORITY_FEE_ACCOUNTS: usize = 128; +pub const MIN_PRIORITY_FEE: u64 = 1; + +pub async fn get_estimate_with_min>( + client: &C, + accounts: &impl ToAccountMetas, + min_priority_fee: u64, +) -> Result { + let client_url = client.as_ref().url(); + if client_url.contains("mainnet.helius") { + helius::get_estimate_with_min(client, accounts, min_priority_fee).await + } else { + base::get_estimate_with_min(client, accounts, min_priority_fee).await + } +} + +fn account_keys(accounts: &impl ToAccountMetas) -> impl Iterator { + accounts + .to_account_metas(None) + .into_iter() + .filter(|account_meta| account_meta.is_writable) + .map(|x| x.pubkey) + .unique() + .take(MAX_RECENT_PRIORITY_FEE_ACCOUNTS) +} + +mod helius { + use super::*; + use serde::Deserialize; + use serde_json::json; + + pub async fn get_estimate_with_min>( + client: &C, + accounts: &impl ToAccountMetas, + min_priority_fee: u64, + ) -> Result { + #[derive(Debug, Deserialize)] + #[serde(rename_all = "camelCase")] + struct Response { + priority_fee_estimate: f64, + } + let request = solana_client::rpc_request::RpcRequest::Custom { + method: "getPriorityFeeEstimate", + }; + let account_keys: Vec<_> = account_keys(accounts).map(|v| v.to_string()).collect(); + let params = json!([ + { + "accountKeys": account_keys, + "options": { + "recommended": true, + } + } + ]); + + let response: Response = client.as_ref().send(request, params).await?; + Ok((response.priority_fee_estimate.ceil() as u64).max(min_priority_fee)) + } +} + +mod base { + use super::*; + + pub async fn get_estimate_with_min>( + client: &C, + accounts: &impl ToAccountMetas, + min_priority_fee: u64, + ) -> Result { + let account_keys: Vec<_> = account_keys(accounts).collect(); + let recent_fees = client + .as_ref() + .get_recent_prioritization_fees(&account_keys) + .await?; + let mut max_per_slot = Vec::new(); + for (slot, fees) in &recent_fees.into_iter().group_by(|x| x.slot) { + let Some(maximum) = fees.map(|x| x.prioritization_fee).max() else { + continue; + }; + max_per_slot.push((slot, maximum)); + } + // Only take the most recent 20 maximum fees: + max_per_slot.sort_by(|a, b| a.0.cmp(&b.0).reverse()); + let mut max_per_slot: Vec<_> = max_per_slot.into_iter().take(20).map(|x| x.1).collect(); + max_per_slot.sort(); + // Get the median: + let num_recent_fees = max_per_slot.len(); + let mid = num_recent_fees / 2; + let estimate = if num_recent_fees == 0 { + min_priority_fee + } else if num_recent_fees % 2 == 0 { + // If the number of samples is even, taken the mean of the two median fees + (max_per_slot[mid - 1] + max_per_slot[mid]) / 2 + } else { + max_per_slot[mid] + } + .max(min_priority_fee); + Ok(estimate) + } +} + +pub fn compute_budget_instruction(compute_limit: u32) -> solana_sdk::instruction::Instruction { + solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit(compute_limit) +} + +pub fn compute_price_instruction(priority_fee: u64) -> solana_sdk::instruction::Instruction { + solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_price(priority_fee) +} + +pub async fn compute_price_instruction_for_accounts>( + client: &C, + accounts: &impl ToAccountMetas, + min_priority_fee: u64, +) -> Result { + let priority_fee = get_estimate_with_min(client, accounts, min_priority_fee).await?; + Ok(compute_price_instruction(priority_fee)) +} + +pub async fn compute_budget_for_instructions, T: Signers + ?Sized>( + client: &C, + instructions: Vec, + signers: &T, + compute_multiplier: f32, + payer: Option<&Pubkey>, + blockhash: Option, +) -> Result { + // Check for existing compute unit limit instruction and replace it if found + let mut updated_instructions = instructions.clone(); + for ix in &mut updated_instructions { + if ix.program_id == solana_sdk::compute_budget::id() + && ix.data.first() + == solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit(0) + .data + .first() + { + ix.data = solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit( + 1900000, + ) + .data; // Replace limit + } + } + + let blockhash_actual = match blockhash { + Some(hash) => hash, + None => client.as_ref().get_latest_blockhash().await?, + }; + + let snub_tx = Transaction::new( + signers, + Message::new(&updated_instructions, payer), + blockhash_actual, + ); + + // Simulate the transaction to get the actual compute used + let simulation_result = client.as_ref().simulate_transaction(&snub_tx).await?; + let actual_compute_used = simulation_result.value.units_consumed.unwrap_or(200000); + let final_compute_budget = (actual_compute_used as f32 * compute_multiplier) as u32; + Ok(compute_budget_instruction(final_compute_budget)) +} + +pub async fn auto_compute_limit_and_price, T: Signers + ?Sized>( + client: &C, + instructions: Vec, + signers: &T, + compute_multiplier: f32, + payer: Option<&Pubkey>, + blockhash: Option, +) -> Result, Error> { + let mut updated_instructions = instructions.clone(); + + // Compute budget instruction + let compute_budget_ix = compute_budget_for_instructions( + client, + instructions.clone(), + signers, + compute_multiplier, + payer, + blockhash, + ) + .await?; + + // Compute price instruction + let accounts: Vec = instructions + .iter() + .flat_map(|i| i.accounts.iter().map(|a| a.pubkey)) + .unique() + .map(|pk| AccountMeta::new(pk, false)) + .collect(); + + let compute_price_ix = + compute_price_instruction_for_accounts(client, &accounts, MIN_PRIORITY_FEE).await?; + + replace_or_insert_instruction(&mut updated_instructions, compute_budget_ix, 0); + replace_or_insert_instruction(&mut updated_instructions, compute_price_ix, 1); + Ok(updated_instructions) +} diff --git a/helium-lib/src/reward.rs b/helium-lib/src/reward.rs index c482972b..ea6d3ef8 100644 --- a/helium-lib/src/reward.rs +++ b/helium-lib/src/reward.rs @@ -7,11 +7,10 @@ use crate::{ error::{DecodeError, EncodeError, Error}, helium_entity_manager, keypair::{Keypair, Pubkey}, - kta, lazy_distributor, + kta, lazy_distributor, priority_fee, programs::SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, rewards_oracle, solana_sdk::{instruction::Instruction, transaction::Transaction}, - solana_transaction_utils::priority_fee, token::TokenAmount, TransactionOpts, }; diff --git a/helium-lib/src/solana_transaction_utils/mod.rs b/helium-lib/src/solana_transaction_utils/mod.rs deleted file mode 100644 index ef7f5e71..00000000 --- a/helium-lib/src/solana_transaction_utils/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod pack; -pub mod priority_fee; diff --git a/helium-lib/src/solana_transaction_utils/pack.rs b/helium-lib/src/solana_transaction_utils/pack.rs deleted file mode 100644 index d68959f8..00000000 --- a/helium-lib/src/solana_transaction_utils/pack.rs +++ /dev/null @@ -1,49 +0,0 @@ -use solana_sdk::{ - compute_budget::ComputeBudgetInstruction, instruction::Instruction, signature::Keypair, - signer::Signer, transaction::Transaction, -}; - -const MAX_TRANSACTION_SIZE: usize = 1232; // Maximum transaction size in bytes - -// Returns packed txs with the indices in instructions that were used in that tx. -pub fn pack_instructions_into_transactions( - instructions: Vec>, - payer: &Keypair, -) -> Vec<(Vec, Vec)> { - // Change return type - let mut transactions = Vec::new(); - let compute_ixs = vec![ - ComputeBudgetInstruction::set_compute_unit_limit(200000), - ComputeBudgetInstruction::set_compute_unit_price(1), - ]; - let mut curr_instructions: Vec = compute_ixs.clone(); - let mut curr_indices: Vec = Vec::new(); // Track indices of instructions - let mut ix_queue: Vec<(Instruction, usize)> = instructions - .iter() - .enumerate() - .flat_map(|(i, group)| group.iter().map(move |ix| (ix.clone(), i))) - .collect(); - ix_queue.reverse(); - - while let Some((ix, index)) = ix_queue.pop() { - curr_instructions.push(ix); - curr_indices.push(index); - let tx = Transaction::new_with_payer(&curr_instructions, Some(&payer.pubkey())); - let len = bincode::serialize(&tx).unwrap().len(); - if len > MAX_TRANSACTION_SIZE { - ix_queue.push(( - curr_instructions.pop().unwrap(), - curr_indices.pop().unwrap(), - )); - transactions.push((curr_instructions.clone(), curr_indices.clone())); - curr_instructions = compute_ixs.clone(); - curr_indices.clear(); - } - } - - if !curr_instructions.is_empty() { - transactions.push((curr_instructions.clone(), curr_indices.clone())); - } - - transactions -} diff --git a/helium-lib/src/solana_transaction_utils/priority_fee.rs b/helium-lib/src/solana_transaction_utils/priority_fee.rs deleted file mode 100644 index 9c449611..00000000 --- a/helium-lib/src/solana_transaction_utils/priority_fee.rs +++ /dev/null @@ -1,211 +0,0 @@ -use itertools::Itertools; - -use crate::{ - anchor_lang::ToAccountMetas, - client::SolanaRpcClient, - error::Error, - keypair::Pubkey, - solana_client, - solana_sdk::{ - instruction::{AccountMeta, Instruction}, - message::Message, - signers::Signers, - transaction::Transaction, - }, - utils::replace_or_insert_instruction, -}; - -pub const MAX_RECENT_PRIORITY_FEE_ACCOUNTS: usize = 128; -pub const MIN_PRIORITY_FEE: u64 = 1; - -pub async fn get_estimate_with_min>( - client: &C, - accounts: &impl ToAccountMetas, - min_priority_fee: u64, -) -> Result { - let client_url = client.as_ref().url(); - if client_url.contains("mainnet.helius") { - helius::get_estimate_with_min(client, accounts, min_priority_fee).await - } else { - base::get_estimate_with_min(client, accounts, min_priority_fee).await - } -} - -fn account_keys(accounts: &impl ToAccountMetas) -> impl Iterator { - accounts - .to_account_metas(None) - .into_iter() - .filter(|account_meta| account_meta.is_writable) - .map(|x| x.pubkey) - .unique() - .take(MAX_RECENT_PRIORITY_FEE_ACCOUNTS) -} - -mod helius { - use super::*; - use serde::Deserialize; - use serde_json::json; - - pub async fn get_estimate_with_min>( - client: &C, - accounts: &impl ToAccountMetas, - min_priority_fee: u64, - ) -> Result { - #[derive(Debug, Deserialize)] - #[serde(rename_all = "camelCase")] - struct Response { - priority_fee_estimate: f64, - } - let request = solana_client::rpc_request::RpcRequest::Custom { - method: "getPriorityFeeEstimate", - }; - let account_keys: Vec<_> = account_keys(accounts).map(|v| v.to_string()).collect(); - let params = json!([ - { - "accountKeys": account_keys, - "options": { - "recommended": true, - } - } - ]); - - let response: Response = client.as_ref().send(request, params).await?; - Ok((response.priority_fee_estimate.ceil() as u64).max(min_priority_fee)) - } -} - -mod base { - use super::*; - - pub async fn get_estimate_with_min>( - client: &C, - accounts: &impl ToAccountMetas, - min_priority_fee: u64, - ) -> Result { - let account_keys: Vec<_> = account_keys(accounts).collect(); - let recent_fees = client - .as_ref() - .get_recent_prioritization_fees(&account_keys) - .await?; - let mut max_per_slot = Vec::new(); - for (slot, fees) in &recent_fees.into_iter().group_by(|x| x.slot) { - let Some(maximum) = fees.map(|x| x.prioritization_fee).max() else { - continue; - }; - max_per_slot.push((slot, maximum)); - } - // Only take the most recent 20 maximum fees: - max_per_slot.sort_by(|a, b| a.0.cmp(&b.0).reverse()); - let mut max_per_slot: Vec<_> = max_per_slot.into_iter().take(20).map(|x| x.1).collect(); - max_per_slot.sort(); - // Get the median: - let num_recent_fees = max_per_slot.len(); - let mid = num_recent_fees / 2; - let estimate = if num_recent_fees == 0 { - min_priority_fee - } else if num_recent_fees % 2 == 0 { - // If the number of samples is even, taken the mean of the two median fees - (max_per_slot[mid - 1] + max_per_slot[mid]) / 2 - } else { - max_per_slot[mid] - } - .max(min_priority_fee); - Ok(estimate) - } -} - -pub fn compute_budget_instruction(compute_limit: u32) -> solana_sdk::instruction::Instruction { - solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit(compute_limit) -} - -pub fn compute_price_instruction(priority_fee: u64) -> solana_sdk::instruction::Instruction { - solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_price(priority_fee) -} - -pub async fn compute_price_instruction_for_accounts>( - client: &C, - accounts: &impl ToAccountMetas, - min_priority_fee: u64, -) -> Result { - let priority_fee = get_estimate_with_min(client, accounts, min_priority_fee).await?; - Ok(compute_price_instruction(priority_fee)) -} - -pub async fn compute_budget_for_instructions, T: Signers + ?Sized>( - client: &C, - instructions: Vec, - signers: &T, - compute_multiplier: f32, - payer: Option<&Pubkey>, - blockhash: Option, -) -> Result { - // Check for existing compute unit limit instruction and replace it if found - let mut updated_instructions = instructions.clone(); - for ix in &mut updated_instructions { - if ix.program_id == solana_sdk::compute_budget::id() - && ix.data.first() - == solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit(0) - .data - .first() - { - ix.data = solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit( - 1900000, - ) - .data; // Replace limit - } - } - - let blockhash_actual = match blockhash { - Some(hash) => hash, - None => client.as_ref().get_latest_blockhash().await?, - }; - - let snub_tx = Transaction::new( - signers, - Message::new(&updated_instructions, payer), - blockhash_actual, - ); - - // Simulate the transaction to get the actual compute used - let simulation_result = client.as_ref().simulate_transaction(&snub_tx).await?; - let actual_compute_used = simulation_result.value.units_consumed.unwrap_or(200000); - let final_compute_budget = (actual_compute_used as f32 * compute_multiplier) as u32; - Ok(compute_budget_instruction(final_compute_budget)) -} - -pub async fn auto_compute_limit_and_price, T: Signers + ?Sized>( - client: &C, - instructions: Vec, - signers: &T, - compute_multiplier: f32, - payer: Option<&Pubkey>, - blockhash: Option, -) -> Result, Error> { - let mut updated_instructions = instructions.clone(); - - // Compute budget instruction - let compute_budget_ix = compute_budget_for_instructions( - client, - instructions.clone(), - signers, - compute_multiplier, - payer, - blockhash, - ) - .await?; - - // Compute price instruction - let accounts: Vec = instructions - .iter() - .flat_map(|i| i.accounts.iter().map(|a| a.pubkey)) - .unique() - .map(|pk| AccountMeta::new(pk, false)) - .collect(); - - let compute_price_ix = - compute_price_instruction_for_accounts(client, &accounts, MIN_PRIORITY_FEE).await?; - - replace_or_insert_instruction(&mut updated_instructions, compute_budget_ix, 0); - replace_or_insert_instruction(&mut updated_instructions, compute_price_ix, 1); - Ok(updated_instructions) -} diff --git a/helium-lib/src/transaction.rs b/helium-lib/src/transaction.rs index e69de29b..6c977575 100644 --- a/helium-lib/src/transaction.rs +++ b/helium-lib/src/transaction.rs @@ -0,0 +1,157 @@ +use crate::{ + client::SolanaClient, + error::Error, + priority_fee::auto_compute_limit_and_price, + solana_client::{ + nonblocking::tpu_client::TpuClient, + send_and_confirm_transactions_in_parallel::{ + send_and_confirm_transactions_in_parallel, SendAndConfirmConfig, + }, + tpu_client::TpuClientConfig, + }, + solana_sdk::{ + commitment_config::CommitmentConfig, compute_budget::ComputeBudgetInstruction, + instruction::Instruction, message::Message, signature::Keypair, signer::Signer, + transaction::Transaction, + }, +}; + +const MAX_TRANSACTION_SIZE: usize = 1232; // Maximum transaction size in bytes + +pub fn replace_or_insert_instruction( + instructions: &mut Vec, + new_instruction: Instruction, + insert_pos: usize, +) { + if let Some(pos) = instructions + .iter() + .position(|ix| ix.program_id == solana_sdk::compute_budget::id()) + { + instructions[pos + insert_pos] = new_instruction; + } else { + instructions.insert(insert_pos, new_instruction); + } +} + +// Returns packed txs with the indices in instructions that were used in that tx. +pub fn pack_instructions( + instructions: Vec>, + payer: &Keypair, +) -> Vec<(Vec, Vec)> { + // Change return type + let mut transactions = Vec::new(); + let compute_ixs = vec![ + ComputeBudgetInstruction::set_compute_unit_limit(200000), + ComputeBudgetInstruction::set_compute_unit_price(1), + ]; + let mut curr_instructions: Vec = compute_ixs.clone(); + let mut curr_indices: Vec = Vec::new(); // Track indices of instructions + let mut ix_queue: Vec<(Instruction, usize)> = instructions + .iter() + .enumerate() + .flat_map(|(i, group)| group.iter().map(move |ix| (ix.clone(), i))) + .collect(); + ix_queue.reverse(); + + while let Some((ix, index)) = ix_queue.pop() { + curr_instructions.push(ix); + curr_indices.push(index); + let tx = Transaction::new_with_payer(&curr_instructions, Some(&payer.pubkey())); + let len = bincode::serialize(&tx).unwrap().len(); + if len > MAX_TRANSACTION_SIZE { + ix_queue.push(( + curr_instructions.pop().unwrap(), + curr_indices.pop().unwrap(), + )); + transactions.push((curr_instructions.clone(), curr_indices.clone())); + curr_instructions = compute_ixs.clone(); + curr_indices.clear(); + } + } + + if !curr_instructions.is_empty() { + transactions.push((curr_instructions.clone(), curr_indices.clone())); + } + + transactions +} + +pub async fn send_instructions( + client: SolanaClient, + ixs: Vec, + extra_signers: &[Keypair], + sequentially: bool, +) -> Result<(), Error> { + let wallet = client + .wallet + .as_ref() + .ok_or_else(|| Error::WalletUnconfigured)?; + + let (blockhash, _) = client + .inner + .as_ref() + .get_latest_blockhash_with_commitment(CommitmentConfig::finalized()) + .await + .expect("Failed to get latest blockhash"); + + let txs = pack_instructions(vec![ixs], &wallet); + let mut with_auto_compute: Vec = Vec::new(); + let keys: Vec<&dyn Signer> = std::iter::once(&wallet as &dyn Signer) + .chain(extra_signers.iter().map(|k| k as &dyn Signer)) + .collect(); + + for (tx, _) in &txs { + let computed = auto_compute_limit_and_price( + &client, + tx.clone(), + &keys, + 1.2, + Some(&wallet.pubkey()), + Some(blockhash), + ) + .await + .unwrap(); + + with_auto_compute.push(Message::new(&computed, Some(&wallet.pubkey()))); + } + + if with_auto_compute.is_empty() { + return Ok(()); + } + + let results; + let tpu_client = TpuClient::new( + "helium-lib", + client.inner.clone(), + &client.ws_url(), + TpuClientConfig::default(), + ) + .await?; + + match sequentially { + true => { + results = tpu_client + .send_and_confirm_messages_with_spinner(&with_auto_compute, &keys) + .await?; + } + false => { + results = send_and_confirm_transactions_in_parallel( + client.inner.clone(), + Some(tpu_client), + &with_auto_compute, + &keys, + SendAndConfirmConfig { + with_spinner: true, + resign_txs_count: Some(5), + }, + ) + .await?; + } + } + + if let Some(err) = results.into_iter().flatten().next() { + return Err(Error::from(err)); + } + + Ok(()) +} diff --git a/helium-lib/src/utils.rs b/helium-lib/src/utils.rs deleted file mode 100644 index 99c56b7e..00000000 --- a/helium-lib/src/utils.rs +++ /dev/null @@ -1,21 +0,0 @@ -use solana_sdk::instruction::Instruction; - -const EPOCH_LENGTH: u64 = 60 * 60 * 24; -pub fn get_current_epoch(unix_time: u64) -> u64 { - unix_time / EPOCH_LENGTH -} - -pub fn replace_or_insert_instruction( - instructions: &mut Vec, - new_instruction: Instruction, - insert_pos: usize, -) { - if let Some(pos) = instructions - .iter() - .position(|ix| ix.program_id == solana_sdk::compute_budget::id()) - { - instructions[pos + insert_pos] = new_instruction; - } else { - instructions.insert(insert_pos, new_instruction); - } -} diff --git a/helium-wallet/Cargo.toml b/helium-wallet/Cargo.toml index a013e10b..cb43ebd6 100644 --- a/helium-wallet/Cargo.toml +++ b/helium-wallet/Cargo.toml @@ -28,7 +28,7 @@ serde_json = {workspace = true} clap = { workspace = true } qr2term = "0.2" rust_decimal = {workspace = true} -tokio = {workspace = true} +tokio = { version = "1.0", features = ["full"] } helium-lib = { path = "../helium-lib", features = ["clap", "mnemonic"] } helium-mnemonic = { path = "../helium-mnemonic" } helium-proto = {workspace = true} From 25147f3d14d9bb4ee399e66e44cf021b739afead Mon Sep 17 00:00:00 2001 From: bry Date: Fri, 20 Dec 2024 13:14:22 -0600 Subject: [PATCH 43/49] fix --- Cargo.lock | 2 +- Cargo.toml | 2 +- helium-lib/src/iot.rs | 56 ++++++++++++++++++++----------------------- helium-lib/src/lib.rs | 2 +- 4 files changed, 29 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f4f3895..6252fe10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2705,7 +2705,7 @@ dependencies = [ [[package]] name = "helium-proto" version = "0.1.0" -source = "git+https://github.com/helium/proto?branch=master#c5c67f5631b69ef696961995045c0a41f9a5b936" +source = "git+https://github.com/helium/proto?branch=master#b4c8c8f47dfff38a2ff1b7fe14e1b2a1beea651c" dependencies = [ "bytes", "prost", diff --git a/Cargo.toml b/Cargo.toml index 48ba6c76..f6d87469 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,4 +22,4 @@ helium-crypto = { version = "0.8" } helium-proto = { git = "https://github.com/helium/proto", branch = "master", features = [ "services", ] } -clap = { version = "4", features = ["derive"] } +clap = { version = "4", features = ["derive"] } \ No newline at end of file diff --git a/helium-lib/src/iot.rs b/helium-lib/src/iot.rs index 8b529127..949c7e3a 100644 --- a/helium-lib/src/iot.rs +++ b/helium-lib/src/iot.rs @@ -1,9 +1,8 @@ use crate::{ anchor_lang::{InstructionData, ToAccountMetas}, - iot_routing_manager, - helium_entity_manager, - programs::TOKEN_METADATA_PROGRAM_ID, + helium_entity_manager, iot_routing_manager, keypair::Pubkey, + programs::TOKEN_METADATA_PROGRAM_ID, }; use sha2::{Digest, Sha256}; @@ -11,7 +10,6 @@ use solana_sdk::instruction::Instruction; use spl_associated_token_account::get_associated_token_address; use std::result::Result; - pub fn routing_manager_key(sub_dao: &Pubkey) -> Pubkey { Pubkey::find_program_address( &[b"routing_manager", sub_dao.as_ref()], @@ -111,11 +109,13 @@ pub mod organization { use super::*; use crate::{ - asset, client::{GetAnchorAccount, SolanaRpcClient}, - error::Error, helium_entity_manager, dao::{Dao, SubDao}, - iot_routing_manager, metaplex, + asset, + client::{GetAnchorAccount, SolanaRpcClient}, + dao::{Dao, SubDao}, + error::Error, + helium_entity_manager, iot_routing_manager, metaplex, programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, - token::Token + token::Token, }; pub enum OrgIdentifier { @@ -126,7 +126,7 @@ pub mod organization { pub async fn ensure_exists>( client: &C, identifier: OrgIdentifier, - ) -> Result<(Pubkey, OrganizationV0), Error> { + ) -> Result<(Pubkey, iot_routing_manager::OrganizationV0), Error> { let sub_dao = SubDao::Iot.key(); let routing_manager_key = routing_manager_key(&sub_dao); let organization_key = match identifier { @@ -136,7 +136,7 @@ pub mod organization { match client .as_ref() - .anchor_account::(&organization_key) + .anchor_account::(&organization_key) .await? { Some(organization) => Ok((organization_key, organization)), @@ -154,7 +154,7 @@ pub mod organization { let payer_iot_ata_key = get_associated_token_address(&payer, Token::Iot.mint()); let dao_key = Dao::Hnt.key(); let sub_dao = SubDao::Iot.key(); - let program_approval_key = Dao::Hnt.program_approval_key(&iot_routing_manager::ID) + let program_approval_key = Dao::Hnt.program_approval_key(&iot_routing_manager::ID); client .as_ref() @@ -164,7 +164,7 @@ pub mod organization { client .as_ref() - .anchor_account::(&program_approval_key) + .anchor_account::(&program_approval_key) .await? .ok_or_else(|| Error::account_not_found())?; @@ -178,13 +178,13 @@ pub mod organization { let routing_manager_key = routing_manager_key(&sub_dao); let routing_manager = client .as_ref() - .anchor_account::(&routing_manager_key) + .anchor_account::(&routing_manager_key) .await? .ok_or_else(|| Error::account_not_found())?; client .as_ref() - .anchor_account::(&net_id_key) + .anchor_account::(&net_id_key) .await? .ok_or_else(|| Error::account_not_found())?; @@ -257,7 +257,7 @@ pub mod organization { _client: &C, authority: Pubkey, organization_key: Pubkey, - args: UpdateOrganizationArgsV0, + args: iot_routing_manager::UpdateOrganizationArgsV0, ) -> Result { Ok(Instruction { program_id: iot_routing_manager::ID, @@ -274,9 +274,7 @@ pub mod organization { pub mod organization_delegate { use super::*; - use crate::{ - client::SolanaRpcClient, error::Error, iot_routing_manager - }; + use crate::{client::SolanaRpcClient, error::Error, iot_routing_manager}; pub async fn create>( _client: &C, @@ -332,8 +330,8 @@ pub mod net_id { use crate::{ client::{GetAnchorAccount, SolanaRpcClient}, - error::Error, dao::SubDao, + error::Error, iot_routing_manager, }; @@ -345,7 +343,7 @@ pub mod net_id { pub async fn ensure_exists>( client: &C, identifier: NetIdIdentifier, - ) -> Result<(Pubkey, NetIdV0), Error> { + ) -> Result<(Pubkey, iot_routing_manager::NetIdV0), Error> { let sub_dao = SubDao::Iot.key(); let routing_manager_key = routing_manager_key(&sub_dao); let net_id_key = match identifier { @@ -355,7 +353,7 @@ pub mod net_id { match client .as_ref() - .anchor_account::(&net_id_key) + .anchor_account::(&net_id_key) .await? { Some(net_id) => Ok((net_id_key, net_id)), @@ -366,21 +364,21 @@ pub mod net_id { pub async fn create>( client: &C, payer: Pubkey, - args: InitializeNetIdArgsV0, + args: iot_routing_manager::InitializeNetIdArgsV0, authority: Option, ) -> Result<(Pubkey, Instruction), Error> { let sub_dao = SubDao::Iot.key(); let routing_manager_key = routing_manager_key(&sub_dao); let routing_manager = client .as_ref() - .anchor_account::(&routing_manager_key) + .anchor_account::(&routing_manager_key) .await? .ok_or_else(|| Error::account_not_found())?; let net_id_key = net_id_key(&routing_manager_key, args.net_id); let net_id_exists = client .as_ref() - .anchor_account::(&net_id_key) + .anchor_account::(&net_id_key) .await .is_ok(); @@ -412,8 +410,8 @@ pub mod devaddr_constraint { use crate::{ client::{GetAnchorAccount, SolanaRpcClient}, - error::Error, dao::SubDao, + error::Error, iot_routing_manager, token::Token, }; @@ -421,7 +419,7 @@ pub mod devaddr_constraint { pub async fn create>( client: &C, payer: Pubkey, - args: InitializeDevaddrConstraintArgsV0, + args: iot_routing_manager::InitializeDevaddrConstraintArgsV0, organization_key: Pubkey, net_id_key: Pubkey, authority: Option, @@ -442,10 +440,8 @@ pub mod devaddr_constraint { .await? .ok_or_else(|| Error::account_not_found())?; - let devaddr_constarint_key = devaddr_constraint_key( - &organization_key, - args.start_addr.unwrap_or(net_id.current_addr_offset), - ); + let devaddr_constarint_key = + devaddr_constraint_key(&organization_key, net_id.current_addr_offset); Ok(( devaddr_constarint_key, diff --git a/helium-lib/src/lib.rs b/helium-lib/src/lib.rs index c68cf618..539ca061 100644 --- a/helium-lib/src/lib.rs +++ b/helium-lib/src/lib.rs @@ -60,7 +60,7 @@ where use std::sync::Arc; pub fn init(solana_client: Arc) -> Result<(), error::Error> { - kta::init(solana_client.solana_rpc_client()) + kta::init(solana_client.inner.clone()) } pub struct TransactionOpts { From 2527773f63a6ec653fb692d1a4499479ede44d1b Mon Sep 17 00:00:00 2001 From: bry Date: Tue, 14 Jan 2025 13:36:54 -0600 Subject: [PATCH 44/49] fold metaplex into asset --- helium-lib/src/asset.rs | 37 ++++++++++++++++++++++++++++++++++++- helium-lib/src/dao.rs | 12 ++++++------ helium-lib/src/iot.rs | 6 +++--- helium-lib/src/lib.rs | 2 +- helium-lib/src/metaplex.rs | 34 ---------------------------------- 5 files changed, 46 insertions(+), 45 deletions(-) delete mode 100644 helium-lib/src/metaplex.rs diff --git a/helium-lib/src/asset.rs b/helium-lib/src/asset.rs index 7d07cc1e..699dd5d3 100644 --- a/helium-lib/src/asset.rs +++ b/helium-lib/src/asset.rs @@ -8,7 +8,9 @@ use crate::{ keypair::{serde_opt_pubkey, serde_pubkey, Keypair, Pubkey}, kta, mk_transaction_with_blockhash, priority_fee::{compute_budget_instruction, compute_price_instruction_for_accounts}, - programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, + programs::{ + SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID, TOKEN_METADATA_PROGRAM_ID, + }, solana_sdk::{instruction::AccountMeta, transaction::Transaction}, TransactionOpts, }; @@ -16,6 +18,39 @@ use itertools::Itertools; use serde::{Deserialize, Serialize}; use std::{collections::HashMap, result::Result as StdResult, str::FromStr}; +pub fn bubblegum_signer_key() -> Pubkey { + Pubkey::find_program_address(&[b"collection_cpi"], &mpl_bubblegum::ID).0 +} + +pub fn collection_metadata_key(collection_key: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[ + b"metadata", + TOKEN_METADATA_PROGRAM_ID.as_ref(), + collection_key.as_ref(), + ], + &TOKEN_METADATA_PROGRAM_ID, + ) + .0 +} + +pub fn collection_master_edition_key(collection_key: &Pubkey) -> Pubkey { + Pubkey::find_program_address( + &[ + b"metadata", + TOKEN_METADATA_PROGRAM_ID.as_ref(), + collection_key.as_ref(), + b"edition", + ], + &TOKEN_METADATA_PROGRAM_ID, + ) + .0 +} + +pub fn merkle_tree_authority_key(merkle_tree: &Pubkey) -> Pubkey { + Pubkey::find_program_address(&[merkle_tree.as_ref()], &mpl_bubblegum::ID).0 +} + pub fn shared_merkle_key(proof_size: u8) -> Pubkey { Pubkey::find_program_address( &[b"shared_merkle", &[proof_size]], diff --git a/helium-lib/src/dao.rs b/helium-lib/src/dao.rs index 7103a756..ababf17a 100644 --- a/helium-lib/src/dao.rs +++ b/helium-lib/src/dao.rs @@ -1,6 +1,6 @@ use crate::{ - data_credits, entity_key::AsEntityKey, get_current_epoch, helium_entity_manager, - helium_sub_daos, keypair::Pubkey, lazy_distributor, metaplex, rewards_oracle, token::Token, + asset, data_credits, entity_key::AsEntityKey, get_current_epoch, helium_entity_manager, + helium_sub_daos, keypair::Pubkey, lazy_distributor, rewards_oracle, token::Token, }; use sha2::{Digest, Sha256}; @@ -53,19 +53,19 @@ impl Dao { } pub fn collection_metadata_key(&self, collection_key: &Pubkey) -> Pubkey { - metaplex::collection_metadata_key(collection_key) + asset::collection_metadata_key(collection_key) } pub fn collection_master_edition_key(&self, collection_key: &Pubkey) -> Pubkey { - metaplex::collection_master_edition_key(collection_key) + asset::collection_master_edition_key(collection_key) } pub fn merkle_tree_authority(&self, merkle_tree: &Pubkey) -> Pubkey { - metaplex::merkle_tree_authority_key(merkle_tree) + asset::merkle_tree_authority_key(merkle_tree) } pub fn bubblegum_signer(&self) -> Pubkey { - metaplex::bubblegum_signer_key() + asset::bubblegum_signer_key() } pub fn entity_creator_key(&self) -> Pubkey { diff --git a/helium-lib/src/iot.rs b/helium-lib/src/iot.rs index 949c7e3a..11df8508 100644 --- a/helium-lib/src/iot.rs +++ b/helium-lib/src/iot.rs @@ -113,7 +113,7 @@ pub mod organization { client::{GetAnchorAccount, SolanaRpcClient}, dao::{Dao, SubDao}, error::Error, - helium_entity_manager, iot_routing_manager, metaplex, + helium_entity_manager, iot_routing_manager, programs::{SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID}, token::Token, }; @@ -205,7 +205,7 @@ pub mod organization { payer_iot_account: payer_iot_ata_key, iot_price_oracle: Token::Iot.price_key().unwrap().clone(), authority: authority.unwrap_or(payer.clone()), - bubblegum_signer: metaplex::bubblegum_signer_key(), + bubblegum_signer: asset::bubblegum_signer_key(), shared_merkle: shared_merkle_key, helium_entity_manager_program: helium_entity_manager::ID, dao: dao_key, @@ -218,7 +218,7 @@ pub mod organization { ), entity_creator: Dao::Hnt.entity_creator_key(), key_to_asset: organization_key_to_asset(&dao_key, oui), - tree_authority: metaplex::merkle_tree_authority_key(&shared_merkle.merkle_tree), + tree_authority: asset::merkle_tree_authority_key(&shared_merkle.merkle_tree), recipient: recipient.unwrap_or(payer.clone()), merkle_tree: shared_merkle.merkle_tree, bubblegum_program: mpl_bubblegum::ID, diff --git a/helium-lib/src/lib.rs b/helium-lib/src/lib.rs index e03421a4..1ebf18a8 100644 --- a/helium-lib/src/lib.rs +++ b/helium-lib/src/lib.rs @@ -12,7 +12,6 @@ pub mod iot; pub mod keypair; pub mod kta; pub mod memo; -pub mod metaplex; pub mod onboarding; pub mod priority_fee; pub mod programs; @@ -82,6 +81,7 @@ impl Default for TransactionOpts { const EPOCH_LENGTH: u64 = 60 * 60 * 24; pub fn get_current_epoch(unix_time: u64) -> u64 { unix_time / EPOCH_LENGTH +} pub async fn mk_transaction_with_blockhash>( client: &C, diff --git a/helium-lib/src/metaplex.rs b/helium-lib/src/metaplex.rs deleted file mode 100644 index f0a25a6c..00000000 --- a/helium-lib/src/metaplex.rs +++ /dev/null @@ -1,34 +0,0 @@ -use crate::{keypair::Pubkey, programs::TOKEN_METADATA_PROGRAM_ID}; - -pub fn bubblegum_signer_key() -> Pubkey { - Pubkey::find_program_address(&[b"collection_cpi"], &mpl_bubblegum::ID).0 -} - -pub fn collection_metadata_key(collection_key: &Pubkey) -> Pubkey { - Pubkey::find_program_address( - &[ - b"metadata", - TOKEN_METADATA_PROGRAM_ID.as_ref(), - collection_key.as_ref(), - ], - &TOKEN_METADATA_PROGRAM_ID, - ) - .0 -} - -pub fn collection_master_edition_key(collection_key: &Pubkey) -> Pubkey { - Pubkey::find_program_address( - &[ - b"metadata", - TOKEN_METADATA_PROGRAM_ID.as_ref(), - collection_key.as_ref(), - b"edition", - ], - &TOKEN_METADATA_PROGRAM_ID, - ) - .0 -} - -pub fn merkle_tree_authority_key(merkle_tree: &Pubkey) -> Pubkey { - Pubkey::find_program_address(&[merkle_tree.as_ref()], &mpl_bubblegum::ID).0 -} From 0dd0e45e3a5e25264a985e1031d1379e5e18fefc Mon Sep 17 00:00:00 2001 From: bry Date: Tue, 14 Jan 2025 14:51:20 -0600 Subject: [PATCH 45/49] pr feedback --- helium-lib/src/client.rs | 12 +-- helium-lib/src/dao.rs | 86 +++++++----------- helium-lib/src/error.rs | 16 +--- helium-lib/src/lib.rs | 1 - helium-lib/src/priority_fee.rs | 36 ++++++-- helium-lib/src/transaction.rs | 157 --------------------------------- 6 files changed, 66 insertions(+), 242 deletions(-) delete mode 100644 helium-lib/src/transaction.rs diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index d03e0d8b..baa11fa1 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -33,7 +33,7 @@ static USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_V pub struct SolanaClient { pub inner: Arc, pub base_url: String, - pub wallet: Option>, + pub keypair: Option>, } impl Default for SolanaClient { @@ -44,7 +44,7 @@ impl Default for SolanaClient { } impl SolanaClient { - pub fn new(url: &str, wallet: Option>) -> Result { + pub fn new(url: &str, keypair: Option>) -> Result { let client = Arc::new( solana_client::nonblocking::rpc_client::RpcClient::new_with_commitment( url.to_string(), @@ -55,7 +55,7 @@ impl SolanaClient { Ok(Self { inner: client, base_url: url.to_string(), - wallet, + keypair, }) } @@ -67,10 +67,10 @@ impl SolanaClient { } pub fn pubkey(&self) -> Result { - self.wallet + self.keypair .as_ref() - .map(|wallet| wallet.pubkey()) - .ok_or_else(|| Error::WalletUnconfigured) + .map(|keypair| keypair.pubkey()) + .ok_or_else(|| Error::KeypairUnconfigured) } } diff --git a/helium-lib/src/dao.rs b/helium-lib/src/dao.rs index ababf17a..3c655624 100644 --- a/helium-lib/src/dao.rs +++ b/helium-lib/src/dao.rs @@ -184,51 +184,31 @@ impl SubDao { pub fn rewardable_entity_config_key(&self) -> Pubkey { let sub_dao = self.key(); - match self { - Self::Iot => { - Pubkey::find_program_address( - &[ - b"rewardable_entity_config", - &sub_dao.as_ref(), - "IOT".as_bytes(), - ], - &helium_entity_manager::ID, - ) - .0 - } - Self::Mobile => { - Pubkey::find_program_address( - &[ - b"rewardable_entity_config", - &sub_dao.as_ref(), - "MOBILE".as_bytes(), - ], - &helium_entity_manager::ID, - ) - .0 - } - } + let suffix = match self { + Self::Iot => b"IOT".as_ref(), + Self::Mobile => b"MOBILE".as_ref(), + }; + + Pubkey::find_program_address( + &[b"rewardable_entity_config", &sub_dao.as_ref(), suffix], + &helium_entity_manager::id(), + ) + .0 } pub fn info_key(&self, entity_key: &E) -> Pubkey { let config_key = self.rewardable_entity_config_key(); let hash = Sha256::digest(&entity_key.as_entity_key()); - match self { - Self::Iot => { - Pubkey::find_program_address( - &[b"iot_info", &config_key.as_ref(), &hash], - &helium_entity_manager::ID, - ) - .0 - } - Self::Mobile => { - Pubkey::find_program_address( - &[b"mobile_info", &config_key.as_ref(), &hash], - &helium_entity_manager::ID, - ) - .0 - } - } + let prefix = match self { + Self::Iot => "iot_info", + Self::Mobile => "mobile_info", + }; + + Pubkey::find_program_address( + &[prefix.as_bytes(), &config_key.as_ref(), &hash], + &helium_entity_manager::id(), + ) + .0 } pub fn lazy_distributor_key(&self) -> Pubkey { @@ -253,22 +233,16 @@ impl SubDao { pub fn config_key(&self) -> Pubkey { let sub_dao = self.key(); - match self { - Self::Iot => { - Pubkey::find_program_address( - &[b"iot_config", &sub_dao.as_ref()], - &helium_entity_manager::ID, - ) - .0 - } - Self::Mobile => { - Pubkey::find_program_address( - &[b"mobile_config", sub_dao.as_ref()], - &helium_entity_manager::ID, - ) - .0 - } - } + let prefix = match self { + Self::Iot => "iot_config", + Self::Mobile => "mobile_config", + }; + + Pubkey::find_program_address( + &[prefix.as_bytes(), &sub_dao.as_ref()], + &helium_entity_manager::id(), + ) + .0 } pub fn epoch_info_key(&self) -> Pubkey { diff --git a/helium-lib/src/error.rs b/helium-lib/src/error.rs index 8850ed1e..c3207b67 100644 --- a/helium-lib/src/error.rs +++ b/helium-lib/src/error.rs @@ -47,16 +47,8 @@ pub enum Error { Decode(#[from] DecodeError), #[error("encode: {0}")] Encode(#[from] EncodeError), - #[error("Wallet is not configured")] - WalletUnconfigured, - #[error("error: {0}")] - Error(String), -} - -impl From> for Error { - fn from(err: Box) -> Self { - Self::other(err.to_string()) - } + #[error("Keypair is not configured")] + KeypairUnconfigured, } impl From for Error { @@ -92,10 +84,6 @@ impl Error { _ => false, } } - - pub fn other(reason: S) -> Self { - Self::Error(reason.to_string()) - } } #[derive(Debug, Error)] diff --git a/helium-lib/src/lib.rs b/helium-lib/src/lib.rs index 1ebf18a8..96fa4672 100644 --- a/helium-lib/src/lib.rs +++ b/helium-lib/src/lib.rs @@ -17,7 +17,6 @@ pub mod priority_fee; pub mod programs; pub mod reward; pub mod token; -pub mod transaction; pub use anchor_client; pub use anchor_client::solana_client; diff --git a/helium-lib/src/priority_fee.rs b/helium-lib/src/priority_fee.rs index 18eabef6..b806ae49 100644 --- a/helium-lib/src/priority_fee.rs +++ b/helium-lib/src/priority_fee.rs @@ -10,7 +10,6 @@ use crate::{ signers::Signers, transaction::Transaction, }, - transaction::replace_or_insert_instruction, }; use itertools::Itertools; @@ -132,14 +131,14 @@ pub async fn compute_price_instruction_for_accounts>( pub async fn compute_budget_for_instructions, T: Signers + ?Sized>( client: &C, - instructions: Vec, + instructions: &[Instruction], signers: &T, compute_multiplier: f32, payer: Option<&Pubkey>, blockhash: Option, ) -> Result { // Check for existing compute unit limit instruction and replace it if found - let mut updated_instructions = instructions.clone(); + let mut updated_instructions = instructions.to_vec(); for ix in &mut updated_instructions { if ix.program_id == solana_sdk::compute_budget::id() && ix.data.first() @@ -174,18 +173,18 @@ pub async fn compute_budget_for_instructions, T: Signe pub async fn auto_compute_limit_and_price, T: Signers + ?Sized>( client: &C, - instructions: Vec, + instructions: &[Instruction], signers: &T, compute_multiplier: f32, payer: Option<&Pubkey>, blockhash: Option, ) -> Result, Error> { - let mut updated_instructions = instructions.clone(); + let mut updated_instructions = instructions.to_vec(); // Compute budget instruction let compute_budget_ix = compute_budget_for_instructions( client, - instructions.clone(), + &updated_instructions, signers, compute_multiplier, payer, @@ -204,7 +203,28 @@ pub async fn auto_compute_limit_and_price, T: Signers let compute_price_ix = compute_price_instruction_for_accounts(client, &accounts, MIN_PRIORITY_FEE).await?; - replace_or_insert_instruction(&mut updated_instructions, compute_budget_ix, 0); - replace_or_insert_instruction(&mut updated_instructions, compute_price_ix, 1); + insert_or_replace_compute_instructions( + &mut updated_instructions, + compute_budget_ix, + compute_price_ix, + ); + Ok(updated_instructions) } + +fn insert_or_replace_compute_instructions( + instructions: &mut Vec, + budget_ix: Instruction, + price_ix: Instruction, +) { + if let Some(pos) = instructions + .iter() + .position(|ix| ix.program_id == solana_sdk::compute_budget::id()) + { + instructions[pos] = budget_ix; + instructions[pos + 1] = price_ix; + } else { + instructions.insert(0, budget_ix); + instructions.insert(1, price_ix); + } +} diff --git a/helium-lib/src/transaction.rs b/helium-lib/src/transaction.rs deleted file mode 100644 index 6c977575..00000000 --- a/helium-lib/src/transaction.rs +++ /dev/null @@ -1,157 +0,0 @@ -use crate::{ - client::SolanaClient, - error::Error, - priority_fee::auto_compute_limit_and_price, - solana_client::{ - nonblocking::tpu_client::TpuClient, - send_and_confirm_transactions_in_parallel::{ - send_and_confirm_transactions_in_parallel, SendAndConfirmConfig, - }, - tpu_client::TpuClientConfig, - }, - solana_sdk::{ - commitment_config::CommitmentConfig, compute_budget::ComputeBudgetInstruction, - instruction::Instruction, message::Message, signature::Keypair, signer::Signer, - transaction::Transaction, - }, -}; - -const MAX_TRANSACTION_SIZE: usize = 1232; // Maximum transaction size in bytes - -pub fn replace_or_insert_instruction( - instructions: &mut Vec, - new_instruction: Instruction, - insert_pos: usize, -) { - if let Some(pos) = instructions - .iter() - .position(|ix| ix.program_id == solana_sdk::compute_budget::id()) - { - instructions[pos + insert_pos] = new_instruction; - } else { - instructions.insert(insert_pos, new_instruction); - } -} - -// Returns packed txs with the indices in instructions that were used in that tx. -pub fn pack_instructions( - instructions: Vec>, - payer: &Keypair, -) -> Vec<(Vec, Vec)> { - // Change return type - let mut transactions = Vec::new(); - let compute_ixs = vec![ - ComputeBudgetInstruction::set_compute_unit_limit(200000), - ComputeBudgetInstruction::set_compute_unit_price(1), - ]; - let mut curr_instructions: Vec = compute_ixs.clone(); - let mut curr_indices: Vec = Vec::new(); // Track indices of instructions - let mut ix_queue: Vec<(Instruction, usize)> = instructions - .iter() - .enumerate() - .flat_map(|(i, group)| group.iter().map(move |ix| (ix.clone(), i))) - .collect(); - ix_queue.reverse(); - - while let Some((ix, index)) = ix_queue.pop() { - curr_instructions.push(ix); - curr_indices.push(index); - let tx = Transaction::new_with_payer(&curr_instructions, Some(&payer.pubkey())); - let len = bincode::serialize(&tx).unwrap().len(); - if len > MAX_TRANSACTION_SIZE { - ix_queue.push(( - curr_instructions.pop().unwrap(), - curr_indices.pop().unwrap(), - )); - transactions.push((curr_instructions.clone(), curr_indices.clone())); - curr_instructions = compute_ixs.clone(); - curr_indices.clear(); - } - } - - if !curr_instructions.is_empty() { - transactions.push((curr_instructions.clone(), curr_indices.clone())); - } - - transactions -} - -pub async fn send_instructions( - client: SolanaClient, - ixs: Vec, - extra_signers: &[Keypair], - sequentially: bool, -) -> Result<(), Error> { - let wallet = client - .wallet - .as_ref() - .ok_or_else(|| Error::WalletUnconfigured)?; - - let (blockhash, _) = client - .inner - .as_ref() - .get_latest_blockhash_with_commitment(CommitmentConfig::finalized()) - .await - .expect("Failed to get latest blockhash"); - - let txs = pack_instructions(vec![ixs], &wallet); - let mut with_auto_compute: Vec = Vec::new(); - let keys: Vec<&dyn Signer> = std::iter::once(&wallet as &dyn Signer) - .chain(extra_signers.iter().map(|k| k as &dyn Signer)) - .collect(); - - for (tx, _) in &txs { - let computed = auto_compute_limit_and_price( - &client, - tx.clone(), - &keys, - 1.2, - Some(&wallet.pubkey()), - Some(blockhash), - ) - .await - .unwrap(); - - with_auto_compute.push(Message::new(&computed, Some(&wallet.pubkey()))); - } - - if with_auto_compute.is_empty() { - return Ok(()); - } - - let results; - let tpu_client = TpuClient::new( - "helium-lib", - client.inner.clone(), - &client.ws_url(), - TpuClientConfig::default(), - ) - .await?; - - match sequentially { - true => { - results = tpu_client - .send_and_confirm_messages_with_spinner(&with_auto_compute, &keys) - .await?; - } - false => { - results = send_and_confirm_transactions_in_parallel( - client.inner.clone(), - Some(tpu_client), - &with_auto_compute, - &keys, - SendAndConfirmConfig { - with_spinner: true, - resign_txs_count: Some(5), - }, - ) - .await?; - } - } - - if let Some(err) = results.into_iter().flatten().next() { - return Err(Error::from(err)); - } - - Ok(()) -} From 16239b5cd3f88a9d34ab12a0cc35e0bdd64cdef0 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 15 Jan 2025 09:03:13 -0600 Subject: [PATCH 46/49] remove refrences to tpu --- helium-lib/src/error.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/helium-lib/src/error.rs b/helium-lib/src/error.rs index c3207b67..549bbc10 100644 --- a/helium-lib/src/error.rs +++ b/helium-lib/src/error.rs @@ -33,12 +33,6 @@ pub enum Error { Program(#[from] solana_program::program_error::ProgramError), #[error("solana: {0}")] Solana(Box), - #[error("solana transaction: {0}")] - SolanaTransaction(#[from] solana_sdk::transaction::TransactionError), - #[error("solana pubsub: {0}")] - SolanaPubsub(#[from] solana_client::pubsub_client::PubsubClientError), - #[error("tpu sender: {0}")] - TPUSender(#[from] solana_client::tpu_client::TpuSenderError), #[error("signing: {0}")] Signing(#[from] solana_sdk::signer::SignerError), #[error("crypto: {0}")] From fb7c2c4b1c13428494ed902f903f9de90eac8f39 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 15 Jan 2025 14:45:24 -0600 Subject: [PATCH 47/49] pr feedback tweaks --- Cargo.lock | 24 +++++++++-------------- Cargo.toml | 8 +++++++- helium-lib/Cargo.toml | 2 +- helium-lib/src/client.rs | 41 +++++++++++++++++++++++++++++++++++++++ helium-lib/src/error.rs | 8 ++++++++ helium-lib/src/keypair.rs | 10 +++++++++- 6 files changed, 75 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b0edfee4..ac543c1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1440,7 +1440,6 @@ dependencies = [ [[package]] name = "circuit-breaker" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -1921,7 +1920,6 @@ dependencies = [ [[package]] name = "data-credits" version = "0.2.2" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2231,7 +2229,6 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fanout" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2597,7 +2594,6 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "helium-anchor-gen" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2607,6 +2603,7 @@ dependencies = [ "helium-entity-manager", "helium-sub-daos", "hexboosting", + "iot-routing-manager", "lazy-distributor", "lazy-transactions", "mobile-entity-manager", @@ -2643,7 +2640,6 @@ dependencies = [ [[package]] name = "helium-entity-manager" version = "0.2.11" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2705,7 +2701,6 @@ dependencies = [ [[package]] name = "helium-proto" version = "0.1.0" -source = "git+https://github.com/helium/proto?branch=master#b4c8c8f47dfff38a2ff1b7fe14e1b2a1beea651c" dependencies = [ "bytes", "prost", @@ -2721,7 +2716,6 @@ dependencies = [ [[package]] name = "helium-sub-daos" version = "0.1.8" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2779,7 +2773,6 @@ dependencies = [ [[package]] name = "hexboosting" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -3153,6 +3146,14 @@ dependencies = [ "generic-array", ] +[[package]] +name = "iot-routing-manager" +version = "0.1.2" +dependencies = [ + "anchor-gen", + "anchor-lang 0.29.0", +] + [[package]] name = "ipnet" version = "2.10.1" @@ -3280,7 +3281,6 @@ dependencies = [ [[package]] name = "lazy-distributor" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -3289,7 +3289,6 @@ dependencies = [ [[package]] name = "lazy-transactions" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -3521,7 +3520,6 @@ dependencies = [ [[package]] name = "mobile-entity-manager" version = "0.1.3" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -4104,7 +4102,6 @@ dependencies = [ [[package]] name = "price-oracle" version = "0.2.1" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -4595,7 +4592,6 @@ dependencies = [ [[package]] name = "rewards-oracle" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -7027,7 +7023,6 @@ dependencies = [ [[package]] name = "treasury-management" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -7225,7 +7220,6 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "voter-stake-registry" version = "0.3.3" -source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", diff --git a/Cargo.toml b/Cargo.toml index f6d87469..6bfa18d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,4 +22,10 @@ helium-crypto = { version = "0.8" } helium-proto = { git = "https://github.com/helium/proto", branch = "master", features = [ "services", ] } -clap = { version = "4", features = ["derive"] } \ No newline at end of file +clap = { version = "4", features = ["derive"] } + +[patch.'https://github.com/helium/proto'] +helium-proto = { path = "../proto" } + +[patch.'https://github.com/helium/helium-anchor-gen.git'] +helium-anchor-gen = { path = "../helium-anchor-gen" } \ No newline at end of file diff --git a/helium-lib/Cargo.toml b/helium-lib/Cargo.toml index 0baab8f3..2f6a309c 100644 --- a/helium-lib/Cargo.toml +++ b/helium-lib/Cargo.toml @@ -28,7 +28,7 @@ bincode = "1.3.3" reqwest = { version = "0", default-features = false, features = [ "rustls-tls", ] } -helium-anchor-gen = {git = "https://github.com/helium/helium-anchor-gen.git" } +helium-anchor-gen = { git = "https://github.com/helium/helium-anchor-gen.git" } spl-associated-token-account = { version = "*", features = ["no-entrypoint"] } spl-account-compression = { version = "0.3", features = ["no-entrypoint"] } spl-memo = "4" diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index baa11fa1..596bda59 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -4,6 +4,7 @@ use crate::{ error::{DecodeError, Error}, is_zero, keypair::{self, Keypair, Pubkey}, + priority_fee::auto_compute_limit_and_price, solana_client, solana_sdk::{commitment_config::CommitmentConfig, signer::Signer}, }; @@ -11,6 +12,7 @@ use crate::{ use futures::{stream, StreamExt, TryStreamExt}; use itertools::Itertools; use jsonrpc_client::{JsonRpcError, SendRequest}; +use solana_sdk::{instruction::Instruction, message::Message, transaction::Transaction}; use std::{marker::Send, sync::Arc}; use tracing::instrument; @@ -72,6 +74,45 @@ impl SolanaClient { .map(|keypair| keypair.pubkey()) .ok_or_else(|| Error::KeypairUnconfigured) } + + pub async fn send_instructions( + &self, + ixs: &[Instruction], + extra_signers: &[Keypair], + ) -> Result<(), Error> { + let keypair = self + .keypair + .as_ref() + .ok_or_else(|| Error::KeypairUnconfigured)?; + + if ixs.is_empty() { + return Ok(()); + } + + let signers: Vec<&dyn Signer> = std::iter::once(keypair.as_ref() as &dyn Signer) + .chain(extra_signers.iter().map(|k| k as &dyn Signer)) + .collect(); + + let recent_blockhash = self.inner.get_latest_blockhash().await?; + let optimized_ixs = auto_compute_limit_and_price( + &self.inner, + ixs, + &signers, + 1.2, + Some(&keypair.pubkey()), + Some(recent_blockhash), + ) + .await?; + + let message = Message::new(&optimized_ixs, Some(&keypair.pubkey())); + let transaction = Transaction::new(&signers, message, recent_blockhash); + + self.inner + .send_and_confirm_transaction_with_spinner(&transaction) + .await?; + + Ok(()) + } } #[derive(Clone)] diff --git a/helium-lib/src/error.rs b/helium-lib/src/error.rs index 549bbc10..473dbb7a 100644 --- a/helium-lib/src/error.rs +++ b/helium-lib/src/error.rs @@ -43,6 +43,14 @@ pub enum Error { Encode(#[from] EncodeError), #[error("Keypair is not configured")] KeypairUnconfigured, + #[error("encode: {0}")] + Error(String), +} + +impl Error { + pub fn other(reason: S) -> Self { + Self::Error(reason.to_string()) + } } impl From for Error { diff --git a/helium-lib/src/keypair.rs b/helium-lib/src/keypair.rs index f328c949..0f64f46f 100644 --- a/helium-lib/src/keypair.rs +++ b/helium-lib/src/keypair.rs @@ -2,7 +2,7 @@ use crate::{ error::{DecodeError, Error}, solana_sdk::signature::SignerError, }; -use std::sync::Arc; +use std::{path::PathBuf, sync::Arc}; #[derive(PartialEq, Debug)] pub struct Keypair(solana_sdk::signer::keypair::Keypair); @@ -10,6 +10,7 @@ pub struct Keypair(solana_sdk::signer::keypair::Keypair); pub struct VoidKeypair; pub use solana_sdk::pubkey; +use solana_sdk::signer::EncodableKey; pub use solana_sdk::{pubkey::Pubkey, pubkey::PUBKEY_BYTES, signature::Signature, signer::Signer}; pub mod serde_pubkey { @@ -141,6 +142,13 @@ impl Keypair { .map_err(|_| DecodeError::other("invalid words"))?; Ok(Self(keypair).into()) } + + pub fn from_path(path: PathBuf) -> Result { + let keypair = solana_sdk::signer::keypair::Keypair::read_from_file(path).map_err(|e| { + Error::Decode(DecodeError::other(format!("failed to read keypair: {}", e))) + })?; + Ok(Self(keypair).into()) + } } impl VoidKeypair { From 4d8ea0fcdcf8177a81dd927847dab73973e18d1b Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 16 Jan 2025 19:58:08 -0600 Subject: [PATCH 48/49] fix compute budget estimate --- helium-lib/src/client.rs | 15 +++++++++++++-- helium-lib/src/priority_fee.rs | 32 +++++++++++++++++++++++++------- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/helium-lib/src/client.rs b/helium-lib/src/client.rs index 596bda59..c9d35fa3 100644 --- a/helium-lib/src/client.rs +++ b/helium-lib/src/client.rs @@ -9,6 +9,7 @@ use crate::{ solana_sdk::{commitment_config::CommitmentConfig, signer::Signer}, }; +use anchor_client::solana_client::send_and_confirm_transactions_in_parallel; use futures::{stream, StreamExt, TryStreamExt}; use itertools::Itertools; use jsonrpc_client::{JsonRpcError, SendRequest}; @@ -54,6 +55,13 @@ impl SolanaClient { ), ); + // Add debug print for keypair + if let Some(kp) = &keypair { + println!("Initializing SolanaClient with keypair: {:?}", kp.pubkey()); + } else { + println!("Initializing SolanaClient without keypair"); + } + Ok(Self { inner: client, base_url: url.to_string(), @@ -93,7 +101,11 @@ impl SolanaClient { .chain(extra_signers.iter().map(|k| k as &dyn Signer)) .collect(); - let recent_blockhash = self.inner.get_latest_blockhash().await?; + let (recent_blockhash, _) = self + .inner + .get_latest_blockhash_with_commitment(CommitmentConfig::finalized()) + .await?; + let optimized_ixs = auto_compute_limit_and_price( &self.inner, ixs, @@ -106,7 +118,6 @@ impl SolanaClient { let message = Message::new(&optimized_ixs, Some(&keypair.pubkey())); let transaction = Transaction::new(&signers, message, recent_blockhash); - self.inner .send_and_confirm_transaction_with_spinner(&transaction) .await?; diff --git a/helium-lib/src/priority_fee.rs b/helium-lib/src/priority_fee.rs index b806ae49..c6c06860 100644 --- a/helium-lib/src/priority_fee.rs +++ b/helium-lib/src/priority_fee.rs @@ -137,19 +137,37 @@ pub async fn compute_budget_for_instructions, T: Signe payer: Option<&Pubkey>, blockhash: Option, ) -> Result { + const DEFAULT_COMPUTE_UNITS: u32 = 1_900_000; // Check for existing compute unit limit instruction and replace it if found let mut updated_instructions = instructions.to_vec(); - for ix in &mut updated_instructions { - if ix.program_id == solana_sdk::compute_budget::id() + + let has_compute_limit = updated_instructions.iter().any(|ix| { + ix.program_id == solana_sdk::compute_budget::id() && ix.data.first() == solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit(0) .data .first() - { - ix.data = solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit( - 1900000, - ) - .data; // Replace limit + }); + + if !has_compute_limit { + updated_instructions.insert(0, compute_budget_instruction(DEFAULT_COMPUTE_UNITS)); + } else { + // Replace existing compute unit limit instruction + for ix in &mut updated_instructions { + if ix.program_id == solana_sdk::compute_budget::id() + && ix.data.first() + == solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit( + 0, + ) + .data + .first() + { + ix.data = + solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit( + DEFAULT_COMPUTE_UNITS, + ) + .data; + } } } From a62acdbe930d4c72a3d371e6373a3597802574ab Mon Sep 17 00:00:00 2001 From: bry Date: Fri, 17 Jan 2025 11:37:54 -0600 Subject: [PATCH 49/49] unpatch crates --- Cargo.lock | 24 +++++++++++++++--------- Cargo.toml | 8 +------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac543c1f..f6fcb8d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1440,6 +1440,7 @@ dependencies = [ [[package]] name = "circuit-breaker" version = "0.1.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -1920,6 +1921,7 @@ dependencies = [ [[package]] name = "data-credits" version = "0.2.2" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2229,6 +2231,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fanout" version = "0.1.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2594,6 +2597,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "helium-anchor-gen" version = "0.1.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2603,7 +2607,6 @@ dependencies = [ "helium-entity-manager", "helium-sub-daos", "hexboosting", - "iot-routing-manager", "lazy-distributor", "lazy-transactions", "mobile-entity-manager", @@ -2640,6 +2643,7 @@ dependencies = [ [[package]] name = "helium-entity-manager" version = "0.2.11" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2701,6 +2705,7 @@ dependencies = [ [[package]] name = "helium-proto" version = "0.1.0" +source = "git+https://github.com/helium/proto?branch=master#4085e00c6f4d82c3da798ae1bc97324bc9cada2e" dependencies = [ "bytes", "prost", @@ -2716,6 +2721,7 @@ dependencies = [ [[package]] name = "helium-sub-daos" version = "0.1.8" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -2773,6 +2779,7 @@ dependencies = [ [[package]] name = "hexboosting" version = "0.1.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -3146,14 +3153,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "iot-routing-manager" -version = "0.1.2" -dependencies = [ - "anchor-gen", - "anchor-lang 0.29.0", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -3281,6 +3280,7 @@ dependencies = [ [[package]] name = "lazy-distributor" version = "0.2.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -3289,6 +3289,7 @@ dependencies = [ [[package]] name = "lazy-transactions" version = "0.2.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -3520,6 +3521,7 @@ dependencies = [ [[package]] name = "mobile-entity-manager" version = "0.1.3" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -4102,6 +4104,7 @@ dependencies = [ [[package]] name = "price-oracle" version = "0.2.1" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -4592,6 +4595,7 @@ dependencies = [ [[package]] name = "rewards-oracle" version = "0.2.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -7023,6 +7027,7 @@ dependencies = [ [[package]] name = "treasury-management" version = "0.2.0" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", @@ -7220,6 +7225,7 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "voter-stake-registry" version = "0.3.3" +source = "git+https://github.com/helium/helium-anchor-gen.git#3036b33793cfe54b20ab24761677493510d5bd50" dependencies = [ "anchor-gen", "anchor-lang 0.29.0", diff --git a/Cargo.toml b/Cargo.toml index 6bfa18d7..f6d87469 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,10 +22,4 @@ helium-crypto = { version = "0.8" } helium-proto = { git = "https://github.com/helium/proto", branch = "master", features = [ "services", ] } -clap = { version = "4", features = ["derive"] } - -[patch.'https://github.com/helium/proto'] -helium-proto = { path = "../proto" } - -[patch.'https://github.com/helium/helium-anchor-gen.git'] -helium-anchor-gen = { path = "../helium-anchor-gen" } \ No newline at end of file +clap = { version = "4", features = ["derive"] } \ No newline at end of file