Repository navigation
fix(types): don't reject valid Platform quorums (8-of-12) in ValidateBasic - #1315
QuantumExplorer wants to merge 1 commit into
Conversation
…lid Platform quorums The threshold-vs-total-power check added in #1052 requires validator sets with more than 3 members to have a voting threshold of at least 2/3 + 1 of total power. The llmq_devnet_platform quorum type produced by Dash Core is 8-of-12, which is exactly 2/3 (threshold 800 of power 1200), so the check rejects it and the node fails replay in a restart loop: voting threshold 800 of quorum with power 1200 MUST be at least 2/3*1200+1 = 801 The threshold is dictated by the LLMQ quorum type formed by Core, not by Tenderdash, so enforcing a stricter rule here makes otherwise valid quorums unstartable. This removes the switch block (restoring pre-#1052 behavior) while keeping the VotingPowerThreshold overflow guard. Fixes #1314 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesQuorum Threshold Validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
replaced by #1328 |
Summary
Removes the quorum voting-threshold validation in
ValidatorSet.ValidateBasic()that prevents a node from starting when given a validllmq_devnet_platformquorum.Since v1.5.0, Tenderdash fails replay in a restart loop with:
llmq_devnet_platformis defined as 8-of-12 (dash/llmq/llmq.go), which is exactly 2/3 — threshold8 * 100 = 800of total power12 * 100 = 1200. The check added in #1052 requires more than 3-member sets to have a threshold of at least2/3 + 1 = 801, so it rejects the quorum Dash Core actually produces.The voting threshold is dictated by the LLMQ quorum type formed by Core, not by Tenderdash, so enforcing a stricter rule here makes otherwise-valid quorums unstartable.
Fixes #1314.
Changes
switch len(vals.Validators)threshold-vs-total-power block fromValidatorSet.ValidateBasic()(introduced in feat: allow defining validator power threshold in consensus params #1052, absent in v1.4.x).VotingPowerThresholdoverflow guard.This restores the pre-#1052
ValidateBasic()behavior for this code path.Notes / alternatives
The block was also internally inconsistent:
case 3allowed exactly 2/3 (threshold < totalPower*2/3) while thedefaultbranch required strictly more (threshold < (totalPower*2/3)+1), so 3-member platform quorums passed but 12-member ones did not.If a strict BFT threshold is desired in the future, it should be coordinated with Dash Core's LLMQ quorum definitions (or driven via the
voting_power_thresholdconsensus param), rather than enforced unilaterally inValidateBasic()where it rejects quorums Core considers valid.Test plan
go build ./...go test ./types/...— existingTestValidatorSetValidateBasiccases still pass (none assert the removed threshold errors; the 1-validator and 4-validator "good" cases continue to validate).llmq_devnet_platform(8-of-12) quorum and confirm replay no longer fails.Summary by CodeRabbit