fix: replace panic! with graceful error return in commit_shard_chunk and commit_block - #1016
Open
Sertug17 wants to merge 1 commit into
Open
fix: replace panic! with graceful error return in commit_shard_chunk and commit_block#1016Sertug17 wants to merge 1 commit into
Sertug17 wants to merge 1 commit into
Conversation
…nd commit_block Both functions called panic!() when replay_proposal returned an error, crashing the entire node process. This happens after consensus has already decided on a value, so a transient storage error would take down the node completely and force a full resync. Replace panic! with early return so the node stays alive and the error is surfaced via the existing error!() log call. Closes farcasterxyz#1015
|
@claude is attempting to deploy a commit to the Internal - Neynar Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes issue #1015.
Both
commit_shard_chunk(src/storage/store/engine.rs) andcommit_block(src/storage/store/block_engine.rs) calledpanic!()whenreplay_proposalreturned an error. This crashes the entire node process a single transient storage error would take down a validator or full node completely.Problem
These functions are called after consensus has already decided on a value. At that point the node is committed to applying the block. If
replay_proposalreturns an error (e.g. transient I/O failure, unexpected DB state), the previous code panicked:This means:
Fix
Replace
panic!()with earlyreturn, keeping the existingerror!()log:The error is already logged clearly. The node stays alive and can continue processing future blocks rather than crashing.
Files Changed
src/storage/store/engine.rscommit_shard_chunksrc/storage/store/block_engine.rscommit_blockCloses #1015