Sort bench-tps keypairs (#5254)

automerge
This commit is contained in:
Tyera Eulberg 2019-07-23 18:46:33 -06:00 committed by Grimes
parent 8a12ed029c
commit 26e380e53c
1 changed files with 5 additions and 1 deletions

View File

@ -6,7 +6,7 @@ use crate::bench::{
};
use solana::gossip_service::{discover_cluster, get_multi_client};
use solana_sdk::fee_calculator::FeeCalculator;
use solana_sdk::signature::Keypair;
use solana_sdk::signature::{Keypair, KeypairUtil};
use std::collections::HashMap;
use std::fs::File;
use std::io::prelude::*;
@ -91,6 +91,10 @@ fn main() {
keypairs.push(Keypair::from_bytes(&bytes).unwrap());
last_balance = balance;
});
// Sort keypairs so that do_bench_tps() uses the same subset of accounts for each run.
// This prevents the amount of storage needed for bench-tps accounts from creeping up
// across multiple runs.
keypairs.sort_by(|x, y| x.pubkey().to_string().cmp(&y.pubkey().to_string()));
(keypairs, last_balance)
} else {
generate_and_fund_keypairs(