Skip to content

Commit

Permalink
Correctly store ALTs themselves into minimized snapshot (#34134)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun authored Nov 18, 2023
1 parent 7dd8d4b commit 07f1709
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2962,18 +2962,18 @@ impl Blockstore {
if let Ok(entries) = self.get_slot_entries(slot, 0) {
entries.into_par_iter().for_each(|entry| {
entry.transactions.into_iter().for_each(|tx| {
if let Some(lookups) = tx.message.address_table_lookups() {
add_to_set(
&lookup_tables,
lookups.iter().map(|lookup| &lookup.account_key),
);
}
// Attempt to verify transaction and load addresses from the current bank,
// or manually scan the transaction for addresses if the transaction.
if let Ok(tx) = bank.fully_verify_transaction(tx.clone()) {
add_to_set(&result, tx.message().account_keys().iter());
} else {
add_to_set(&result, tx.message.static_account_keys());
if let Some(lookups) = tx.message.address_table_lookups() {
add_to_set(
&lookup_tables,
lookups.iter().map(|lookup| &lookup.account_key),
);
}

let tx = SanitizedVersionedTransaction::try_from(tx)
.expect("transaction failed to sanitize");
Expand All @@ -2993,6 +2993,7 @@ impl Blockstore {
lookup_tables.into_par_iter().for_each(|lookup_table_key| {
bank.get_account(&lookup_table_key)
.map(|lookup_table_account| {
add_to_set(&result, &[lookup_table_key]);
AddressLookupTable::deserialize(lookup_table_account.data()).map(|t| {
add_to_set(&result, &t.addresses[..]);
})
Expand Down

0 comments on commit 07f1709

Please sign in to comment.