-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Find and load missing programs in LoadedPrograms cache #30275
Conversation
b706e0a
to
f43f41f
Compare
2a89875
to
37cc11f
Compare
37cc11f
to
d7a80c8
Compare
932f1e5
to
0393038
Compare
@@ -43,7 +43,7 @@ impl TransactionExecutorCache { | |||
|
|||
pub fn set_tombstone(&mut self, key: Pubkey) { | |||
self.visible | |||
.insert(key, Arc::new(LoadedProgram::new_tombstone())); | |||
.insert(key, Arc::new(LoadedProgram::new_tombstone(0))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be clock.slot
not 0
because it is used for re-/un-deployment.
/// This behaves differently than `insert_entry()` in case there's currently a program at the | ||
/// `deploytment_slot`. It'll replace the current entry with a tombstone, whereas `insert_entry()` | ||
/// would retain and return the current entry. | ||
pub fn set_tombstone(&mut self, key: Pubkey, deployment_slot: Slot) -> Arc<LoadedProgram> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not feel like the right abstraction, because all forms of un/re/deployment should use the same insert method, including tombstones.
However, the current insert method covers both: Normal loading for execution and program-management-instructions. So maybe that should be split into two insert methods. One for program-management-instructions which can only add entries and never overwrite. And one for normal execution which can unify duplicate loads.
- filter program accounts in a transaction batch - filter the accounts that are missing in LoadedPrograms cache - load the programs before processing the transactions - unit tests
0393038
to
a2d6f6e
Compare
…0275) * Find and load missing programs in LoadedPrograms cache - filter program accounts in a transaction batch - filter the accounts that are missing in LoadedPrograms cache - load the programs before processing the transactions - unit tests * address review comments * fix clippy * address review comments * fix test * fix more tests
Problem
LoadedProgram cache is currently unused.
Summary of Changes
Find and load missing programs in LoadedPrograms cache
Fixes #