Remove unnecessary dependencies on fullnode mod

This commit is contained in:
Michael Vines
2019-02-06 21:09:46 -08:00
parent ab4828aae7
commit 95ac6305bc
6 changed files with 18 additions and 20 deletions

View File

@ -6,14 +6,13 @@ use crate::bank::{Bank, BankError};
use crate::compute_leader_confirmation_service::ComputeLeaderConfirmationService; use crate::compute_leader_confirmation_service::ComputeLeaderConfirmationService;
use crate::counter::Counter; use crate::counter::Counter;
use crate::entry::Entry; use crate::entry::Entry;
use crate::fullnode::TpuRotationSender;
use crate::packet::Packets; use crate::packet::Packets;
use crate::poh_recorder::{PohRecorder, PohRecorderError}; use crate::poh_recorder::{PohRecorder, PohRecorderError};
use crate::poh_service::{Config, PohService}; use crate::poh_service::{Config, PohService};
use crate::result::{Error, Result}; use crate::result::{Error, Result};
use crate::service::Service; use crate::service::Service;
use crate::sigverify_stage::VerifiedPackets; use crate::sigverify_stage::VerifiedPackets;
use crate::tpu::TpuReturnType; use crate::tpu::{TpuReturnType, TpuRotationSender};
use bincode::deserialize; use bincode::deserialize;
use log::Level; use log::Level;
use solana_sdk::hash::Hash; use solana_sdk::hash::Hash;

View File

