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

@@ -18,8 +18,10 @@ use solana::ncp::Ncp;
use solana::result;
use solana::service::Service;
use solana::signature::{Keypair, KeypairUtil};
use solana::system_transaction::SystemTransaction;
use solana::thin_client::ThinClient;
use solana::timing::{duration_as_ms, duration_as_s};
use solana::transaction::Transaction;
use solana::window::{default_window, WINDOW_SIZE};
use solana_program_interface::pubkey::Pubkey;
use std::collections::{HashSet, VecDeque};
@@ -1469,10 +1471,9 @@ fn send_tx_and_retry_get_balance(
let mut client = mk_client(leader);
trace!("getting leader last_id");
let last_id = client.get_last_id();
let tx = Transaction::system_new(&alice.keypair(), *bob_pubkey, transfer_amount, last_id);
info!("executing leader transfer");
let _sig = client
.transfer(transfer_amount, &alice.keypair(), *bob_pubkey, &last_id)
.unwrap();
let _res = client.retry_transfer_signed(&tx, 30);
retry_get_balance(&mut client, bob_pubkey, expected)
}