Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
95bf68f
Correct some strange naming
garious May 11, 2018
600a1f8
Initialize thin client with events port
garious May 11, 2018
5510085
Better names
garious May 11, 2018
f0be595
Create function for thin client thread
garious May 11, 2018
0488d0a
Extract sig verify functions
garious May 12, 2018
3cedbc4
Reorder to reflect the pipeline order
garious May 12, 2018
765d901
Better names
garious May 12, 2018
b781fdb
Reorganize
garious May 12, 2018
3c11a91
Cleanup verifier error handling
garious May 12, 2018
1960788
Move sig verification stage into its own module
garious May 12, 2018
ca80bc3
Move the writer stage's utilities to its own module
garious May 12, 2018
cd96843
Free up name ThinClientService
garious May 12, 2018
d2f95d5
Move thin client service thread into thin_client_service.rs
garious May 12, 2018
2376dfc
Let thin client own the receiver channel
garious May 12, 2018
73abea0
No need for TPU dependency
garious May 12, 2018
b4ca414
More object-oriented
garious May 12, 2018
7ab3331
Move validation processor to its own module
garious May 12, 2018
898f497
Free up name 'thin_client_service'
garious May 12, 2018
421d9aa
Free up the name 'tpu'
garious May 12, 2018
4180571
Don't pass events_socket to RPU
garious May 12, 2018
3d82807
Delete dead code
garious May 12, 2018
1511dc4
Move RequestProcessor out of Rpu/Tvu state
garious May 12, 2018
a3d2831
Free up the name 'accounting_stage'
garious May 12, 2018
a3869dd
Move entry_receiver to RequestStage
garious May 12, 2018
6264508
Consistent naming of senders and receivers
garious May 12, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Free up the name 'tpu'
  • Loading branch information
garious committed May 12, 2018
commit 421d9aa501d850542a6f59bf05fe8a5d55b9d6fd
6 changes: 3 additions & 3 deletions src/bin/testnode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use solana::accounting_stage::AccountingStage;
use solana::crdt::ReplicatedData;
use solana::entry::Entry;
use solana::event::Event;
use solana::rpu::Rpu;
use solana::signature::{KeyPair, KeyPairUtil};
use solana::tpu::Tpu;
use std::env;
use std::io::{stdin, stdout, Read};
use std::net::UdpSocket;
Expand Down Expand Up @@ -117,7 +117,7 @@ fn main() {

let accounting_stage = AccountingStage::new(accountant, &last_id, Some(1000));
let exit = Arc::new(AtomicBool::new(false));
let tpu = Arc::new(Tpu::new(accounting_stage));
let rpu = Arc::new(Rpu::new(accounting_stage));
let serve_sock = UdpSocket::bind(&serve_addr).unwrap();
let gossip_sock = UdpSocket::bind(&gossip_addr).unwrap();
let replicate_sock = UdpSocket::bind(&replicate_addr).unwrap();
Expand All @@ -130,7 +130,7 @@ fn main() {
serve_sock.local_addr().unwrap(),
);
eprintln!("starting server...");
let threads = tpu.serve(
let threads = rpu.serve(
d,
serve_sock,
events_sock,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ pub mod plan;
pub mod recorder;
pub mod request_stage;
pub mod result;
pub mod rpu;
pub mod sig_verify_stage;
pub mod signature;
pub mod streamer;
pub mod thin_client;
pub mod timing;
pub mod tpu;
pub mod transaction;
pub mod tvu;
extern crate bincode;
Expand Down
12 changes: 6 additions & 6 deletions src/tpu.rs → src/rpu.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! The `tpu` module implements the Transaction Processing Unit, a
//! The `rpu` module implements the Request Processing Unit, a
//! 5-stage transaction processing pipeline in software.

use accounting_stage::AccountingStage;
Expand All @@ -16,16 +16,16 @@ use std::sync::{Arc, Mutex, RwLock};
use std::thread::{spawn, JoinHandle};
use streamer;

pub struct Tpu {
pub struct Rpu {
accounting_stage: Arc<AccountingStage>,
request_processor: Arc<RequestProcessor>,
}

impl Tpu {
/// Create a new Tpu that wraps the given Accountant.
impl Rpu {
/// Create a new Rpu that wraps the given Accountant.
pub fn new(accounting_stage: AccountingStage) -> Self {
let request_processor = RequestProcessor::new(accounting_stage.accountant.clone());
Tpu {
Rpu {
accounting_stage: Arc::new(accounting_stage),
request_processor: Arc::new(request_processor),
}
Expand Down Expand Up @@ -66,7 +66,7 @@ impl Tpu {
})
}

/// Create a UDP microservice that forwards messages the given Tpu.
/// Create a UDP microservice that forwards messages the given Rpu.
/// This service is the network leader
/// Set `exit` to shutdown its threads.
pub fn serve<W: Write + Send + 'static>(
Expand Down
15 changes: 7 additions & 8 deletions src/thin_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct ThinClient {
}

impl ThinClient {
/// Create a new ThinClient that will interface with Tpu
/// Create a new ThinClient that will interface with Rpu
/// over `requests_socket` and `events_socket`. To receive responses, the caller must bind `socket`
/// to a public address before invoking ThinClient methods.
pub fn new(addr: SocketAddr, requests_socket: UdpSocket, events_socket: UdpSocket) -> Self {
Expand Down Expand Up @@ -161,14 +161,14 @@ mod tests {
use logger;
use mint::Mint;
use plan::Plan;
use rpu::Rpu;
use signature::{KeyPair, KeyPairUtil};
use std::io::sink;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, RwLock};
use std::thread::sleep;
use std::time::Duration;
use std::time::Instant;
use tpu::Tpu;
use tvu::{self, Tvu};

#[test]
Expand All @@ -191,8 +191,8 @@ mod tests {
let bob_pubkey = KeyPair::new().pubkey();
let exit = Arc::new(AtomicBool::new(false));
let accounting_stage = AccountingStage::new(accountant, &alice.last_id(), Some(30));
let tpu = Arc::new(Tpu::new(accounting_stage));
let threads = tpu.serve(d, serve, events_socket, gossip, exit.clone(), sink())
let rpu = Arc::new(Rpu::new(accounting_stage));
let threads = rpu.serve(d, serve, events_socket, gossip, exit.clone(), sink())
.unwrap();
sleep(Duration::from_millis(300));

Expand Down Expand Up @@ -230,10 +230,9 @@ mod tests {
let bob_pubkey = KeyPair::new().pubkey();
let exit = Arc::new(AtomicBool::new(false));
let accounting_stage = AccountingStage::new(accountant, &alice.last_id(), Some(30));
let tpu = Arc::new(Tpu::new(accounting_stage));
let rpu = Arc::new(Rpu::new(accounting_stage));
let serve_addr = leader_serve.local_addr().unwrap();
let threads = Tpu::serve(
&tpu,
let threads = rpu.serve(
leader_data,
leader_serve,
leader_events,
Expand Down Expand Up @@ -302,7 +301,7 @@ mod tests {
let leader_acc = {
let accountant = Accountant::new(&alice);
let accounting_stage = AccountingStage::new(accountant, &alice.last_id(), Some(30));
Arc::new(Tpu::new(accounting_stage))
Arc::new(Rpu::new(accounting_stage))
};

let replicant_acc = {
Expand Down