@ -12,8 +12,8 @@ use crate::rpc_pubsub::PubSubService;
use crate::service::Service; use crate::service::Service;
use crate::storage_stage::StorageState; use crate::storage_stage::StorageState;
use crate::streamer::BlobSender; use crate::streamer::BlobSender;
use crate::tpu::{Tpu, TpuReturnType}; use crate::tpu::{Tpu, TpuReturnType, TpuRotationReceiver};
use crate::tvu::{Sockets, Tvu, TvuReturnType}; use crate::tvu::{Sockets, Tvu, TvuReturnType, TvuRotationReceiver};
use crate::voting_keypair::VotingKeypair; use crate::voting_keypair::VotingKeypair;
use log::Level; use log::Level;
use solana_sdk::hash::Hash; use solana_sdk::hash::Hash;
@ -28,11 +28,6 @@ use std::sync::{Arc, RwLock};
use std::thread::{spawn, Result}; use std::thread::{spawn, Result};
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
pub type TvuRotationSender = Sender<TvuReturnType>;
pub type TpuRotationSender = Sender<TpuReturnType>;
type TvuRotationReceiver = Receiver<TvuReturnType>;
type TpuRotationReceiver = Receiver<TpuReturnType>;
struct NodeServices { struct NodeServices {
tpu: Tpu, tpu: Tpu,
tvu: Tvu, tvu: Tvu,

View File

@ -1,25 +1,26 @@
//! The `poh_service` module implements a service that records the passing of //! The `poh_service` module implements a service that records the passing of
//! "ticks", a measure of time in the PoH stream //! "ticks", a measure of time in the PoH stream
use crate::fullnode::TpuRotationSender;
use crate::poh_recorder::{PohRecorder, PohRecorderError}; use crate::poh_recorder::{PohRecorder, PohRecorderError};
use crate::result::Error; use crate::result::Error;
use crate::result::Result; use crate::result::Result;
use crate::service::Service; use crate::service::Service;
use crate::tpu::TpuReturnType; use crate::tpu::{TpuReturnType, TpuRotationSender};
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc; use std::sync::Arc;
use std::thread::sleep; use std::thread::sleep;
use std::thread::{self, Builder, JoinHandle}; use std::thread::{self, Builder, JoinHandle};
use std::time::Duration; use std::time::Duration;
pub const NUM_TICKS_PER_SECOND: usize = 10; pub const NUM_TICKS_PER_SECOND: usize = 10;
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub enum Config { pub enum Config {
/// * `Tick` - Run full PoH thread. Tick is a rough estimate of how many hashes to roll before transmitting a new entry. /// * `Tick` - Run full PoH thread. Tick is a rough estimate of how many hashes to roll before
/// transmitting a new entry.
Tick(usize), Tick(usize),
/// * `Sleep`- Low power mode. Sleep is a rough estimate of how long to sleep before rolling 1 poh once and producing 1 /// * `Sleep`- Low power mode. Sleep is a rough estimate of how long to sleep before rolling 1
/// tick. /// PoH once and producing 1 tick.
Sleep(Duration), Sleep(Duration),
} }

View File

@ -10,11 +10,10 @@ use crate::entry_stream::EntryStream;
use crate::entry_stream::EntryStreamHandler; use crate::entry_stream::EntryStreamHandler;
#[cfg(test)] #[cfg(test)]
use crate::entry_stream::MockEntryStream as EntryStream; use crate::entry_stream::MockEntryStream as EntryStream;
use crate::fullnode::TvuRotationSender;
use crate::packet::BlobError; use crate::packet::BlobError;
use crate::result::{Error, Result}; use crate::result::{Error, Result};
use crate::service::Service; use crate::service::Service;
use crate::tvu::TvuReturnType; use crate::tvu::{TvuReturnType, TvuRotationSender};
use crate::voting_keypair::VotingKeypair; use crate::voting_keypair::VotingKeypair;
use log::Level; use log::Level;
use solana_metrics::{influxdb, submit}; use solana_metrics::{influxdb, submit};

View File

@ -7,7 +7,6 @@ use crate::broadcast_service::BroadcastService;
use crate::cluster_info::ClusterInfo; use crate::cluster_info::ClusterInfo;
use crate::cluster_info_vote_listener::ClusterInfoVoteListener; use crate::cluster_info_vote_listener::ClusterInfoVoteListener;
use crate::fetch_stage::FetchStage; use crate::fetch_stage::FetchStage;
use crate::fullnode::TpuRotationSender;
use crate::poh_service::Config; use crate::poh_service::Config;
use crate::service::Service; use crate::service::Service;
use crate::sigverify_stage::SigVerifyStage; use crate::sigverify_stage::SigVerifyStage;
@ -17,7 +16,7 @@ use solana_sdk::hash::Hash;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use std::net::UdpSocket; use std::net::UdpSocket;
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::mpsc::channel; use std::sync::mpsc::{channel, Receiver, Sender};
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
use std::thread; use std::thread;
@ -25,6 +24,9 @@ pub enum TpuReturnType {
LeaderRotation(u64), LeaderRotation(u64),
} }
pub type TpuRotationSender = Sender<TpuReturnType>;
pub type TpuRotationReceiver = Receiver<TpuReturnType>;
pub enum TpuMode { pub enum TpuMode {
Leader(LeaderServices), Leader(LeaderServices),
Forwarder(ForwarderServices), Forwarder(ForwarderServices),

View File

@ -16,7 +16,6 @@ use crate::bank::Bank;
use crate::blob_fetch_stage::BlobFetchStage; use crate::blob_fetch_stage::BlobFetchStage;
use crate::cluster_info::ClusterInfo; use crate::cluster_info::ClusterInfo;
use crate::db_ledger::DbLedger; use crate::db_ledger::DbLedger;
use crate::fullnode::TvuRotationSender;
use crate::replay_stage::ReplayStage; use crate::replay_stage::ReplayStage;
use crate::retransmit_stage::RetransmitStage; use crate::retransmit_stage::RetransmitStage;
use crate::service::Service; use crate::service::Service;
@ -27,7 +26,7 @@ use solana_sdk::hash::Hash;
use solana_sdk::signature::{Keypair, KeypairUtil}; use solana_sdk::signature::{Keypair, KeypairUtil};
use std::net::UdpSocket; use std::net::UdpSocket;
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::mpsc::{channel, Receiver, SyncSender}; use std::sync::mpsc::{channel, Receiver, Sender, SyncSender};
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
use std::thread; use std::thread;
@ -36,6 +35,9 @@ pub enum TvuReturnType {
LeaderRotation(u64, u64, Hash), LeaderRotation(u64, u64, Hash),
} }
pub type TvuRotationSender = Sender<TvuReturnType>;
pub type TvuRotationReceiver = Receiver<TvuReturnType>;
pub struct Tvu { pub struct Tvu {
fetch_stage: BlobFetchStage, fetch_stage: BlobFetchStage,
retransmit_stage: RetransmitStage, retransmit_stage: RetransmitStage,