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

add filler accounts to bloat validator and predict failure #20491

Merged
merged 8 commits into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/src/accounts_hash_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ impl AccountsHashVerifier {
HashStats::default(),
false,
None,
None, // this will fail with filler accounts
)
.unwrap();

Expand Down
10 changes: 10 additions & 0 deletions ledger-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,12 @@ fn main() {
.validator(is_parsable::<usize>)
.takes_value(true)
.help("How much memory the accounts index can consume. If this is exceeded, some account index entries will be stored on disk. If missing, the entire index is stored in memory.");
let accounts_filler_count = Arg::with_name("accounts_filler_count")
.long("accounts-filler-count")
.value_name("COUNT")
.validator(is_parsable::<usize>)
.takes_value(true)
.help("How many accounts to add to stress the system. Accounts are ignored in operations related to correctness.");
let account_paths_arg = Arg::with_name("account_paths")
.long("accounts")
.value_name("PATHS")
Expand Down Expand Up @@ -1217,6 +1223,7 @@ fn main() {
.arg(&limit_load_slot_count_from_snapshot_arg)
.arg(&accounts_index_bins)
.arg(&accounts_index_limit)
.arg(&accounts_filler_count)
.arg(&verify_index_arg)
.arg(&hard_forks_arg)
.arg(&no_accounts_db_caching_arg)
Expand Down Expand Up @@ -1961,9 +1968,12 @@ fn main() {
accounts_index_config.drives = Some(accounts_index_paths);
}

let filler_account_count = value_t!(arg_matches, "accounts_filler_count", usize).ok();

let accounts_db_config = Some(AccountsDbConfig {
index: Some(accounts_index_config),
accounts_hash_cache_path: Some(ledger_path.clone()),
filler_account_count,
});

let process_options = ProcessOptions {
Expand Down
10 changes: 10 additions & 0 deletions ledger/src/bank_forks_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ pub fn load(
info!("Snapshots disabled; will load from genesis");
}

if process_options
.accounts_db_config
.as_ref()
.and_then(|config| config.filler_account_count)
.unwrap_or_default()
> 0
{
panic!("filler accounts specified, but not loading from snapshot");
}

load_from_genesis(
genesis_config,
blockstore,
Expand Down
1 change: 1 addition & 0 deletions runtime/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ impl Accounts {
key,
&mut account,
rent_for_sysvars,
self.accounts_db.filler_account_suffix.as_ref(),
);
(account, rent_due)
} else {
Expand Down
Loading