fix: resolve 4 panics in mempool and proposer - #1014
Open
Sertug17 wants to merge 1 commit into
Open
Conversation
- fix BlockProposer warn log: our_height was logging proposal_height - replace todo!() with fallback MempoolKey for data=None messages - replace unwrap() with safe map on fname_transfer.proof Closes farcasterxyz#1013
|
@Sertug17 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 4 confirmed bugs found by static code analysis:
1. Genesis parent_hash typo (
src/consensus/proposer.rs:173)vec![0, 32]produces a 2-byte array[0x00, 0x20]should bevec. The comma vs semicolon typo corrupts the genesis shard chunk hash.2. BlockProposer warn log:
our_heightshowed wrong value (src/consensus/proposer.rs:588)Both
our_heightandproposal_heightlogged the same value. Fixed to logconfirmed_height.block_number, consistent with ShardProposer.3.
todo!()panic on gossip message decode failure (src/mempool/mempool.rs:310)message_bytes_decode()setsdata = Noneon failure → message passesmessage_is_valid()→mempool_key()hitstodo!()→ mempool task panics. A malformed gossip message from any peer could crash the node.4.
fname_transfer.proof.unwrap()panic (src/mempool/mempool.rs:329)proofisOptionin protobuf. AnFnameTransferwithproof: Nonewould panic the mempool task.Closes #1013