Skip to content

Commit

Permalink
reforkering
Browse files Browse the repository at this point in the history
fmt

rebase forkup

fixing build all

leave the last block open

more tests

rebase fix

replay test fix

rollback depth parameter

cleanup

better replay stage

s/finalized/frozen for bank_checkpoints that are no longer able to write transactions or ticks

remove println

disconnect blob sender so that TVU isn't replyaing onto TPU's fork

finalize()->freeze(), code review comments

rebased

fix window_send_test

remove entries_to_blocks()

guard against too many ticks in a slot

limiting ticks, take #2

more info

fix test_replay_stage_poh_error_entry_receiver

fix leader_scheduler::test_update_height

s/bank_state/bank_fork/g

s/bank_checkpoint/bank_delta/g

fix up stragglers from rename

get it building again.  num_ticks_left_in_slot() should not assume slot from tick_height
  • Loading branch information
aeyakovenko authored and rob-solana committed Feb 7, 2019
1 parent cdb2a7b commit 9b53743
Show file tree
Hide file tree
Showing 27 changed files with 2,111 additions and 1,073 deletions.
19 changes: 13 additions & 6 deletions benches/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use test::Bencher;

#[bench]
fn bench_process_transaction(bencher: &mut Bencher) {
solana_logger::setup();
let (genesis_block, mint_keypair) = GenesisBlock::new(100_000_000);
let bank = Bank::new(&genesis_block);

Expand All @@ -25,31 +26,37 @@ fn bench_process_transaction(bencher: &mut Bencher) {
&mint_keypair,
rando0.pubkey(),
10_000,
bank.last_id(),
bank.active_fork().last_id(),
0,
);
assert_eq!(bank.process_transaction(&tx), Ok(()));

// Seed the 'to' account and a cell for its signature.
let rando1 = Keypair::new();
let tx = SystemTransaction::new_move(&rando0, rando1.pubkey(), 1, bank.last_id(), 0);
let tx = SystemTransaction::new_move(
&rando0,
rando1.pubkey(),
1,
bank.active_fork().last_id(),
0,
);
assert_eq!(bank.process_transaction(&tx), Ok(()));

// Finally, return the transaction to the benchmark.
tx
})
.collect();

let mut id = bank.last_id();
let mut id = bank.active_fork().last_id();

for _ in 0..(MAX_ENTRY_IDS - 1) {
bank.register_tick(&id);
for _ in 0..(MAX_ENTRY_IDS / 2) {
bank.active_fork().register_tick(&id);
id = hash(&id.as_ref())
}

bencher.iter(|| {
// Since benchmarker runs this multiple times, we need to clear the signatures.
bank.clear_signatures();
bank.active_fork().clear_signatures();
let results = bank.process_transactions(&transactions);
assert!(results.iter().all(Result::is_ok));
})
Expand Down
20 changes: 10 additions & 10 deletions benches/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ fn bench_banking_stage_multi_accounts(bencher: &mut Bencher) {
let res = bank.process_transaction(&tx);
assert!(res.is_ok(), "sanity test transactions");
});
bank.clear_signatures();
bank.active_fork().clear_signatures();
//sanity check, make sure all the transactions can execute in parallel
let res = bank.process_transactions(&transactions);
for r in res {
assert!(r.is_ok(), "sanity parallel execution");
}
bank.clear_signatures();
bank.active_fork().clear_signatures();
let verified: Vec<_> = to_packets_chunked(&transactions.clone(), 192)
.into_iter()
.map(|x| {
Expand All @@ -113,19 +113,19 @@ fn bench_banking_stage_multi_accounts(bencher: &mut Bencher) {
let mut id = genesis_block.last_id();
for _ in 0..MAX_ENTRY_IDS {
id = hash(&id.as_ref());
bank.register_tick(&id);
bank.active_fork().register_tick(&id);
}

let half_len = verified.len() / 2;
let mut start = 0;
bencher.iter(move || {
// make sure the transactions are still valid
bank.register_tick(&genesis_block.last_id());
bank.active_fork().register_tick(&genesis_block.last_id());
for v in verified[start..start + half_len].chunks(verified.len() / num_threads) {
verified_sender.send(v.to_vec()).unwrap();
}
check_txs(&signal_receiver, txes / 2);
bank.clear_signatures();
bank.active_fork().clear_signatures();
start += half_len;
start %= verified.len();
});
Expand Down Expand Up @@ -194,13 +194,13 @@ fn bench_banking_stage_multi_programs(bencher: &mut Bencher) {
let res = bank.process_transaction(&tx);
assert!(res.is_ok(), "sanity test transactions");
});
bank.clear_signatures();
bank.active_fork().clear_signatures();
//sanity check, make sure all the transactions can execute in parallel
let res = bank.process_transactions(&transactions);
for r in res {
assert!(r.is_ok(), "sanity parallel execution");
}
bank.clear_signatures();
bank.active_fork().clear_signatures();
let verified: Vec<_> = to_packets_chunked(&transactions.clone(), 96)
.into_iter()
.map(|x| {
Expand All @@ -222,19 +222,19 @@ fn bench_banking_stage_multi_programs(bencher: &mut Bencher) {
let mut id = genesis_block.last_id();
for _ in 0..MAX_ENTRY_IDS {
id = hash(&id.as_ref());
bank.register_tick(&id);
bank.active_fork().register_tick(&id);
}

let half_len = verified.len() / 2;
let mut start = 0;
bencher.iter(move || {
// make sure the transactions are still valid
bank.register_tick(&genesis_block.last_id());
bank.active_fork().register_tick(&genesis_block.last_id());
for v in verified[start..start + half_len].chunks(verified.len() / num_threads) {
verified_sender.send(v.to_vec()).unwrap();
}
check_txs(&signal_receiver, txes / 2);
bank.clear_signatures();
bank.active_fork().clear_signatures();
start += half_len;
start %= verified.len();
});
Expand Down
4 changes: 2 additions & 2 deletions ledger-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fn main() {
}
("verify", _) => {
let bank = Bank::new(&genesis_block);
let mut last_id = bank.last_id();
let mut last_id = bank.active_fork().last_id();
let mut num_entries = 0;
for (i, entry) in entries.enumerate() {
if i >= head {
Expand All @@ -129,7 +129,7 @@ fn main() {
last_id = entry.id;
num_entries += 1;

if let Err(e) = bank.process_entry(&entry) {
if let Err(e) = bank.active_fork().process_entries(&[entry]) {
eprintln!("verify failed at entry[{}], err: {:?}", i + 2, e);
if !matches.is_present("continue") {
exit(1);
Expand Down
Loading

0 comments on commit 9b53743

Please sign in to comment.