-
Notifications
You must be signed in to change notification settings - Fork 303
Remove u64 leader schedule #2551
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the u64-based leader schedule implementation from the codebase and simplifies the leader election mechanism to only use U256-based weighted round-robin scheduling. The key changes include removing the Epoch parameter from the get_leader trait method and eliminating the staking_activation configuration that previously determined which algorithm to use.
- Simplified the
LeaderElectiontrait by removing theepochparameter fromget_leadermethod - Removed u64-based leader schedule generation and the associated
staking_activationepoch configuration - Updated
WeightedRoundRobinto useDefaulttrait instead ofnew()constructor
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| monad-validator/src/leader_election.rs | Removed Epoch parameter from get_leader trait method signature and cleaned up imports |
| monad-validator/src/weighted_round_robin.rs | Removed staking_activation field, replaced new() with Default impl, removed u64-based functions (randomize, generate_random_validator_u64), simplified get_leader implementation, and removed obsolete test |
| monad-validator/src/simple_round_robin.rs | Removed unused _epoch parameter from get_leader implementation and cleaned up imports |
| monad-testutil/src/proposal.rs | Updated get_leader call site to remove epoch argument |
| monad-state/src/lib.rs | Updated get_leader call sites and changed instantiation to use WeightedRoundRobin::default() |
| monad-node/src/main.rs | Changed WeightedRoundRobin instantiation to use default() instead of new(staking_activation) |
| monad-node/examples/ledger-tail.rs | Removed unused ChainConfig and MonadChainConfig imports, removed staking activation lookup code, updated leader election instantiation to use default() |
| monad-debugger/src/graphql/mod.rs | Updated get_leader call sites to remove epoch argument |
| monad-consensus/tests/proposal.rs | Removed unused _epoch parameter from test implementation of LeaderElection trait |
| monad-consensus/src/validation/signing.rs | Updated all get_leader call sites and changed test instantiations to use WeightedRoundRobin::default() |
| monad-consensus-state/src/lib.rs | Updated all get_leader call sites throughout the consensus state machine to remove epoch argument |
| monad-blocksync/src/blocksync.rs | Updated test get_leader call site to remove epoch argument |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d58433c to
3fe546c
Compare
af3a374
3fe546c to
af3a374
Compare
No description provided.