Skip to content

Commit 7991681

Browse files
authored
fix logs (#722)
## 📝 Summary <!--- A general summary of your changes --> ## 💡 Motivation and Context <!--- (Optional) Why is this change required? What problem does it solve? Remove this section if not applicable. --> --- ## ✅ I have completed the following steps: * [ ] Run `make lint` * [ ] Run `make test` * [ ] Added tests (if applicable)
1 parent 6064832 commit 7991681

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

crates/rbuilder/src/live_builder/block_output/unfinished_block_processing.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ impl PrefinalizedBlockInner {
167167
.adjust_finalized_block(local_ctx, value, seen_competition_bid)
168168
.map(Some)
169169
} else {
170+
// we clone here because finalizing block multiple times is not supported
170171
self.block_building_helper
172+
.box_clone()
171173
.finalize_block(local_ctx, value, seen_competition_bid)
172174
.map(Some)
173175
}
@@ -394,7 +396,9 @@ impl UnfinishedBuiltBlocksInput {
394396
trace!("Prefinalized block");
395397
}
396398
Err(err) => {
397-
error!(?err, "Failed to prefinalize block");
399+
if err.is_critical() {
400+
error!(?err, "Failed to prefinalize block");
401+
}
398402
continue;
399403
}
400404
};
@@ -464,7 +468,18 @@ impl UnfinishedBuiltBlocksInput {
464468
block.block_id != finalize_command.prefinalized_block.block_id
465469
});
466470

467-
error!(?err, "Failed to finalize prefinalized block");
471+
let log_error = if self.adjust_finalized_blocks {
472+
// always log this error as its not expected when adjusting blocks
473+
true
474+
} else {
475+
// same as for old flow with finalization, log only critical errors
476+
err.is_critical()
477+
};
478+
479+
if log_error {
480+
// when adjusting blocks finalization adjustment should not fail
481+
error!(?err, "Failed to finalize prefinalized block");
482+
}
468483
continue;
469484
}
470485
};

0 commit comments

Comments
 (0)