Skip to content

Decommissioned stateful leader election#3319

Merged
pompon0 merged 13 commits intomainfrom
gprusak-election-main3
Apr 28, 2026
Merged

Decommissioned stateful leader election#3319
pompon0 merged 13 commits intomainfrom
gprusak-election-main3

Conversation

@pompon0
Copy link
Copy Markdown
Contributor

@pompon0 pompon0 commented Apr 27, 2026

will be deployed with 6.6 (at earliest)

pompon0 added 8 commits April 23, 2026 10:54
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
@pompon0 pompon0 requested a review from wen-coding April 27, 2026 17:43
@pompon0 pompon0 changed the title Decomissioned stateful leader election Decommissioned stateful leader election Apr 27, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 28, 2026, 12:14 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.43%. Comparing base (d67dd88) to head (bd2bdbb).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
sei-chain-pr 69.71% <100.00%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-tendermint/config/config.go 69.27% <ø> (-2.87%) ⬇️
sei-tendermint/internal/consensus/state.go 81.89% <100.00%> (+6.33%) ⬆️
...tendermint/internal/consensus/types/round_state.go 85.84% <100.00%> (-0.19%) ⬇️

... and 1813 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pompon0 pompon0 requested a review from sei-will April 27, 2026 18:20
Base automatically changed from gprusak-election-main2 to main April 27, 2026 19:10
@pompon0 pompon0 added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit 33099c0 Apr 28, 2026
38 checks passed
@pompon0 pompon0 deleted the gprusak-election-main3 branch April 28, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants