Skip to content

leader election algorithm (port of #3270)#3305

Merged
pompon0 merged 4 commits intomainfrom
gprusak-election-main
Apr 27, 2026
Merged

leader election algorithm (port of #3270)#3305
pompon0 merged 4 commits intomainfrom
gprusak-election-main

Conversation

@pompon0
Copy link
Copy Markdown
Contributor

@pompon0 pompon0 commented Apr 23, 2026

No description provided.

pompon0 added 2 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.
@pompon0 pompon0 requested review from sei-will and wen-coding April 23, 2026 12:42
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 27, 2026, 5:23 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.44%. Comparing base (10c2d92) to head (9fbc709).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
sei-tendermint/internal/consensus/state.go 91.66% 0 Missing and 1 partial ⚠️
...tendermint/internal/consensus/types/round_state.go 96.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3305      +/-   ##
==========================================
- Coverage   59.16%   58.44%   -0.73%     
==========================================
  Files        2093     2085       -8     
  Lines      171972   209324   +37352     
==========================================
+ Hits       101755   122332   +20577     
- Misses      61401    78194   +16793     
+ Partials     8816     8798      -18     
Flag Coverage Δ
sei-chain-pr 76.36% <95.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%) ⬇️
sei-tendermint/types/validator_set.go 93.30% <100.00%> (+0.20%) ⬆️
sei-tendermint/internal/consensus/state.go 82.58% <91.66%> (+7.91%) ⬆️
...tendermint/internal/consensus/types/round_state.go 86.37% <96.00%> (+1.10%) ⬆️

... and 1808 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 enabled auto-merge April 23, 2026 13:00
@pompon0 pompon0 changed the title new short term election algorithm (port of #3270) leader election algorithm (port of #3270) Apr 23, 2026
@pompon0 pompon0 added this pull request to the merge queue Apr 27, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Apr 27, 2026
@pompon0 pompon0 enabled auto-merge April 27, 2026 17:21
@pompon0 pompon0 added this pull request to the merge queue Apr 27, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 27, 2026
@pompon0 pompon0 added this pull request to the merge queue Apr 27, 2026
Merged via the queue into main with commit 3f9ee82 Apr 27, 2026
38 checks passed
@pompon0 pompon0 deleted the gprusak-election-main branch April 27, 2026 18:39
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