Skip to content

StatelessLeaderElection defaults to true (port of #3291)#3318

Merged
pompon0 merged 8 commits into
mainfrom
gprusak-election-main2
Apr 27, 2026
Merged

StatelessLeaderElection defaults to true (port of #3291)#3318
pompon0 merged 8 commits into
mainfrom
gprusak-election-main2

Conversation

@pompon0

@pompon0 pompon0 commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Switching the default to true, will disable stateful leader election completely in 6.6

pompon0 added 6 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 review from sei-will and wen-coding April 27, 2026 17:41
@github-actions

github-actions Bot commented Apr 27, 2026

Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 27, 2026, 6:43 PM

@codecov

codecov Bot commented Apr 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.29%. Comparing base (3f9ee82) to head (53de65f).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3318      +/-   ##
==========================================
- Coverage   59.17%   58.29%   -0.88%     
==========================================
  Files        2093     2085       -8     
  Lines      171956   208881   +36925     
==========================================
+ Hits       101754   121777   +20023     
- Misses      61391    78312   +16921     
+ Partials     8811     8792      -19     
Flag Coverage Δ
sei-chain-pr 70.35% <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% <100.00%> (-2.81%) ⬇️

... and 1810 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.

Base automatically changed from gprusak-election-main to main April 27, 2026 18:39
@pompon0 pompon0 enabled auto-merge April 27, 2026 18:42
@pompon0 pompon0 added this pull request to the merge queue Apr 27, 2026
Merged via the queue into main with commit d21cb23 Apr 27, 2026
38 checks passed
@pompon0 pompon0 deleted the gprusak-election-main2 branch April 27, 2026 19:10
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