fix: Require prepare quorum on NEWVIEW M1 and reject incomplete CX proofs - #5138
Draft
GheisMohammadi wants to merge 2 commits into
Draft
fix: Require prepare quorum on NEWVIEW M1 and reject incomplete CX proofs#5138GheisMohammadi wants to merge 2 commits into
GheisMohammadi wants to merge 2 commits into
Conversation
M1 is a prepare certificate: the payload must include the block hash, and the prepare mask must meet quorum.
Nil receipts, merkle block numbers, header numbers, and amounts cannot be read as values.
GheisMohammadi
marked this pull request as draft
August 27, 2026 21:50
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.
Two small validation fixes. Behavior for normal blocks and valid proofs is unchanged.
NEWVIEW M1 prepare check
During view change, a NEWVIEW message can carry an M1 payload: the prepared block hash, plus the prepare signature and bitmap.
ProcessViewChangeMsgalready requires that prepare bitmap to reach quorum.onNewViewnow does the same:ValidPayloadLength(32-byte hash plus signature bytes) before the hash is readIf those checks fail, the node stays in view change.
Incomplete CX receipts proofs
A cross-shard receipts proof is incomplete if required pointers are missing. Those fields are now treated as empty / invalid before they are used:
Receiptslist →GetToShardIDreturns an errorMerkleProof.BlockNumor header number →ContainsEmptyFieldis trueAmountonCXReceipt.Copy→ copy keeps amount as nil (big.Int.Setneeds a non-nil source)