mirror of
https://github.com/luxfi/node.git
synced 2026-07-27 03:39:39 +00:00
v1.34.26: consensus v1.35.29 -> v1.35.33 (finality committee sizing) + quorum ValidatorCount
Restores mainnet C-Chain finality. The prior stall: with 5 live validators but MainnetParams K=21/alpha=15, BOTH finality gates (assembleCertLocked cert-alpha AND view-change POL) required 15 distinct votes — impossible from 5 validators, so the chain froze (safe, no fork). consensus v1.35.33 sizes both gates from the live validator count via effectiveCommittee (alpha=4 for n=5), inheriting the minBFTCommittee K=4/alpha=3 floor (1085013 self-finality guard preserved); Snowman K=21 sample untouched. node chains/quorum.go adds validatorStakeSource.ValidatorCount (height-indexed, deterministic). EVM stays v1.104.7 (head-state pin). Test: 5-validator MainnetParams control freezes, fix converges in 0.35s. Co-authored-by: Hanzo Dev <dev@hanzo.ai>
This commit is contained in:
@@ -267,6 +267,16 @@ func (s *validatorStakeSource) TotalStake(height uint64) uint64 {
|
||||
return total
|
||||
}
|
||||
|
||||
// ValidatorCount implements consensuschain.StakeSource. The number of DISTINCT
|
||||
// validators in the set IN FORCE AT height — the round-scoped view-change's BFT
|
||||
// committee size (it sizes its POL/precommit quorum to bftAlpha over this count,
|
||||
// NOT the oversized Snowman sample K). Read from the SAME height-indexed set as
|
||||
// Weight/TotalStake so every node computes the identical committee and the
|
||||
// count-quorum matches the ⅔-by-stake set exactly.
|
||||
func (s *validatorStakeSource) ValidatorCount(height uint64) int {
|
||||
return len(validatorSetAtHeight(s.state, s.networkID, height))
|
||||
}
|
||||
|
||||
var _ consensuschain.StakeSource = (*validatorStakeSource)(nil)
|
||||
|
||||
// --- validator-set-root source (MEDIUM: epoch binding) -----------------------
|
||||
|
||||
Reference in New Issue
Block a user