Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vote refresh fix when outside slothash (#29948)
* When there are too many pubkeys in one slot, kick the one with lowest stake out. * Cache last_root to reduce read locks we need. * Use slots_in_epoch to limit number of slots in the map. * Fix lint errors. * Only cache stake and slots per epoch once per epoch. * Revert "Only cache stake and slots per epoch once per epoch." This reverts commit 8658aad. * Vote at the tip of current fork if last vote is outside SlotHash of the tip and last vote expired. * Add unittest when last vote is outside slothash, we should vote at the tip of the current fork. * Revert "Use slots_in_epoch to limit number of slots in the map." This reverts commit 93574f5. * Revert "Cache last_root to reduce read locks we need." This reverts commit bb114ec. * Revert "When there are too many pubkeys in one slot, kick the one with lowest" This reverts commit 711e29a. * Move new vote generation when last vote is outside slothash into the main path, this actually makes more sense since we don't select where to vote in two different places, and all the vote generation logic is seamlessly inherited. * - Move vote refresh to be behind select vote and do not refresh vote if a new vote is selected. - Check whether last vote is inside slothash inside select_vote_and_reset_forks - rename slot_within_slothash to is_in_slothashes_history - remove one unittest for now, more tests will be added in a separate CL * Remove new test, it will be in another file. * Add is_in_slot_hashes_history test in the new file. * Add unittest for the case when last vote is outside slot hashes. * Small improvements and more unittests. * Fix bad merge. * Update docs/src/terminology.md Co-authored-by: mvines <[email protected]> * Put SwitchForkDecision::FailedSwitchThreshold logic into separate function. * Make linter happy. --------- Co-authored-by: mvines <[email protected]>
- Loading branch information