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

Exit early if there's no validator slashing #7587

Merged
merged 9 commits into from Oct 21, 2020
Merged

Conversation

terencechain
Copy link
Member

@terencechain terencechain commented Oct 20, 2020

These validators copies for process slashing are bad. We shouldn't need to copy validators if slashing is not going to happen. This PR implemented a pre condition and a circuit breaker to exit early if there's no meaningful slashing to process

Heap flames for references:
Screen Shot 2020-10-20 at 4 08 00 PM

Related #7544

@terencechain terencechain requested a review from a team as a code owner October 20, 2020 23:22
@terencechain terencechain changed the title Exit early if there's no slashing Exit early if there's no validator slashing Oct 20, 2020
@terencechain terencechain marked this pull request as draft October 21, 2020 00:13
@codecov
Copy link

codecov bot commented Oct 21, 2020

Codecov Report

Merging #7587 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #7587      +/-   ##
==========================================
+ Coverage   61.65%   61.68%   +0.02%     
==========================================
  Files         423      423              
  Lines       29666    29636      -30     
==========================================
- Hits        18290    18280      -10     
+ Misses       8448     8432      -16     
+ Partials     2928     2924       -4     

@@ -248,6 +248,16 @@ func ProcessFinalUpdates(state *stateTrie.BeaconState) (*stateTrie.BeaconState,
upwardThreshold := hysteresisInc * params.BeaconConfig().HysteresisUpwardMultiplier

bals := state.Balances()
var updateEffective bool
Copy link
Member Author

Choose a reason for hiding this comment

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

Note, this should be in a different PR

@terencechain
Copy link
Member Author

Related #7585

@terencechain terencechain marked this pull request as ready for review October 21, 2020 18:48
@terencechain terencechain added the Ready For Review A pull request ready for code review label Oct 21, 2020
@prylabs-bulldozer prylabs-bulldozer bot merged commit 9554ad3 into master Oct 21, 2020
@delete-merged-branch delete-merged-branch bot deleted the check-slashing branch October 21, 2020 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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