Skip to content

Commit

Permalink
fix(sequencing): make repropose use the proper channel
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-starkware committed Dec 10, 2024
1 parent 45fa6d6 commit 26d3496
Showing 1 changed file with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use papyrus_consensus::types::{
use papyrus_network::network_manager::{BroadcastTopicClient, BroadcastTopicClientTrait};
use papyrus_protobuf::consensus::{
ConsensusMessage,
Proposal,
ProposalFin,
ProposalInit,
ProposalPart,
Expand Down Expand Up @@ -261,18 +260,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<ValidatorId> {
Expand Down

0 comments on commit 26d3496

Please sign in to comment.