Skip to content

Conversation

@mattfoley8
Copy link
Contributor

@mattfoley8 mattfoley8 commented Jun 8, 2023

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.

@mattfoley8 mattfoley8 requested a review from lazynina June 8, 2023 15:59
@mattfoley8 mattfoley8 self-assigned this Jun 8, 2023
@mattfoley8 mattfoley8 requested a review from a team as a code owner June 8, 2023 15:59
Copy link
Member

@lazynina lazynina left a 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

}

// Retrieve the CurrentEpochNumber.
currentEpochNumber, err := bav.GetCurrentEpochNumber()
Copy link
Member

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?

Copy link
Contributor Author

@mattfoley8 mattfoley8 Jun 8, 2023

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.

@mattfoley8 mattfoley8 merged commit e0bd06b into mf/pos-merge-20230605 Jun 8, 2023
@mattfoley8 mattfoley8 deleted the mf/jail-inactive-validators branch June 8, 2023 19:25
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.

3 participants