diff --git a/src/lib.rs b/src/lib.rs index 6ef6b754f0..67bb27766d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -40,6 +40,7 @@ pub mod request; pub mod request_processor; pub mod request_stage; pub mod result; +pub mod retransmit_stage; pub mod rpu; pub mod service; pub mod signature; @@ -54,7 +55,6 @@ pub mod tvu; pub mod vote_stage; pub mod voting; pub mod wallet; -pub mod window_stage; pub mod write_stage; extern crate bincode; extern crate bs58; diff --git a/src/window_stage.rs b/src/retransmit_stage.rs similarity index 87% rename from src/window_stage.rs rename to src/retransmit_stage.rs index e6daaebc7b..b144de764c 100644 --- a/src/window_stage.rs +++ b/src/retransmit_stage.rs @@ -1,4 +1,4 @@ -//! The `window_stage` maintains the blob window +//! The `retransmit_stage` retransmits blobs between validators use broadcaster; use crdt::Crdt; @@ -10,11 +10,11 @@ use std::sync::{Arc, RwLock}; use std::thread::{self, JoinHandle}; use streamer::{self, BlobReceiver, SharedWindow}; -pub struct WindowStage { +pub struct RetransmitStage { thread_hdls: Vec>, } -impl WindowStage { +impl RetransmitStage { pub fn new( crdt: &Arc>, window: SharedWindow, @@ -43,11 +43,11 @@ impl WindowStage { ); let thread_hdls = vec![t_retransmit, t_window]; - (WindowStage { thread_hdls }, blob_receiver) + (RetransmitStage { thread_hdls }, blob_receiver) } } -impl Service for WindowStage { +impl Service for RetransmitStage { fn thread_hdls(self) -> Vec> { self.thread_hdls } diff --git a/src/tvu.rs b/src/tvu.rs index 55c3afef6b..3c83fc9c42 100644 --- a/src/tvu.rs +++ b/src/tvu.rs @@ -2,29 +2,29 @@ //! 3-stage transaction validation pipeline in software. //! //! ```text -//! .--------------------------------------------. -//! | | -//! | .--------------------------------+------------. -//! | | TVU | | -//! | | | | -//! | | | | .------------. -//! | | .------------+-------------->| Validators | -//! v | .-------. | | | `------------` -//! .----+---. | | | .----+---. .----+---------. | -//! | Leader |--------->| Blob | | Window | | Replicate | | -//! `--------` | | Fetch |-->| Stage |-->| Stage / | | -//! .------------. | | Stage | | | | Vote Stage | | -//! | Validators |----->| | `--------` `----+---------` | -//! `------------` | `-------` | | -//! | | | -//! | | | -//! | | | -//! `--------------------------------|------------` -//! | -//! v -//! .------. -//! | Bank | -//! `------` +//! .------------------------------------------------. +//! | | +//! | .------------------------------------+------------. +//! | | TVU | | +//! | | | | +//! | | | | .------------. +//! | | .----------------+-------------->| Validators | +//! v | .-------. | | | `------------` +//! .----+---. | | | .----+-------. .----+---------. | +//! | Leader |--------->| Blob | | Retransmit | | Replicate | | +//! `--------` | | Fetch |-->| Stage |-->| Stage / | | +//! .------------. | | Stage | | | | Vote Stage | | +//! | Validators |----->| | `------------` `----+---------` | +//! `------------` | `-------` | | +//! | | | +//! | | | +//! | | | +//! `------------------------------------|------------` +//! | +//! v +//! .------. +//! | Bank | +//! `------` //! ``` //! //! 1. Fetch Stage @@ -41,6 +41,7 @@ use blob_fetch_stage::BlobFetchStage; use crdt::Crdt; use packet::BlobRecycler; use replicate_stage::ReplicateStage; +use retransmit_stage::RetransmitStage; use service::Service; use signature::Keypair; use std::net::UdpSocket; @@ -48,12 +49,11 @@ use std::sync::atomic::AtomicBool; use std::sync::{Arc, RwLock}; use std::thread::{self, JoinHandle}; use streamer::SharedWindow; -use window_stage::WindowStage; pub struct Tvu { replicate_stage: ReplicateStage, fetch_stage: BlobFetchStage, - window_stage: WindowStage, + retransmit_stage: RetransmitStage, } impl Tvu { @@ -90,7 +90,7 @@ impl Tvu { //TODO //the packets coming out of blob_receiver need to be sent to the GPU and verified //then sent to the window, which does the erasure coding reconstruction - let (window_stage, blob_window_receiver) = WindowStage::new( + let (retransmit_stage, blob_window_receiver) = RetransmitStage::new( &crdt, window, entry_height, @@ -112,7 +112,7 @@ impl Tvu { Tvu { replicate_stage, fetch_stage, - window_stage, + retransmit_stage, } } @@ -127,7 +127,7 @@ impl Service for Tvu { let mut thread_hdls = vec![]; thread_hdls.extend(self.replicate_stage.thread_hdls().into_iter()); thread_hdls.extend(self.fetch_stage.thread_hdls().into_iter()); - thread_hdls.extend(self.window_stage.thread_hdls().into_iter()); + thread_hdls.extend(self.retransmit_stage.thread_hdls().into_iter()); thread_hdls }