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

Ensure validator active for voluntary exits #807

Merged
merged 5 commits into from
Mar 19, 2019
Merged

Conversation

JustinDrake
Copy link
Collaborator

No description provided.

Copy link
Contributor

@djrtwo djrtwo left a comment

Choose a reason for hiding this comment

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

Nice catch!

Copy link
Contributor

@djrtwo djrtwo left a comment

Choose a reason for hiding this comment

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

Actually, this can still underflow because activation_epoch is set to ACTIVE_EXIT_DELAY epochs into the future so there is a set of epochs in which activation_epoch > current_epoch when validators are in the process of being activated.

I think it is safer to use assert is_active_validator or assert validator.activation_epoch <= get_current_epoch(state)

@JustinDrake
Copy link
Collaborator Author

I went with assert is_active_validator.

Copy link
Contributor

@djrtwo djrtwo left a comment

Choose a reason for hiding this comment

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

have full testing coverage on process_voluntary_exit woo

@djrtwo djrtwo merged commit c9975d7 into dev Mar 19, 2019
@djrtwo djrtwo deleted the JustinDrake-patch-20 branch March 19, 2019 22:03
@djrtwo djrtwo changed the title Avoid underflow in voluntary exits Ensure validator active for voluntary exits Apr 23, 2019
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

2 participants