Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomize leader election #3693

Merged
merged 11 commits into from
Oct 1, 2024
Merged

Randomize leader election #3693

merged 11 commits into from
Oct 1, 2024

Conversation

ss-es
Copy link
Contributor

@ss-es ss-es commented Sep 23, 2024

Closes #3684

This PR:

  • Adds randomized (seeded by view) leader rotation as a separate type implementing the Membership trait. This logic previously existed but was gated behind a feature flag.
  • Mostly removes feature flag gating around leader rotation logic. The randomized-leader-election feature is completely removed, while fixed-leader-election is now exclusively a feature in the examples crate.
  • test_success and test_all_restart now also run with randomized leader rotations.

This PR does not:

Key places to review:

  • Are there other tests that should be run with randomized leader election?

Copy link
Contributor

@dailinsubjam dailinsubjam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others LGTM! Copy-pasted from Zullip for future sequencer-benchmarking reference:

https://github.com/EspressoSystems/espresso-sequencer/blob/8151b2b54c36802d13ef7262a6d364176ae13509/sequencer/src/context.rs#L106-L110

the first argument to new is just the nodes that you want to allow to be leader.

@ss-es ss-es marked this pull request as ready for review September 30, 2024 22:17
@ss-es ss-es requested a review from bfish713 as a code owner September 30, 2024 22:17
crates/hotshot/src/traits/election/randomized_committee.rs Outdated Show resolved Hide resolved
crates/examples/infra/mod.rs Show resolved Hide resolved
#[derive(Clone, Debug, Eq, PartialEq, Hash)]

/// The static committee election
pub struct GeneralStaticCommittee<T: NodeType> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just name this GeneralRandomCommittee? or similar so we don't have 2 structs named the exact same thing, I could see this causing some weird headache in the future. Unless this is some common code style thing I wasn't aware of

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just following the style from before, but yeah I agree -- renamed!

@ss-es ss-es merged commit f010b3b into main Oct 1, 2024
35 of 36 checks passed
@ss-es ss-es deleted the ss/seeded-leader-rotation branch October 1, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DRB] - Add seeded randomized leader rotation
4 participants