diff --git a/accounts-db/src/accounts.rs b/accounts-db/src/accounts.rs index 3b8477890bdebd..8de5431318a3a0 100644 --- a/accounts-db/src/accounts.rs +++ b/accounts-db/src/accounts.rs @@ -588,10 +588,10 @@ impl Accounts { pub fn store_cached<'a>( &self, accounts: impl StorableAccounts<'a>, - transactions: &'a [&'a SanitizedTransaction], + transactions: Option<&'a [&'a SanitizedTransaction]>, ) { self.accounts_db - .store_cached_inline_update_index(accounts, Some(transactions)); + .store_cached_inline_update_index(accounts, transactions); } pub fn store_accounts_cached<'a>(&self, accounts: impl StorableAccounts<'a>) { diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 34a1cd9d70b89c..4b17701df20efa 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -3801,9 +3801,10 @@ impl Bank { &durable_nonce, lamports_per_signature, ); - self.rc - .accounts - .store_cached((self.slot(), accounts_to_store.as_slice()), &transactions); + self.rc.accounts.store_cached( + (self.slot(), accounts_to_store.as_slice()), + transactions.as_deref(), + ); }); self.collect_rent(&processing_results); diff --git a/svm/src/account_saver.rs b/svm/src/account_saver.rs index 379283399cd920..ca3c45dbfd50f3 100644 --- a/svm/src/account_saver.rs +++ b/svm/src/account_saver.rs @@ -45,7 +45,7 @@ pub fn collect_accounts_to_store<'a, T: SVMMessage>( processing_results: &'a mut [TransactionProcessingResult], durable_nonce: &DurableNonce, lamports_per_signature: u64, -) -> (Vec<(&'a Pubkey, &'a AccountSharedData)>, Vec<&'a T>) { +) -> (Vec<(&'a Pubkey, &'a AccountSharedData)>, Option>) { let collect_capacity = max_number_of_accounts_to_collect(txs, processing_results); let mut accounts = Vec::with_capacity(collect_capacity); let mut transactions = Vec::with_capacity(collect_capacity); @@ -87,7 +87,7 @@ pub fn collect_accounts_to_store<'a, T: SVMMessage>( } } } - (accounts, transactions) + (accounts, Some(transactions)) } fn collect_accounts_for_successful_tx<'a, T: SVMMessage>( @@ -294,6 +294,7 @@ mod tests { .iter() .any(|(pubkey, _account)| *pubkey == &keypair1.pubkey())); + let transactions = transactions.unwrap(); assert_eq!(transactions.len(), 2); assert!(transactions.iter().any(|txn| (*txn).eq(&tx0))); assert!(transactions.iter().any(|txn| (*txn).eq(&tx1)));