Skip to content

Commit

Permalink
Rename genesis block to genesis config (solana-labs#6816)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry authored Nov 9, 2019
1 parent 63425be commit 9807f47
Show file tree
Hide file tree
Showing 79 changed files with 1,105 additions and 1,095 deletions.
14 changes: 7 additions & 7 deletions banking_bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rayon::prelude::*;
use solana_core::banking_stage::{create_test_recorder, BankingStage};
use solana_core::cluster_info::ClusterInfo;
use solana_core::cluster_info::Node;
use solana_core::genesis_utils::{create_genesis_block, GenesisBlockInfo};
use solana_core::genesis_utils::{create_genesis_config, GenesisConfigInfo};
use solana_core::packet::to_packets_chunked;
use solana_core::poh_recorder::PohRecorder;
use solana_core::poh_recorder::WorkingBankEntry;
Expand Down Expand Up @@ -102,29 +102,29 @@ fn main() {
const PACKETS_PER_BATCH: usize = 192;
let txes = PACKETS_PER_BATCH * num_threads * CHUNKS;
let mint_total = 1_000_000_000_000;
let GenesisBlockInfo {
genesis_block,
let GenesisConfigInfo {
genesis_config,
mint_keypair,
..
} = create_genesis_block(mint_total);
} = create_genesis_config(mint_total);

let (verified_sender, verified_receiver) = unbounded();
let (vote_sender, vote_receiver) = unbounded();
let bank0 = Bank::new(&genesis_block);
let bank0 = Bank::new(&genesis_config);
let mut bank_forks = BankForks::new(0, bank0);
let mut bank = bank_forks.working_bank();

info!("threads: {} txs: {}", num_threads, txes);

let mut transactions = make_accounts_txs(txes, &mint_keypair, genesis_block.hash());
let mut transactions = make_accounts_txs(txes, &mint_keypair, genesis_config.hash());

// fund all the accounts
transactions.iter().for_each(|tx| {
let fund = system_transaction::transfer(
&mint_keypair,
&tx.message.account_keys[0],
mint_total / txes as u64,
genesis_block.hash(),
genesis_config.hash(),
);
let x = bank.process_transaction(&fund);
x.unwrap();
Expand Down
16 changes: 8 additions & 8 deletions bench-tps/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ mod tests {
use solana_runtime::bank_client::BankClient;
use solana_sdk::client::SyncClient;
use solana_sdk::fee_calculator::FeeCalculator;
use solana_sdk::genesis_block::create_genesis_block;
use solana_sdk::genesis_config::create_genesis_config;

#[test]
fn test_switch_directions() {
Expand All @@ -1057,8 +1057,8 @@ mod tests {

#[test]
fn test_bench_tps_bank_client() {
let (genesis_block, id) = create_genesis_block(10_000);
let bank = Bank::new(&genesis_block);
let (genesis_config, id) = create_genesis_config(10_000);
let bank = Bank::new(&genesis_config);
let clients = vec![BankClient::new(bank)];

let mut config = Config::default();
Expand All @@ -1075,8 +1075,8 @@ mod tests {

#[test]
fn test_bench_tps_fund_keys() {
let (genesis_block, id) = create_genesis_block(10_000);
let bank = Bank::new(&genesis_block);
let (genesis_config, id) = create_genesis_config(10_000);
let bank = Bank::new(&genesis_config);
let client = BankClient::new(bank);
let tx_count = 10;
let lamports = 20;
Expand All @@ -1096,10 +1096,10 @@ mod tests {

#[test]
fn test_bench_tps_fund_keys_with_fees() {
let (mut genesis_block, id) = create_genesis_block(10_000);
let (mut genesis_config, id) = create_genesis_config(10_000);
let fee_calculator = FeeCalculator::new(11, 0);
genesis_block.fee_calculator = fee_calculator;
let bank = Bank::new(&genesis_block);
genesis_config.fee_calculator = fee_calculator;
let bank = Bank::new(&genesis_config);
let client = BankClient::new(bank);
let tx_count = 10;
let lamports = 20;
Expand Down
Loading

0 comments on commit 9807f47

Please sign in to comment.