-
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
Code to load a program from its account #30282
Conversation
e49b0f5
to
a349b74
Compare
impl LoadedPrograms { | ||
/// Inserts a single entry | ||
pub fn insert_entry(&mut self, key: Pubkey, entry: LoadedProgram) -> bool { | ||
pub fn insert_entry(&mut self, key: Pubkey, entry: LoadedProgram) -> LoadedProgramEntry { |
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 don't think this change belongs into this PR.
At least insert_entry()
is not used yet.
programs/bpf_loader/src/lib.rs
Outdated
let loaded_program = LoadedProgram::new( | ||
program.get_owner(), | ||
loader, | ||
0, // Fill in the deployment slot of the program |
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.
TODO left.
This could be returned in get_programdata_offset()
:
solana/programs/bpf_loader/src/lib.rs
Line 197 in a349b74
slot: _, |
And maybe rename it to
get_programdata_offset_and_deployment_slot()
.
a349b74
to
c7ae903
Compare
Problem
Need API to load a program from its program and programdata account.
Summary of Changes
Added a new API to bpf_loader to load the program. Also updated
LoadedProgram
structure to store more meta data about the program.Fixes #