Support for custom BroadcastStage in local cluster tests (#4716)
* Refactor BroadcastStage to support custom implementations, add FailEntryVerificationBroadcastRun implementation * Plumb switch on broadcast type through validator * Add test for validator generating non-verifiable entries to local_cluster * Fix bad initializers * Refactor broadcast run code into utils
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
use crate::banking_stage::BankingStage;
|
||||
use crate::blocktree::Blocktree;
|
||||
use crate::broadcast_stage::BroadcastStage;
|
||||
use crate::broadcast_stage::{BroadcastStage, BroadcastStageType};
|
||||
use crate::cluster_info::ClusterInfo;
|
||||
use crate::cluster_info_vote_listener::ClusterInfoVoteListener;
|
||||
use crate::fetch_stage::FetchStage;
|
||||
@@ -37,6 +37,7 @@ impl Tpu {
|
||||
broadcast_socket: UdpSocket,
|
||||
sigverify_disabled: bool,
|
||||
blocktree: &Arc<Blocktree>,
|
||||
broadcast_type: &BroadcastStageType,
|
||||
exit: &Arc<AtomicBool>,
|
||||
) -> Self {
|
||||
cluster_info.write().unwrap().set_leader(id);
|
||||
@@ -70,7 +71,7 @@ impl Tpu {
|
||||
verified_vote_receiver,
|
||||
);
|
||||
|
||||
let broadcast_stage = BroadcastStage::new(
|
||||
let broadcast_stage = broadcast_type.new_broadcast_stage(
|
||||
broadcast_socket,
|
||||
cluster_info.clone(),
|
||||
entry_receiver,
|
||||
|
||||
Reference in New Issue
Block a user