Skip to content
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

En 7716 below signed threshold #2337

Merged
merged 8 commits into from
Oct 8, 2020

Conversation

raduchis
Copy link
Contributor

@raduchis raduchis commented Oct 1, 2020

according to the economics document if a validator has a number of signatures included below 2.5% all the rating increases as a validator, validatorSuccess and validatorIgnored should be reverted for the current epoch.

Testing: start a testnet and shutdown a validator. During the first 2 epochs the validators rating should be decreased by the number of validator failures, while on the third epoch by the number of success and ignored

@@ -26,6 +26,9 @@
# SwitchJailWaitingEnableEpoch represents the epoch when the system smart contract processing at end of epoch is enabled
SwitchJailWaitingEnableEpoch = 2

# BelowSignedThresholdEnableEpoch represents the epoch when the change for computing rating for validators below signed rating is enabled
BelowSignedThresholdEnableEpoch = 2
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

process/peer/process.go Outdated Show resolved Hide resolved

if computedThreshold <= signedThreshold {
newTempRating := vs.rater.RevertIncreaseValidator(shardId, validator.TempRating, validator.ValidatorFailure)
increasedRatingTimes := uint32(0)
if epoch < vs.belowSignedThresholdEnableEpoch {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is ok as it is. In other cases (where current epoch was unavailable) we used the epoch change notifier mechanism.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok!

@bogdan-rosianu bogdan-rosianu self-requested a review October 2, 2020 08:49
bogdan-rosianu
bogdan-rosianu previously approved these changes Oct 2, 2020
Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

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

System tests passed.

@LucianMincu LucianMincu merged commit 21fea20 into development Oct 8, 2020
@LucianMincu LucianMincu deleted the EN-7716-below-signed-threshold branch October 8, 2020 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants