-
Notifications
You must be signed in to change notification settings - Fork 108
Mf/jail inactive validators #550
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
Conversation
lazynina
left a comment
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.
Overall looks good - just two questions for you
lib/block_view_validator.go
Outdated
| } | ||
|
|
||
| // Retrieve the CurrentEpochNumber. | ||
| currentEpochNumber, err := bav.GetCurrentEpochNumber() |
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.
how do we know if they satisfied some criteria such that they shouldn't be jailed? Seems like we'd end up with every validator being jailed as it stands?
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.
That is correct as it stands now. I just updated the description above with this line:
A validator stays active by either voting on blocks or proposing new blocks. When they participate in consensus by performing either of those actions, we update their LastActiveAtEpochNumber.
We haven't implemented the consensus logic to handle VOTES or new BLOCK_PROPOSALS. But in that logic, we will be updating the ValidatorEntry.LastActiveAtEpochNumber = CurrentEpochNumber.
This PR jails inactive validators. A validator stays active by either voting on blocks or proposing new blocks. When they participate in consensus by performing either of those actions, we update their LastActiveAtEpochNumber. If they fall inactive beyond our grace period (a param stored on the GlobalParamsEntry) we jail them. We run this logic in the OnEpochCompleteHook.