diff --git a/src/rpu.rs b/src/rpu.rs index 0f7d31674d..17187bec74 100644 --- a/src/rpu.rs +++ b/src/rpu.rs @@ -21,8 +21,6 @@ use write_stage::WriteStage; pub struct Rpu { bank: Arc, - start_hash: Hash, - tick_duration: Option, pub thread_hdls: Vec>, } @@ -42,11 +40,11 @@ impl Rpu { ) -> Self { let mut rpu = Rpu { bank: Arc::new(bank), - start_hash, - tick_duration, thread_hdls: vec![], }; let thread_hdls = rpu.serve( + start_hash, + tick_duration, me, requests_socket, broadcast_socket, @@ -64,6 +62,8 @@ impl Rpu { /// Set `exit` to shutdown its threads. pub fn serve( &self, + start_hash: Hash, + tick_duration: Option, me: ReplicatedData, requests_socket: UdpSocket, broadcast_socket: UdpSocket, @@ -93,11 +93,8 @@ impl Rpu { blob_recycler.clone(), ); - let record_stage = RecordStage::new( - request_stage.signal_receiver, - &self.start_hash, - self.tick_duration, - ); + let record_stage = + RecordStage::new(request_stage.signal_receiver, &start_hash, tick_duration); let write_stage = WriteStage::new( self.bank.clone(), diff --git a/src/tpu.rs b/src/tpu.rs index 4908aeb7e2..94b8e0f256 100644 --- a/src/tpu.rs +++ b/src/tpu.rs @@ -20,8 +20,6 @@ use write_stage::WriteStage; pub struct Tpu { bank: Arc, - start_hash: Hash, - tick_duration: Option, pub thread_hdls: Vec>, } @@ -40,11 +38,18 @@ impl Tpu { ) -> Self { let mut tpu = Tpu { bank: Arc::new(bank), - start_hash, - tick_duration, thread_hdls: vec![], }; - let thread_hdls = tpu.serve(me, requests_socket, broadcast_socket, gossip, exit, writer); + let thread_hdls = tpu.serve( + start_hash, + tick_duration, + me, + requests_socket, + broadcast_socket, + gossip, + exit, + writer, + ); tpu.thread_hdls.extend(thread_hdls); tpu } @@ -54,6 +59,8 @@ impl Tpu { /// Set `exit` to shutdown its threads. pub fn serve( &self, + start_hash: Hash, + tick_duration: Option, me: ReplicatedData, requests_socket: UdpSocket, broadcast_socket: UdpSocket, @@ -80,11 +87,8 @@ impl Tpu { packet_recycler.clone(), ); - let record_stage = RecordStage::new( - banking_stage.signal_receiver, - &self.start_hash, - self.tick_duration, - ); + let record_stage = + RecordStage::new(banking_stage.signal_receiver, &start_hash, tick_duration); let write_stage = WriteStage::new( self.bank.clone(),