Skip to content

Commit df1087d

Browse files
ananas-blockSwenSchaeferjohann
authored andcommitted
fix: preserve spend signatures in getCompressionSignaturesForAccount
- Add in_accounts and batch_nullify_context hashes to kept_account_hashes in filter_by_known_trees, so spend transaction entries are not filtered out - Remove filter in v2 parser that excluded input accounts also present in outputs, making v2 consistent with v1 behavior
1 parent 9b391f9 commit df1087d

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/ingester/parser/state_update.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,17 @@ impl StateUpdate {
185185
// Track which account hashes we're keeping for filtering account_transactions later
186186
let mut kept_account_hashes = HashSet::new();
187187

188+
// Add input (spent) account hashes - these don't have tree info but should be kept
189+
// for account_transactions tracking
190+
kept_account_hashes.extend(self.in_accounts.iter().cloned());
191+
192+
// Add batch nullify context hashes (v2 batch input accounts)
193+
kept_account_hashes.extend(
194+
self.batch_nullify_context
195+
.iter()
196+
.map(|ctx| Hash::from(ctx.account_hash)),
197+
);
198+
188199
// Filter out_accounts
189200
let out_accounts: Vec<_> = self
190201
.out_accounts

src/ingester/parser/tx_event_parser_v2.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use crate::ingester::parser::state_update::{AccountTransaction, StateUpdate};
99
use crate::ingester::parser::tx_event_parser::create_state_update_v1;
1010

1111
use super::state_update::AddressQueueUpdate;
12-
use crate::common::typedefs::hash::Hash;
1312
use light_event::parse::event_from_light_transaction;
1413
use light_compressed_account::Pubkey as LightPubkey;
1514
use solana_pubkey::Pubkey;
@@ -139,20 +138,10 @@ where
139138
.extend(event.batch_input_accounts.clone());
140139

141140
// Create account_transactions for v2 batch input accounts
142-
// but only for accounts that are not being created in this same transaction
143-
let output_account_hashes: std::collections::HashSet<_> = state_update_event
144-
.out_accounts
145-
.iter()
146-
.map(|acc| acc.account.hash.clone())
147-
.collect();
148-
149141
state_update_event.account_transactions.extend(
150142
event
151143
.batch_input_accounts
152144
.iter()
153-
.filter(|batch_account| {
154-
!output_account_hashes.contains(&Hash::from(batch_account.account_hash))
155-
})
156145
.map(|batch_account| AccountTransaction {
157146
hash: batch_account.account_hash.into(),
158147
signature: tx,

0 commit comments

Comments
 (0)