Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion linera-bridge/src/monitor/linera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,16 @@ async fn persist_cert_bytes(
event_indices: &[u32],
cert: &ConfirmedBlockCertificate,
) {
let cert_bytes = bcs::to_bytes(cert).expect("BCS-serialize cert");
// BCS serialization can fail (e.g. for overly nested or oversized values), so skip the height
// rather than panicking and aborting the whole monitor loop — matching how the caller handles a
// failed certificate read.
let cert_bytes = match bcs::to_bytes(cert) {
Ok(bytes) => bytes,
Err(error) => {
tracing::warn!(?height, ?error, "Failed to BCS-serialize certificate");
return;
}
};
let state = monitor.read().await;
let Some(db) = state.db() else { return };
for event_index in event_indices {
Expand Down
Loading