+ +
diff --git a/narwhal/primary/src/garbage_collector.rs b/narwhal/primary/src/garbage_collector.rs index 612ef7deeed14..0c0a0352fd757 100644 --- a/narwhal/primary/src/garbage_collector.rs +++ b/narwhal/primary/src/garbage_collector.rs @@ -56,7 +56,7 @@ impl GarbageCollector { let round = certificate.round(); if round > last_committed_round { last_committed_round = round; - + // Trigger cleanup on the primary. self.consensus_round.store(round, Ordering::Relaxed); diff --git a/narwhal/primary/src/primary.rs b/narwhal/primary/src/primary.rs index 9e85bf90fac46..8ba317fe2741e 100644 --- a/narwhal/primary/src/primary.rs +++ b/narwhal/primary/src/primary.rs @@ -200,6 +200,7 @@ impl Primary { // The `Helper` is dedicated to reply to certificates requests from other primaries. Helper::spawn(committee.clone(), store, rx_cert_requests); + // NOTE: This log entry is used to compute performance. info!( "Primary {} successfully booted on {}", name, diff --git a/narwhal/primary/src/proposer.rs b/narwhal/primary/src/proposer.rs index eb5a6d6054d0e..5afaa96568e79 100644 --- a/narwhal/primary/src/proposer.rs +++ b/narwhal/primary/src/proposer.rs @@ -91,7 +91,7 @@ impl Proposer { debug!("Created {:?}", header); #[cfg(feature = "benchmark")] - for (digest, _) in &header.payload { + for digest in header.payload.keys() { // NOTE: This log entry is used to compute performance. info!("Created {} -> {:?}", header, digest); } diff --git a/narwhal/primary/src/tests/core_tests.rs b/narwhal/primary/src/tests/core_tests.rs index 600731154c087..746ad925ea38a 100644 --- a/narwhal/primary/src/tests/core_tests.rs +++ b/narwhal/primary/src/tests/core_tests.rs @@ -76,7 +76,7 @@ async fn process_header() { let received = handle.await.unwrap(); match bincode::deserialize(&received).unwrap() { PrimaryMessage::Vote(x) => assert_eq!(x, expected), - x => assert!(false, "Unexpected message: {:?}", x), + x => panic!("Unexpected message: {:?}", x), } // Ensure the header is correctly stored. @@ -277,7 +277,7 @@ async fn process_votes() { for received in try_join_all(handles).await.unwrap() { match bincode::deserialize(&received).unwrap() { PrimaryMessage::Certificate(x) => assert_eq!(x, expected), - x => assert!(false, "Unexpected message: {:?}", x), + x => panic!("Unexpected message: {:?}", x), } } } diff --git a/narwhal/worker/README.md b/narwhal/worker/README.md new file mode 100644 index 0000000000000..970ac919d8460 --- /dev/null +++ b/narwhal/worker/README.md @@ -0,0 +1,6 @@ +# Worker Diagram +The diagram below illustrates the worker's architecture and could be useful to keep in mind while going through the code. + ++ +
diff --git a/narwhal/worker/src/tests/batch_maker_tests.rs b/narwhal/worker/src/tests/batch_maker_tests.rs index d35f5db948e64..2aff2423dc5ce 100644 --- a/narwhal/worker/src/tests/batch_maker_tests.rs +++ b/narwhal/worker/src/tests/batch_maker_tests.rs @@ -27,7 +27,7 @@ async fn make_batch() { let QuorumWaiterMessage { batch, handlers: _ } = rx_message.recv().await.unwrap(); match bincode::deserialize(&batch).unwrap() { WorkerMessage::Batch(batch) => assert_eq!(batch, expected_batch), - _ => assert!(false, "Unexpected message"), + _ => panic!("Unexpected message"), } } @@ -54,6 +54,6 @@ async fn batch_timeout() { let QuorumWaiterMessage { batch, handlers: _ } = rx_message.recv().await.unwrap(); match bincode::deserialize(&batch).unwrap() { WorkerMessage::Batch(batch) => assert_eq!(batch, expected_batch), - _ => assert!(false, "Unexpected message"), + _ => panic!("Unexpected message"), } } diff --git a/narwhal/worker/src/tests/common.rs b/narwhal/worker/src/tests/common.rs index 52f8d87a5d940..03c1d209fff3c 100644 --- a/narwhal/worker/src/tests/common.rs +++ b/narwhal/worker/src/tests/common.rs @@ -122,7 +122,7 @@ pub fn listener(address: SocketAddr, expected: Option