Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces ReadAccountMapEntry in slots_by_pubkey() #35241

Merged

Conversation

brooksprumo
Copy link
Contributor

Problem

See #34786 for background.

We want to limit the use of ReadAccountMapEntry, from AccountsIndex, everywhere. Ultimately removing it once there are no more uses.

Bank tests uses AccountsIndex::get(), which calls AccountsIndex::get_account_read_entry(). The slots_by_pubkey() function returns the slots from an entry's slot list as a Vec. We can do the same thing with get_and_then(), instead of get().

Summary of Changes

  • Uses get_and_then() in slots_by_pubkey()
  • removes unused Ancestors parameter

@brooksprumo brooksprumo self-assigned this Feb 19, 2024
@brooksprumo brooksprumo changed the title Uses get_and_then() in slots_by_pubkey() Replaces ReadAccountMapEntry in slots_by_pubkey() Feb 19, 2024
@brooksprumo brooksprumo marked this pull request as ready for review February 19, 2024 16:29
Copy link

codecov bot commented Feb 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4b65cc8) 81.6% compared to head (aa0f2cb) 81.6%.
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #35241     +/-   ##
=========================================
- Coverage    81.6%    81.6%   -0.1%     
=========================================
  Files         833      833             
  Lines      224765   224770      +5     
=========================================
- Hits       183480   183467     -13     
- Misses      41285    41303     +18     

Copy link
Contributor

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@brooksprumo brooksprumo merged commit d88b7d9 into solana-labs:master Feb 20, 2024
35 checks passed
@brooksprumo brooksprumo deleted the self-ref/2/bank-slots_by_pubkey branch February 20, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants