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_processor;
|
||||||
pub mod request_stage;
|
pub mod request_stage;
|
||||||
pub mod result;
|
pub mod result;
|
||||||
|
pub mod retransmit_stage;
|
||||||
pub mod rpu;
|
pub mod rpu;
|
||||||
pub mod service;
|
pub mod service;
|
||||||
pub mod signature;
|
pub mod signature;
|
||||||
|
@ -54,7 +55,6 @@ pub mod tvu;
|
||||||
pub mod vote_stage;
|
pub mod vote_stage;
|
||||||
pub mod voting;
|
pub mod voting;
|
||||||
pub mod wallet;
|
pub mod wallet;
|
||||||
pub mod window_stage;
|
|
||||||
pub mod write_stage;
|
pub mod write_stage;
|
||||||
extern crate bincode;
|
extern crate bincode;
|
||||||
extern crate bs58;
|
extern crate bs58;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! The `window_stage` maintains the blob window
|
//! The `retransmit_stage` retransmits blobs between validators
|
||||||
|
|
||||||
use broadcaster;
|
use broadcaster;
|
||||||
use crdt::Crdt;
|
use crdt::Crdt;
|
||||||
|
@ -10,11 +10,11 @@ use std::sync::{Arc, RwLock};
|
||||||
use std::thread::{self, JoinHandle};
|
use std::thread::{self, JoinHandle};
|
||||||
use streamer::{self, BlobReceiver, SharedWindow};
|
use streamer::{self, BlobReceiver, SharedWindow};
|
||||||
|
|
||||||
pub struct WindowStage {
|
pub struct RetransmitStage {
|
||||||
thread_hdls: Vec<JoinHandle<()>>,
|
thread_hdls: Vec<JoinHandle<()>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WindowStage {
|
impl RetransmitStage {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
crdt: &Arc<RwLock<Crdt>>,
|
crdt: &Arc<RwLock<Crdt>>,
|
||||||
window: SharedWindow,
|
window: SharedWindow,
|
||||||
|
@ -43,11 +43,11 @@ impl WindowStage {
|
||||||
);
|
);
|
||||||
let thread_hdls = vec![t_retransmit, t_window];
|
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<()>> {
|
fn thread_hdls(self) -> Vec<JoinHandle<()>> {
|
||||||
self.thread_hdls
|
self.thread_hdls
|
||||||
}
|
}
|
56
src/tvu.rs
56
src/tvu.rs
|
@ -2,29 +2,29 @@
|
||||||
//! 3-stage transaction validation pipeline in software.
|
//! 3-stage transaction validation pipeline in software.
|
||||||
//!
|
//!
|
||||||
//! ```text
|
//! ```text
|
||||||
//! .--------------------------------------------.
|
//! .------------------------------------------------.
|
||||||
//! | |
|
//! | |
|
||||||
//! | .--------------------------------+------------.
|
//! | .------------------------------------+------------.
|
||||||
//! | | TVU | |
|
//! | | TVU | |
|
||||||
//! | | | |
|
//! | | | |
|
||||||
//! | | | | .------------.
|
//! | | | | .------------.
|
||||||
//! | | .------------+-------------->| Validators |
|
//! | | .----------------+-------------->| Validators |
|
||||||
//! v | .-------. | | | `------------`
|
//! v | .-------. | | | `------------`
|
||||||
//! .----+---. | | | .----+---. .----+---------. |
|
//! .----+---. | | | .----+-------. .----+---------. |
|
||||||
//! | Leader |--------->| Blob | | Window | | Replicate | |
|
//! | Leader |--------->| Blob | | Retransmit | | Replicate | |
|
||||||
//! `--------` | | Fetch |-->| Stage |-->| Stage / | |
|
//! `--------` | | Fetch |-->| Stage |-->| Stage / | |
|
||||||
//! .------------. | | Stage | | | | Vote Stage | |
|
//! .------------. | | Stage | | | | Vote Stage | |
|
||||||
//! | Validators |----->| | `--------` `----+---------` |
|
//! | Validators |----->| | `------------` `----+---------` |
|
||||||
//! `------------` | `-------` | |
|
//! `------------` | `-------` | |
|
||||||
//! | | |
|
//! | | |
|
||||||
//! | | |
|
//! | | |
|
||||||
//! | | |
|
//! | | |
|
||||||
//! `--------------------------------|------------`
|
//! `------------------------------------|------------`
|
||||||
//! |
|
//! |
|
||||||
//! v
|
//! v
|
||||||
//! .------.
|
//! .------.
|
||||||
//! | Bank |
|
//! | Bank |
|
||||||
//! `------`
|
//! `------`
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! 1. Fetch Stage
|
//! 1. Fetch Stage
|
||||||
|
@ -41,6 +41,7 @@ use blob_fetch_stage::BlobFetchStage;
|
||||||
use crdt::Crdt;
|
use crdt::Crdt;
|
||||||
use packet::BlobRecycler;
|
use packet::BlobRecycler;
|
||||||
use replicate_stage::ReplicateStage;
|
use replicate_stage::ReplicateStage;
|
||||||
|
use retransmit_stage::RetransmitStage;
|
||||||
use service::Service;
|
use service::Service;
|
||||||
use signature::Keypair;
|
use signature::Keypair;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
|
@ -48,12 +49,11 @@ use std::sync::atomic::AtomicBool;
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
use std::thread::{self, JoinHandle};
|
use std::thread::{self, JoinHandle};
|
||||||
use streamer::SharedWindow;
|
use streamer::SharedWindow;
|
||||||
use window_stage::WindowStage;
|
|
||||||
|
|
||||||
pub struct Tvu {
|
pub struct Tvu {
|
||||||
replicate_stage: ReplicateStage,
|
replicate_stage: ReplicateStage,
|
||||||
fetch_stage: BlobFetchStage,
|
fetch_stage: BlobFetchStage,
|
||||||
window_stage: WindowStage,
|
retransmit_stage: RetransmitStage,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Tvu {
|
impl Tvu {
|
||||||
|
@ -90,7 +90,7 @@ impl Tvu {
|
||||||
//TODO
|
//TODO
|
||||||
//the packets coming out of blob_receiver need to be sent to the GPU and verified
|
//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
|
//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,
|
&crdt,
|
||||||
window,
|
window,
|
||||||
entry_height,
|
entry_height,
|
||||||
|
@ -112,7 +112,7 @@ impl Tvu {
|
||||||
Tvu {
|
Tvu {
|
||||||
replicate_stage,
|
replicate_stage,
|
||||||
fetch_stage,
|
fetch_stage,
|
||||||
window_stage,
|
retransmit_stage,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ impl Service for Tvu {
|
||||||
let mut thread_hdls = vec![];
|
let mut thread_hdls = vec![];
|
||||||
thread_hdls.extend(self.replicate_stage.thread_hdls().into_iter());
|
thread_hdls.extend(self.replicate_stage.thread_hdls().into_iter());
|
||||||
thread_hdls.extend(self.fetch_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
|
thread_hdls
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue