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

Fix Up Exits Pool Logic #7774

Merged
merged 10 commits into from
Nov 11, 2020
Merged

Fix Up Exits Pool Logic #7774

merged 10 commits into from
Nov 11, 2020

Conversation

rauljordan
Copy link
Contributor

@rauljordan rauljordan commented Nov 11, 2020

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

This is related to #7772. Our exits logic was needlessly complex, and we needed better tests for it. Additionally, we needed to simplify further parts of the code in there and ensure our binary search is correct according to the Go stdlib. Among the changes included are:

  • Removal HasBeenIncluded() as the method was only used in tests
  • No need for maps to keep track of exits. All we should do is keep an ordered list of validator indices for exits that are pending and check incoming exits against the list with binary search
  • We should prevent malformed messages from making it into the pending exits list
  • If we receive a new exit that has a more favorable exit epoch, we replace the existing pending exit

@rauljordan rauljordan self-assigned this Nov 11, 2020
@rauljordan rauljordan added Bug Something isn't working Ready For Review A pull request ready for code review labels Nov 11, 2020
@codecov
Copy link

codecov bot commented Nov 11, 2020

Codecov Report

Merging #7774 (d57bdb3) into master (660ed2d) will increase coverage by 0.07%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #7774      +/-   ##
==========================================
+ Coverage   62.17%   62.24%   +0.07%     
==========================================
  Files         429      429              
  Lines       30366    30365       -1     
==========================================
+ Hits        18881    18902      +21     
+ Misses       8549     8527      -22     
  Partials     2936     2936              

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants