Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/ingester/parser/state_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ impl StateUpdate {
// Track which account hashes we're keeping for filtering account_transactions later
let mut kept_account_hashes = HashSet::new();

// Add input (spent) account hashes - these don't have tree info but should be kept
// for account_transactions tracking
kept_account_hashes.extend(self.in_accounts.iter().cloned());

// Add batch nullify context hashes (v2 batch input accounts)
kept_account_hashes.extend(
self.batch_nullify_context
.iter()
.map(|ctx| Hash::from(ctx.account_hash)),
);

// Filter out_accounts
let out_accounts: Vec<_> = self
.out_accounts
Expand Down
11 changes: 0 additions & 11 deletions src/ingester/parser/tx_event_parser_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::ingester::parser::state_update::{AccountTransaction, StateUpdate};
use crate::ingester::parser::tx_event_parser::create_state_update_v1;

use super::state_update::AddressQueueUpdate;
use crate::common::typedefs::hash::Hash;
use light_event::parse::event_from_light_transaction;
use light_compressed_account::Pubkey as LightPubkey;
use solana_pubkey::Pubkey;
Expand Down Expand Up @@ -139,20 +138,10 @@ where
.extend(event.batch_input_accounts.clone());

// Create account_transactions for v2 batch input accounts
// but only for accounts that are not being created in this same transaction
let output_account_hashes: std::collections::HashSet<_> = state_update_event
.out_accounts
.iter()
.map(|acc| acc.account.hash.clone())
.collect();

state_update_event.account_transactions.extend(
event
.batch_input_accounts
.iter()
.filter(|batch_account| {
!output_account_hashes.contains(&Hash::from(batch_account.account_hash))
})
.map(|batch_account| AccountTransaction {
hash: batch_account.account_hash.into(),
signature: tx,
Expand Down
Loading