Connect TPU's broadcast service with TVU's blob fetch stage (#2587)

* Connect TPU's broadcast service with TVU's blob fetch stage

- This is needed since ledger is being written only in TVU now

* fix clippy warnings

* fix failing test

* fix broken tests

* fixed failing tests
This commit is contained in:
Pankaj Garg
2019-01-31 13:43:22 -08:00
committed by GitHub
parent 2dd20c38b2
commit 32162ef0f1
9 changed files with 80 additions and 31 deletions

View File

@ -29,6 +29,7 @@ use std::env;
use std::fs::remove_dir_all;
use std::net::UdpSocket;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::mpsc::channel;
use std::sync::{Arc, RwLock};
use std::thread::{sleep, Builder, JoinHandle};
use std::time::{Duration, Instant};
@ -1708,9 +1709,14 @@ fn test_broadcast_last_tick() {
let blob_fetch_stages: Vec<_> = listening_nodes
.iter_mut()
.map(|(_, _, node, _)| {
BlobFetchStage::new(
Arc::new(node.sockets.tvu.pop().unwrap()),
blob_receiver_exit.clone(),
let (blob_fetch_sender, blob_fetch_receiver) = channel();
(
BlobFetchStage::new(
Arc::new(node.sockets.tvu.pop().unwrap()),
&blob_fetch_sender,
blob_receiver_exit.clone(),
),
blob_fetch_receiver,
)
})
.collect();