From 5530a2959b2202c0f8d9c8d4c7afc8d74013a80f Mon Sep 17 00:00:00 2001 From: Satya Vusirikala Date: Fri, 14 Jun 2024 17:28:15 -0500 Subject: [PATCH] Remove unnecessary commit decision broadcast (#13358) * Remove unnecessary commit decision broadcast * Update unit test --- consensus/src/pipeline/buffer_manager.rs | 11 ++--------- consensus/src/pipeline/tests/buffer_manager_tests.rs | 5 +++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/consensus/src/pipeline/buffer_manager.rs b/consensus/src/pipeline/buffer_manager.rs index dfa5a56141279..6f9a728c8e553 100644 --- a/consensus/src/pipeline/buffer_manager.rs +++ b/consensus/src/pipeline/buffer_manager.rs @@ -384,15 +384,8 @@ impl BufferManager { let aggregated_item = item.unwrap_aggregated(); let block = aggregated_item.executed_blocks.last().unwrap().block(); observe_block(block.timestamp_usecs(), BlockStage::COMMIT_CERTIFIED); - // TODO: As all the validators broadcast commit votes directly to all other validators, - // the proposer do not have to broadcast commit decision again. Remove this if block. - // if we're the proposer for the block, we're responsible to broadcast the commit decision. - if block.author() == Some(self.author) { - let commit_decision = CommitMessage::Decision(CommitDecision::new( - aggregated_item.commit_proof.clone(), - )); - self.commit_proof_rb_handle = self.do_reliable_broadcast(commit_decision); - } + // As all the validators broadcast commit votes directly to all other validators, + // the proposer do not have to broadcast commit decision again. let commit_proof = aggregated_item.commit_proof.clone(); if commit_proof.ledger_info().ends_epoch() { // the epoch ends, reset to avoid executing more blocks, execute after diff --git a/consensus/src/pipeline/tests/buffer_manager_tests.rs b/consensus/src/pipeline/tests/buffer_manager_tests.rs index 71806a1bd06f8..ed1247bc4c2c2 100644 --- a/consensus/src/pipeline/tests/buffer_manager_tests.rs +++ b/consensus/src/pipeline/tests/buffer_manager_tests.rs @@ -320,8 +320,9 @@ fn buffer_manager_happy_path_test() { .ok(); } - // commit decision will be sent too, so 3 * 2 - for _ in 0..6 { + // Only commit votes are sent, so 3 commit votes are expected + // Commit decision is no longer broadcasted + for _ in 0..3 { if let Some(msg) = self_loop_rx.next().await { loopback_commit_vote(msg, &msg_tx, &verifier).await; }