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

Feature - ProgramCache index implementation switch #1269

Merged
merged 3 commits into from
May 10, 2024

Conversation

Lichtso
Copy link

@Lichtso Lichtso commented May 9, 2024

Problem

The current index structure in ProgramCache is to complex to reason about and maintain. A simpler index structure which uses the account-last-written-to-slot from the accounts-db instead of a slot version sequence is planned to replace it.
However, we want to be able to switch between the implementations easily to make sure they agree before removing the old one.

Summary of Changes

  • Adds the enum IndexImplementation as a global switch.
  • Inserts match self.index in all methods of ProgramCache which use entries or loading_entries.
  • Removes direct usage of ProgramCache::entries in tests.

@Lichtso Lichtso force-pushed the feature/program_cache_index branch 2 times, most recently from 2842936 to 1a7ca88 Compare May 9, 2024 19:38
@codecov-commenter
Copy link

codecov-commenter commented May 9, 2024

Codecov Report

Attention: Patch coverage is 94.73684% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 82.1%. Comparing base (e621336) to head (8e87677).
Report is 6 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1269    +/-   ##
========================================
  Coverage    82.1%    82.1%            
========================================
  Files         899      899            
  Lines      237263   237296    +33     
========================================
+ Hits       194810   194913   +103     
+ Misses      42453    42383    -70     

@Lichtso Lichtso force-pushed the feature/program_cache_index branch from 1a7ca88 to 8e87677 Compare May 10, 2024 17:11
@Lichtso Lichtso requested a review from buffalojoec May 10, 2024 20:02
@Lichtso Lichtso merged commit 9c3c252 into anza-xyz:master May 10, 2024
38 checks passed
@Lichtso Lichtso deleted the feature/program_cache_index branch May 10, 2024 23:17
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.

3 participants