Correctly handle the only root case#13352
Conversation
| slot_history.add(42); | ||
|
|
||
| let tower = tower.adjust_lockouts_after_replay(42, &slot_history); | ||
| assert_eq!(tower.unwrap().voted_slots(), [42]); |
| } | ||
|
|
||
| #[test] | ||
| fn test_adjust_lockouts_after_replay_vote_on_only_root() { |
There was a problem hiding this comment.
also add future tower version of this test?
|
|
||
| let original_votes_len = self.lockouts.votes.len(); | ||
| self.initialize_lockouts(move |_| retain_flags_for_each_vote.next().unwrap()); | ||
| let keep_the_only_root_vote_for_no_double_vote = |
There was a problem hiding this comment.
comment here why this must be accepted.
There was a problem hiding this comment.
because we start to vote on root....
also, it's very very rare to see this on the wild. I've just come up with this possibility while working on #12671.
There was a problem hiding this comment.
We can also augment the check here https://github.com/solana-labs/solana/blob/master/core/src/consensus.rs#L454 to check that the vote slot > root so the is_locked_out check will fail
Codecov Report
@@ Coverage Diff @@
## master #13352 +/- ##
=======================================
Coverage 82.0% 82.0%
=======================================
Files 376 376
Lines 87888 87903 +15
=======================================
+ Hits 72104 72132 +28
+ Misses 15784 15771 -13 |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
|
This stale pull request has been automatically closed. Thank you for your contributions. |
Problem
this is the last known bug of tower.
this is just a brain dump so that I can focus on inflation.
Summary of Changes
TBD
Fixes #