Skip to content

fix: resolve 4 panics in mempool and proposer - #1014

Open
Sertug17 wants to merge 1 commit into
farcasterxyz:mainfrom
Sertug17:fix/mempool-panic-and-proposer-bugs
Open

fix: resolve 4 panics in mempool and proposer#1014
Sertug17 wants to merge 1 commit into
farcasterxyz:mainfrom
Sertug17:fix/mempool-panic-and-proposer-bugs

Conversation

@Sertug17

@Sertug17 Sertug17 commented Aug 12, 2026

Copy link
Copy Markdown

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 be vec![0; 32] (32 zero bytes). The comma vs semicolon typo corrupts the genesis shard chunk hash.

2. BlockProposer warn log: our_height showed wrong value (src/consensus/proposer.rs:588)
Both our_height and proposal_height logged the same value. Fixed to log confirmed_height.block_number, consistent with ShardProposer.

3. todo!() panic on gossip message decode failure (src/mempool/mempool.rs:310)
message_bytes_decode() sets data = None on failure → message passes message_is_valid()mempool_key() hits todo!() → 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)
proof is Option in protobuf. An FnameTransfer with proof: None would panic the mempool task.

Closes #1013

- 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
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

@Sertug17 is attempting to deploy a commit to the Internal - Neynar Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: mempool panics on todo!() when a gossip message fails to decode data_bytes

1 participant