solana icon indicating copy to clipboard operation
solana copied to clipboard

Replaces ReadAccountMapEntry in read_index_for_accessor_or_load_slow()

Open brooksprumo opened this issue 1 year ago • 1 comments

Problem

See https://github.com/solana-labs/solana/issues/34786 for background.

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

When reading the index for an account accessor, we currently use ReadAccountMapEntry via AccountsIndex::get(). But we can do it other ways without ReadAccountMapEntry.

Summary of Changes

Adds get_with_and_then() and uses it in read_index_for_accessor_or_load_slow()

brooksprumo avatar Feb 16 '24 22:02 brooksprumo

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #35220     +/-   ##
=========================================
- Coverage    81.6%    81.6%   -0.1%     
=========================================
  Files         833      833             
  Lines      224765   224776     +11     
=========================================
- Hits       183480   183476      -4     
- Misses      41285    41300     +15     

codecov[bot] avatar Feb 16 '24 23:02 codecov[bot]

I rebased and force-pushed this branch to pull in #35307.

brooksprumo avatar Feb 24 '24 02:02 brooksprumo