Tick entry ids as only valid last_ids (#1441)

Generate tick entry ids and only register ticks as the last_id expected by the bank.  Since the bank is MT, the in-flight pipeline of transactions cannot be close to the end of the queue or there is a high possibility that a starved thread will encode an expired last_id into the ledger.  The banking_stage therefore uses a shorter age limit for encoded last_ids then the validators.

Bench client doesn't send transactions that are older then 30 seconds.
This commit is contained in:
anatoly yakovenko
2018-10-10 17:23:06 -07:00
committed by GitHub
parent 5c523716aa
commit 5c85e037f8
9 changed files with 307 additions and 167 deletions

View File

@@ -28,17 +28,14 @@ fn bench_process_transaction(bencher: &mut Bencher) {
&mint.keypair(),
rando0.pubkey(),
10_000,
mint.last_id(),
bank.last_id(),
0,
);
assert_eq!(bank.process_transaction(&tx), Ok(()));
// Seed the 'to' account and a cell for its signature.
let last_id = hash(&serialize(&i).unwrap()); // Unique hash
bank.register_entry_id(&last_id);
let rando1 = Keypair::new();
let tx = Transaction::system_move(&rando0, rando1.pubkey(), 1, last_id, 0);
let tx = Transaction::system_move(&rando0, rando1.pubkey(), 1, bank.last_id(), 0);
assert_eq!(bank.process_transaction(&tx), Ok(()));
// Finally, return the transaction to the benchmark.