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

SVM: change modified programs result to hash map #1391

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

buffalojoec
Copy link

Problem

Currently, the SVM's TransactionResult requires a full local program cache
instance to return the programs modified by the transaction batch. This can
be done more elegantly with a hash map.

Furthermore, other crates who must mock out SVM transaction results can
now simply use HashMap::new(), and forego having to drag in types from
solana-program-runtime. This even removes the dependency from AccountsDB
altogether.

Summary of Changes

Change programs_modified_by_tx in the SVM's TransactionResult to be a
HashMap<Pubkey, Arc<ProgramCacheEntry>>.

@buffalojoec buffalojoec marked this pull request as ready for review May 16, 2024 19:24
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.7%. Comparing base (e01278e) to head (242a8ae).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1391   +/-   ##
=======================================
  Coverage    82.7%    82.7%           
=======================================
  Files         872      872           
  Lines      369436   369439    +3     
=======================================
+ Hits       305779   305803   +24     
+ Misses      63657    63636   -21     

@buffalojoec
Copy link
Author

@Lichtso @pgarg66 This change tees up my next PR, which unifies the two local program cache instances.

@buffalojoec buffalojoec added the automerge automerge Merge this Pull Request automatically once CI passes label Jun 12, 2024
@mergify mergify bot merged commit 5148dcc into anza-xyz:master Jun 12, 2024
52 checks passed
samkim-crypto pushed a commit to samkim-crypto/agave that referenced this pull request Jul 31, 2024
* SVM: change modified programs result to hash map

* take entries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants