From 90b11a608b9c7794ff54c5452e6d439e4dc760c5 Mon Sep 17 00:00:00 2001 From: HaoranYi Date: Tue, 21 Nov 2023 09:27:31 -0600 Subject: [PATCH] refactor AccountsToStore (#34185) Co-authored-by: HaoranYi --- accounts-db/src/accounts_db.rs | 2 +- accounts-db/src/ancient_append_vecs.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index bbeee4c01..fc4e9d4d4 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -378,7 +378,7 @@ impl CurrentAncientAppendVec { let accounts = accounts_to_store.get(storage_selector); db.store_accounts_frozen( - (self.slot(), accounts, accounts_to_store.slot), + (self.slot(), accounts, accounts_to_store.slot()), None::>, self.append_vec(), None, diff --git a/accounts-db/src/ancient_append_vecs.rs b/accounts-db/src/ancient_append_vecs.rs index 78951c5e0..4e113a771 100644 --- a/accounts-db/src/ancient_append_vecs.rs +++ b/accounts-db/src/ancient_append_vecs.rs @@ -867,7 +867,7 @@ pub struct AccountsToStore<'a> { /// if 'accounts' contains more items than can be contained in the primary storage, then we have to split these accounts. /// 'index_first_item_overflow' specifies the index of the first item in 'accounts' that will go into the overflow storage index_first_item_overflow: usize, - pub slot: Slot, + slot: Slot, } impl<'a> AccountsToStore<'a> { @@ -915,6 +915,10 @@ impl<'a> AccountsToStore<'a> { }; &self.accounts[range] } + + pub fn slot(&self) -> Slot { + self.slot + } } /// capacity of an ancient append vec