-
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
Optional Cli parameter to add additional-fee to solana ping #23513
Optional Cli parameter to add additional-fee to solana ping #23513
Conversation
521af9a
to
67fb6d3
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.
Looking good! Just nits
cli/src/cluster_query.rs
Outdated
if let Some(compute_budget_ix) = build_compute_budget_instruction(additional_fee) { | ||
Message::new(&[ix, compute_budget_ix], Some(&config.signers[0].pubkey())) | ||
} else { | ||
Message::new(&[ix], Some(&config.signers[0].pubkey())) | ||
} |
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.
if let Some(compute_budget_ix) = build_compute_budget_instruction(additional_fee) { | |
Message::new(&[ix, compute_budget_ix], Some(&config.signers[0].pubkey())) | |
} else { | |
Message::new(&[ix], Some(&config.signers[0].pubkey())) | |
} | |
let mut ixs = vec![system_instruction::transfer(&config.signers[0].pubkey(), &to, lamports)]; | |
if let Some(additional_fee) = additional_fee { | |
ixs.push(build_compute_budget_instruction(additional_fee)); | |
} | |
Message::new(&ixs, Some(&config.signers[0].pubkey())) |
Nit: I think this is slightly easier to grok, and more DRY.
Will need to remove previous line (github wouldn't let me make a suggestion on it since it's not part of diff)
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.
IIRC compute budget IXs MUST be first (but after nonce! 😝)
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.
think it just needs to be in the first 3 IXs: https://github.com/solana-labs/solana/blob/master/program-runtime/src/compute_budget.rs#L112-L115
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.
Ah, "otherwise ignored." I must've missed that during compute budget review, or else I'd have complained 😅
@jackcmay should ComputeBudget
instructions be prefixed by convention even though we aren't enforcing it?
cli/src/cluster_query.rs
Outdated
additional_fee = default_fee_structure | ||
.get_max_fee(signature_count, write_lock_count) | ||
.try_into() | ||
.unwrap(); |
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.
Can we make this an expect()
and explain why we think get_max_fee()
won't ever return > u32::MAX?
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.
yep, remove this block of code
cli/src/cluster_query.rs
Outdated
if let Some(compute_budget_ix) = build_compute_budget_instruction(additional_fee) { | ||
Message::new(&[ix, compute_budget_ix], Some(&config.signers[0].pubkey())) | ||
} else { | ||
Message::new(&[ix], Some(&config.signers[0].pubkey())) | ||
} |
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.
IIRC compute budget IXs MUST be first (but after nonce! 😝)
Co-authored-by: Tyera Eulberg <[email protected]> Co-authored-by: Trent Nelson <[email protected]>
cc1c2c6
to
a29ff69
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 and slim now, lgtm
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.
r+. lgtm with Tyera's help string correction and a comment from Jack RE prefixing compute budget IXs
correct the help message for arg Co-authored-by: Tyera Eulberg <[email protected]>
Pull request has been modified.
Codecov Report
@@ Coverage Diff @@
## master #23513 +/- ##
=========================================
+ Coverage 81.3% 81.4% +0.1%
=========================================
Files 572 575 +3
Lines 155876 156618 +742
=========================================
+ Hits 126815 127618 +803
+ Misses 29061 29000 -61 |
This PR has been automatically locked since there has not been any activity in past 14 days after it was merged. |
Problem
During testnet bench tps test, Solana Ping transactions are not landing, therefore not showing on Explorer status. Can add additional-fee to Ping transactions to allow landing even during bench tps test.
Note: it requires
tx_wide_compute_cap
feature to be turned on, and leader-qos (#23257) landed in testnetSummary of Changes
additional-fee
, if it is provided, acompute-budget
instruction with additional_fee will be included ping transaction to increase its fee-per-cu.0
is specified as additional-fee value, default lamports for 1 signature and 1 write lock will be used.Fixes #