apollo_consensus: better panic message on voted height storage error#13835
apollo_consensus: better panic message on voted height storage error#13835ShahakShama wants to merge 1 commit intomainfrom
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Code review
Demonstration: fn main() {
let x: Result<(), &str> = Err("underlying error");
x.expect("Failed to write voted height {self.height} to storage");
}Output: Suggestion: switch to self.voted_height_storage
.lock()
.await
.set_prev_voted_height(height)
.unwrap_or_else(|error| {
panic!(
"Failed to write voted height {height} to storage: {error}. Crashing before \
sending vote to avoid risk of equivocation"
)
});sequencer/crates/apollo_consensus/src/manager.rs Lines 1020 to 1028 in d32871d Reference: 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
|
|
|
Suggestion: |
itamar-starkware
left a comment
There was a problem hiding this comment.
@itamar-starkware reviewed 1 file and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ShahakShama).
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on itamar-starkware).
crates/apollo_consensus/src/manager.rs line 1023 at r1 (raw file):
Previously, itamar-starkware wrote…
Suggestion:
.expect(&format!("Failed to write voted height {height} to storage. Crashing..."));
Done.

No description provided.