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

bench-tps: allow option to not set account data size on every transaction #209

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

anwayde
Copy link

@anwayde anwayde commented Mar 12, 2024

Problem

Bench TPS needs this feature activated on the cluster since all transactions are hardcoded to include the instruction to set the account data size. However, this will not work on a test cluster where this feature is not activated. Moreover, Firedancer currently does not support that instruction.

Summary of Changes

This adds a flag --skip-tx-account-data-size which when specified, will not add that instruction. This makes Bench TPS work with FIredancer (and Solana clusters without any features activated).

Fixes #

Copy link

@KirillLykov KirillLykov left a comment

Choose a reason for hiding this comment

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

looks good except for one small change

@@ -1131,6 +1155,10 @@ pub fn fund_keypairs<T: 'static + BenchTpsClient + Send + Sync + ?Sized>(
return Err(BenchTpsError::AirdropFailure);
}
}
let data_size_limit = match skip_tx_account_data_size {

Choose a reason for hiding this comment

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

I think match is not needed here, can be done with if statement.

Choose a reason for hiding this comment

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

In the light of the Greg's comment, maybe something like:

let data_size_limit = (!skip_tx_account_data_size)
            .then(|| get_transaction_loaded_accounts_data_size(enable_padding));

@gregcusack gregcusack self-requested a review March 12, 2024 17:13
Comment on lines 1158 to 1159
let data_size_limit = match skip_tx_account_data_size {
true => 0,

Choose a reason for hiding this comment

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

using data_size_limit <- 0 to indicate there is no limit is a little confusing. maybe I'd use an Option<u32>. That way if it is Some() then there is a limit and if it is None there is no limit

instructions.push(
ComputeBudgetInstruction::set_loaded_accounts_data_size_limit(data_size_limit),
);
if data_size_limit != 0 {
Copy link

@KirillLykov KirillLykov Mar 13, 2024

Choose a reason for hiding this comment

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

If data_size_limit becomes Option<u32>:

Suggested change
if data_size_limit != 0 {
if let Some(data_size_limit) = data_size_limit {

@anwayde anwayde force-pushed the bench-tps branch 2 times, most recently from e9ea404 to 9139719 Compare March 13, 2024 15:12
Copy link

@gregcusack gregcusack left a comment

Choose a reason for hiding this comment

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

lgtm!

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.9%. Comparing base (e682fec) to head (77b855e).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #209   +/-   ##
=======================================
  Coverage    81.9%    81.9%           
=======================================
  Files         837      837           
  Lines      226539   226490   -49     
=======================================
- Hits       185548   185508   -40     
+ Misses      40991    40982    -9     

@KirillLykov KirillLykov merged commit 926c571 into anza-xyz:master Mar 13, 2024
35 checks passed
Copy link

mergify bot commented Jun 12, 2024

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.

mergify bot pushed a commit that referenced this pull request Jun 12, 2024
…tion (#209)

bench-tps: allow option to not set account data size
(cherry picked from commit 926c571)
codebender828 pushed a commit to codebender828/agave that referenced this pull request Oct 3, 2024
…tion (anza-xyz#209)

bench-tps: allow option to not set account data size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants