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

Move code to check_program_modification_slot out of SVM #329

Merged

Conversation

pgarg66
Copy link

@pgarg66 pgarg66 commented Mar 19, 2024

Problem

The code to check_program_modification_slot doesn't belong in SVM. It's an implementation detail that should be handled by the user of SVM.

Summary of Changes

Move the code out of SVM and call it using a trait method.

Fixes #

dmakarov
dmakarov previously approved these changes Mar 19, 2024
svm/src/transaction_processor.rs Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.9%. Comparing base (e8526f6) to head (8fbd9b4).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master     #329     +/-   ##
=========================================
- Coverage    81.9%    81.9%   -0.1%     
=========================================
  Files         837      837             
  Lines      226874   226873      -1     
=========================================
- Hits       185868   185835     -33     
- Misses      41006    41038     +32     

@pgarg66 pgarg66 marked this pull request as ready for review March 20, 2024 04:54
@pgarg66 pgarg66 requested review from dmakarov and LucasSte March 20, 2024 04:54
Comment on lines +107 to +109
fn get_program_match_criteria(&self, _program: &Pubkey) -> LoadedProgramMatchCriteria {
LoadedProgramMatchCriteria::NoCriteria
}

Choose a reason for hiding this comment

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

Shouldn't we leave the default implementation empty?

Copy link
Author

Choose a reason for hiding this comment

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

This behavior is very Solana specific. If other users can handle cold starts better, they shouldn't need to implement this function. So there's a default implementation.

@pgarg66 pgarg66 merged commit aba8ce5 into anza-xyz:master Mar 20, 2024
35 checks passed
@pgarg66 pgarg66 deleted the simplify-check_program_modification_slot branch March 20, 2024 12:39
codebender828 pushed a commit to codebender828/agave that referenced this pull request Oct 3, 2024
* Move code to check_program_modification_slot out of SVM

* add documentation for the public function
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.

4 participants