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

Check program modification slots during cold start #31331

Merged
merged 6 commits into from
Apr 28, 2023

Conversation

pgarg66
Copy link
Contributor

@pgarg66 pgarg66 commented Apr 24, 2023

Problem

During cold start, the program cache could have an incomplete view of the deployed/modified programs. The cache relies on program management instructions to update and manage program cache entries during regular run time. But, at the startup ledger may have modifications to the program that are not yet rooted (i.e. only valid on certain forks). This can lead to execution of an outdated program.

Summary of Changes

  • Compute the highest slot in the startup/snapshot ledger
  • Until the root slot moves past the highest slot, do the following
    • Read the program state to find the deployment slot.
    • If the deployment slot is in future compared to the program entry in the cache, treat the program as missing in the cache.
    • This will trigger the reloading of the program by reading the program account visible on the current slot.

Fixes #

@pgarg66 pgarg66 requested a review from Lichtso April 24, 2023 19:48
@pgarg66 pgarg66 marked this pull request as ready for review April 24, 2023 19:57
@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

Merging #31331 (7ca824f) into master (2dcdfff) will increase coverage by 0.0%.
The diff coverage is 76.4%.

@@           Coverage Diff            @@
##           master   #31331    +/-   ##
========================================
  Coverage    81.5%    81.5%            
========================================
  Files         734      734            
  Lines      207153   207288   +135     
========================================
+ Hits       168955   169073   +118     
- Misses      38198    38215    +17     

@pgarg66 pgarg66 force-pushed the deployment-slot-check branch 3 times, most recently from c92b619 to 3ac804c Compare April 25, 2023 23:02
@yihau
Copy link
Member

yihau commented Apr 26, 2023

#31348 has been merged. could you try to rebase again? thank you for your patient!

@pgarg66 pgarg66 requested a review from Lichtso April 27, 2023 01:23
@pgarg66 pgarg66 merged commit 94dc8fe into solana-labs:master Apr 28, 2023
@pgarg66 pgarg66 deleted the deployment-slot-check branch April 28, 2023 13:22
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