Track votes from gossip for optimistic confirmation (#11209)

* Add check in cluster_info_vote_listenere to see if optimstic conf was achieved
Add OptimisticConfirmationVerifier

* More fixes

* Fix merge conflicts

* Remove gossip notificatin

* Add dashboards

* Fix rebase

* Count switch votes as well toward optimistic conf

* rename

Co-authored-by: Carl <carl@solana.com>
This commit is contained in:
carllin
2020-07-28 02:33:27 -07:00
committed by GitHub
parent d9d69eee81
commit a7ea340f22
12 changed files with 1368 additions and 273 deletions

View File

@ -14,13 +14,23 @@ pub fn new_vote_transaction(
node_keypair: &Keypair,
vote_keypair: &Keypair,
authorized_voter_keypair: &Keypair,
switch_proof_hash: Option<Hash>,
) -> Transaction {
let votes = Vote::new(slots, bank_hash);
let vote_ix = vote_instruction::vote(
&vote_keypair.pubkey(),
&authorized_voter_keypair.pubkey(),
votes,
);
let vote_ix = if let Some(switch_proof_hash) = switch_proof_hash {
vote_instruction::vote_switch(
&vote_keypair.pubkey(),
&authorized_voter_keypair.pubkey(),
votes,
switch_proof_hash,
)
} else {
vote_instruction::vote(
&vote_keypair.pubkey(),
&authorized_voter_keypair.pubkey(),
votes,
)
};
let mut vote_tx = Transaction::new_with_payer(&[vote_ix], Some(&node_keypair.pubkey()));