forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 239
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
wen_restart: Fix the epoch_stakes used in calculation. #2376
Merged
wen-coding
merged 31 commits into
anza-xyz:master
from
wen-coding:wen_restart_use_appropriate_epoch_stakes
Aug 23, 2024
Merged
Changes from 16 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
777f739
wen_restart: Fix the epoch_stakes used in calculation.
wen-coding 6fdf31e
Merge branch 'master' into wen_restart_use_appropriate_epoch_stakes
wen-coding a5cc18e
Fix a bad merge.
wen-coding 2bef89b
Remove EpochStakesCache, it only caches epoch stakes from root_bank, …
wen-coding 4e85977
Split aggregate into smaller functions.
wen-coding 20614e9
Merge branch 'master' into wen_restart_use_appropriate_epoch_stakes
wen-coding 77df63b
Merge branch 'master' into wen_restart_use_appropriate_epoch_stakes
wen-coding dfcc6cc
Merge branch 'master' into wen_restart_use_appropriate_epoch_stakes
wen-coding 2a30886
Switch to node_id_to_stake which is simpler.
wen-coding ec895a4
Rename update_slots_stake_map and switch to epoch_total_stake().
wen-coding fffffb7
Merge branch 'master' into wen_restart_use_appropriate_epoch_stakes
wen-coding 0c0b574
Remove unnecessary utility functions.
wen-coding 78598f4
Do not modify epoch_info_vec, just init it with two epochs we will co…
wen-coding 0cef6f2
Merge branch 'master' into wen_restart_use_appropriate_epoch_stakes
wen-coding a601722
Merge branch 'master' into wen_restart_use_appropriate_epoch_stakes
wen-coding 1f74e80
Switch to epoch_node_id_to_stake()
wen-coding ac97e1e
Add test for divergence at Epoch boundary.
wen-coding 67848af
Merge branch 'master' into wen_restart_use_appropriate_epoch_stakes
wen-coding 4958a24
Make linter happy.
wen-coding a236422
Merge branch 'master' into wen_restart_use_appropriate_epoch_stakes
wen-coding 5df389e
- wait for the new Epoch if > 1/3 of the validators voted for some
wen-coding 198237c
Merge branch 'master' into wen_restart_use_appropriate_epoch_stakes
wen-coding 13a6b25
Fix a bad merge.
wen-coding bafbced
Merge branch 'master' into wen_restart_use_appropriate_epoch_stakes
wen-coding 1c96e52
Fix a bad merge.
wen-coding 1202248
Merge branch 'master' into wen_restart_use_appropriate_epoch_stakes
wen-coding 0b4857a
Change constant format.
wen-coding 944a357
Do not loop through the whole table.
wen-coding d733f4a
Address reviewer feedback.
wen-coding 9242a56
Address reviewer comments.
wen-coding 6c0cd01
Merge branch 'master' into wen_restart_use_appropriate_epoch_stakes
wen-coding File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
hmm do we need this extra flag, can we just ignore LastVotedForkSlots that are not in the current or next epoch?
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.
We need this extra flag because
root_epoch + 1
is always inepoch_info_vec
now, but we don't always considerroot_epoch + 1
for exit criteria. For example, we won't consider it at all if no one has ever voted in the next epoch.We then need this extra flag in the proto file because the proto file is a snapshot, we can restart from this snapshot. Then we need this calculated correctly.
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.
For logging purposes and cleaner implementation instead of the
considered_during_exit
flag, we could track for epochN
andN+1
two fields,voted_percent
andvoted_for_this_epoch_percent
voted_percent
is the % stake of the epoch that has voted for either epochvoted_for_this_epoch_percent
is the % stake of this epoch that has voted for a slot in this epoch.This might be useful for debugging as well if we log this information.
This seems extractable from the bank on restart
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.
Changed to voted_percent and voted_for_this_epoch_percent.