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 8, 2024
1 parent 27483e5 commit b0b4583
Showing 1 changed file with 43 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,18 +258,50 @@ 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");

// self.network_proposal_sender.send(
// (init.height.0, futures::stream::iter(vec![
// ProposalPart::Init(init.clone()),
// ProposalPart::Transactions(TransactionBatch {
// transactions,
// tx_hashes: vec![],
// }),
// ProposalPart::Fin(ProposalFin { proposal_content_id: id }),
// ]))
// ).await.expect("Failed to send proposal");

// 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))
// .await
// .expect("Failed to send proposal");
}

async fn validators(&self, _height: BlockNumber) -> Vec<ValidatorId> {
Expand Down

0 comments on commit b0b4583

Please sign in to comment.