Skip to content
This repository has been archived by the owner on Dec 26, 2024. It is now read-only.

Commit

Permalink
fix(consensus): resolve dropped messages (#2236)
Browse files Browse the repository at this point in the history
  • Loading branch information
asmaastarkware authored and dan-starkware committed Jul 23, 2024
1 parent 6454563 commit 91b1013
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/sequencing/papyrus_consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,17 @@ where
}

loop {
let message = current_height_messages.pop().unwrap_or(
let message = if let Some(msg) = current_height_messages.pop() {
msg
} else {
// TODO(matan): Handle parsing failures and utilize ReportCallback.
network_receiver
.next()
.await
.expect("Network receiver closed unexpectedly")
.0
.expect("Failed to parse consensus message"),
);
.expect("Failed to parse consensus message")
};

if message.height() != height.0 {
debug!("Received a message for a different height. {:?}", message);
Expand Down

0 comments on commit 91b1013

Please sign in to comment.