Skip to content

Commit

Permalink
Use the default Pubkey formatter instead of debug_id()
Browse files Browse the repository at this point in the history
  • Loading branch information
garious committed Sep 6, 2018
1 parent 8f94e3f commit 0fa27f6
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 304 deletions.
6 changes: 1 addition & 5 deletions src/bin/bench-tps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,7 @@ fn main() {
println!(" Node address | Node identifier");
println!("----------------------+------------------");
for node in &validators {
println!(
" {:20} | {:16x}",
node.contact_info.tpu.to_string(),
node.debug_id()
);
println!(" {:20} | {}", node.contact_info.tpu.to_string(), node.id);
}
println!("Nodes: {}", validators.len());

Expand Down
20 changes: 10 additions & 10 deletions src/broadcast_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn broadcast(
transmit_index: &mut WindowIndex,
receive_index: &mut u64,
) -> Result<()> {
let debug_id = node_info.debug_id();
let id = node_info.id;
let timer = Duration::new(1, 0);
let mut dq = receiver.recv_timeout(timer)?;
while let Ok(mut nq) = receiver.try_recv() {
Expand All @@ -43,12 +43,12 @@ fn broadcast(
let blobs_chunked = blobs_vec.chunks(WINDOW_SIZE as usize).map(|x| x.to_vec());

if log_enabled!(Level::Trace) {
trace!("{}", window::print_window(debug_id, window, *receive_index));
trace!("{}", window::print_window(&id, window, *receive_index));
}

for mut blobs in blobs_chunked {
let blobs_len = blobs.len();
trace!("{:x}: broadcast blobs.len: {}", debug_id, blobs_len);
trace!("{}: broadcast blobs.len: {}", id, blobs_len);

// Index the blobs
window::index_blobs(node_info, &blobs, receive_index)
Expand All @@ -64,29 +64,29 @@ fn broadcast(
let pos = (ix % WINDOW_SIZE) as usize;
if let Some(x) = mem::replace(&mut win[pos].data, None) {
trace!(
"{:x} popped {} at {}",
debug_id,
"{} popped {} at {}",
id,
x.read().unwrap().get_index().unwrap(),
pos
);
recycler.recycle(x, "broadcast-data");
}
if let Some(x) = mem::replace(&mut win[pos].coding, None) {
trace!(
"{:x} popped {} at {}",
debug_id,
"{} popped {} at {}",
id,
x.read().unwrap().get_index().unwrap(),
pos
);
recycler.recycle(x, "broadcast-coding");
}

trace!("{:x} null {}", debug_id, pos);
trace!("{} null {}", id, pos);
}
while let Some(b) = blobs.pop() {
let ix = b.read().unwrap().get_index().expect("blob index");
let pos = (ix % WINDOW_SIZE) as usize;
trace!("{:x} caching {} at {}", debug_id, ix, pos);
trace!("{} caching {} at {}", id, ix, pos);
assert!(win[pos].data.is_none());
win[pos].data = Some(b);
}
Expand All @@ -96,7 +96,7 @@ fn broadcast(
#[cfg(feature = "erasure")]
{
erasure::generate_coding(
debug_id,
&id,
&mut window.write().unwrap(),
recycler,
*receive_index,
Expand Down
Loading

0 comments on commit 0fa27f6

Please sign in to comment.