-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add prioritized validators. Filter prioritized validators when updating validator set. #15
Conversation
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.
Replace setPrioritizedValidators function with add/remove functions. Each time, a validator is added to or removed from the whitelist.
The _arrangeValidatorCandidates function can be optimized. We only need 1 for loop. (We do not need to fix it now. I only put a note here, let's do this later).
97dbb30
to
0db9b0f
Compare
function _arrangeValidatorCandidates(address[] memory _candidates, uint _newValidatorCount) | ||
internal | ||
view | ||
returns (address[] memory _arrangedValidators) | ||
{ | ||
_arrangedValidators = new address[](_newValidatorCount); |
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.
The array _candidates
is a memory variable, we may want to remove _arrangedValidators
for gas saving.
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.
I guess we can increase the weight for the whitelisted address (e.g adding to a fixed number)
Description
TODO
Checklist