From a387c0ed61a575fb4f36ea0c44e1ba8b15367123 Mon Sep 17 00:00:00 2001 From: Guy Nir Date: Sun, 8 Dec 2024 17:36:27 +0200 Subject: [PATCH] fix(sequencing): make repropose use the proper channel --- .../src/papyrus_consensus_context.rs | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/crates/sequencing/papyrus_consensus_orchestrator/src/papyrus_consensus_context.rs b/crates/sequencing/papyrus_consensus_orchestrator/src/papyrus_consensus_context.rs index ff1ae68828e..8e0388df380 100644 --- a/crates/sequencing/papyrus_consensus_orchestrator/src/papyrus_consensus_context.rs +++ b/crates/sequencing/papyrus_consensus_orchestrator/src/papyrus_consensus_context.rs @@ -25,7 +25,6 @@ use papyrus_consensus::types::{ use papyrus_network::network_manager::{BroadcastTopicClient, BroadcastTopicClientTrait}; use papyrus_protobuf::consensus::{ ConsensusMessage, - Proposal, ProposalFin, ProposalInit, ProposalPart, @@ -258,18 +257,26 @@ impl ConsensusContext for PapyrusConsensusContext { .unwrap_or_else(|| panic!("No proposal found for height {} and id {}", init.height, id)) .clone(); - let proposal = Proposal { - height: init.height.0, - round: init.round, - proposer: init.proposer, - transactions, - block_hash: id, - valid_round: init.valid_round, - }; - self.network_broadcast_client - .broadcast_message(ConsensusMessage::Proposal(proposal)) + let (mut proposal_sender, proposal_receiver) = mpsc::channel(CHANNEL_SIZE); + self.network_proposal_sender + .send((init.height.0, proposal_receiver)) .await - .expect("Failed to send proposal"); + .expect("Failed to send proposal receiver"); + proposal_sender + .send(ProposalPart::Init(init.clone())) + .await + .expect("Failed to send proposal init"); + proposal_sender + .send(ProposalPart::Transactions(TransactionBatch { + transactions: transactions.clone(), + tx_hashes: vec![], + })) + .await + .expect("Failed to send transactions"); + proposal_sender + .send(ProposalPart::Fin(ProposalFin { proposal_content_id: id })) + .await + .expect("Failed to send fin"); } async fn validators(&self, _height: BlockNumber) -> Vec {