Refactor Accounts Index and AccountsIndexIterator#6923
Merged
jeffwashington merged 4 commits intoanza-xyz:masterfrom Jul 11, 2025
Merged
Refactor Accounts Index and AccountsIndexIterator#6923jeffwashington merged 4 commits intoanza-xyz:masterfrom
jeffwashington merged 4 commits intoanza-xyz:masterfrom
Conversation
HaoranYi
reviewed
Jul 10, 2025
jeffwashington
commented
Jul 10, 2025
jeffwashington
commented
Jul 10, 2025
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6923 +/- ##
=======================================
Coverage 83.2% 83.2%
=======================================
Files 853 853
Lines 377587 377566 -21
=======================================
- Hits 314488 314476 -12
+ Misses 63099 63090 -9 🚀 New features to boost your workflow:
|
HaoranYi
reviewed
Jul 11, 2025
| " slots: {:?}", | ||
| *account_entry.slot_list.read().unwrap() | ||
| ); | ||
| for pubkey in map.keys() { |
HaoranYi
reviewed
Jul 11, 2025
| start_bin: usize, | ||
| end_bin_inclusive: usize, | ||
| items: Vec<(Pubkey, Arc<AccountMapEntry<T>>)>, | ||
| items: Vec<Pubkey>, |
There was a problem hiding this comment.
nit: rename AccountsIndexIterator -> AccountsIndexPubkeyIterator?
There was a problem hiding this comment.
IMO let's rename in a separate PR.
HaoranYi
reviewed
Jul 11, 2025
| @@ -730,21 +730,27 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> AccountsIndex<T, U> { | |||
| for pubkey_list in self.iter(range.as_ref(), returns_items) { | |||
|
I updated the PR title and description to reflect the new changes. |
HaoranYi
approved these changes
Jul 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With the removal of rent scanning, we can cleanup, remove, and then simplify flushing and holding ranges. To facilitate that, we can refactor how scan iterates throug the accounts. Scanning accounts are deprecated behavior, but still possible to call.
From API's perspective, we should not provide APIs which holds Arc<AccountMapEntry> for an entry that is in the accounts-index. That could lead to race conditions with other accounts-db task, such as flush, clean, shrink etc. To mitigate this, we refactor the account index iterator to avoid returning internal data structures directly and instead return lightweight identifiers (i.e., pubkeys).
Summary of Changes
Fixes #