@ -64,17 +64,13 @@ impl Drop for Finalizer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
pub struct ReplayStageConfig {
|
pub struct ReplayStageConfig {
|
||||||
pub my_pubkey: Pubkey,
|
pub my_pubkey: Pubkey,
|
||||||
pub vote_account: Pubkey,
|
pub vote_account: Pubkey,
|
||||||
pub voting_keypair: Option<Arc<Keypair>>,
|
pub voting_keypair: Option<Arc<Keypair>>,
|
||||||
pub blocktree: Arc<Blocktree>,
|
|
||||||
pub bank_forks: Arc<RwLock<BankForks>>,
|
|
||||||
pub cluster_info: Arc<RwLock<ClusterInfo>>,
|
|
||||||
pub exit: Arc<AtomicBool>,
|
pub exit: Arc<AtomicBool>,
|
||||||
pub ledger_signal_receiver: Receiver<bool>,
|
|
||||||
pub subscriptions: Arc<RpcSubscriptions>,
|
pub subscriptions: Arc<RpcSubscriptions>,
|
||||||
pub poh_recorder: Arc<Mutex<PohRecorder>>,
|
|
||||||
pub leader_schedule_cache: Arc<LeaderScheduleCache>,
|
pub leader_schedule_cache: Arc<LeaderScheduleCache>,
|
||||||
pub slot_full_senders: Vec<Sender<(u64, Pubkey)>>,
|
pub slot_full_senders: Vec<Sender<(u64, Pubkey)>>,
|
||||||
pub snapshot_package_sender: Option<SnapshotPackageSender>,
|
pub snapshot_package_sender: Option<SnapshotPackageSender>,
|
||||||
@ -181,18 +177,20 @@ impl ForkProgress {
|
|||||||
|
|
||||||
impl ReplayStage {
|
impl ReplayStage {
|
||||||
#[allow(clippy::new_ret_no_self)]
|
#[allow(clippy::new_ret_no_self)]
|
||||||
pub fn new(config: ReplayStageConfig) -> (Self, Receiver<Vec<Arc<Bank>>>) {
|
pub fn new(
|
||||||
|
config: ReplayStageConfig,
|
||||||
|
blocktree: Arc<Blocktree>,
|
||||||
|
bank_forks: Arc<RwLock<BankForks>>,
|
||||||
|
cluster_info: Arc<RwLock<ClusterInfo>>,
|
||||||
|
ledger_signal_receiver: Receiver<bool>,
|
||||||
|
poh_recorder: Arc<Mutex<PohRecorder>>,
|
||||||
|
) -> (Self, Receiver<Vec<Arc<Bank>>>) {
|
||||||
let ReplayStageConfig {
|
let ReplayStageConfig {
|
||||||
my_pubkey,
|
my_pubkey,
|
||||||
vote_account,
|
vote_account,
|
||||||
voting_keypair,
|
voting_keypair,
|
||||||
blocktree,
|
|
||||||
bank_forks,
|
|
||||||
cluster_info,
|
|
||||||
exit,
|
exit,
|
||||||
ledger_signal_receiver,
|
|
||||||
subscriptions,
|
subscriptions,
|
||||||
poh_recorder,
|
|
||||||
leader_schedule_cache,
|
leader_schedule_cache,
|
||||||
slot_full_senders,
|
slot_full_senders,
|
||||||
snapshot_package_sender,
|
snapshot_package_sender,
|
||||||
|
@ -163,13 +163,8 @@ impl Tvu {
|
|||||||
my_pubkey: keypair.pubkey(),
|
my_pubkey: keypair.pubkey(),
|
||||||
vote_account: *vote_account,
|
vote_account: *vote_account,
|
||||||
voting_keypair,
|
voting_keypair,
|
||||||
blocktree: blocktree.clone(),
|
|
||||||
bank_forks: bank_forks.clone(),
|
|
||||||
cluster_info: cluster_info.clone(),
|
|
||||||
exit: exit.clone(),
|
exit: exit.clone(),
|
||||||
ledger_signal_receiver,
|
|
||||||
subscriptions: subscriptions.clone(),
|
subscriptions: subscriptions.clone(),
|
||||||
poh_recorder: poh_recorder.clone(),
|
|
||||||
leader_schedule_cache: leader_schedule_cache.clone(),
|
leader_schedule_cache: leader_schedule_cache.clone(),
|
||||||
slot_full_senders: vec![blockstream_slot_sender, ledger_cleanup_slot_sender],
|
slot_full_senders: vec![blockstream_slot_sender, ledger_cleanup_slot_sender],
|
||||||
snapshot_package_sender,
|
snapshot_package_sender,
|
||||||
@ -177,7 +172,14 @@ impl Tvu {
|
|||||||
transaction_status_sender,
|
transaction_status_sender,
|
||||||
};
|
};
|
||||||
|
|
||||||
let (replay_stage, root_bank_receiver) = ReplayStage::new(replay_stage_config);
|
let (replay_stage, root_bank_receiver) = ReplayStage::new(
|
||||||
|
replay_stage_config,
|
||||||
|
blocktree.clone(),
|
||||||
|
bank_forks.clone(),
|
||||||
|
cluster_info.clone(),
|
||||||
|
ledger_signal_receiver,
|
||||||
|
poh_recorder.clone(),
|
||||||
|
);
|
||||||
|
|
||||||
let blockstream_service = if let Some(blockstream_unix_socket) = blockstream_unix_socket {
|
let blockstream_service = if let Some(blockstream_unix_socket) = blockstream_unix_socket {
|
||||||
let blockstream_service = BlockstreamService::new(
|
let blockstream_service = BlockstreamService::new(
|
||||||
|
Reference in New Issue
Block a user