@@ -6,6 +6,7 @@ use crate::{
66 block_storage:: tracing:: { observe_block, BlockStage } ,
77 counters:: { self , update_counters_for_block, update_counters_for_compute_result} ,
88 monitor,
9+ network:: NetworkSender ,
910 payload_manager:: TPayloadManager ,
1011 txn_notifier:: TxnNotifier ,
1112 IntGaugeGuard ,
@@ -135,6 +136,7 @@ pub struct PipelineBuilder {
135136 persisted_auxiliary_info_version : u8 ,
136137 rand_check_enabled : bool ,
137138 module_cache : Arc < Mutex < Option < ValidationState < CachedStateView > > > > ,
139+ network_sender : Arc < NetworkSender > ,
138140}
139141
140142fn spawn_shared_fut <
@@ -257,6 +259,7 @@ impl PipelineBuilder {
257259 enable_pre_commit : bool ,
258260 consensus_onchain_config : & OnChainConsensusConfig ,
259261 persisted_auxiliary_info_version : u8 ,
262+ network_sender : Arc < NetworkSender > ,
260263 ) -> Self {
261264 let module_cache = Arc :: new ( Mutex :: new ( None ) ) ;
262265 Self {
@@ -274,6 +277,7 @@ impl PipelineBuilder {
274277 persisted_auxiliary_info_version,
275278 rand_check_enabled : consensus_onchain_config. rand_check_enabled ( ) ,
276279 module_cache,
280+ network_sender,
277281 }
278282 }
279283
@@ -434,14 +438,15 @@ impl PipelineBuilder {
434438 None ,
435439 ) ;
436440 let commit_vote_fut = spawn_shared_fut (
437- Self :: sign_commit_vote (
441+ Self :: sign_and_broadcast_commit_vote (
438442 ledger_update_fut. clone ( ) ,
439443 order_vote_rx,
440444 order_proof_fut. clone ( ) ,
441445 commit_proof_fut. clone ( ) ,
442446 self . signer . clone ( ) ,
443447 block. clone ( ) ,
444448 self . order_vote_enabled ,
449+ self . network_sender . clone ( ) ,
445450 ) ,
446451 Some ( & mut abort_handles) ,
447452 ) ;
@@ -860,15 +865,16 @@ impl PipelineBuilder {
860865 }
861866
862867 /// Precondition: 1. ledger update finishes, 2. order vote or order proof or commit proof is received
863- /// What it does: Sign the commit vote with execution result, it needs to update the timestamp for reconfig suffix blocks
864- async fn sign_commit_vote (
868+ /// What it does: Sign the commit vote with execution result and broadcast , it needs to update the timestamp for reconfig suffix blocks
869+ async fn sign_and_broadcast_commit_vote (
865870 ledger_update_fut : TaskFuture < LedgerUpdateResult > ,
866871 order_vote_rx : oneshot:: Receiver < ( ) > ,
867872 order_proof_fut : TaskFuture < WrappedLedgerInfo > ,
868873 commit_proof_fut : TaskFuture < LedgerInfoWithSignatures > ,
869874 signer : Arc < ValidatorSigner > ,
870875 block : Arc < Block > ,
871876 order_vote_enabled : bool ,
877+ network_sender : Arc < NetworkSender > ,
872878 ) -> TaskResult < CommitVoteResult > {
873879 let mut tracker = Tracker :: start_waiting ( "sign_commit_vote" , & block) ;
874880 let ( compute_result, _, epoch_end_timestamp) = ledger_update_fut. await ?;
@@ -907,11 +913,11 @@ impl PipelineBuilder {
907913 let ledger_info = LedgerInfo :: new ( block_info, consensus_data_hash) ;
908914 info ! ( "[Pipeline] Signed ledger info {ledger_info}" ) ;
909915 let signature = signer. sign ( & ledger_info) . expect ( "Signing should succeed" ) ;
910- Ok ( CommitVote :: new_with_signature (
911- signer . author ( ) ,
912- ledger_info ,
913- signature ,
914- ) )
916+ let commit_vote = CommitVote :: new_with_signature ( signer . author ( ) , ledger_info , signature ) ;
917+ network_sender
918+ . broadcast_commit_vote ( commit_vote . clone ( ) )
919+ . await ;
920+ Ok ( commit_vote )
915921 }
916922
917923 /// Precondition: 1. ledger update finishes, 2. parent block's phase finishes 2. order proof is received
0 commit comments