Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

Conversation

PaulVMo
Copy link
Contributor

@PaulVMo PaulVMo commented Aug 22, 2022

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:

  1. New chain var election_penalty_history_percentage which 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]
  2. Changes the tenure penalty from being applied at the beginning of the round to the end of the round. This makes it so that the tenure penalty for the current group is not part of the previous penalties. This is necessary because if the election_penalty_history_percentage is zero, we still want to count the current round's tenure penalty in the score for deselecting.

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.

@@ -47,6 +48,8 @@ val_hb(#val_v1{heartbeat = HB}) ->

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't the previous clause have handled this correctly, because 7 >= 6?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants