-
Notifications
You must be signed in to change notification settings - Fork 337
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
Adjustments of loader-v4 (part 3) #2821
Conversation
The Firedancer team maintains a line-for-line reimplementation of the |
(program_keypair, instruction) | ||
} | ||
|
||
pub fn load_program<T: Client>( |
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.
Was this function unused?
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.
Yes they were for the loaders-v1 and v2, which we deprecated.
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.
So these are pure deletion of the code. The new functions are not related to these.
(trying to avoid comparing two independent functions).
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.
Yes, implementation / code wise they are unrelated. Conceptually they are related because these are their replacements but for the newest loader. However, loader-v4 is closest to loader-v3 so comparing the new functions against load_upgradeable_program_and_advance_slot()
makes more sense.
runtime/src/loader_utils.rs
Outdated
for (index, instruction) in instructions.into_iter().enumerate() { | ||
let message = Message::new(&[instruction], Some(&payer_keypair.pubkey())); | ||
bank_client | ||
.send_and_confirm_message(signers[index.min(signers.len() - 1)], message) |
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.
Some documentation will be helpful here, as to why we are doing signers[index.min(signers.len() - 1)]
. I am able to understand it right now, but may not be obvious for the future maintainers.
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.
I reimplemented it using iterators instead of indices, hopefully that makes it self explanatory.
@@ -279,7 +280,7 @@ pub fn process_instruction_deploy( | |||
}; | |||
let executor = ProgramCacheEntry::new( | |||
&loader_v4::id(), | |||
environments.program_runtime_v2.clone(), | |||
environments.program_runtime_v1.clone(), |
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.
Should we split this in its own PR?
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.
The code looks good to me. Can we add some tests? |
…loader_v4(). Removes load_and_finalize_program() and load_program().
b280978
to
b9d5608
Compare
* Fixes two bugs in loader-v4. * Adds instructions_to_load_program_of_loader_v4() and load_program_of_loader_v4(). Removes load_and_finalize_program() and load_program().
Problem
Continuation of #2750.
Summary of Changes
load_and_finalize_program()
andload_program()
in loader utils.instructions_to_load_program_of_loader_v4()
andload_program_of_loader_v4()
to loader utils.