Decommissioned stateful leader election#3319
Merged
Conversation
The new algorithm is choosing leader of (height,round), based on hash(height,round) and weights of validators (public lottery). The new algorithm is enabled via config flag: Consensus.StatelessLeaderElection (false by default). It will be the only option in 6.5. Additional changes: * updated crypto package to include zeroize fix (otherwise it panics under a new compiler) * made consensus tests run against both stateful and stateless leader election. The caveat is that many of the consensus tests are very poor quality and they hardcode the expected leader schedule. To minimize the amount of work, these tests have been adjusted in one of the following ways: a) the test harness looks for a starting round which produces the leader schedule that the test expects; b) the test harness adjusts the weights so that the leader schedule matches what the test expects. * I have manually run the tests outside of the consensus module with StatelessLeaderElection = true, however these are not included in CI.
Switching the default to true, will disable stateful leader election completely in 6.6
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3319 +/- ##
==========================================
- Coverage 59.19% 58.43% -0.77%
==========================================
Files 2097 2085 -12
Lines 172482 209275 +36793
==========================================
+ Hits 102106 122282 +20176
- Misses 61532 78187 +16655
+ Partials 8844 8806 -38
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
sei-will
approved these changes
Apr 27, 2026
wen-coding
approved these changes
Apr 28, 2026
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.
will be deployed with 6.6 (at earliest)