-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Implement Epoch Processing Helpers - Attestations Matching #2379
Conversation
Codecov Report
@@ Coverage Diff @@
## spec-v0.6 #2379 +/- ##
=============================================
+ Coverage 66.45% 66.54% +0.08%
=============================================
Files 121 121
Lines 9599 9630 +31
=============================================
+ Hits 6379 6408 +29
Misses 2511 2511
- Partials 709 711 +2 |
return nil, fmt.Errorf("could not get block root for epoch %d: %v", epoch, err) | ||
} | ||
|
||
var tgtAtts []*pb.PendingAttestation |
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.
can you set the size of the slices beforehand to reduce memory allocations
return nil, fmt.Errorf("could not get block root for epoch %d: %v", epoch, err) | ||
} | ||
|
||
//var tgtAtts []*pb.PendingAttestation |
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.
Remove?
Part of #2307
This PR implements the following epoch processing helpers and tests, the helpers are grouped into one logical processing function for efficiency reason (we don't have to loop through the attestations N^2 times)
get_matching_source_attestations
get_matching_target_attestations
get_matching_head_attestations
Changes:
BlockRootAtSlot
andBlockRoot
TargetRoot
andHeadRoot
to bebyte
, it wasuint64