-
Notifications
You must be signed in to change notification settings - Fork 369
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
add tx_priority_fee argument for program deploy subcommand #312
add tx_priority_fee argument for program deploy subcommand #312
Conversation
apologies for creating a new pr |
found a workaround for setting compute units based on programs i have added 2000 cu when program is neither system_program or bpf_upgradable_loader |
3b368f8
to
8e10829
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.
None of the set_compute_budget_ixs_if_needed
call-sites pass the actual message instructions into the function so the compute_unit_limit
isn't being set properly.
let mut initial_instructions: Vec<Instruction> = Vec::new(); | ||
|
||
set_compute_budget_ixs_if_needed(&mut initial_instructions, &compute_unit_price); | ||
initial_instructions.extend(ixs); |
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.
Compute budget instructions should only be added if !ixs.is_empty()
let mut initial_instructions: Vec<Instruction> = Vec::new(); | ||
|
||
(initial_message, write_messages, balance_needed) | ||
set_compute_budget_ixs_if_needed(&mut initial_instructions, &compute_unit_price); | ||
initial_instructions.extend(ixs); |
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.
Same here, need to check if !ixs.is_empty()
first
ixs.push(ComputeBudgetInstruction::set_compute_unit_limit( | ||
compute_units_required_for_ixs + compute_units_for_compute_budget_ixs, | ||
)); | ||
ixs.push(ComputeBudgetInstruction::set_compute_unit_price( | ||
*compute_unit_price, | ||
)); |
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.
compute budget instructions need to be inserted at the beginning of the instruction list
@@ -247,6 +247,7 @@ fn run_transactions_dos( | |||
upgrade_authority_signer_index: 0, | |||
is_final: true, | |||
max_len: None, | |||
compute_unit_price, |
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.
compute_unit_price, | |
compute_unit_price: None, |
|
||
let upgrade_authority = Keypair::new(); | ||
|
||
config.json_rpc_url = "https://api.devnet.solana.com".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.
We should not be using devnet for tests...
@Nagaprasadvr thanks for getting this started but I'm going to take this over since the tests need a lot of work and I want this PR merged relatively quickly if possible. |
sure im happy with that ! program deployments have been failing recently for big programs hope this fix will help that ! |
Moved to #364 |
Issue - #21
Add Transaction priority fee argument in terms of micro LAMPORTS to solana program deploy subcommand
Problem
solana program deploy command could take a lot of time to finish due to program code size .Transaction execution speeds
can be increased or txs can be prioritised by setting compute_unit_price (priority fee) for every tx this price is set and txs
are executes faster than normal therefore making program deployment faster.
usage - solana program deploy --tx-priority-fee 1000000
Summary of Changes
solana/cli/program - added tx_priority_fee logic