Add VoteTracker for tracking cluster's votes in gossip (#8327)

Track votes by slot in cluster_vote_listener
This commit is contained in:
carllin
2020-03-09 22:03:09 -07:00
committed by GitHub
parent ae8badb141
commit 9872430bd2
8 changed files with 1003 additions and 23 deletions

View File

@@ -5,14 +5,16 @@ use crate::{
banking_stage::BankingStage,
broadcast_stage::{BroadcastStage, BroadcastStageType},
cluster_info::ClusterInfo,
cluster_info_vote_listener::ClusterInfoVoteListener,
cluster_info_vote_listener::{ClusterInfoVoteListener, VoteTracker},
fetch_stage::FetchStage,
poh_recorder::{PohRecorder, WorkingBankEntry},
sigverify::TransactionSigVerifier,
sigverify_stage::{DisabledSigVerifier, SigVerifyStage},
};
use crossbeam_channel::unbounded;
use solana_ledger::{blockstore::Blockstore, blockstore_processor::TransactionStatusSender};
use solana_ledger::{
bank_forks::BankForks, blockstore::Blockstore, blockstore_processor::TransactionStatusSender,
};
use std::{
net::UdpSocket,
sync::{
@@ -46,6 +48,8 @@ impl Tpu {
broadcast_type: &BroadcastStageType,
exit: &Arc<AtomicBool>,
shred_version: u16,
vote_tracker: Arc<VoteTracker>,
bank_forks: Arc<RwLock<BankForks>>,
) -> Self {
let (packet_sender, packet_receiver) = channel();
let fetch_stage = FetchStage::new_with_sender(
@@ -72,6 +76,8 @@ impl Tpu {
sigverify_disabled,
verified_vote_sender,
&poh_recorder,
vote_tracker,
bank_forks,
);
let banking_stage = BankingStage::new(