Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

accounts-cluster-bench, close all accounts in a sliding window #17993

Merged
merged 2 commits into from
Jun 16, 2021

Conversation

carllin
Copy link
Contributor

@carllin carllin commented Jun 15, 2021

Problem

Can't simulate cleaning of zero-lamport accounts in accounts-cluster-bench unless a sliding window of
created accounts are all eventually zeroed

Summary of Changes

Support closing all accounts in a sliding window

Fixes #

@carllin carllin requested a review from CriesofCarrots June 15, 2021 22:09
@codecov
Copy link

codecov bot commented Jun 16, 2021

Codecov Report

Merging #17993 (6daf7d9) into master (dbd4dc0) will decrease coverage by 0.0%.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           master   #17993     +/-   ##
=========================================
- Coverage    82.6%    82.6%   -0.1%     
=========================================
  Files         435      435             
  Lines      121572   121572             
=========================================
- Hits       100466   100443     -23     
- Misses      21106    21129     +23     

.long("close-frequency")
.takes_value(true)
.value_name("BYTES")
.help(
"Send close transactions after this many accounts created. \
"Every `n` batches, create a batch of close transactions for
the first batch of accounts created.
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
the first batch of accounts created.
the earliest remaining batch of accounts created.

Comment on lines 587 to 589
Note: a `close-frequency` value near or below `batch-size` \
may result in transaction-simulation errors, as the close \
transactions will be submitted before the corresponding \
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this part of the comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the comment!

Comment on lines 480 to 482
let expected_closed = (total_accounts_created as u64
/ (close_nth_batch * batch_size as u64))
* batch_size as u64;
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
let expected_closed = (total_accounts_created as u64
/ (close_nth_batch * batch_size as u64))
* batch_size as u64;
let num_batches_to_close = total_accounts_created as u64
/ (close_nth_batch * batch_size as u64);
let expected_closed = num_batches_to_close * batch_size as u64;

Total nit, but just makes it a little more clear why the batch_sizes don't cancel out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

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.

lgtm!

@carllin carllin added the v1.7 label Jun 16, 2021
@carllin carllin merged commit ed18add into solana-labs:master Jun 16, 2021
mergify bot pushed a commit that referenced this pull request Jun 16, 2021
mergify bot added a commit that referenced this pull request Jun 16, 2021
@brooksprumo brooksprumo mentioned this pull request Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants