Skip to content

Commit

Permalink
fix(consensus): resolve dropped messages
Browse files Browse the repository at this point in the history
  • Loading branch information
asmaastarkware committed Jul 18, 2024
1 parent e23be56 commit e7bcf31
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 @@ -64,15 +64,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 e7bcf31

Please sign in to comment.