fix(consensus): scope emergency shard-0 quorum power - #17
Open
Frozen wants to merge 1 commit into
Open
Conversation
Preserve all committee bitmap positions while assigning zero effective consensus power to the 41-key recovery manifest for the exact mainnet shard-0 block 92733439 certificate context. Apply the same roster semantics to live consensus and certificate verification, including context-safe caching and fail-closed parent-hash activation.
Greptile SummaryThis coordinated consensus change scopes an emergency shard-0 voting-power roster to the final block of mainnet epoch 3002 while preserving committee membership and bitmap positions.
Confidence Score: 5/5The PR appears safe to merge as a coordinated hard fork, with no concrete changed-code defect identified in the scoped quorum activation or verification paths. Live consensus and certificate verification consistently identify signed block 92733439 by mainnet chain, shard, epoch, height, and retained parent hash, fail closed on boundary mismatches, preserve bitmap ordering, and restore the canonical roster for epoch 3003.
|
| Filename | Overview |
|---|---|
| consensus/quorum/emergency.go | Defines the exact activation boundary, validates the manifest and roster, and creates a copied, normalized effective voting-power roster without changing bitmap ordering. |
| consensus/quorum/one-node-staked-vote.go | Adds context-aware voter initialization so live prepare, commit, and view-change tallies use the emergency effective roster. |
| consensus/quorum/verifier.go | Applies the same context-sensitive effective roster while verifying certificate bitmaps and fails closed on an invalid activation context. |
| consensus/consensus_service.go | Builds the next signed block's voting-power context from the retained current header when updating the live decider. |
| consensus/consensus_v2.go | Refreshes consensus immediately after committing the retained parent so emergency activation does not depend on restart or epoch transition. |
| internal/chain/engine.go | Propagates signed-block context through certificate verification, recovers cross-link parent hashes when available, and scopes verified-signature cache entries to all quorum-relevant inputs. |
Sequence Diagram
sequenceDiagram
participant C as Consensus
participant D as Live Decider
participant E as Chain Engine
participant V as Quorum Verifier
C->>D: Commit retained parent 92733438
C->>D: Refresh for signed block 92733439
D->>D: Exclude 41 keys and renormalize 156 slots
C->>D: Form VIEWCHANGE/PREPARE/COMMIT quorum
E->>V: Verify certificate with chain, epoch, height, parent hash
V->>V: Apply identical emergency effective roster
C->>D: Commit epoch-final block 92733439
C->>D: Refresh canonical epoch-3003 roster
Reviews (1): Last reviewed commit: "fix(consensus): scope emergency shard-0 ..." | Re-trigger Greptile
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 is a coordinated consensus hard fork for the stalled mainnet shard-0 boundary at the end of epoch 3002.
1.VIEWCHANGE,PREPARE, andCOMMITquorum paths and to block/cross-link certificate verification.Exact activation boundary
The override applies only when all of the following match:
A candidate context at signed height
92733439with a different parent hash fails closed. Historical and all other out-of-scope certificates use the original roster and voting power.Certificate boundary:
The override therefore sunsets after the certificate for signed block
92733439; epoch 3003 uses the canonical roster.Manifest attestation
Immediately before publication, two independent production shard-0 nodes agreed on:
Ordered manifest integrity:
This attests exact membership and serialization against the retained committee. It does not claim key ownership or future availability.
Consensus/state isolation
This patch does not change:
votepower.Computebehavior.Only context-scoped consensus voting power is transformed. An excluded leader can still cause a timeout; the following view change can reach quorum under the same effective roster.
Rollout risks and requirements
41/41manifest match before enabling consensus.Verification
make testwas not used because this repository target runskill_node.sh, pulls the floatingharmonyone/localnet-testimage, and mounts the active checkout. Native package tests and compile checks above avoid those side effects and the unpinned image.