Rename WindowStage to RetransmitStage
The window is used for both broadcasting from leader to validator and retransmitting between validators.
This commit is contained in:
parent
a09d2e252a
commit
6a8a494f5d
|
@ -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;
|
||||
|
|
|
@ -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<JoinHandle<()>>,
|
||||
}
|
||||
|
||||
impl WindowStage {
|
||||
impl RetransmitStage {
|
||||
pub fn new(
|
||||
crdt: &Arc<RwLock<Crdt>>,
|
||||
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<JoinHandle<()>> {
|
||||
self.thread_hdls
|
||||
}
|
56
src/tvu.rs
56
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue