Ungated fixes extracted from harmony-one/harmony#5122 - #5125
Closed
Frozen wants to merge 2 commits into
Closed
Conversation
Fork-free subset of harmony-one#5122: every fix here changes no epoch-gated behaviour, so nodes running it stay in consensus with the current network. Critical: - consensus: reject VIEWCHANGE senders not in the committee; a non-member signature left the M3 aggregate unverifiable against its bitmap - slash: skip external debt apportionment when total external stake is zero (divide by zero on fully undelegated delegators) - votepower: guard zero TotalEffectiveStake in Compute (divide by zero) - core: reject CXReceiptsProof with mismatched ShardIDs/CXShardHashes lengths or a nil merkle proof High: - consensus: bound pending receipt header epoch to current+1 and cap requeues of proofs whose shard state never arrives - types: CXReceiptsProof.Copy wrote CommitSig into CommitBitmap - state: bounds-check AddReward against the delegation snapshot Medium: - staking: apply MaxBLSPerValidator before BLS proof verification Low: - core: nil parent check in MayBalanceMigration; nil receiver in ContainsEmptyField; GetVMConfig returns a copy; empty payload guard in HandleNodeMessage; unreachable uint64 comparison removed; slot key slice aliasing fixed
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
This PR extracts the mixed-binary-compatible, fork-free fixes from #5122.
These changes do not depend on
StrictStateValidationEpoch, do not change its activation epochs, and do not include any fork-gated behavior from #5122. They are intended to remain consensus-compatible while v1.2 and v1.3 validators operate together.Included fixes
CXShardHasheslists shorter thanShardIDs; preserve legacy acceptance of trailing hashes.current + 1and cap requeues.CommitSigandCommitBitmapinto the correct fields.AddRewardagainst the delegation snapshot.MaxBLSPerValidatorbefore BLS proof verification.CXReceiptsProofreceiver.GetVMConfig.Explicitly excluded
All rows marked
Gated: Yesin #5122 remain excluded, including the gated EVM, delegation, reward, vote-power, receipt-import, and validator-state behavior changes. This PR contains noStrictStateValidationEpochconfiguration change.Two initially ungated changes are also excluded because they alter mixed-binary state-transition behavior and require coordinated activation:
Strict equality for
ShardIDsandCXShardHashesis likewise deferred to a coordinated activation. This PR rejects only a shorter hash list, matching the legacy accepted-input boundary while replacing its out-of-range panic with an error.Provenance and scope
harmony-one/harmony:mainafter Reject abandoned branch hashes #5106 and Guard emergency recovery ViewID transitions #5107.Testing
Focused local verification on the current head:
Additional compatibility checks:
onViewChangeSanityCheckmembership test fails when the committee check is removed;