Mainnet Patch: cross-shard, staking, rewards, consensus and the VM (dev port) - #19
Mainnet Patch: cross-shard, staking, rewards, consensus and the VM (dev port)#19Frozen wants to merge 38 commits into
Conversation
Greptile SummaryThe PR ports a coordinated, fork-gated mainnet patch covering cross-shard receipt validation, staking and reward accounting, quorum behavior, block processing, RPC exposure, and EVM state transitions. No publishable defect remained after reviewing the changed paths and their surrounding contracts.
Confidence Score: 5/5The PR appears safe to merge based on the reviewed changes, with no concrete blocking or independently actionable non-blocking issue identified. The coordinated fork gating, validation checks, accounting corrections, and EVM rollback behavior are consistently applied across the examined proposal, import, execution, and persistence paths.
|
| Filename | Overview |
|---|---|
| internal/params/config.go | Introduces the shared fork epoch and rule used to gate consensus-affecting validation changes. |
| consensus/consensus_block_proposing.go | Bounds pending receipt epochs and retries while retaining temporarily unverifiable proofs. |
| core/blockchain_impl.go | Verifies incoming receipts on strict block insertion paths and isolates returned VM configuration. |
| core/staking_verifier.go | Validates delegation-index ownership and corrects reward collection and redelegation accounting. |
| core/vm/evm.go | Corrects nested transfer semantics and restores non-state EVM side effects when frames revert. |
| staking/types/delegation.go | Ensures every removed unlocked undelegation is included in the payout after activation. |
| staking/slash/double-sign.go | Avoids dividing slash debt by zero when a validator has no remaining external stake. |
| consensus/votepower/roster.go | Redistributes voting power across staked members when no Harmony-operated slots exist. |
| rpc/harmony/private_debug.go | Restricts the consensus-affecting backup-mode operation to the private debug RPC surface. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Block or transaction input] --> B{StrictStateValidation active?}
B -- No --> C[Legacy consensus and state behavior]
B -- Yes --> D[Additional receipt and staking validation]
D --> E[Process EVM and staking transitions]
E --> F{Execution succeeds?}
F -- No --> G[Restore state, receipts, and stake messages]
F -- Yes --> H[Persist validated state]
H --> I[Consensus and reward accounting]
Reviews (1): Last reviewed commit: "test(consensus): use dev BLS wrapper in ..." | Re-trigger Greptile
|
Superseded by the upstream PR: harmony-one#5130 |
Summary
Ports harmony-one#5122 from
mainto the currentdevbranch.This preserves the source PR's 30 fixes across cross-shard receipts/transfers, staking and delegation, rewards, EPoS/quorum, view change, block processing/storage, legacy sync, RPC, and the EVM. No new protocol scope is added.
Dev integration
dev.dev's dirty-validator persistence behavior where it overlaps the strict-state-validation changes.dev's Herumi-backed BLS wrapper introduced by Replace Harmony BLS forks with official Herumi package harmony-one/harmony#5086.Source PR: harmony-one#5122
Testing
All listed packages pass locally on the rebased branch.