This repository was archived by the owner on Mar 5, 2024. It is now read-only.
change consensus deselection weighting#1468
Merged
Vagabond merged 1 commit intohelium:masterfrom Sep 30, 2022
Merged
Conversation
Vagabond
reviewed
Sep 30, 2022
| new_group(Ledger, Hash, Size, Delay) -> | ||
| case ?get_var(?election_version, Ledger) of | ||
| {ok, N} when N >= 7 -> | ||
| new_group_v7(Ledger, Hash, Size, Delay); |
Contributor
There was a problem hiding this comment.
Wouldn't the previous clause have handled this correctly, because 7 >= 6?
Contributor
Author
There was a problem hiding this comment.
yes, admittedly its a little clunky but i did it for readability. for each previous election_version, there was a one-to-one mapping with new_group_vX. So, I thought calling a v6 when election_version = 7 was going to be unintuitive. so long as the author v8 is cautious, then i'd be happy to change it. maybe just put a comment here
Vagabond
approved these changes
Sep 30, 2022
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This change lays the foundation for additional tunability in the election process, specifically with the goal of removing low performers more quickly from the group. This flexibility is achieved through two changes:
election_penalty_history_percentagewhich is used during scoring of existing group members before selecting members for removal. This value controls whether and how much the previous penalties contribute to the score:([election_penalty_history_percentage] * [total existing penalty]) + [current epoch performance penalty] + [current epoch tenure penalty]These changes are guarded behind election_version = 7. No changes are made in the logic for selection new validators into CG. It continues to be weighted random based on the total penalty score at time of the election.
To achieve the goal of more quickly removing low performers, I suggest that
election_penalty_history_percentage= 0. This causes the deselection to be based entirely on performance in the existing group which in my opinion is the most important consideration for a well functioning CG. In the long-run, this will still provide equal rewards for equal performance. If all validators have perform perfectly during an epoch, the odds of being removed are equal. That said, governance processes should be used to select the value of this new var and are outside the scope of this PR.