Remove unused StakeLockout::lockout#10719
Conversation
|
Odd.. Why the test fails? I felt |
| for slot in slot_with_ancestors { | ||
| let entry = &mut stake_lockouts.entry(slot).or_default(); | ||
| entry.lockout += vote.lockout(); | ||
| stake_lockouts.insert(slot, StakeLockout::default()); |
There was a problem hiding this comment.
I think the test failures are because this is replacing the slot entry every time (resets stake_lockouts.stake, but it could already exist from previous calls to update_ancestor_stakes 😃 )
Codecov Report
@@ Coverage Diff @@
## master #10719 +/- ##
=========================================
- Coverage 81.7% 81.7% -0.1%
=========================================
Files 300 300
Lines 70509 70482 -27
=========================================
- Hits 57660 57622 -38
- Misses 12849 12860 +11 |
| pub stake_lockouts: HashMap<Slot, StakeLockout>, | ||
| pub total_staked: u64, | ||
| pub voted_stakes: VotedStakes, | ||
| pub total_stake: Stake, |
There was a problem hiding this comment.
@carllin I've ended up renaming bunch of interrelated fields/types while addressing https://github.com/solana-labs/solana/pull/10719/files#r443351567. How does this look for you, overall?
Also, I've chosen adjuctive noun naming convension because I think this is more natural than total_staked/vote_staked, etc. And the precedent exists: rooted_stake in the existing code (not stake_rooted) and Active Stake: XXX in solana validator (not Active Staked).
There was a problem hiding this comment.
Ah, also, I've added Voted intentionally because just Stakes sounded too general.
* Remove unused StakeLockout::lockout * Revert... * Really revert to the original behavior... * Use consistent naming after StakeLockout removal * Furhter clean up * Missed type aliases... * More... * Even more...
Problem
StakeLockout::lockout isn't used anymore and it does unnecessary computation to mange the field and uses extra memory.
Also, the naming is outdated as a result.
Summary of Changes
Remove the field and tidy up the namings of types and fields.
This PR should contain no functional change.
Part of #10718