-
-
Notifications
You must be signed in to change notification settings - Fork 343
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
feat: use Uint32Array for shuffling/committees #6475
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## unstable #6475 +/- ##
=========================================
Coverage 61.72% 61.72%
=========================================
Files 555 555
Lines 58204 58205 +1
Branches 1839 1839
=========================================
+ Hits 35925 35926 +1
Misses 22240 22240
Partials 39 39 |
Performance Report✔️ no performance regression detected Full benchmark results
|
packages/beacon-node/src/chain/opPools/aggregatedAttestationPool.ts
Outdated
Show resolved
Hide resolved
looks good to me, dropped a minor comment @wemeetagain |
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.
LGTM
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.
Sweet!!! 🎸
🎉 This PR is included in v1.17.0 🎉 |
Motivation
Looking at heap snapshots of a running lodestar node, the memory usage of shufflings stood out as larger than necessary.
Description
Replace
number[]
withUint32Array
foractiveIndices
,shuffling
, andcommittees
in theEpochShuffling
.This has two benefits: tighter packing of the data (TypedArray vs Object) AND data sharing between
shuffling
andcommittees
.The tradeoff is that only indices < 2 ^ 32 (4.2 billion) can be represented here, rather than indices < 2 ^ 53. In practice this is plenty and not an issue.