-
Notifications
You must be signed in to change notification settings - Fork 636
Feature - UpgradeableLoaderInstruction::ExtendProgramChecked
#6131
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
Feature - UpgradeableLoaderInstruction::ExtendProgramChecked
#6131
Conversation
The Firedancer team maintains a line-for-line reimplementation of the |
e93ec72
to
435b3c6
Compare
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.
Just a fly-by review, the program logic looks great to me, just some small comments on the CLI and tests
8e7ef1f
to
c79ac7a
Compare
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.
Just a couple of last things, and thanks for fixing up the tests, they look great!
c79ac7a
to
baba6ec
Compare
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.
Just the last bit from my side, then this is ready to go in!
edf3150
to
6f70d23
Compare
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.
Looks like there's just some lockfile changes to commit, then this is good to go!
042ef6f
to
f64f03c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6131 +/- ##
=========================================
- Coverage 82.8% 82.8% -0.1%
=========================================
Files 843 843
Lines 378109 378209 +100
=========================================
+ Hits 313134 313197 +63
- Misses 64975 65012 +37 🚀 New features to boost your workflow:
|
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.
Looks great to me, thanks for addressing all the points!
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.
Looks good, just a few small items from me!
if invoke_context | ||
.get_feature_set() | ||
.enable_extend_program_checked | ||
{ |
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 might be nice to add a log message for the developer! I guess for either one.
programs/bpf_loader/src/lib.rs
Outdated
const PROGRAM_DATA_ACCOUNT_INDEX: IndexOfAccount = 0; | ||
const PROGRAM_ACCOUNT_INDEX: IndexOfAccount = 1; | ||
const AUTHORITY_ACCOUNT_INDEX: IndexOfAccount = 2; | ||
let optional_payer_account_index = if check_authority { 4 } else { 3 }; |
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 kind of note here about the system program being at index 2 or 3, based on the authority check, would be nice for other maintainers.
"additionalBytes": additional_bytes, | ||
"programDataAccount": account_keys[instruction.accounts[0] as usize].to_string(), | ||
"programAccount": account_keys[instruction.accounts[1] as usize].to_string(), | ||
"authority": account_keys[instruction.accounts[2] as usize].to_string(), |
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 think you need a .len() > 2
check here, since the call to check_num_bpf_upgradeable_loader_accounts
will only check loader v3 accounts, not the authority, which is most likely owned by System.
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 extra check isn't necessary, the function is just poorly named. It checks for all accounts, not just ones owned by the loader program:
agave/transaction-status/src/parse_bpf_loader.rs
Lines 208 to 213 in a9bb1ba
fn check_num_bpf_upgradeable_loader_accounts( | |
accounts: &[u8], | |
num: usize, | |
) -> Result<(), ParseInstructionError> { | |
check_num_accounts(accounts, num, ParsableProgram::BpfUpgradeableLoader) | |
} |
dae745e
to
019ec1d
Compare
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.
Nice!
019ec1d
to
eb3e328
Compare
9f721b9
to
fc57f4a
Compare
fc57f4a
to
71e26b5
Compare
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis. |
* Bumps solana-loader-v3-interface version. * Adds the feature. * Adds feature gating logic. * Adjusts transaction-status parser. * Adjusts CLI manual extend and auto extend. * Adds authority_signer_index to ProgramCliCommand::ExtendProgramChecked. * Adjusts solana-bpf-loader-program-tests. (cherry picked from commit 94d70cd) # Conflicts: # Cargo.lock # feature-set/src/lib.rs # genesis/Cargo.toml # programs/bpf-loader-tests/tests/extend_program_ix.rs # programs/sbf/Cargo.lock # programs/sbf/Cargo.toml # runtime/Cargo.toml # svm-feature-set/src/lib.rs # svm/Cargo.toml # svm/examples/Cargo.lock # transaction-status/Cargo.toml
* Bumps solana-loader-v3-interface version. * Adds the feature. * Adds feature gating logic. * Adjusts transaction-status parser. * Adjusts CLI manual extend and auto extend. * Adds authority_signer_index to ProgramCliCommand::ExtendProgramChecked. * Adjusts solana-bpf-loader-program-tests. (cherry picked from commit 94d70cd)
* Bumps solana-loader-v3-interface version. * Adds the feature. * Adds feature gating logic. * Adjusts transaction-status parser. * Adjusts CLI manual extend and auto extend. * Adds authority_signer_index to ProgramCliCommand::ExtendProgramChecked. * Adjusts solana-bpf-loader-program-tests. (cherry picked from commit 94d70cd)
* Bumps solana-loader-v3-interface version. * Adds the feature. * Adds feature gating logic. * Adjusts transaction-status parser. * Adjusts CLI manual extend and auto extend. * Adds authority_signer_index to ProgramCliCommand::ExtendProgramChecked. * Adjusts solana-bpf-loader-program-tests. (cherry picked from commit 94d70cd)
* Bumps solana-loader-v3-interface version. * Adds the feature. * Adds feature gating logic. * Adjusts transaction-status parser. * Adjusts CLI manual extend and auto extend. * Adds authority_signer_index to ProgramCliCommand::ExtendProgramChecked. * Adjusts solana-bpf-loader-program-tests. (cherry picked from commit 94d70cd)
…(backport of #6131) (#6217) Feature - `UpgradeableLoaderInstruction::ExtendProgramChecked` (#6131) * Bumps solana-loader-v3-interface version. * Adds the feature. * Adds feature gating logic. * Adjusts transaction-status parser. * Adjusts CLI manual extend and auto extend. * Adds authority_signer_index to ProgramCliCommand::ExtendProgramChecked. * Adjusts solana-bpf-loader-program-tests. (cherry picked from commit 94d70cd) Co-authored-by: Alexander Meißner <[email protected]>
See SIMD-0164.
Feature Gate Issue: #87