From f7728ee5b8494b5c817c97c84bccfa83afb64065 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Wed, 21 Feb 2024 16:50:46 -0500 Subject: [PATCH 1/6] program_transformers: remove plerkle --- Cargo.lock | 33 +++-- Cargo.toml | 3 + .../tests/integration_tests/common.rs | 35 +++++- nft_ingester/src/account_updates.rs | 19 ++- nft_ingester/src/lib.rs | 2 +- nft_ingester/src/main.rs | 1 + nft_ingester/src/plerkle.rs | 116 ++++++++++++++++++ nft_ingester/src/transaction_notifications.rs | 26 +++- program_transformers/Cargo.toml | 2 +- program_transformers/src/bubblegum/mint_v1.rs | 4 +- .../src/bubblegum/update_metadata.rs | 2 +- program_transformers/src/lib.rs | 94 +++++++------- program_transformers/src/token/mod.rs | 38 +++--- .../src/token_metadata/master_edition.rs | 13 +- .../src/token_metadata/mod.rs | 17 ++- .../src/token_metadata/v1_asset.rs | 7 +- 16 files changed, 297 insertions(+), 115 deletions(-) create mode 100644 nft_ingester/src/plerkle.rs diff --git a/Cargo.lock b/Cargo.lock index 2b52079e1..3e854b632 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1000,20 +1000,18 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blockbuster" version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e71e288e73543fddc5c0f099ef7cdca8d01ca278996f73f386b9ab6d65c2b4" +source = "git+https://github.com/rpcpool/blockbuster.git?tag=blockbuster-v1.0.1-no-plerkle#4b814daa10a69dddafb1bb434f544aac864c7ffe" dependencies = [ "anchor-lang", "async-trait", "borsh 0.10.3", "bs58 0.4.0", - "flatbuffers", "lazy_static", "log", "mpl-bubblegum", "mpl-token-metadata", - "plerkle_serialization", "solana-sdk", + "solana-transaction-status", "spl-account-compression", "spl-noop", "spl-token", @@ -1826,9 +1824,9 @@ dependencies = [ [[package]] name = "deunicode" -version = "1.4.1" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a1abaf4d861455be59f64fd2b55606cb151fce304ede7165f410243ce96bde6" +checksum = "b6e854126756c496b8c81dec88f9a706b15b875c5849d4097a3854476b9fdf94" [[package]] name = "dialoguer" @@ -2113,9 +2111,9 @@ dependencies = [ [[package]] name = "fake" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26221445034074d46b276e13eb97a265ebdb8ed8da705c4dddd3dd20b66b45d2" +checksum = "1c25829bde82205da46e1823b2259db6273379f626fc211f126f65654a2669be" dependencies = [ "deunicode", "rand 0.8.5", @@ -2833,9 +2831,9 @@ checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" [[package]] name = "insta" -version = "1.34.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" +checksum = "7c985c1bef99cf13c58fade470483d81a2bfe846ebde60ed28cc2dddec2df9e2" dependencies = [ "console", "lazy_static", @@ -3385,7 +3383,7 @@ dependencies = [ "num-derive 0.3.3", "num-traits", "serde", - "serde_with 3.6.0", + "serde_with 3.6.1", "solana-program", "thiserror", ] @@ -4142,10 +4140,10 @@ dependencies = [ "futures", "mpl-bubblegum", "num-traits", - "plerkle_serialization", "sea-orm", "serde_json", "solana-sdk", + "solana-transaction-status", "spl-account-compression", "spl-token", "sqlx", @@ -5206,9 +5204,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.6.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b0ed1662c5a68664f45b76d18deb0e234aff37207086803165c961eb695e981" +checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" dependencies = [ "base64 0.21.4", "chrono", @@ -5216,8 +5214,9 @@ dependencies = [ "indexmap 1.9.3", "indexmap 2.0.2", "serde", + "serde_derive", "serde_json", - "serde_with_macros 3.6.0", + "serde_with_macros 3.6.1", "time 0.3.29", ] @@ -5235,9 +5234,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.6.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568577ff0ef47b879f736cd66740e022f3672788cdf002a05a4e609ea5a6fb15" +checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" dependencies = [ "darling", "proc-macro2 1.0.69", diff --git a/Cargo.toml b/Cargo.toml index dc9e15726..a148537a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,6 +118,9 @@ clone_on_ref_ptr = "deny" missing_const_for_fn = "deny" trivially_copy_pass_by_ref = "deny" +[patch.crates-io] +blockbuster = { git = "https://github.com/rpcpool/blockbuster.git", tag = "blockbuster-v1.0.1-no-plerkle" } + [profile.release] codegen-units = 1 lto = true diff --git a/integration_tests/tests/integration_tests/common.rs b/integration_tests/tests/integration_tests/common.rs index b9d9da335..24f91e9de 100644 --- a/integration_tests/tests/integration_tests/common.rs +++ b/integration_tests/tests/integration_tests/common.rs @@ -12,13 +12,19 @@ use migration::sea_orm::{ use migration::{Migrator, MigratorTrait}; use mpl_token_metadata::accounts::Metadata; -use nft_ingester::config; +use nft_ingester::{ + config, + plerkle::{ + parse_account_keys, parse_message_instructions, parse_meta_inner_instructions, + parse_pubkey, parse_signature, parse_slice, + }, +}; use once_cell::sync::Lazy; use plerkle_serialization::root_as_account_info; use plerkle_serialization::root_as_transaction_info; use plerkle_serialization::serializer::serialize_account; use plerkle_serialization::solana_geyser_plugin_interface_shims::ReplicaAccountInfoV2; -use program_transformers::ProgramTransformer; +use program_transformers::{AccountInfo, ProgramTransformer, TransactionInfo}; use solana_client::nonblocking::rpc_client::RpcClient; use solana_sdk::pubkey::Pubkey; @@ -356,7 +362,12 @@ pub async fn index_account_bytes(setup: &TestSetup, account_bytes: Vec) { setup .transformer - .handle_account_update(account) + .handle_account_update(&AccountInfo { + slot: account.slot(), + pubkey: &parse_pubkey(account.pubkey()).expect("failed to parse account"), + owner: &parse_pubkey(account.owner()).expect("failed to parse account"), + data: parse_slice(account.data()).expect("failed to parse account"), + }) .await .unwrap(); } @@ -419,7 +430,23 @@ async fn cached_fetch_transaction(setup: &TestSetup, sig: Signature) -> Vec pub async fn index_transaction(setup: &TestSetup, sig: Signature) { let txn_bytes: Vec = cached_fetch_transaction(setup, sig).await; let txn = root_as_transaction_info(&txn_bytes).unwrap(); - setup.transformer.handle_transaction(&txn).await.unwrap(); + setup + .transformer + .handle_transaction(&TransactionInfo { + slot: txn.slot(), + signature: &parse_signature(txn.signature()).expect("failed to parse transaction"), + account_keys: &parse_account_keys(txn.account_keys()) + .expect("failed to parse transaction"), + message_instructions: &parse_message_instructions(txn.outer_instructions()) + .expect("failed to parse transaction"), + meta_inner_instructions: &parse_meta_inner_instructions( + txn.compiled_inner_instructions(), + txn.inner_instructions(), + ) + .expect("failed to parse transaction"), + }) + .await + .unwrap(); } async fn cached_fetch_largest_token_account_id(client: &RpcClient, mint: Pubkey) -> Pubkey { diff --git a/nft_ingester/src/account_updates.rs b/nft_ingester/src/account_updates.rs index 354aaf9c6..c49b6cd5e 100644 --- a/nft_ingester/src/account_updates.rs +++ b/nft_ingester/src/account_updates.rs @@ -2,6 +2,7 @@ use { crate::{ metric, metrics::capture_result, + plerkle::{parse_pubkey, parse_slice}, tasks::{create_download_metadata_notifier, TaskData}, }, cadence_macros::{is_global_default_set, statsd_count, statsd_time}, @@ -9,7 +10,7 @@ use { log::{debug, error}, plerkle_messenger::{ConsumptionType, Messenger, MessengerConfig, RecvData}, plerkle_serialization::root_as_account_info, - program_transformers::ProgramTransformer, + program_transformers::{error::ProgramTransformerResult, AccountInfo, ProgramTransformer}, sqlx::{Pool, Postgres}, std::sync::Arc, tokio::{ @@ -103,7 +104,7 @@ async fn handle_account( account = Some(bs58::encode(pubkey.0.as_slice()).into_string()); } let begin_processing = Instant::now(); - let res = manager.handle_account_update(account_update).await; + let res = handle_account_update(manager, account_update).await; let should_ack = capture_result( id.clone(), stream_key, @@ -120,3 +121,17 @@ async fn handle_account( } ret_id } + +async fn handle_account_update<'a>( + manager: Arc, + account_update: plerkle_serialization::AccountInfo<'_>, +) -> ProgramTransformerResult<()> { + manager + .handle_account_update(&AccountInfo { + slot: account_update.slot(), + pubkey: &parse_pubkey(account_update.pubkey())?, + owner: &parse_pubkey(account_update.owner())?, + data: parse_slice(account_update.data())?, + }) + .await +} diff --git a/nft_ingester/src/lib.rs b/nft_ingester/src/lib.rs index 9aee9c6ba..9569da43a 100644 --- a/nft_ingester/src/lib.rs +++ b/nft_ingester/src/lib.rs @@ -1,10 +1,10 @@ -pub mod account_updates; pub mod ack; pub mod backfiller; pub mod config; pub mod database; pub mod error; pub mod metrics; +pub mod plerkle; pub mod stream; pub mod tasks; pub mod transaction_notifications; diff --git a/nft_ingester/src/main.rs b/nft_ingester/src/main.rs index aeaf8b0fe..caf2c26f1 100644 --- a/nft_ingester/src/main.rs +++ b/nft_ingester/src/main.rs @@ -5,6 +5,7 @@ pub mod config; mod database; pub mod error; pub mod metrics; +mod plerkle; mod stream; pub mod tasks; mod transaction_notifications; diff --git a/nft_ingester/src/plerkle.rs b/nft_ingester/src/plerkle.rs new file mode 100644 index 000000000..9a3bd33ba --- /dev/null +++ b/nft_ingester/src/plerkle.rs @@ -0,0 +1,116 @@ +use { + flatbuffers::{ForwardsUOffset, Vector}, + plerkle_serialization::{ + CompiledInnerInstructions as FBCompiledInnerInstructions, + CompiledInstruction as FBCompiledInstruction, InnerInstructions as FBInnerInstructions, + Pubkey as FBPubkey, + }, + program_transformers::error::{ProgramTransformerError, ProgramTransformerResult}, + solana_sdk::{instruction::CompiledInstruction, pubkey::Pubkey, signature::Signature}, + solana_transaction_status::{InnerInstruction, InnerInstructions}, +}; + +fn deser_err() -> ProgramTransformerError { + ProgramTransformerError::DeserializationError("Could not deserialize data".to_owned()) +} + +pub fn parse_pubkey(pubkey: Option<&FBPubkey>) -> ProgramTransformerResult { + Ok(Pubkey::try_from(pubkey.ok_or_else(deser_err)?.0.as_slice()) + .expect("valid key from FlatBuffer")) +} + +pub fn parse_slice(data: Option>) -> ProgramTransformerResult<&[u8]> { + data.map(|data| data.bytes()).ok_or_else(deser_err) +} + +pub fn parse_signature(data: Option<&str>) -> ProgramTransformerResult { + data.ok_or_else(deser_err)? + .parse() + .map_err(|_error| deser_err()) +} + +pub fn parse_account_keys( + keys: Option>, +) -> ProgramTransformerResult> { + keys.ok_or_else(deser_err).map(|keys| { + keys.iter() + .map(|key| Pubkey::try_from(key.0.as_slice()).expect("valid key from FlatBuffer")) + .collect() + }) +} + +pub fn parse_message_instructions( + vec_cix: Option>>, +) -> ProgramTransformerResult> { + vec_cix.ok_or_else(deser_err).and_then(|vec| { + vec.iter() + .map(|cix| { + Ok(CompiledInstruction { + program_id_index: cix.program_id_index(), + accounts: cix.accounts().ok_or_else(deser_err)?.bytes().to_vec(), + data: cix.data().ok_or_else(deser_err)?.bytes().to_vec(), + }) + }) + .collect() + }) +} + +pub fn parse_meta_inner_instructions( + vec_ciixs: Option>>, + vec_iixs: Option>>, +) -> ProgramTransformerResult> { + if let Some(vec_ciixs) = vec_ciixs { + vec_ciixs + .iter() + .map(|ciix| { + Ok(InnerInstructions { + index: ciix.index(), + instructions: ciix + .instructions() + .ok_or_else(deser_err)? + .iter() + .map(|ix| { + let cix = ix.compiled_instruction().ok_or_else(deser_err)?; + Ok(InnerInstruction { + instruction: CompiledInstruction { + program_id_index: cix.program_id_index(), + accounts: cix + .accounts() + .ok_or_else(deser_err)? + .bytes() + .to_vec(), + data: cix.data().ok_or_else(deser_err)?.bytes().to_vec(), + }, + stack_height: Some(ix.stack_height() as u32), + }) + }) + .collect::>()?, + }) + }) + .collect() + } else if let Some(vec_iixs) = vec_iixs { + vec_iixs + .iter() + .map(|iixs| { + Ok(InnerInstructions { + index: iixs.index(), + instructions: iixs + .instructions() + .expect("valid instructions") + .iter() + .map(|cix| InnerInstruction { + instruction: CompiledInstruction { + program_id_index: cix.program_id_index(), + accounts: cix.accounts().expect("valid accounts").bytes().to_vec(), + data: cix.data().expect("valid data").bytes().to_vec(), + }, + stack_height: Some(0), + }) + .collect(), + }) + }) + .collect() + } else { + Err(deser_err()) + } +} diff --git a/nft_ingester/src/transaction_notifications.rs b/nft_ingester/src/transaction_notifications.rs index e3932eaf6..5d20d3dd4 100644 --- a/nft_ingester/src/transaction_notifications.rs +++ b/nft_ingester/src/transaction_notifications.rs @@ -2,6 +2,10 @@ use { crate::{ metric, metrics::capture_result, + plerkle::{ + parse_account_keys, parse_message_instructions, parse_meta_inner_instructions, + parse_signature, + }, tasks::{create_download_metadata_notifier, TaskData}, }, cadence_macros::{is_global_default_set, statsd_count, statsd_time}, @@ -9,7 +13,7 @@ use { log::{debug, error}, plerkle_messenger::{ConsumptionType, Messenger, MessengerConfig, RecvData}, plerkle_serialization::root_as_transaction_info, - program_transformers::ProgramTransformer, + program_transformers::{error::ProgramTransformerResult, ProgramTransformer, TransactionInfo}, sqlx::{Pool, Postgres}, std::sync::Arc, tokio::{ @@ -101,7 +105,7 @@ async fn handle_transaction( } let begin = Instant::now(); - let res = manager.handle_transaction(&tx).await; + let res = handle_transaction_update(manager, tx).await; let should_ack = capture_result( id.clone(), stream_key, @@ -118,3 +122,21 @@ async fn handle_transaction( } ret_id } + +async fn handle_transaction_update<'a>( + manager: Arc, + tx: plerkle_serialization::TransactionInfo<'_>, +) -> ProgramTransformerResult<()> { + manager + .handle_transaction(&TransactionInfo { + slot: tx.slot(), + signature: &parse_signature(tx.signature())?, + account_keys: &parse_account_keys(tx.account_keys())?, + message_instructions: &parse_message_instructions(tx.outer_instructions())?, + meta_inner_instructions: &parse_meta_inner_instructions( + tx.compiled_inner_instructions(), + tx.inner_instructions(), + )?, + }) + .await +} diff --git a/program_transformers/Cargo.toml b/program_transformers/Cargo.toml index 76cb6c0d7..5c58e7fde 100644 --- a/program_transformers/Cargo.toml +++ b/program_transformers/Cargo.toml @@ -14,10 +14,10 @@ digital_asset_types = { workspace = true, features = ["json_types", "sql_types"] futures = { workspace = true } mpl-bubblegum = { workspace = true } num-traits = { workspace = true } -plerkle_serialization = { workspace = true } sea-orm = { workspace = true } serde_json = { workspace = true } solana-sdk = { workspace = true } +solana-transaction-status = { workspace = true } spl-account-compression = { workspace = true, features = ["no-entrypoint"] } spl-token = { workspace = true, features = ["no-entrypoint"] } sqlx = { workspace = true } diff --git a/program_transformers/src/bubblegum/mint_v1.rs b/program_transformers/src/bubblegum/mint_v1.rs index a293eef8c..641156cb9 100644 --- a/program_transformers/src/bubblegum/mint_v1.rs +++ b/program_transformers/src/bubblegum/mint_v1.rs @@ -148,7 +148,7 @@ where &multi_txn, id_bytes.to_vec(), nonce as i64, - tree_id.to_vec(), + tree_id.to_bytes().to_vec(), le.leaf_hash.to_vec(), le.schema.data_hash(), le.schema.creator_hash(), @@ -183,7 +183,7 @@ where upsert_asset_authority( &multi_txn, id_bytes.to_vec(), - authority.to_vec(), + authority.to_bytes().to_vec(), seq as i64, slot_i, ) diff --git a/program_transformers/src/bubblegum/update_metadata.rs b/program_transformers/src/bubblegum/update_metadata.rs index 19d9ca615..fd01a930e 100644 --- a/program_transformers/src/bubblegum/update_metadata.rs +++ b/program_transformers/src/bubblegum/update_metadata.rs @@ -166,7 +166,7 @@ where &multi_txn, id_bytes.to_vec(), nonce as i64, - tree_id.to_vec(), + tree_id.to_bytes().to_vec(), le.leaf_hash.to_vec(), le.schema.data_hash(), le.schema.creator_hash(), diff --git a/program_transformers/src/lib.rs b/program_transformers/src/lib.rs index f11e2a0da..66dc736c4 100644 --- a/program_transformers/src/lib.rs +++ b/program_transformers/src/lib.rs @@ -14,9 +14,9 @@ use { }, }, futures::future::BoxFuture, - plerkle_serialization::{AccountInfo, Pubkey as FBPubkey, TransactionInfo}, sea_orm::{DatabaseConnection, SqlxPostgresConnector}, - solana_sdk::pubkey::Pubkey, + solana_sdk::{instruction::CompiledInstruction, pubkey::Pubkey, signature::Signature}, + solana_transaction_status::InnerInstructions, sqlx::PgPool, std::collections::{HashMap, HashSet, VecDeque}, tracing::{debug, error, info}, @@ -28,6 +28,23 @@ pub mod error; mod token; mod token_metadata; +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct AccountInfo<'a> { + pub slot: u64, + pub pubkey: &'a Pubkey, + pub owner: &'a Pubkey, + pub data: &'a [u8], +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct TransactionInfo<'a> { + pub slot: u64, + pub signature: &'a Signature, + pub account_keys: &'a [Pubkey], + pub message_instructions: &'a [CompiledInstruction], + pub meta_inner_instructions: &'a [InnerInstructions], +} + #[derive(Debug, Clone, PartialEq, Eq)] pub struct DownloadMetadataInfo { asset_data_id: Vec, @@ -90,52 +107,42 @@ impl ProgramTransformer { } } - pub fn break_transaction<'i>( + pub fn break_transaction<'a>( &self, - tx: &'i TransactionInfo<'i>, - ) -> VecDeque<(IxPair<'i>, Option>>)> { - let ref_set: HashSet<&[u8]> = self.key_set.iter().map(|k| k.as_ref()).collect(); - order_instructions(ref_set, tx) + tx_info: &'a TransactionInfo<'_>, + ) -> VecDeque<(IxPair<'a>, Option>>)> { + order_instructions( + &self.key_set, + tx_info.account_keys, + tx_info.message_instructions, + tx_info.meta_inner_instructions, + ) } #[allow(clippy::borrowed_box)] - pub fn match_program(&self, key: &FBPubkey) -> Option<&Box> { - match Pubkey::try_from(key.0.as_slice()) { - Ok(pubkey) => self.parsers.get(&pubkey), - Err(_error) => { - error!("failed to parse key: {key:?}"); - None - } - } + pub fn match_program(&self, key: &Pubkey) -> Option<&Box> { + self.parsers.get(key) } - pub async fn handle_transaction<'a>( + pub async fn handle_transaction( &self, - tx: &'a TransactionInfo<'a>, + tx_info: &TransactionInfo<'_>, ) -> ProgramTransformerResult<()> { - let sig: Option<&str> = tx.signature(); - info!("Handling Transaction: {:?}", sig); - let instructions = self.break_transaction(tx); - let accounts = tx.account_keys().unwrap_or_default(); - let slot = tx.slot(); - let txn_id = tx.signature().unwrap_or(""); - let mut keys: Vec = Vec::with_capacity(accounts.len()); - for k in accounts.into_iter() { - keys.push(*k); - } + info!("Handling Transaction: {:?}", tx_info.signature); + let instructions = self.break_transaction(tx_info); let mut not_impl = 0; let ixlen = instructions.len(); debug!("Instructions: {}", ixlen); let contains = instructions .iter() - .filter(|(ib, _inner)| ib.0 .0.as_ref() == mpl_bubblegum::ID.as_ref()); + .filter(|(ib, _inner)| ib.0 == mpl_bubblegum::ID); debug!("Instructions bgum: {}", contains.count()); for (outer_ix, inner_ix) in instructions { let (program, instruction) = outer_ix; - let ix_accounts = instruction.accounts().unwrap().iter().collect::>(); + let ix_accounts = &instruction.accounts; let ix_account_len = ix_accounts.len(); let max = ix_accounts.iter().max().copied().unwrap_or(0) as usize; - if keys.len() < max { + if tx_info.account_keys.len() < max { return Err(ProgramTransformerError::DeserializationError( "Missing Accounts in Serialized Ixn/Txn".to_string(), )); @@ -144,21 +151,22 @@ impl ProgramTransformer { ix_accounts .iter() .fold(Vec::with_capacity(ix_account_len), |mut acc, a| { - if let Some(key) = keys.get(*a as usize) { + if let Some(key) = tx_info.account_keys.get(*a as usize) { acc.push(*key); } acc }); let ix = InstructionBundle { - txn_id, + txn_id: &tx_info.signature.to_string(), program, instruction: Some(instruction), inner_ix, keys: ix_accounts.as_slice(), - slot, + slot: tx_info.slot, }; - if let Some(program) = self.match_program(&ix.program) { + let program_key = ix.program; + if let Some(program) = self.match_program(&program_key) { debug!("Found a ix for program: {:?}", program.key()); let result = program.handle_instruction(&ix)?; let concrete = result.result_type(); @@ -175,7 +183,7 @@ impl ProgramTransformer { .map_err(|err| { error!( "Failed to handle bubblegum instruction for txn {:?}: {:?}", - sig, err + tx_info.signature, err ); err })?; @@ -194,18 +202,16 @@ impl ProgramTransformer { Ok(()) } - pub async fn handle_account_update<'b>( + pub async fn handle_account_update( &self, - acct: AccountInfo<'b>, + account_info: &AccountInfo<'_>, ) -> ProgramTransformerResult<()> { - let owner = acct.owner().unwrap(); - if let Some(program) = self.match_program(owner) { - let result = program.handle_account(&acct)?; - let concrete = result.result_type(); - match concrete { + if let Some(program) = self.match_program(account_info.owner) { + let result = program.handle_account(account_info.data)?; + match result.result_type() { ProgramParseResult::TokenMetadata(parsing_result) => { handle_token_metadata_account( - &acct, + account_info, parsing_result, &self.storage, &self.download_metadata_notifier, @@ -214,7 +220,7 @@ impl ProgramTransformer { } ProgramParseResult::TokenProgramAccount(parsing_result) => { handle_token_program_account( - &acct, + account_info, parsing_result, &self.storage, &self.download_metadata_notifier, diff --git a/program_transformers/src/token/mod.rs b/program_transformers/src/token/mod.rs index 8b0590cce..2dd5d990f 100644 --- a/program_transformers/src/token/mod.rs +++ b/program_transformers/src/token/mod.rs @@ -4,12 +4,11 @@ use { upsert_assets_mint_account_columns, upsert_assets_token_account_columns, AssetMintAccountColumns, AssetTokenAccountColumns, }, - error::{ProgramTransformerError, ProgramTransformerResult}, - DownloadMetadataNotifier, + error::ProgramTransformerResult, + AccountInfo, DownloadMetadataNotifier, }, blockbuster::programs::token_account::TokenProgramAccount, digital_asset_types::dao::{asset, sea_orm_active_enums::OwnerType, token_accounts, tokens}, - plerkle_serialization::AccountInfo, sea_orm::{ entity::{ActiveValue, ColumnTrait}, query::{QueryFilter, QueryTrait}, @@ -21,14 +20,13 @@ use { }; pub async fn handle_token_program_account<'a, 'b, 'c>( - account_update: &'a AccountInfo<'a>, + account_info: &'a AccountInfo<'a>, parsing_result: &'b TokenProgramAccount, db: &'c DatabaseConnection, _download_metadata_notifier: &DownloadMetadataNotifier, ) -> ProgramTransformerResult<()> { - let key = *account_update.pubkey().unwrap(); - let key_bytes = key.0.to_vec(); - let spl_token_program = account_update.owner().unwrap().0.to_vec(); + let account_key = account_info.pubkey.to_bytes().to_vec(); + let account_owner = account_info.owner.to_bytes().to_vec(); match &parsing_result { TokenProgramAccount::TokenAccount(ta) => { let mint = ta.mint.to_bytes().to_vec(); @@ -39,14 +37,14 @@ pub async fn handle_token_program_account<'a, 'b, 'c>( let frozen = matches!(ta.state, AccountState::Frozen); let owner = ta.owner.to_bytes().to_vec(); let model = token_accounts::ActiveModel { - pubkey: ActiveValue::Set(key_bytes), + pubkey: ActiveValue::Set(account_key.clone()), mint: ActiveValue::Set(mint.clone()), delegate: ActiveValue::Set(delegate.clone()), owner: ActiveValue::Set(owner.clone()), frozen: ActiveValue::Set(frozen), delegated_amount: ActiveValue::Set(ta.delegated_amount as i64), - token_program: ActiveValue::Set(spl_token_program), - slot_updated: ActiveValue::Set(account_update.slot() as i64), + token_program: ActiveValue::Set(account_owner.clone()), + slot_updated: ActiveValue::Set(account_info.slot as i64), amount: ActiveValue::Set(ta.amount as i64), close_authority: ActiveValue::Set(None), }; @@ -89,7 +87,7 @@ pub async fn handle_token_program_account<'a, 'b, 'c>( owner: Some(owner.clone()), frozen, delegate, - slot_updated_token_account: Some(account_update.slot() as i64), + slot_updated_token_account: Some(account_info.slot as i64), }, &txn, ) @@ -109,9 +107,9 @@ pub async fn handle_token_program_account<'a, 'b, 'c>( COption::None => None, }; let model = tokens::ActiveModel { - mint: ActiveValue::Set(key_bytes.clone()), - token_program: ActiveValue::Set(spl_token_program), - slot_updated: ActiveValue::Set(account_update.slot() as i64), + mint: ActiveValue::Set(account_key.clone()), + token_program: ActiveValue::Set(account_owner), + slot_updated: ActiveValue::Set(account_info.slot as i64), supply: ActiveValue::Set(m.supply as i64), decimals: ActiveValue::Set(m.decimals as i32), close_authority: ActiveValue::Set(None), @@ -142,7 +140,7 @@ pub async fn handle_token_program_account<'a, 'b, 'c>( ); db.execute(query).await?; - let asset_update: Option = asset::Entity::find_by_id(key_bytes.clone()) + let asset_update: Option = asset::Entity::find_by_id(account_key.clone()) .filter( asset::Column::OwnerType .eq(OwnerType::Single) @@ -155,10 +153,10 @@ pub async fn handle_token_program_account<'a, 'b, 'c>( if let Some(_asset) = asset_update { upsert_assets_mint_account_columns( AssetMintAccountColumns { - mint: key_bytes.clone(), - suppply_mint: Some(key_bytes), + mint: account_key.clone(), + suppply_mint: Some(account_key), supply: m.supply, - slot_updated_mint_account: account_update.slot(), + slot_updated_mint_account: account_info.slot, }, db, ) @@ -167,7 +165,5 @@ pub async fn handle_token_program_account<'a, 'b, 'c>( Ok(()) } - _ => Err(ProgramTransformerError::NotImplemented), - }?; - Ok(()) + } } diff --git a/program_transformers/src/token_metadata/master_edition.rs b/program_transformers/src/token_metadata/master_edition.rs index e62d89932..7f76fa4b0 100644 --- a/program_transformers/src/token_metadata/master_edition.rs +++ b/program_transformers/src/token_metadata/master_edition.rs @@ -8,17 +8,17 @@ use { asset, asset_v1_account_attachments, extensions, sea_orm_active_enums::{SpecificationAssetClass, V1AccountAttachments}, }, - plerkle_serialization::Pubkey as FBPubkey, sea_orm::{ entity::{ActiveModelTrait, ActiveValue, EntityTrait, RelationTrait}, query::{JoinType, QuerySelect, QueryTrait}, sea_query::query::OnConflict, ConnectionTrait, DatabaseTransaction, DbBackend, }, + solana_sdk::pubkey::Pubkey, }; pub async fn save_v2_master_edition( - id: FBPubkey, + id: Pubkey, slot: u64, me_data: &MasterEdition, txn: &DatabaseTransaction, @@ -34,7 +34,7 @@ pub async fn save_v2_master_edition( } pub async fn save_v1_master_edition( - id: FBPubkey, + id: Pubkey, slot: u64, me_data: &DeprecatedMasterEditionV1, txn: &DatabaseTransaction, @@ -55,16 +55,17 @@ pub async fn save_v1_master_edition( ) .await } + pub async fn save_master_edition( version: V1AccountAttachments, - id: FBPubkey, + id: Pubkey, slot: u64, me_data: &MasterEdition, txn: &DatabaseTransaction, ) -> ProgramTransformerResult<()> { - let id_bytes = id.0.to_vec(); + let id_bytes = id.to_bytes().to_vec(); let master_edition: Option<(asset_v1_account_attachments::Model, Option)> = - asset_v1_account_attachments::Entity::find_by_id(id.0.to_vec()) + asset_v1_account_attachments::Entity::find_by_id(id.to_bytes().to_vec()) .find_also_related(asset::Entity) .join( JoinType::InnerJoin, diff --git a/program_transformers/src/token_metadata/mod.rs b/program_transformers/src/token_metadata/mod.rs index beb2f3a97..9f9d2783b 100644 --- a/program_transformers/src/token_metadata/mod.rs +++ b/program_transformers/src/token_metadata/mod.rs @@ -5,10 +5,9 @@ use { master_edition::{save_v1_master_edition, save_v2_master_edition}, v1_asset::{burn_v1_asset, save_v1_asset}, }, - DownloadMetadataNotifier, + AccountInfo, DownloadMetadataNotifier, }, blockbuster::programs::token_metadata::{TokenMetadataAccountData, TokenMetadataAccountState}, - plerkle_serialization::AccountInfo, sea_orm::{DatabaseConnection, TransactionTrait}, }; @@ -16,25 +15,24 @@ mod master_edition; mod v1_asset; pub async fn handle_token_metadata_account<'a, 'b, 'c>( - account_update: &'a AccountInfo<'a>, + account_info: &'a AccountInfo<'a>, parsing_result: &'b TokenMetadataAccountState, db: &'c DatabaseConnection, download_metadata_notifier: &DownloadMetadataNotifier, ) -> ProgramTransformerResult<()> { - let key = *account_update.pubkey().unwrap(); match &parsing_result.data { TokenMetadataAccountData::EmptyAccount => { - burn_v1_asset(db, key, account_update.slot()).await?; + burn_v1_asset(db, *account_info.pubkey, account_info.slot).await?; Ok(()) } TokenMetadataAccountData::MasterEditionV1(m) => { let txn = db.begin().await?; - save_v1_master_edition(key, account_update.slot(), m, &txn).await?; + save_v1_master_edition(*account_info.pubkey, account_info.slot, m, &txn).await?; txn.commit().await?; Ok(()) } TokenMetadataAccountData::MetadataV1(m) => { - if let Some(info) = save_v1_asset(db, m, account_update.slot()).await? { + if let Some(info) = save_v1_asset(db, m, account_info.slot).await? { download_metadata_notifier(info) .await .map_err(ProgramTransformerError::DownloadMetadataNotify)?; @@ -43,7 +41,7 @@ pub async fn handle_token_metadata_account<'a, 'b, 'c>( } TokenMetadataAccountData::MasterEditionV2(m) => { let txn = db.begin().await?; - save_v2_master_edition(key, account_update.slot(), m, &txn).await?; + save_v2_master_edition(*account_info.pubkey, account_info.slot, m, &txn).await?; txn.commit().await?; Ok(()) } @@ -51,6 +49,5 @@ pub async fn handle_token_metadata_account<'a, 'b, 'c>( // TokenMetadataAccountData::UseAuthorityRecord(_) => {} // TokenMetadataAccountData::CollectionAuthorityRecord(_) => {} _ => Err(ProgramTransformerError::NotImplemented), - }?; - Ok(()) + } } diff --git a/program_transformers/src/token_metadata/v1_asset.rs b/program_transformers/src/token_metadata/v1_asset.rs index fefaa0aad..95b860c3b 100644 --- a/program_transformers/src/token_metadata/v1_asset.rs +++ b/program_transformers/src/token_metadata/v1_asset.rs @@ -24,7 +24,6 @@ use { }, json::ChainDataV1, }, - plerkle_serialization::Pubkey as FBPubkey, sea_orm::{ entity::{ActiveValue, ColumnTrait, EntityTrait}, query::{JsonValue, Order, QueryFilter, QueryOrder, QueryTrait, Select}, @@ -38,12 +37,12 @@ use { pub async fn burn_v1_asset( conn: &T, - id: FBPubkey, + id: Pubkey, slot: u64, ) -> ProgramTransformerResult<()> { - let (id, slot_i) = (id.0, slot as i64); + let (id, slot_i) = (id, slot as i64); let model = asset::ActiveModel { - id: ActiveValue::Set(id.to_vec()), + id: ActiveValue::Set(id.to_bytes().to_vec()), slot_updated: ActiveValue::Set(Some(slot_i)), burnt: ActiveValue::Set(true), ..Default::default() From b5a4ec4f5f3427620a5449d2be7bcebecfe836cf Mon Sep 17 00:00:00 2001 From: Kyle Espinola Date: Tue, 27 Feb 2024 21:19:14 +0100 Subject: [PATCH 2/6] refactor: use deserializers from plerkle_serialization --- Cargo.lock | 5 +- Cargo.toml | 3 +- nft_ingester/src/account_updates.rs | 13 +- nft_ingester/src/plerkle.rs | 116 +----------------- nft_ingester/src/transaction_notifications.rs | 25 ++-- 5 files changed, 31 insertions(+), 131 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3e854b632..3b736a7a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3992,9 +3992,8 @@ dependencies = [ [[package]] name = "plerkle_serialization" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f021e409a6a1ec8b7a325db27254e7fa3942e845cfe96f5f8f494977f2646a8" +version = "1.7.0" +source = "git+https://github.com/rpcpool/digital-asset-validator-plugin.git?branch=espi/plerkle-solana-parsers#43c14870252b9e8264b8b1c57f9e0fc379f1621c" dependencies = [ "bs58 0.4.0", "chrono", diff --git a/Cargo.toml b/Cargo.toml index a148537a1..62b84e614 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,7 +73,7 @@ once_cell = "1.19.0" open-rpc-derive = "0.0.4" open-rpc-schema = "0.0.4" plerkle_messenger = "1.6.0" -plerkle_serialization = "1.6.0" +plerkle_serialization = "1.7.0" program_transformers = { path = "program_transformers" } prometheus = "0.13.3" proxy-wasm = "0.2.0" @@ -120,6 +120,7 @@ trivially_copy_pass_by_ref = "deny" [patch.crates-io] blockbuster = { git = "https://github.com/rpcpool/blockbuster.git", tag = "blockbuster-v1.0.1-no-plerkle" } +plerkle_serialization = { git = "https://github.com/rpcpool/digital-asset-validator-plugin.git", branch = "espi/plerkle-solana-parsers" } [profile.release] codegen-units = 1 diff --git a/nft_ingester/src/account_updates.rs b/nft_ingester/src/account_updates.rs index c49b6cd5e..73d3c59fe 100644 --- a/nft_ingester/src/account_updates.rs +++ b/nft_ingester/src/account_updates.rs @@ -2,14 +2,17 @@ use { crate::{ metric, metrics::capture_result, - plerkle::{parse_pubkey, parse_slice}, + plerkle::into_program_transformer_err, tasks::{create_download_metadata_notifier, TaskData}, }, cadence_macros::{is_global_default_set, statsd_count, statsd_time}, chrono::Utc, log::{debug, error}, plerkle_messenger::{ConsumptionType, Messenger, MessengerConfig, RecvData}, - plerkle_serialization::root_as_account_info, + plerkle_serialization::{ + deserializer::{parse_pubkey, parse_slice}, + root_as_account_info, + }, program_transformers::{error::ProgramTransformerResult, AccountInfo, ProgramTransformer}, sqlx::{Pool, Postgres}, std::sync::Arc, @@ -129,9 +132,9 @@ async fn handle_account_update<'a>( manager .handle_account_update(&AccountInfo { slot: account_update.slot(), - pubkey: &parse_pubkey(account_update.pubkey())?, - owner: &parse_pubkey(account_update.owner())?, - data: parse_slice(account_update.data())?, + pubkey: &parse_pubkey(account_update.pubkey()).map_err(into_program_transformer_err)?, + owner: &parse_pubkey(account_update.owner()).map_err(into_program_transformer_err)?, + data: parse_slice(account_update.data()).map_err(into_program_transformer_err)?, }) .await } diff --git a/nft_ingester/src/plerkle.rs b/nft_ingester/src/plerkle.rs index 9a3bd33ba..1f7c8d574 100644 --- a/nft_ingester/src/plerkle.rs +++ b/nft_ingester/src/plerkle.rs @@ -1,116 +1,8 @@ use { - flatbuffers::{ForwardsUOffset, Vector}, - plerkle_serialization::{ - CompiledInnerInstructions as FBCompiledInnerInstructions, - CompiledInstruction as FBCompiledInstruction, InnerInstructions as FBInnerInstructions, - Pubkey as FBPubkey, - }, - program_transformers::error::{ProgramTransformerError, ProgramTransformerResult}, - solana_sdk::{instruction::CompiledInstruction, pubkey::Pubkey, signature::Signature}, - solana_transaction_status::{InnerInstruction, InnerInstructions}, + plerkle_serialization::deserializer::SolanaDeserializerError, + program_transformers::error::ProgramTransformerError, }; -fn deser_err() -> ProgramTransformerError { - ProgramTransformerError::DeserializationError("Could not deserialize data".to_owned()) -} - -pub fn parse_pubkey(pubkey: Option<&FBPubkey>) -> ProgramTransformerResult { - Ok(Pubkey::try_from(pubkey.ok_or_else(deser_err)?.0.as_slice()) - .expect("valid key from FlatBuffer")) -} - -pub fn parse_slice(data: Option>) -> ProgramTransformerResult<&[u8]> { - data.map(|data| data.bytes()).ok_or_else(deser_err) -} - -pub fn parse_signature(data: Option<&str>) -> ProgramTransformerResult { - data.ok_or_else(deser_err)? - .parse() - .map_err(|_error| deser_err()) -} - -pub fn parse_account_keys( - keys: Option>, -) -> ProgramTransformerResult> { - keys.ok_or_else(deser_err).map(|keys| { - keys.iter() - .map(|key| Pubkey::try_from(key.0.as_slice()).expect("valid key from FlatBuffer")) - .collect() - }) -} - -pub fn parse_message_instructions( - vec_cix: Option>>, -) -> ProgramTransformerResult> { - vec_cix.ok_or_else(deser_err).and_then(|vec| { - vec.iter() - .map(|cix| { - Ok(CompiledInstruction { - program_id_index: cix.program_id_index(), - accounts: cix.accounts().ok_or_else(deser_err)?.bytes().to_vec(), - data: cix.data().ok_or_else(deser_err)?.bytes().to_vec(), - }) - }) - .collect() - }) -} - -pub fn parse_meta_inner_instructions( - vec_ciixs: Option>>, - vec_iixs: Option>>, -) -> ProgramTransformerResult> { - if let Some(vec_ciixs) = vec_ciixs { - vec_ciixs - .iter() - .map(|ciix| { - Ok(InnerInstructions { - index: ciix.index(), - instructions: ciix - .instructions() - .ok_or_else(deser_err)? - .iter() - .map(|ix| { - let cix = ix.compiled_instruction().ok_or_else(deser_err)?; - Ok(InnerInstruction { - instruction: CompiledInstruction { - program_id_index: cix.program_id_index(), - accounts: cix - .accounts() - .ok_or_else(deser_err)? - .bytes() - .to_vec(), - data: cix.data().ok_or_else(deser_err)?.bytes().to_vec(), - }, - stack_height: Some(ix.stack_height() as u32), - }) - }) - .collect::>()?, - }) - }) - .collect() - } else if let Some(vec_iixs) = vec_iixs { - vec_iixs - .iter() - .map(|iixs| { - Ok(InnerInstructions { - index: iixs.index(), - instructions: iixs - .instructions() - .expect("valid instructions") - .iter() - .map(|cix| InnerInstruction { - instruction: CompiledInstruction { - program_id_index: cix.program_id_index(), - accounts: cix.accounts().expect("valid accounts").bytes().to_vec(), - data: cix.data().expect("valid data").bytes().to_vec(), - }, - stack_height: Some(0), - }) - .collect(), - }) - }) - .collect() - } else { - Err(deser_err()) - } +pub fn into_program_transformer_err(e: SolanaDeserializerError) -> ProgramTransformerError { + ProgramTransformerError::DeserializationError(e.to_string()) } diff --git a/nft_ingester/src/transaction_notifications.rs b/nft_ingester/src/transaction_notifications.rs index 5d20d3dd4..95f6eac04 100644 --- a/nft_ingester/src/transaction_notifications.rs +++ b/nft_ingester/src/transaction_notifications.rs @@ -2,17 +2,20 @@ use { crate::{ metric, metrics::capture_result, - plerkle::{ - parse_account_keys, parse_message_instructions, parse_meta_inner_instructions, - parse_signature, - }, + plerkle::into_program_transformer_err, tasks::{create_download_metadata_notifier, TaskData}, }, cadence_macros::{is_global_default_set, statsd_count, statsd_time}, chrono::Utc, log::{debug, error}, plerkle_messenger::{ConsumptionType, Messenger, MessengerConfig, RecvData}, - plerkle_serialization::root_as_transaction_info, + plerkle_serialization::{ + deserializer::{ + parse_account_keys, parse_message_instructions, parse_meta_inner_instructions, + parse_signature, + }, + root_as_transaction_info, + }, program_transformers::{error::ProgramTransformerResult, ProgramTransformer, TransactionInfo}, sqlx::{Pool, Postgres}, std::sync::Arc, @@ -130,13 +133,15 @@ async fn handle_transaction_update<'a>( manager .handle_transaction(&TransactionInfo { slot: tx.slot(), - signature: &parse_signature(tx.signature())?, - account_keys: &parse_account_keys(tx.account_keys())?, - message_instructions: &parse_message_instructions(tx.outer_instructions())?, + signature: &parse_signature(tx.signature()).map_err(into_program_transformer_err)?, + account_keys: &parse_account_keys(tx.account_keys()) + .map_err(into_program_transformer_err)?, + message_instructions: &parse_message_instructions(tx.outer_instructions()) + .map_err(into_program_transformer_err)?, meta_inner_instructions: &parse_meta_inner_instructions( tx.compiled_inner_instructions(), - tx.inner_instructions(), - )?, + ) + .map_err(into_program_transformer_err)?, }) .await } From 8f184d131ed8cb708b69395a3001d66d17e64f02 Mon Sep 17 00:00:00 2001 From: Kyle Espinola Date: Tue, 27 Feb 2024 21:30:04 +0100 Subject: [PATCH 3/6] fix: integration tests use plerkle_serialization deserializers --- .../tests/integration_tests/common.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/integration_tests/tests/integration_tests/common.rs b/integration_tests/tests/integration_tests/common.rs index 24f91e9de..7709fd040 100644 --- a/integration_tests/tests/integration_tests/common.rs +++ b/integration_tests/tests/integration_tests/common.rs @@ -12,18 +12,17 @@ use migration::sea_orm::{ use migration::{Migrator, MigratorTrait}; use mpl_token_metadata::accounts::Metadata; -use nft_ingester::{ - config, - plerkle::{ +use nft_ingester::config; +use once_cell::sync::Lazy; +use plerkle_serialization::{ + deserializer::{ parse_account_keys, parse_message_instructions, parse_meta_inner_instructions, parse_pubkey, parse_signature, parse_slice, }, + root_as_account_info, root_as_transaction_info, + serializer::{seralize_encoded_transaction_with_status, serialize_account}, + solana_geyser_plugin_interface_shims::ReplicaAccountInfoV2, }; -use once_cell::sync::Lazy; -use plerkle_serialization::root_as_account_info; -use plerkle_serialization::root_as_transaction_info; -use plerkle_serialization::serializer::serialize_account; -use plerkle_serialization::solana_geyser_plugin_interface_shims::ReplicaAccountInfoV2; use program_transformers::{AccountInfo, ProgramTransformer, TransactionInfo}; use solana_client::nonblocking::rpc_client::RpcClient; @@ -40,8 +39,6 @@ use futures::TryStreamExt; use tokio_stream::{self as stream}; use log::{error, info}; -use plerkle_serialization::serializer::seralize_encoded_transaction_with_status; -// use rand::seq::SliceRandom; use serde::de::DeserializeOwned; use solana_account_decoder::{UiAccount, UiAccountEncoding}; use solana_client::{ @@ -441,7 +438,6 @@ pub async fn index_transaction(setup: &TestSetup, sig: Signature) { .expect("failed to parse transaction"), meta_inner_instructions: &parse_meta_inner_instructions( txn.compiled_inner_instructions(), - txn.inner_instructions(), ) .expect("failed to parse transaction"), }) From 9fbef5d8af734091f277f52c6ac9c6e2e60af98e Mon Sep 17 00:00:00 2001 From: Kyle Espinola Date: Wed, 28 Feb 2024 14:36:23 +0100 Subject: [PATCH 4/6] fix: handle parsing compiled inner and inner instructions --- Cargo.lock | 764 ++++++++---------- Cargo.toml | 22 +- .../tests/integration_tests/common.rs | 23 +- nft_ingester/Cargo.toml | 28 +- nft_ingester/src/transaction_notifications.rs | 42 +- program_transformers/src/lib.rs | 2 +- 6 files changed, 440 insertions(+), 441 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3b736a7a6..c96803653 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -152,87 +152,79 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "anchor-attribute-access-control" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa5be5b72abea167f87c868379ba3c2be356bfca9e6f474fd055fa0f7eeb4f2" +checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.69", - "quote 1.0.33", - "regex", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-account" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f468970344c7c9f9d03b4da854fd7c54f21305059f53789d0045c1dd803f0018" +checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" dependencies = [ "anchor-syn", - "anyhow", "bs58 0.5.0", - "proc-macro2 1.0.69", - "quote 1.0.33", - "rustversion", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-constant" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59948e7f9ef8144c2aefb3f32a40c5fce2798baeec765ba038389e82301017ef" +checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" dependencies = [ "anchor-syn", - "proc-macro2 1.0.69", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-error" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc753c9d1c7981cb8948cf7e162fb0f64558999c0413058e2d43df1df5448086" +checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" dependencies = [ "anchor-syn", - "proc-macro2 1.0.69", - "quote 1.0.33", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-event" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38b4e172ba1b52078f53fdc9f11e3dc0668ad27997838a0aad2d148afac8c97" +checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-program" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eebd21543606ab61e2d83d9da37d24d3886a49f390f9c43a1964735e8c0f0d5" +checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.69", - "quote 1.0.33", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-client" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8434a6bf33efba0c93157f7fa2fafac658cb26ab75396886dcedd87c2a8ad445" +checksum = "cb48c4a7911038da546dc752655a29fa49f6bd50ebc1edca218bac8da1012acd" dependencies = [ "anchor-lang", "anyhow", @@ -249,33 +241,44 @@ dependencies = [ [[package]] name = "anchor-derive-accounts" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec4720d899b3686396cced9508f23dab420f1308344456ec78ef76f98fda42af" +checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.69", - "quote 1.0.33", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-serde" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +dependencies = [ + "anchor-syn", + "borsh-derive-internal 0.10.3", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-derive-space" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f495e85480bd96ddeb77b71d499247c7d4e8b501e75ecb234e9ef7ae7bd6552a" +checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-lang" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2d4b20100f1310a774aba3471ef268e5c4ba4d5c28c0bbe663c2658acbc414" +checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -284,6 +287,7 @@ dependencies = [ "anchor-attribute-event", "anchor-attribute-program", "anchor-derive-accounts", + "anchor-derive-serde", "anchor-derive-space", "arrayref", "base64 0.13.1", @@ -297,15 +301,15 @@ dependencies = [ [[package]] name = "anchor-syn" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a125e4b0cc046cfec58f5aa25038e34cf440151d58f0db3afc55308251fe936d" +checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" dependencies = [ "anyhow", "bs58 0.5.0", "heck 0.3.3", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "serde", "serde_json", "sha2 0.10.8", @@ -451,7 +455,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" dependencies = [ - "quote 1.0.33", + "quote", "syn 1.0.109", ] @@ -463,8 +467,8 @@ checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ "num-bigint 0.4.4", "num-traits", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -499,8 +503,8 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -514,12 +518,6 @@ dependencies = [ "rand 0.8.5", ] -[[package]] -name = "array-bytes" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" - [[package]] name = "arrayref" version = "0.3.7" @@ -560,8 +558,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", "synstructure", ] @@ -572,8 +570,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -589,7 +587,7 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" dependencies = [ - "quote 1.0.33", + "quote", "syn 1.0.109", ] @@ -754,8 +752,8 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -771,8 +769,8 @@ version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -858,8 +856,8 @@ checksum = "33b8de67cc41132507eeece2584804efcb15f85ba516e34c944b7667f480397a" dependencies = [ "heck 0.3.3", "proc-macro-error", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -936,6 +934,9 @@ name = "bitflags" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +dependencies = [ + "serde", +] [[package]] name = "bitmaps" @@ -999,8 +1000,8 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blockbuster" -version = "1.0.1" -source = "git+https://github.com/rpcpool/blockbuster.git?tag=blockbuster-v1.0.1-no-plerkle#4b814daa10a69dddafb1bb434f544aac864c7ffe" +version = "1.1.0" +source = "git+https://github.com/rpcpool/blockbuster.git?branch=rm-plerkle-101#4c136e32de3dfce04a8bbf014d458b22f48ae06b" dependencies = [ "anchor-lang", "async-trait", @@ -1063,7 +1064,7 @@ dependencies = [ "borsh-derive-internal 0.9.3", "borsh-schema-derive-internal 0.9.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.69", + "proc-macro2", "syn 1.0.109", ] @@ -1076,7 +1077,7 @@ dependencies = [ "borsh-derive-internal 0.10.3", "borsh-schema-derive-internal 0.10.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.69", + "proc-macro2", "syn 1.0.109", ] @@ -1086,8 +1087,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1097,8 +1098,8 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1108,8 +1109,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1119,8 +1120,8 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1203,8 +1204,8 @@ version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1223,8 +1224,8 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -1370,8 +1371,8 @@ checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ "heck 0.4.1", "proc-macro-error", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1382,8 +1383,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -1658,8 +1659,8 @@ checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "strsim 0.10.0", "syn 2.0.38", ] @@ -1671,7 +1672,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", - "quote 1.0.33", + "quote", "syn 2.0.38", ] @@ -1754,6 +1755,16 @@ dependencies = [ "tracing", ] +[[package]] +name = "dashmap" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" +dependencies = [ + "cfg-if", + "num_cpus", +] + [[package]] name = "dashmap" version = "5.5.3" @@ -1817,8 +1828,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1915,32 +1926,32 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] [[package]] -name = "dlopen" -version = "0.1.8" +name = "dlopen2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937" +checksum = "09b4f5f101177ff01b8ec4ecc81eead416a8aa42819a2869311b3420fa114ffa" dependencies = [ - "dlopen_derive", - "lazy_static", + "dlopen2_derive", "libc", + "once_cell", "winapi", ] [[package]] -name = "dlopen_derive" -version = "0.1.4" +name = "dlopen2_derive" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581" +checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" dependencies = [ - "libc", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2", + "quote", + "syn 2.0.38", ] [[package]] @@ -2035,8 +2046,8 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -2348,8 +2359,8 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -3029,8 +3040,8 @@ checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" dependencies = [ "heck 0.4.1", "proc-macro-crate 1.3.1", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -3157,6 +3168,18 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "light-poseidon" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee" +dependencies = [ + "ark-bn254", + "ark-ff", + "num-bigint 0.4.4", + "thiserror", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -3302,8 +3325,8 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "731f8ecebd9f3a4aa847dfe75455e4757a45da40a7793d2f0b1f9b6ed18b23f3" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -3531,8 +3554,8 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -3542,8 +3565,8 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -3624,8 +3647,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -3636,8 +3659,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ea360eafe1022f7cc56cd7b869ed57330fb2453d0c7831d99b74c65d2f5597" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -3684,8 +3707,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae3de03a56750973a83c76a40fb4b81969d42fad152cd0e787e25c79dcf54e3f" dependencies = [ "open-rpc-schema", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -3722,8 +3745,8 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -3769,8 +3792,8 @@ checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" dependencies = [ "Inflector", "proc-macro-error", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -3875,9 +3898,9 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da9f0f13dac8069c139e8300a6510e3f4143ecf5259c60b116a9b271b4ca0d54" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2", "proc-macro2-diagnostics", - "quote 1.0.33", + "quote", "syn 2.0.38", ] @@ -3920,8 +3943,8 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -3992,8 +4015,8 @@ dependencies = [ [[package]] name = "plerkle_serialization" -version = "1.7.0" -source = "git+https://github.com/rpcpool/digital-asset-validator-plugin.git?branch=espi/plerkle-solana-parsers#43c14870252b9e8264b8b1c57f9e0fc379f1621c" +version = "1.8.0" +source = "git+https://github.com/rpcpool/digital-asset-validator-plugin.git?branch=espi/plerkle-solana-parsers#53bce9048ac0bbaa43246185edf785ab16b5c07c" dependencies = [ "bs58 0.4.0", "chrono", @@ -4079,8 +4102,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", "version_check", ] @@ -4091,20 +4114,11 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "version_check", ] -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - [[package]] name = "proc-macro2" version = "1.0.69" @@ -4120,8 +4134,8 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", "version_check", "yansi", @@ -4197,8 +4211,8 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -4211,63 +4225,63 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "qualifier_attr" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "quinn" -version = "0.9.4" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8b432585672228923edbbf64b8b12c14e1112f62e88737655b4a083dbcd78e" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.20.9", + "rustls 0.21.7", "thiserror", "tokio", "tracing", - "webpki", ] [[package]] name = "quinn-proto" -version = "0.9.6" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" dependencies = [ "bytes", "rand 0.8.5", "ring 0.16.20", "rustc-hash", - "rustls 0.20.9", + "rustls 0.21.7", "rustls-native-certs", "slab", "thiserror", "tinyvec", "tracing", - "webpki", ] [[package]] name = "quinn-udp" -version = "0.3.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ + "bytes", "libc", - "quinn-proto", - "socket2 0.4.9", + "socket2 0.5.4", "tracing", - "windows-sys 0.42.0", -] - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", + "windows-sys 0.48.0", ] [[package]] @@ -4276,7 +4290,7 @@ version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2", ] [[package]] @@ -4647,8 +4661,8 @@ version = "0.7.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -4859,8 +4873,8 @@ version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e85e2a16b12bdb763244c69ab79363d71db2b4b918a2def53f80b02e0574b13c" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "serde_derive_internals", "syn 1.0.109", ] @@ -4886,8 +4900,8 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -4953,8 +4967,8 @@ checksum = "7216195de9c6b2474fd0efab486173dccd0eff21f28cc54aa4c0205d52fb3af0" dependencies = [ "bae", "heck 0.3.3", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -5019,8 +5033,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34cdc022b4f606353fe5dc85b09713a04e433323b70163e81513b141c6ae6eb5" dependencies = [ "heck 0.3.3", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", "thiserror", ] @@ -5032,8 +5046,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63f62030c60f3a691f5fe251713b4e220b306e50a71e1d6f9cce1f24bb781978" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", "thiserror", ] @@ -5056,8 +5070,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56821b7076f5096b8f726e2791ad255a99c82498e08ec477a65a96c461ff1927" dependencies = [ "heck 0.3.3", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -5077,8 +5091,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69b4397b825df6ccf1e98bcdabef3bbcfc47ff5853983467850eeab878384f21" dependencies = [ "heck 0.3.3", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "rustversion", "syn 1.0.109", ] @@ -5142,8 +5156,8 @@ version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -5153,8 +5167,8 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -5226,8 +5240,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ "darling", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -5238,8 +5252,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" dependencies = [ "darling", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -5262,7 +5276,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d" dependencies = [ - "dashmap", + "dashmap 5.5.3", "futures", "lazy_static", "log", @@ -5276,8 +5290,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -5294,17 +5308,6 @@ dependencies = [ "opaque-debug", ] -[[package]] -name = "sha-1" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - [[package]] name = "sha1" version = "0.10.6" @@ -5468,14 +5471,14 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "sha-1 0.9.8", + "sha-1", ] [[package]] name = "solana-account-decoder" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52aec62a85932e26d1085864b0f7b99b31934aec8dd132429bfef6d7fb1d3a6" +checksum = "c48541b782c0fbb15ac202f2487353c3649fbf868afacae6ca1c9fe0f7df0b4a" dependencies = [ "Inflector", "base64 0.21.4", @@ -5486,7 +5489,6 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-address-lookup-table-program", "solana-config-program", "solana-sdk", "spl-token", @@ -5496,37 +5498,15 @@ dependencies = [ "zstd", ] -[[package]] -name = "solana-address-lookup-table-program" -version = "1.16.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee0bd25f4ba0a15fc16c57b41b1e1b14f5271b83214fda158fdedb58758d394e" -dependencies = [ - "bincode", - "bytemuck", - "log", - "num-derive 0.3.3", - "num-traits", - "rustc_version", - "serde", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-program", - "solana-program-runtime", - "solana-sdk", - "thiserror", -] - [[package]] name = "solana-clap-utils" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e963043668c640183d48472b281ebb9f713e0c36df0271961d23e6a394e09070" +checksum = "c3a78952f057a7d4f87b3a6a5f4a8705cefbb67bbc00ecffc2c75b168a54c931" dependencies = [ "chrono", "clap 2.34.0", "rpassword", - "solana-perf", "solana-remote-wallet", "solana-sdk", "thiserror", @@ -5537,19 +5517,19 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ccf7bb34fb81c74582a9011babaa2e0220da56c71186e77f45a6f352017fdb" +checksum = "4e85b1d68bce244750bd02c4d71ed0df415c9b8d91a4b0f1e7ce6b97748db46c" dependencies = [ "async-trait", "bincode", + "dashmap 4.0.2", "futures", "futures-util", - "indexmap 1.9.3", + "indexmap 2.0.2", "indicatif", "log", "quinn", - "rand 0.7.3", "rayon", "solana-connection-cache", "solana-measure", @@ -5570,9 +5550,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fd0fc1efb91a1661aeb1ff6a691156c3b1bffdaed0aa096589499dd83f9e50b" +checksum = "7c66c9c5bbc148affd42127061af9c0e7e5901b5e5142e951912f165272203c1" dependencies = [ "bincode", "chrono", @@ -5584,16 +5564,17 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8759e9cb9b1e92a94c31812169ecb5e65b5e215fb70fb68691e03655de5b7b6c" +checksum = "4180686b6384013f062242ee9f18ea6ea68268e9b35fa9aa0206c2a622d1773f" dependencies = [ "async-trait", "bincode", + "crossbeam-channel", "futures-util", - "indexmap 1.9.3", + "indexmap 2.0.2", "log", - "rand 0.7.3", + "rand 0.8.5", "rayon", "rcgen", "solana-measure", @@ -5605,9 +5586,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02eb4f0ed3eade20f4abdcc0031167344237cd6e16808bd0f33945f9db7861fe" +checksum = "174a53486f9e0774680c2b6a53568a15c11ccc5cef1263a7e7d42958bfd61792" dependencies = [ "ahash 0.8.3", "blake3", @@ -5618,13 +5599,10 @@ dependencies = [ "cc", "either", "generic-array", - "getrandom 0.1.16", "im", "lazy_static", "log", "memmap2", - "once_cell", - "rand_core 0.6.4", "rustc_version", "serde", "serde_bytes", @@ -5638,21 +5616,21 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28514761a285944cbad5b3d7930546369b80a713ba37d84bcf6ed2753611765" +checksum = "e69b9bc56d9f92bd194569091d655be239a51a934df1db247e0c8bd2a9352909" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "rustc_version", "syn 2.0.38", ] [[package]] name = "solana-logger" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c310c6749435ce1ea25a9ae3edfb2fd2c2aed2aa4d4f7e0487a8077a0b1ee30" +checksum = "ccb457626944fd2f192285c8281e887081dc346920c181aaf165426dbf081859" dependencies = [ "env_logger 0.9.3", "lazy_static", @@ -5661,9 +5639,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d171357580e62aa4ca19c780e25f4e74de064e2780cb8b9f6b6901d986fcd23" +checksum = "0b2a8bb3ec59a415b1c30827001c38af358a0c244e00a3d5280ca0b0ed264036" dependencies = [ "log", "solana-sdk", @@ -5671,9 +5649,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "013cbb3c82588278d2be18d3317ece5286cb54a3a06d5d38fc31e2a76a6d5e2d" +checksum = "3c89e3237a73f781e0156fe419831c554f6807eb4f4bffea42535be9627d6fc1" dependencies = [ "crossbeam-channel", "gethostname", @@ -5681,23 +5659,24 @@ dependencies = [ "log", "reqwest", "solana-sdk", + "thiserror", ] [[package]] name = "solana-net-utils" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50d7cac0694b1fe07499de25404a0c7d6836457e359aba3b08c3983c3dc5eb6" +checksum = "0ec445e2d9dbfab7360bc0d846a676e318c13eb4d1e0359ef199187d07795d02" dependencies = [ "bincode", "clap 3.2.25", "crossbeam-channel", "log", "nix", - "rand 0.7.3", + "rand 0.8.5", "serde", "serde_derive", - "socket2 0.4.9", + "socket2 0.5.4", "solana-logger", "solana-sdk", "solana-version", @@ -5707,25 +5686,27 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395d559e5be2c439551298e9fa95561807f24921fd9a1e08bb82a3dc05c02dea" +checksum = "c7b58cc4a2f4f450361bc8c1a24a94383c659e6212a74e6080a410f7d87e05a6" dependencies = [ "ahash 0.8.3", "bincode", "bv", "caps", "curve25519-dalek", - "dlopen", - "dlopen_derive", + "dlopen2", "fnv", "lazy_static", "libc", "log", "nix", - "rand 0.7.3", + "rand 0.8.5", "rayon", + "rustc_version", "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", "solana-metrics", "solana-rayon-threadlimit", "solana-sdk", @@ -5734,18 +5715,17 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff2aa5434a77413e9d43e971ceb47bdb003f2e8bbc0365a25b684aca2605c25" +checksum = "c183d16916dd70ce2b59a4b39088f5094649a592e475fb9ebfc3cfe78b3a192c" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", "ark-serialize", - "array-bytes", "base64 0.21.4", "bincode", - "bitflags 1.3.2", + "bitflags 2.4.0", "blake3", "borsh 0.10.3", "borsh 0.9.3", @@ -5762,14 +5742,14 @@ dependencies = [ "lazy_static", "libc", "libsecp256k1", + "light-poseidon", "log", "memoffset 0.9.0", "num-bigint 0.4.4", "num-derive 0.3.3", "num-traits", "parking_lot 0.12.1", - "rand 0.7.3", - "rand_chacha 0.2.2", + "rand 0.8.5", "rustc_version", "rustversion", "serde", @@ -5789,9 +5769,9 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1832fefc2187142dac169812518ec20da68b09abad86e4a78f8ae1787e4f56" +checksum = "1fca7d79b03e54e108069f32cf553c863838b647be7f7135644f8a1d2bdcd3a1" dependencies = [ "base64 0.21.4", "bincode", @@ -5803,7 +5783,7 @@ dependencies = [ "num-derive 0.3.3", "num-traits", "percentage", - "rand 0.7.3", + "rand 0.8.5", "rustc_version", "serde", "solana-frozen-abi", @@ -5817,9 +5797,9 @@ dependencies = [ [[package]] name = "solana-pubsub-client" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89388addbc3192407d948634f82c95c4dbe1efbe578582abfd136720e059556e" +checksum = "d90c6e27f0d1e627728f137db688c45accb1b7ae839021b978d1dcceff40d7a3" dependencies = [ "crossbeam-channel", "futures-util", @@ -5842,9 +5822,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7897b876a6df2d97b3a5ddfd764155c0591e3497e863fd7fdf32b54de4e2644" +checksum = "f340646d1bdd7b7c8e0c71f1f817a4eaeba35c06f025944c52df8f82bb565c79" dependencies = [ "async-mutex", "async-trait", @@ -5854,9 +5834,8 @@ dependencies = [ "log", "quinn", "quinn-proto", - "quinn-udp", "rcgen", - "rustls 0.20.9", + "rustls 0.21.7", "solana-connection-cache", "solana-measure", "solana-metrics", @@ -5870,9 +5849,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba17a930f9974a17a9a6c6e82e7f89b40127e9cc0f9c17cfc29fc5b149d2c38" +checksum = "7effa9e68a7ab9883f7fb4a91c083970223e8e8e355979eb605279608fafa6b7" dependencies = [ "lazy_static", "num_cpus", @@ -5880,9 +5859,9 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80fb35e3fa78ef1d08a6a1d852e2c357e6ae388cb307d24fad359f57c34429f0" +checksum = "e59fee3edad929473b7178f84ae58dbb3feb004a26873c8ab557b3aecfaa6d87" dependencies = [ "console", "dialoguer", @@ -5899,9 +5878,9 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c512944689d747a87f76936c89bb59f5be6c9a3189631857f49746cfa47d5bd1" +checksum = "94ae66b579851b5142ace6133b95192b38f9a72fb4a81ce936f0af92977c062f" dependencies = [ "async-trait", "base64 0.21.4", @@ -5925,9 +5904,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e918b75f8ac4c358a6b512bf8b7dafc8166ddcb52ded5164c6235e0693ccb09" +checksum = "e0a62a61c8c5989f2b5e4b75bda30b4647ad4affbcfe4a2890b1adb05e2b54c8" dependencies = [ "base64 0.21.4", "bs58 0.4.0", @@ -5947,9 +5926,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6e360ea2f3a756bdf6256c1f6ef13f8b01b5d2a7855b4f16cafb4a4017f0557" +checksum = "9db51df524aceb35e305b735086191db052dc163d09b6d5d9be65e216ab7413b" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -5960,14 +5939,14 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1002048941cedbd7dd6a96fdaa3dc5238b998aaa70b81946b1e3ec108cc2be" +checksum = "284587e20a7256621b6061589a6d7f9fc1c1bcb9f25d183555034f7817ec49a6" dependencies = [ "assert_matches", "base64 0.21.4", "bincode", - "bitflags 1.3.2", + "bitflags 2.4.0", "borsh 0.10.3", "bs58 0.4.0", "bytemuck", @@ -5990,8 +5969,9 @@ dependencies = [ "num_enum 0.6.1", "pbkdf2 0.11.0", "qstring", + "qualifier_attr", "rand 0.7.3", - "rand_chacha 0.2.2", + "rand 0.8.5", "rustc_version", "rustversion", "serde", @@ -6013,29 +5993,29 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b41b63b2da4a37ce323aba108db21f4c7bfa638dd1bf58fdc870f83bdce48ba" +checksum = "5fee7090babd8fe6cedd2e377366979464d29fa958bf5fc6554f6c7577b73fd4" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "rustversion", "syn 2.0.38", ] [[package]] name = "solana-streamer" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00e575f2bd5ae2776870fbd1d7379d4ad392c015e2a4e2a328953b821a9d36d" +checksum = "4219f40db983a290ea75212b9e47013a47715eb224ca18e05bd094d86baefc37" dependencies = [ "async-channel 1.9.0", "bytes", "crossbeam-channel", "futures-util", "histogram", - "indexmap 1.9.3", + "indexmap 2.0.2", "itertools 0.10.5", "libc", "log", @@ -6045,10 +6025,9 @@ dependencies = [ "pkcs8", "quinn", "quinn-proto", - "quinn-udp", - "rand 0.7.3", + "rand 0.8.5", "rcgen", - "rustls 0.20.9", + "rustls 0.21.7", "solana-metrics", "solana-perf", "solana-sdk", @@ -6059,9 +6038,9 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df328e2624cce68c9949a53eac317a264eceb997131cb9bd22175698a5f5dc74" +checksum = "7f8d9eb19550425cbb6a96fdea18171a2e44529414fe09f8cf7a238a78fd9a37" dependencies = [ "bincode", "log", @@ -6074,17 +6053,16 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8ce6fe221c0e1fd8aa3078b8fcb0cc3f4c27942f1256b57a60608d81ae5348" +checksum = "795d4d7e76f87640d7a3d1ab6ebc2376d9b9d76a7c2664653628dc6f4bc64ecc" dependencies = [ "async-trait", "bincode", "futures-util", - "indexmap 1.9.3", + "indexmap 2.0.2", "indicatif", "log", - "rand 0.7.3", "rayon", "solana-connection-cache", "solana-measure", @@ -6099,9 +6077,9 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0b811793e78a908119cc02edca3ff8b54d5660104ebd06cc0e2e7e2f66900b" +checksum = "176b554ca42e29abd21d56f31c01599f9b334e65b22911bcdb691b9b02706636" dependencies = [ "Inflector", "base64 0.21.4", @@ -6114,7 +6092,6 @@ dependencies = [ "serde_derive", "serde_json", "solana-account-decoder", - "solana-address-lookup-table-program", "solana-sdk", "spl-associated-token-account", "spl-memo", @@ -6125,9 +6102,9 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897ff303a15ba956e80573dee4cf96d94d41a69adc5362898b98851e347505ad" +checksum = "0a60895d452a9e2de1115d4ebaef537fb608b9a6e206cb7b24c82881a35348e3" dependencies = [ "async-trait", "solana-connection-cache", @@ -6140,9 +6117,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9513754d3b2203a0e1045a211c5d68e72e4ed135e477344c21d096897fd2bf70" +checksum = "572a7a0f49ee43473c2f235432f98b2594c3a4e8cc9a1befd7a085be8192f5bd" dependencies = [ "log", "rustc_version", @@ -6156,9 +6133,9 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b6bfc5302ce0383eb129aa3a916705a20d22c4ad448144ef684b7b028d4053f" +checksum = "89cffa52ab296ccc95ced7ae7875534cb4fd1cbb0bd9b8ad20e7ec55f15bcd5d" dependencies = [ "bincode", "log", @@ -6178,9 +6155,9 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.16.16" +version = "1.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1fe77918563768a65fd5d6cd2fa06cf0aeb11e529a1ef8c230b0fe018600e3" +checksum = "a3e8e2f6c0d78bc9eb07efc1fcd034dd0fcc508af8809343ac861096aab84876" dependencies = [ "aes-gcm-siv", "base64 0.21.4", @@ -6207,9 +6184,9 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.6.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17d4ba1e58947346e360fabde0697029d36ba83c42f669199b16a8931313cf29" +checksum = "3d457cc2ba742c120492a64b7fa60e22c575e891f6b55039f4d736568fb112a3" dependencies = [ "byteorder", "combine 3.8.1", @@ -6248,9 +6225,9 @@ dependencies = [ [[package]] name = "spl-account-compression" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df052fd79e45c75c84ef20f5f2dcf037aeed230d0f2400bf68fa388cc0ece240" +checksum = "85c43bd4455d9fb29b9e4f83c087ccffa2f6f41fecfc0549932ae391d00f3378" dependencies = [ "anchor-lang", "bytemuck", @@ -6302,7 +6279,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fadbefec4f3c678215ca72bd71862697bb06b41fd77c0088902dd3203354387b" dependencies = [ - "quote 1.0.33", + "quote", "spl-discriminator-syn", "syn 2.0.38", ] @@ -6313,8 +6290,8 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e5f2044ca42c8938d54d1255ce599c79a1ffd86b677dfab695caa20f9ffc3f2" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "sha2 0.10.8", "syn 2.0.38", "thiserror", @@ -6370,8 +6347,8 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5269c8e868da17b6552ef35a51355a017bd8e0eae269c201fef830d35fa52c" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "sha2 0.10.8", "syn 2.0.38", ] @@ -6560,8 +6537,8 @@ dependencies = [ "heck 0.4.1", "hex", "once_cell", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "serde", "serde_json", "sha2 0.10.8", @@ -6636,25 +6613,14 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", -] - [[package]] name = "syn" version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "unicode-ident", ] @@ -6664,8 +6630,8 @@ version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "unicode-ident", ] @@ -6675,10 +6641,10 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", - "unicode-xid 0.2.4", + "unicode-xid", ] [[package]] @@ -6760,8 +6726,8 @@ version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -6874,8 +6840,8 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -6923,18 +6889,17 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.17.2" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls 0.20.9", + "rustls 0.21.7", "tokio", - "tokio-rustls 0.23.4", + "tokio-rustls 0.24.1", "tungstenite", - "webpki", - "webpki-roots 0.22.6", + "webpki-roots 0.25.2", ] [[package]] @@ -7066,8 +7031,8 @@ version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -7170,24 +7135,23 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tungstenite" -version = "0.17.3" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" dependencies = [ - "base64 0.13.1", "byteorder", "bytes", + "data-encoding", "http", "httparse", "log", "rand 0.8.5", - "rustls 0.20.9", - "sha-1 0.10.1", + "rustls 0.21.7", + "sha1", "thiserror", "url", "utf-8", - "webpki", - "webpki-roots 0.22.6", + "webpki-roots 0.24.0", ] [[package]] @@ -7272,12 +7236,6 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unicode-xid" version = "0.2.4" @@ -7464,8 +7422,8 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", "wasm-bindgen-shared", ] @@ -7488,7 +7446,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ - "quote 1.0.33", + "quote", "wasm-bindgen-macro-support", ] @@ -7498,8 +7456,8 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -7540,6 +7498,15 @@ dependencies = [ "webpki", ] +[[package]] +name = "webpki-roots" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" +dependencies = [ + "rustls-webpki", +] + [[package]] name = "webpki-roots" version = "0.25.2" @@ -7607,21 +7574,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -7845,8 +7797,8 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] diff --git a/Cargo.toml b/Cargo.toml index 62b84e614..30df86430 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,13 +25,13 @@ repository = "https://github.com/metaplex-foundation/digital-asset-rpc-infrastru version = "0.7.2" [workspace.dependencies] -anchor-client = "0.28.0" -anchor-lang = "0.28.0" +anchor-client = "0.29.0" +anchor-lang = "0.29.0" anyhow = "1.0.75" async-std = "1.0.0" async-trait = "0.1.60" backon = "0.4.1" -blockbuster = "1.0.1" +blockbuster = "1.1.0" borsh = "~0.10.3" borsh-derive = "~0.10.3" bs58 = "0.4.0" @@ -73,7 +73,7 @@ once_cell = "1.19.0" open-rpc-derive = "0.0.4" open-rpc-schema = "0.0.4" plerkle_messenger = "1.6.0" -plerkle_serialization = "1.7.0" +plerkle_serialization = "1.8.0" program_transformers = { path = "program_transformers" } prometheus = "0.13.3" proxy-wasm = "0.2.0" @@ -89,12 +89,12 @@ sea-query = "0.28.1" serde = "1.0.137" serde_json = "1.0.81" serial_test = "2.0.0" -solana-account-decoder = "~1.16.16" -solana-client = "~1.16.16" -solana-program = "~1.16.16" -solana-sdk = "~1.16.16" -solana-transaction-status = "~1.16.16" -spl-account-compression = "0.2.0" +solana-account-decoder = "~1.17" +solana-client = "~1.17" +solana-program = "~1.17" +solana-sdk = "~1.17" +solana-transaction-status = "~1.17" +spl-account-compression = "0.3.0" spl-associated-token-account = ">= 1.1.3, < 3.0" spl-concurrent-merkle-tree = "0.2.0" spl-noop = "0.2.0" @@ -119,7 +119,7 @@ missing_const_for_fn = "deny" trivially_copy_pass_by_ref = "deny" [patch.crates-io] -blockbuster = { git = "https://github.com/rpcpool/blockbuster.git", tag = "blockbuster-v1.0.1-no-plerkle" } +blockbuster = { git = "https://github.com/rpcpool/blockbuster.git", branch = "rm-plerkle-101" } plerkle_serialization = { git = "https://github.com/rpcpool/digital-asset-validator-plugin.git", branch = "espi/plerkle-solana-parsers" } [profile.release] diff --git a/integration_tests/tests/integration_tests/common.rs b/integration_tests/tests/integration_tests/common.rs index 7709fd040..fe6b349ce 100644 --- a/integration_tests/tests/integration_tests/common.rs +++ b/integration_tests/tests/integration_tests/common.rs @@ -16,8 +16,8 @@ use nft_ingester::config; use once_cell::sync::Lazy; use plerkle_serialization::{ deserializer::{ - parse_account_keys, parse_message_instructions, parse_meta_inner_instructions, - parse_pubkey, parse_signature, parse_slice, + parse_account_keys, parse_compiled_inner_instructions, parse_compiled_instructions, + parse_inner_instructions, parse_pubkey, parse_signature, parse_slice, }, root_as_account_info, root_as_transaction_info, serializer::{seralize_encoded_transaction_with_status, serialize_account}, @@ -427,6 +427,18 @@ async fn cached_fetch_transaction(setup: &TestSetup, sig: Signature) -> Vec pub async fn index_transaction(setup: &TestSetup, sig: Signature) { let txn_bytes: Vec = cached_fetch_transaction(setup, sig).await; let txn = root_as_transaction_info(&txn_bytes).unwrap(); + let compiled = txn.compiled_inner_instructions(); + let inner = txn.inner_instructions(); + + let meta_inner_instructions = if let Some(compiled) = compiled { + parse_compiled_inner_instructions(compiled) + } else if let Some(inner) = inner { + parse_inner_instructions(inner) + } else { + panic!("No inner instructions found"); + } + .expect("failed to parse inner instructions"); + setup .transformer .handle_transaction(&TransactionInfo { @@ -434,12 +446,9 @@ pub async fn index_transaction(setup: &TestSetup, sig: Signature) { signature: &parse_signature(txn.signature()).expect("failed to parse transaction"), account_keys: &parse_account_keys(txn.account_keys()) .expect("failed to parse transaction"), - message_instructions: &parse_message_instructions(txn.outer_instructions()) + message_instructions: &parse_compiled_instructions(txn.outer_instructions()) .expect("failed to parse transaction"), - meta_inner_instructions: &parse_meta_inner_instructions( - txn.compiled_inner_instructions(), - ) - .expect("failed to parse transaction"), + meta_inner_instructions: &meta_inner_instructions, }) .await .unwrap(); diff --git a/nft_ingester/Cargo.toml b/nft_ingester/Cargo.toml index 7e824cd24..fd17a2bed 100644 --- a/nft_ingester/Cargo.toml +++ b/nft_ingester/Cargo.toml @@ -14,7 +14,10 @@ cadence = { workspace = true } cadence-macros = { workspace = true } chrono = { workspace = true } clap = { workspace = true, features = ["derive", "cargo"] } -digital_asset_types = { workspace = true, features = ["json_types", "sql_types"] } +digital_asset_types = { workspace = true, features = [ + "json_types", + "sql_types", +] } figment = { workspace = true, features = ["env", "toml", "yaml"] } flatbuffers = { workspace = true } futures = { workspace = true } @@ -26,7 +29,13 @@ program_transformers = { workspace = true } rand = { workspace = true } reqwest = { workspace = true } rust-crypto = { workspace = true } -sea-orm = { workspace = true, features = ["macros", "runtime-tokio-rustls", "sqlx-postgres", "with-chrono", "mock"] } +sea-orm = { workspace = true, features = [ + "macros", + "runtime-tokio-rustls", + "sqlx-postgres", + "with-chrono", + "mock", +] } serde = { workspace = true } serde_json = { workspace = true } solana-account-decoder = { workspace = true } @@ -34,11 +43,22 @@ solana-client = { workspace = true } solana-sdk = { workspace = true } solana-transaction-status = { workspace = true } spl-account-compression = { workspace = true, features = ["no-entrypoint"] } -sqlx = { workspace = true, features = ["macros", "runtime-tokio-rustls", "postgres", "uuid", "offline", "json"] } +sqlx = { workspace = true, features = [ + "macros", + "runtime-tokio-rustls", + "postgres", + "uuid", + "offline", + "json", +] } stretto = { workspace = true, features = ["async"] } thiserror = { workspace = true } tokio = { workspace = true, features = ["tracing"] } -tracing-subscriber = { workspace = true, features = ["json", "env-filter", "ansi"] } +tracing-subscriber = { workspace = true, features = [ + "json", + "env-filter", + "ansi", +] } url = { workspace = true } [lints] diff --git a/nft_ingester/src/transaction_notifications.rs b/nft_ingester/src/transaction_notifications.rs index 95f6eac04..ba2d91b2a 100644 --- a/nft_ingester/src/transaction_notifications.rs +++ b/nft_ingester/src/transaction_notifications.rs @@ -11,12 +11,15 @@ use { plerkle_messenger::{ConsumptionType, Messenger, MessengerConfig, RecvData}, plerkle_serialization::{ deserializer::{ - parse_account_keys, parse_message_instructions, parse_meta_inner_instructions, - parse_signature, + parse_account_keys, parse_compiled_inner_instructions, parse_compiled_instructions, + parse_inner_instructions, parse_signature, }, root_as_transaction_info, }, - program_transformers::{error::ProgramTransformerResult, ProgramTransformer, TransactionInfo}, + program_transformers::{ + error::{ProgramTransformerError, ProgramTransformerResult}, + ProgramTransformer, TransactionInfo, + }, sqlx::{Pool, Postgres}, std::sync::Arc, tokio::{ @@ -130,18 +133,33 @@ async fn handle_transaction_update<'a>( manager: Arc, tx: plerkle_serialization::TransactionInfo<'_>, ) -> ProgramTransformerResult<()> { + let signature = parse_signature(tx.signature()).map_err(into_program_transformer_err)?; + let account_keys = + &parse_account_keys(tx.account_keys()).map_err(into_program_transformer_err)?; + let message_instructions = parse_compiled_instructions(tx.outer_instructions()) + .map_err(into_program_transformer_err)?; + + let compiled = tx.compiled_inner_instructions(); + let inner = tx.inner_instructions(); + + let meta_inner_instructions = if let Some(compiled) = compiled { + parse_compiled_inner_instructions(compiled) + } else if let Some(inner) = inner { + parse_inner_instructions(inner) + } else { + return Err(ProgramTransformerError::DeserializationError( + "No inner instructions found".to_string(), + )); + } + .map_err(into_program_transformer_err)?; + manager .handle_transaction(&TransactionInfo { slot: tx.slot(), - signature: &parse_signature(tx.signature()).map_err(into_program_transformer_err)?, - account_keys: &parse_account_keys(tx.account_keys()) - .map_err(into_program_transformer_err)?, - message_instructions: &parse_message_instructions(tx.outer_instructions()) - .map_err(into_program_transformer_err)?, - meta_inner_instructions: &parse_meta_inner_instructions( - tx.compiled_inner_instructions(), - ) - .map_err(into_program_transformer_err)?, + signature: &signature, + account_keys, + message_instructions: &message_instructions, + meta_inner_instructions: &meta_inner_instructions, }) .await } diff --git a/program_transformers/src/lib.rs b/program_transformers/src/lib.rs index 66dc736c4..d54494195 100644 --- a/program_transformers/src/lib.rs +++ b/program_transformers/src/lib.rs @@ -160,7 +160,7 @@ impl ProgramTransformer { txn_id: &tx_info.signature.to_string(), program, instruction: Some(instruction), - inner_ix, + inner_ix: inner_ix.as_deref(), keys: ix_accounts.as_slice(), slot: tx_info.slot, }; From ab6dbb3aa21d37ded10bbac3e8a912d8b27b07a0 Mon Sep 17 00:00:00 2001 From: Kyle Espinola Date: Tue, 5 Mar 2024 13:51:27 +0100 Subject: [PATCH 5/6] refactor: switch to account and transaction info taking ownership to allow for converting from plerkle to program transformer strcuts with TryFrom --- Cargo.lock | 2 +- .../tests/integration_tests/common.rs | 45 ++++-------- nft_ingester/src/account_updates.rs | 28 ++------ nft_ingester/src/plerkle.rs | 72 ++++++++++++++++++- nft_ingester/src/transaction_notifications.rs | 56 +++------------ program_transformers/src/lib.rs | 38 +++++----- program_transformers/src/token/mod.rs | 8 +-- .../src/token_metadata/mod.rs | 14 ++-- 8 files changed, 129 insertions(+), 134 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c96803653..0cd317497 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4016,7 +4016,7 @@ dependencies = [ [[package]] name = "plerkle_serialization" version = "1.8.0" -source = "git+https://github.com/rpcpool/digital-asset-validator-plugin.git?branch=espi/plerkle-solana-parsers#53bce9048ac0bbaa43246185edf785ab16b5c07c" +source = "git+https://github.com/rpcpool/digital-asset-validator-plugin.git?branch=espi/plerkle-solana-parsers#a623576e6022b9d4a0ae4c6b0bd1b1a4dc8c2b93" dependencies = [ "bs58 0.4.0", "chrono", diff --git a/integration_tests/tests/integration_tests/common.rs b/integration_tests/tests/integration_tests/common.rs index fe6b349ce..e190b39fa 100644 --- a/integration_tests/tests/integration_tests/common.rs +++ b/integration_tests/tests/integration_tests/common.rs @@ -12,18 +12,17 @@ use migration::sea_orm::{ use migration::{Migrator, MigratorTrait}; use mpl_token_metadata::accounts::Metadata; -use nft_ingester::config; +use nft_ingester::{ + config, + plerkle::{PlerkleAccountInfo, PlerkleTransactionInfo}, +}; use once_cell::sync::Lazy; use plerkle_serialization::{ - deserializer::{ - parse_account_keys, parse_compiled_inner_instructions, parse_compiled_instructions, - parse_inner_instructions, parse_pubkey, parse_signature, parse_slice, - }, root_as_account_info, root_as_transaction_info, serializer::{seralize_encoded_transaction_with_status, serialize_account}, solana_geyser_plugin_interface_shims::ReplicaAccountInfoV2, }; -use program_transformers::{AccountInfo, ProgramTransformer, TransactionInfo}; +use program_transformers::ProgramTransformer; use solana_client::nonblocking::rpc_client::RpcClient; use solana_sdk::pubkey::Pubkey; @@ -357,14 +356,13 @@ pub async fn get_token_largest_account(client: &RpcClient, mint: Pubkey) -> anyh pub async fn index_account_bytes(setup: &TestSetup, account_bytes: Vec) { let account = root_as_account_info(&account_bytes).unwrap(); + let account = PlerkleAccountInfo(account) + .try_into() + .expect("failed to parse account info"); + setup .transformer - .handle_account_update(&AccountInfo { - slot: account.slot(), - pubkey: &parse_pubkey(account.pubkey()).expect("failed to parse account"), - owner: &parse_pubkey(account.owner()).expect("failed to parse account"), - data: parse_slice(account.data()).expect("failed to parse account"), - }) + .handle_account_update(&account) .await .unwrap(); } @@ -427,29 +425,14 @@ async fn cached_fetch_transaction(setup: &TestSetup, sig: Signature) -> Vec pub async fn index_transaction(setup: &TestSetup, sig: Signature) { let txn_bytes: Vec = cached_fetch_transaction(setup, sig).await; let txn = root_as_transaction_info(&txn_bytes).unwrap(); - let compiled = txn.compiled_inner_instructions(); - let inner = txn.inner_instructions(); - let meta_inner_instructions = if let Some(compiled) = compiled { - parse_compiled_inner_instructions(compiled) - } else if let Some(inner) = inner { - parse_inner_instructions(inner) - } else { - panic!("No inner instructions found"); - } - .expect("failed to parse inner instructions"); + let transaction_info = PlerkleTransactionInfo(txn) + .try_into() + .expect("failed to parse txn"); setup .transformer - .handle_transaction(&TransactionInfo { - slot: txn.slot(), - signature: &parse_signature(txn.signature()).expect("failed to parse transaction"), - account_keys: &parse_account_keys(txn.account_keys()) - .expect("failed to parse transaction"), - message_instructions: &parse_compiled_instructions(txn.outer_instructions()) - .expect("failed to parse transaction"), - meta_inner_instructions: &meta_inner_instructions, - }) + .handle_transaction(&transaction_info) .await .unwrap(); } diff --git a/nft_ingester/src/account_updates.rs b/nft_ingester/src/account_updates.rs index 73d3c59fe..6d5372555 100644 --- a/nft_ingester/src/account_updates.rs +++ b/nft_ingester/src/account_updates.rs @@ -2,18 +2,15 @@ use { crate::{ metric, metrics::capture_result, - plerkle::into_program_transformer_err, + plerkle::PlerkleAccountInfo, tasks::{create_download_metadata_notifier, TaskData}, }, cadence_macros::{is_global_default_set, statsd_count, statsd_time}, chrono::Utc, log::{debug, error}, plerkle_messenger::{ConsumptionType, Messenger, MessengerConfig, RecvData}, - plerkle_serialization::{ - deserializer::{parse_pubkey, parse_slice}, - root_as_account_info, - }, - program_transformers::{error::ProgramTransformerResult, AccountInfo, ProgramTransformer}, + plerkle_serialization::root_as_account_info, + program_transformers::ProgramTransformer, sqlx::{Pool, Postgres}, std::sync::Arc, tokio::{ @@ -107,7 +104,10 @@ async fn handle_account( account = Some(bs58::encode(pubkey.0.as_slice()).into_string()); } let begin_processing = Instant::now(); - let res = handle_account_update(manager, account_update).await; + + let account_info = PlerkleAccountInfo(account_update).try_into().ok()?; + let res = manager.handle_account_update(&account_info).await; + let should_ack = capture_result( id.clone(), stream_key, @@ -124,17 +124,3 @@ async fn handle_account( } ret_id } - -async fn handle_account_update<'a>( - manager: Arc, - account_update: plerkle_serialization::AccountInfo<'_>, -) -> ProgramTransformerResult<()> { - manager - .handle_account_update(&AccountInfo { - slot: account_update.slot(), - pubkey: &parse_pubkey(account_update.pubkey()).map_err(into_program_transformer_err)?, - owner: &parse_pubkey(account_update.owner()).map_err(into_program_transformer_err)?, - data: parse_slice(account_update.data()).map_err(into_program_transformer_err)?, - }) - .await -} diff --git a/nft_ingester/src/plerkle.rs b/nft_ingester/src/plerkle.rs index 1f7c8d574..f514e53ed 100644 --- a/nft_ingester/src/plerkle.rs +++ b/nft_ingester/src/plerkle.rs @@ -1,8 +1,74 @@ use { - plerkle_serialization::deserializer::SolanaDeserializerError, - program_transformers::error::ProgramTransformerError, + plerkle_serialization::deserializer::*, + program_transformers::{error::ProgramTransformerError, AccountInfo, TransactionInfo}, }; -pub fn into_program_transformer_err(e: SolanaDeserializerError) -> ProgramTransformerError { +pub fn into_program_transformer_err(e: PlerkleDeserializerError) -> ProgramTransformerError { ProgramTransformerError::DeserializationError(e.to_string()) } + +#[derive(thiserror::Error, Clone, Debug)] +pub enum PlerkleDeserializerError { + #[error("Not found")] + NotFound, + #[error("Solana error: {0}")] + Solana(#[from] SolanaDeserializerError), +} + +pub struct PlerkleAccountInfo<'a>(pub plerkle_serialization::AccountInfo<'a>); + +impl<'a> TryFrom> for AccountInfo { + type Error = PlerkleDeserializerError; + + fn try_from(value: PlerkleAccountInfo) -> Result { + let account_info = value.0; + + Ok(Self { + slot: account_info.slot(), + pubkey: account_info + .pubkey() + .ok_or(PlerkleDeserializerError::NotFound)? + .try_into()?, + owner: account_info + .owner() + .ok_or(PlerkleDeserializerError::NotFound)? + .try_into()?, + data: PlerkleOptionalU8Vector(account_info.data()).try_into()?, + }) + } +} + +pub struct PlerkleTransactionInfo<'a>(pub plerkle_serialization::TransactionInfo<'a>); + +impl<'a> TryFrom> for TransactionInfo { + type Error = PlerkleDeserializerError; + + fn try_from(value: PlerkleTransactionInfo<'a>) -> Result { + let tx_info = value.0; + + let slot = tx_info.slot(); + let signature = PlerkleOptionalStr(tx_info.signature()).try_into()?; + let account_keys = PlerkleOptionalPubkeyVector(tx_info.account_keys()).try_into()?; + let message_instructions = PlerkleCompiledInstructionVector( + tx_info + .outer_instructions() + .ok_or(PlerkleDeserializerError::NotFound)?, + ) + .try_into()?; + let compiled = tx_info.compiled_inner_instructions(); + let inner = tx_info.inner_instructions(); + let meta_inner_instructions = compiled + .map(|c| PlerkleCompiledInnerInstructionVector(c).try_into()) + .or_else(|| inner.map(|i| PlerkleInnerInstructionsVector(i).try_into())) + .transpose()? + .unwrap_or_default(); + + Ok(Self { + slot, + signature, + account_keys, + message_instructions, + meta_inner_instructions, + }) + } +} diff --git a/nft_ingester/src/transaction_notifications.rs b/nft_ingester/src/transaction_notifications.rs index ba2d91b2a..df005bc56 100644 --- a/nft_ingester/src/transaction_notifications.rs +++ b/nft_ingester/src/transaction_notifications.rs @@ -2,24 +2,15 @@ use { crate::{ metric, metrics::capture_result, - plerkle::into_program_transformer_err, + plerkle::{into_program_transformer_err, PlerkleTransactionInfo}, tasks::{create_download_metadata_notifier, TaskData}, }, cadence_macros::{is_global_default_set, statsd_count, statsd_time}, chrono::Utc, log::{debug, error}, plerkle_messenger::{ConsumptionType, Messenger, MessengerConfig, RecvData}, - plerkle_serialization::{ - deserializer::{ - parse_account_keys, parse_compiled_inner_instructions, parse_compiled_instructions, - parse_inner_instructions, parse_signature, - }, - root_as_transaction_info, - }, - program_transformers::{ - error::{ProgramTransformerError, ProgramTransformerResult}, - ProgramTransformer, TransactionInfo, - }, + plerkle_serialization::root_as_transaction_info, + program_transformers::ProgramTransformer, sqlx::{Pool, Postgres}, std::sync::Arc, tokio::{ @@ -111,7 +102,11 @@ async fn handle_transaction( } let begin = Instant::now(); - let res = handle_transaction_update(manager, tx).await; + let transaction_info = PlerkleTransactionInfo(tx) + .try_into() + .map_err(into_program_transformer_err) + .ok()?; + let res = manager.handle_transaction(&transaction_info).await; let should_ack = capture_result( id.clone(), stream_key, @@ -128,38 +123,3 @@ async fn handle_transaction( } ret_id } - -async fn handle_transaction_update<'a>( - manager: Arc, - tx: plerkle_serialization::TransactionInfo<'_>, -) -> ProgramTransformerResult<()> { - let signature = parse_signature(tx.signature()).map_err(into_program_transformer_err)?; - let account_keys = - &parse_account_keys(tx.account_keys()).map_err(into_program_transformer_err)?; - let message_instructions = parse_compiled_instructions(tx.outer_instructions()) - .map_err(into_program_transformer_err)?; - - let compiled = tx.compiled_inner_instructions(); - let inner = tx.inner_instructions(); - - let meta_inner_instructions = if let Some(compiled) = compiled { - parse_compiled_inner_instructions(compiled) - } else if let Some(inner) = inner { - parse_inner_instructions(inner) - } else { - return Err(ProgramTransformerError::DeserializationError( - "No inner instructions found".to_string(), - )); - } - .map_err(into_program_transformer_err)?; - - manager - .handle_transaction(&TransactionInfo { - slot: tx.slot(), - signature: &signature, - account_keys, - message_instructions: &message_instructions, - meta_inner_instructions: &meta_inner_instructions, - }) - .await -} diff --git a/program_transformers/src/lib.rs b/program_transformers/src/lib.rs index d54494195..bbdcbdaf6 100644 --- a/program_transformers/src/lib.rs +++ b/program_transformers/src/lib.rs @@ -28,21 +28,21 @@ pub mod error; mod token; mod token_metadata; -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub struct AccountInfo<'a> { +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct AccountInfo { pub slot: u64, - pub pubkey: &'a Pubkey, - pub owner: &'a Pubkey, - pub data: &'a [u8], + pub pubkey: Pubkey, + pub owner: Pubkey, + pub data: Vec, } -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub struct TransactionInfo<'a> { +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct TransactionInfo { pub slot: u64, - pub signature: &'a Signature, - pub account_keys: &'a [Pubkey], - pub message_instructions: &'a [CompiledInstruction], - pub meta_inner_instructions: &'a [InnerInstructions], + pub signature: Signature, + pub account_keys: Vec, + pub message_instructions: Vec, + pub meta_inner_instructions: Vec, } #[derive(Debug, Clone, PartialEq, Eq)] @@ -109,13 +109,13 @@ impl ProgramTransformer { pub fn break_transaction<'a>( &self, - tx_info: &'a TransactionInfo<'_>, + tx_info: &'a TransactionInfo, ) -> VecDeque<(IxPair<'a>, Option>>)> { order_instructions( &self.key_set, - tx_info.account_keys, - tx_info.message_instructions, - tx_info.meta_inner_instructions, + tx_info.account_keys.as_slice(), + tx_info.message_instructions.as_slice(), + tx_info.meta_inner_instructions.as_slice(), ) } @@ -126,7 +126,7 @@ impl ProgramTransformer { pub async fn handle_transaction( &self, - tx_info: &TransactionInfo<'_>, + tx_info: &TransactionInfo, ) -> ProgramTransformerResult<()> { info!("Handling Transaction: {:?}", tx_info.signature); let instructions = self.break_transaction(tx_info); @@ -204,10 +204,10 @@ impl ProgramTransformer { pub async fn handle_account_update( &self, - account_info: &AccountInfo<'_>, + account_info: &AccountInfo, ) -> ProgramTransformerResult<()> { - if let Some(program) = self.match_program(account_info.owner) { - let result = program.handle_account(account_info.data)?; + if let Some(program) = self.match_program(&account_info.owner) { + let result = program.handle_account(&account_info.data)?; match result.result_type() { ProgramParseResult::TokenMetadata(parsing_result) => { handle_token_metadata_account( diff --git a/program_transformers/src/token/mod.rs b/program_transformers/src/token/mod.rs index 2dd5d990f..96372afc9 100644 --- a/program_transformers/src/token/mod.rs +++ b/program_transformers/src/token/mod.rs @@ -19,10 +19,10 @@ use { spl_token::state::AccountState, }; -pub async fn handle_token_program_account<'a, 'b, 'c>( - account_info: &'a AccountInfo<'a>, - parsing_result: &'b TokenProgramAccount, - db: &'c DatabaseConnection, +pub async fn handle_token_program_account<'a, 'b>( + account_info: &AccountInfo, + parsing_result: &'a TokenProgramAccount, + db: &'b DatabaseConnection, _download_metadata_notifier: &DownloadMetadataNotifier, ) -> ProgramTransformerResult<()> { let account_key = account_info.pubkey.to_bytes().to_vec(); diff --git a/program_transformers/src/token_metadata/mod.rs b/program_transformers/src/token_metadata/mod.rs index 9f9d2783b..cbeb94171 100644 --- a/program_transformers/src/token_metadata/mod.rs +++ b/program_transformers/src/token_metadata/mod.rs @@ -14,20 +14,20 @@ use { mod master_edition; mod v1_asset; -pub async fn handle_token_metadata_account<'a, 'b, 'c>( - account_info: &'a AccountInfo<'a>, - parsing_result: &'b TokenMetadataAccountState, - db: &'c DatabaseConnection, +pub async fn handle_token_metadata_account<'a, 'b>( + account_info: &AccountInfo, + parsing_result: &'a TokenMetadataAccountState, + db: &'b DatabaseConnection, download_metadata_notifier: &DownloadMetadataNotifier, ) -> ProgramTransformerResult<()> { match &parsing_result.data { TokenMetadataAccountData::EmptyAccount => { - burn_v1_asset(db, *account_info.pubkey, account_info.slot).await?; + burn_v1_asset(db, account_info.pubkey, account_info.slot).await?; Ok(()) } TokenMetadataAccountData::MasterEditionV1(m) => { let txn = db.begin().await?; - save_v1_master_edition(*account_info.pubkey, account_info.slot, m, &txn).await?; + save_v1_master_edition(account_info.pubkey, account_info.slot, m, &txn).await?; txn.commit().await?; Ok(()) } @@ -41,7 +41,7 @@ pub async fn handle_token_metadata_account<'a, 'b, 'c>( } TokenMetadataAccountData::MasterEditionV2(m) => { let txn = db.begin().await?; - save_v2_master_edition(*account_info.pubkey, account_info.slot, m, &txn).await?; + save_v2_master_edition(account_info.pubkey, account_info.slot, m, &txn).await?; txn.commit().await?; Ok(()) } From 81c4058305c40feeffa70b275682e4b78040d870 Mon Sep 17 00:00:00 2001 From: Kyle Espinola Date: Fri, 8 Mar 2024 13:39:04 +0100 Subject: [PATCH 6/6] refactor: address cr and reference published crates for plerkle_serialization and blockbuster --- Cargo.lock | 8 +++++--- Cargo.toml | 6 +----- nft_ingester/src/plerkle.rs | 11 ++++++----- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0cd317497..b74fb4310 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1000,8 +1000,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blockbuster" -version = "1.1.0" -source = "git+https://github.com/rpcpool/blockbuster.git?branch=rm-plerkle-101#4c136e32de3dfce04a8bbf014d458b22f48ae06b" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "429446ab240a173ca553b6960fcd3d0b843006d89da18fe6c7445a34d9130f7d" dependencies = [ "anchor-lang", "async-trait", @@ -4016,7 +4017,8 @@ dependencies = [ [[package]] name = "plerkle_serialization" version = "1.8.0" -source = "git+https://github.com/rpcpool/digital-asset-validator-plugin.git?branch=espi/plerkle-solana-parsers#a623576e6022b9d4a0ae4c6b0bd1b1a4dc8c2b93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f832646491065468aa8e222b47d41dd5250e4be7866725bef5f0d31c64538f5f" dependencies = [ "bs58 0.4.0", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 30df86430..619da0dac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ anyhow = "1.0.75" async-std = "1.0.0" async-trait = "0.1.60" backon = "0.4.1" -blockbuster = "1.1.0" +blockbuster = "2.0.0" borsh = "~0.10.3" borsh-derive = "~0.10.3" bs58 = "0.4.0" @@ -118,10 +118,6 @@ clone_on_ref_ptr = "deny" missing_const_for_fn = "deny" trivially_copy_pass_by_ref = "deny" -[patch.crates-io] -blockbuster = { git = "https://github.com/rpcpool/blockbuster.git", branch = "rm-plerkle-101" } -plerkle_serialization = { git = "https://github.com/rpcpool/digital-asset-validator-plugin.git", branch = "espi/plerkle-solana-parsers" } - [profile.release] codegen-units = 1 lto = true diff --git a/nft_ingester/src/plerkle.rs b/nft_ingester/src/plerkle.rs index f514e53ed..bef3d4ff6 100644 --- a/nft_ingester/src/plerkle.rs +++ b/nft_ingester/src/plerkle.rs @@ -57,11 +57,12 @@ impl<'a> TryFrom> for TransactionInfo { .try_into()?; let compiled = tx_info.compiled_inner_instructions(); let inner = tx_info.inner_instructions(); - let meta_inner_instructions = compiled - .map(|c| PlerkleCompiledInnerInstructionVector(c).try_into()) - .or_else(|| inner.map(|i| PlerkleInnerInstructionsVector(i).try_into())) - .transpose()? - .unwrap_or_default(); + let meta_inner_instructions = if let Some(c) = compiled { + PlerkleCompiledInnerInstructionVector(c).try_into() + } else { + PlerkleInnerInstructionsVector(inner.ok_or(PlerkleDeserializerError::NotFound)?) + .try_into() + }?; Ok(Self { slot,