-
-
Notifications
You must be signed in to change notification settings - Fork 337
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
Track balances as Number64UintType #2973
Conversation
Code Climate has analyzed commit bc61e9f and detected 0 issues on this pull request. View more on Code Climate. |
Killer improvements!! 🔥 amazing job |
b99accc
to
d1cdc41
Compare
just want to clarify that most of the improvement come from the new ssz and we already merge that to master. The main improvement for this PR is |
d1cdc41
to
5286a5d
Compare
5286a5d
to
fa28b64
Compare
Performance Report✔️ no performance regression detected 🚀🚀 Significant benchmark improvement detected
Full benchmark results
|
|
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.
Looks great nice work!
Motivation
Track
balances
as the newNumber64UintType
of ssz for faster processing, same for slot, epochDescription
This depends on ChainSafe/ssz#159
Number64UintType
of ssznew ListType({elementType: Number64, limit: VALIDATOR_REGISTRY_LIMIT})
persistent-ts
array there to save memory, move it tobalanceList.ts
tree_applyDeltaAtIndex()
ortree_applyDeltaInBatch()
to avoid the patternbalances[i] = balances[i] + delta
(which have to dodeserialize
thenserialize
)processRewardsAndPenalties
: use the new apitree_newTreeFromDeltas()
to build balances tree and avoid BigInt calculation and Uint8Array allocation, it return new number[] array to be used for next step of epoch transitionCloses #2972 #2049
More related improvement could be done after this PR: