-
-
Notifications
You must be signed in to change notification settings - Fork 287
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: forkchoice to track head vote by proto index #5882
Conversation
Performance Report✔️ no performance regression detected 🚀🚀 Significant benchmark improvement detected
Full benchmark results
|
return this.protoArray.maybePrune(finalizedRoot); | ||
const prunedNodes = this.protoArray.maybePrune(finalizedRoot); | ||
const prunedCount = prunedNodes.length; | ||
for (const vote of this.votes) { |
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.
If this array if not sparse, it's always faster to use a regular for loop
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.
will work on this in another PR, merging to see if it helps the I/O lag issue in subsribe-all-subnets
mode
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.
addressed in #5907
🎉 This PR is included in v1.11.0 🎉 |
Motivation
computeDeltas
we have to get index from root twice for each vote so @dapplion suggested we can store vote by proto index insteadDescription
computeDeltas()
2x-3x faster as tested in my local environmentprune
but it happens per epoch whilecomputeDeltas()
happens twice per slotaddLatestMessage()
, while the old way takes 2x2x32 = 128 lookups per vote per epoch in computeDeltas (2 lookups for 2 roots,computeDeltas()
is called 2 per slot ) and it happens at once so it's worth the changeCloses #5852
TODOs