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 aggregated attestation pool grows large in size #4932
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4932 +/- ##
==========================================
+ Coverage 45.45% 45.48% +0.02%
==========================================
Files 209 209
Lines 15960 15963 +3
==========================================
+ Hits 7254 7260 +6
+ Misses 7469 7466 -3
Partials 1237 1237 |
Don't merge yet, I'm testing proposer is passing |
@@ -24,8 +24,7 @@ func (s *Service) aggregateRoutine() { | |||
case <-s.ctx.Done(): | |||
return | |||
case <-ticker.C: | |||
attsToBeAggregated := append(s.pool.UnaggregatedAttestations(), s.pool.AggregatedAttestations()...) | |||
if err := s.aggregateAttestations(ctx, attsToBeAggregated); err != nil { | |||
if err := s.aggregateAttestations(ctx, s.pool.UnaggregatedAttestations()); err != nil { |
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.
Why wouldn't we use the aggregated ones too?
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.
Agreed this a problem. Reverted
* Add metrics * Use it * Use it * Fixed exp time and tests * Update on save too * Expose getters * One epoch purge time * Fixed a timing issue * Clean up * Gazelle * Interface * Prune every epoch * Aggregate twice per slot * Revert attsToBeAggregated * Delete expired atts Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Add metrics * Use it * Use it * Fixed exp time and tests * Update on save too * Expose getters * One epoch purge time * Fixed a timing issue * Clean up * Gazelle * Interface * Prune every epoch * Aggregate twice per slot * Revert attsToBeAggregated * Delete expired atts Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This fixes #4929
Please review and merge #4930 first
Attestation pool were growing large in size because we reset an item's expiration time upon new update. Say a new attestation with
dataA
and bits 0x01 comes in, the expires time of the attestation is set totime.Now + N
.One slot later another attestation with
dataA
but different bits came in. Here we should not touch the expire time, but instead the node reset the expire time totime.Now + N
again. That's why some attestations would never expire because we keep on re aggregating itself here:https://github.com/prysmaticlabs/prysm/compare/fix-exp-time?expand=1#diff-45a8f7c8f90ae232acabd3f59fdea76cL27
Change list:
Live testing update:
[2020-02-23 14:05:36 PST]: Ran it for 10+ epochs, the attestations pool count is steadily below 500 versus 2000.. before