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

Cleanup - load_and_get_programs_from_cache() #30959

Merged

Conversation

Lichtso
Copy link
Contributor

@Lichtso Lichtso commented Mar 29, 2023

Problem

Currently the global cache is locked for every single program that is replenished. But one write lock would suffice.
Also, assign_program() should only be used for program management instructions.

Summary of Changes

  • Only lock the global cache once all missing programs have been loaded.
  • Factors out call of self.rc.accounts.filter_executable_program_accounts() into caller.
  • Replaces assign_program() by replenish().
  • Replaces LoadedProgramEntry by a boolean.

@Lichtso Lichtso requested a review from pgarg66 March 29, 2023 11:56
@Lichtso Lichtso force-pushed the cleanup/load_and_get_programs_from_cache branch from aeb2e40 to 957a9cf Compare March 29, 2023 12:12
Copy link
Contributor

@pgarg66 pgarg66 left a comment

Choose a reason for hiding this comment

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

Looks great

@codecov
Copy link

codecov bot commented Mar 29, 2023

Codecov Report

Merging #30959 (957a9cf) into master (2646fb7) will increase coverage by 0.0%.
The diff coverage is 55.9%.

@@           Coverage Diff           @@
##           master   #30959   +/-   ##
=======================================
  Coverage    81.5%    81.5%           
=======================================
  Files         728      728           
  Lines      205467   205430   -37     
=======================================
- Hits       167532   167507   -25     
+ Misses      37935    37923   -12     

@Lichtso Lichtso merged commit a6ad37f into solana-labs:master Mar 29, 2023
@Lichtso Lichtso deleted the cleanup/load_and_get_programs_from_cache branch March 29, 2023 14:11
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.

None yet

2 participants