-
Notifications
You must be signed in to change notification settings - Fork 0
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
new ban mechanism based on validator participation #17
Merged
Merged
Conversation
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
Contributor
Vitomir2
commented
May 16, 2024
- create the Participation struct and the mapping for the validator's participation;
- create a new status for active validator and activate it when initially stake;
- update the status check of the validator with active where applicable;
- set the activeFrom the current block number when activating the validator;
- create a new function in the ValidatorSet interface to update the lastlyActive for the validator participation;
- update the unstaking to take into account the delegation when unstaking the full amount;
- fix tests and write some new ones to cover the new changes;
SamBorisov
reviewed
May 17, 2024
R-Santev
requested changes
May 17, 2024
create the Participation struct and the mapping for the validator's participation; create new status for active validator and activate it when initially stake; update the status check of the validator with active where applicable; set the activeFrom the current block number when activate the validator; create new function in the ValidatorSet interface to update the lastlyActive for the validator participation; update the unstaking to take into account the delegation when unstaking full amount; fix tests and write some new ones to cover the new changes;
make the participation just a mapping with address and uint; move the participation in the validatorset; withdraw a reward for the reporter when ban a validator; add a parameter for the onlyValidator modifier in order to be able to re-use in more scenarios; delete banValidatorByOwner; add some more tests and delete the ones for the banValidatorByOwner; some other minor optimizations in the descriptions;
Vitomir2
force-pushed
the
125-implement-a-mechanism-to-measure-the-participation-of-every-validator-based-on-uptime-data-provided-to-the-rewardpool-so-a-validator-can-be-banned-in-case-offline-for-more-than-72-hours
branch
from
May 20, 2024 15:45
b9e3e01
to
562f1cc
Compare
R-Santev
requested changes
May 21, 2024
// if (amount > totalStake || amount + delegation > totalStake) | ||
if (amount > validatorStake) revert StakeRequirement({src: "unstake", msg: "INSUFFICIENT_BALANCE"}); | ||
|
||
// uint256 validatorStake = totalStake - delegation; | ||
totalStakeLeft = totalStake - amount; |
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.
totalStakeLeft is unused
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.
Yeah, but it is part of the named return params.
burn the penalty for the ban; delete some redundant comments and optimize others; rename the _mint and _burn methods to _increaseAccountBalance and _decreaseAccountBalance, respectively; add some more expects in the ban tests to assert that the penalty has been burned;
R-Santev
approved these changes
May 22, 2024
Vitomir2
deleted the
125-implement-a-mechanism-to-measure-the-participation-of-every-validator-based-on-uptime-data-provided-to-the-rewardpool-so-a-validator-can-be-banned-in-case-offline-for-more-than-72-hours
branch
May 22, 2024 07:04
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.