Skip to content
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

Merged
merged 2 commits into from
Mar 8, 2022

Conversation

tao-stones
Copy link
Contributor

@tao-stones tao-stones commented Mar 7, 2022

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 testnet

Summary of Changes

  • Add an optional Cli command line param, additional-fee, if it is provided, a compute-budget instruction with additional_fee will be included ping transaction to increase its fee-per-cu.
  • if zero 0 is specified as additional-fee value, default lamports for 1 signature and 1 write lock will be used.

Fixes #

@tao-stones tao-stones force-pushed the additional-fee-for-ping branch 2 times, most recently from 521af9a to 67fb6d3 Compare March 7, 2022 20:57
Copy link
Contributor

@CriesofCarrots CriesofCarrots left a 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 Show resolved Hide resolved
Comment on lines 1437 to 1414
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()))
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)

Copy link
Contributor

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! 😝)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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 Show resolved Hide resolved
additional_fee = default_fee_structure
.get_max_fee(signature_count, write_lock_count)
.try_into()
.unwrap();
Copy link
Contributor

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?

Copy link
Contributor Author

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 Show resolved Hide resolved
cli/src/cluster_query.rs Outdated Show resolved Hide resolved
Comment on lines 1437 to 1414
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()))
}
Copy link
Contributor

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! 😝)

cli/src/cluster_query.rs Outdated Show resolved Hide resolved
cli/src/cluster_query.rs Outdated Show resolved Hide resolved
cli/src/cluster_query.rs Outdated Show resolved Hide resolved
cli/src/cluster_query.rs Show resolved Hide resolved
@mergify mergify bot dismissed t-nelson’s stale review March 7, 2022 22:54

Pull request has been modified.

CriesofCarrots
CriesofCarrots previously approved these changes Mar 8, 2022
Copy link
Contributor

@CriesofCarrots CriesofCarrots left a 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

cli/src/cluster_query.rs Show resolved Hide resolved
cli/src/cluster_query.rs Outdated Show resolved Hide resolved
t-nelson
t-nelson previously approved these changes Mar 8, 2022
Copy link
Contributor

@t-nelson t-nelson left a 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]>
@mergify mergify bot dismissed stale reviews from CriesofCarrots and t-nelson March 8, 2022 01:52

Pull request has been modified.

@tao-stones tao-stones added the automerge Merge this Pull Request automatically once CI passes label Mar 8, 2022
@mergify mergify bot merged commit e790d0f into solana-labs:master Mar 8, 2022
@codecov
Copy link

codecov bot commented Mar 8, 2022

Codecov Report

Merging #23513 (c435f60) into master (eff085f) will increase coverage by 0.1%.
The diff coverage is 88.2%.

@@            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     

@github-actions
Copy link
Contributor

This PR has been automatically locked since there has not been any activity in past 14 days after it was merged.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes locked PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants