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 filter_executable_program_accounts to bank.rs #34004

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

pgarg66
Copy link
Contributor

@pgarg66 pgarg66 commented Nov 9, 2023

Problem

Accounts::filter_executable_program_accounts() makes accounts API complicated. Implementing it via trait/interface for standalone SVM will make it unnecessarily complicated.

Summary of Changes

Move filter_executable_program_accounts closer to the call site, so it can be moved into standalone SVM package.

Fixes #

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #34004 (dbbc71f) into master (28e08ac) will decrease coverage by 0.1%.
The diff coverage is 100.0%.

@@            Coverage Diff            @@
##           master   #34004     +/-   ##
=========================================
- Coverage    81.9%    81.9%   -0.1%     
=========================================
  Files         811      811             
  Lines      219427   219412     -15     
=========================================
- Hits       179769   179709     -60     
- Misses      39658    39703     +45     

@pgarg66 pgarg66 marked this pull request as ready for review November 9, 2023 18:44
@pgarg66 pgarg66 requested a review from LucasSte November 9, 2023 18:44
if let Ok(index) = self
.rc
.accounts
.accounts_db
Copy link
Contributor

Choose a reason for hiding this comment

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

As in load_accounts, the only member of self we need for this function is Arc<AccountsDb>.

I was thinking of maintaining the accounts related functions as standalone and receive the Arc<AccountsDb> as a parameter. Do you think this is also valid for this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the final SVM implementation we'll need a trait here instead of a specific class/object. It might be worth keeping the change simple for now. Let's see what trait definition will look like and adjust accordingly.

@pgarg66 pgarg66 merged commit 59eb559 into solana-labs:master Nov 9, 2023
17 checks passed
@pgarg66 pgarg66 deleted the svm branch November 9, 2023 22:40
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.

2 participants