-
-
Notifications
You must be signed in to change notification settings - Fork 281
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: async shuffling refactor #6938
base: unstable
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #6938 +/- ##
============================================
+ Coverage 49.35% 50.84% +1.49%
============================================
Files 592 597 +5
Lines 39293 39835 +542
Branches 2248 2256 +8
============================================
+ Hits 19392 20254 +862
+ Misses 19860 19581 -279
+ Partials 41 0 -41 |
Performance Report✔️ no performance regression detected Full benchmark results
|
This reverts commit 104aa56.
7d24ec9
to
fd8196e
Compare
Epoch Transition MetricsUnstable to Feat2 comparison (
|
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.
This looks good
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 awesome, I think we should wait for v1.22 to be released first before merging this
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.
is there a reason why we use both upcoming and next epoch terminology?
Yes. The slot gets incremented between |
Can you commit this somewhere in the code as a jsdoc comment? |
const shuffling = await chain.shufflingCache.get(epoch, decisionRoot); | ||
if (!shuffling) { | ||
throw new ApiError( | ||
400, |
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.
should be aligned to the other error
Motivation
Replaces #6521
Move calculation of next shuffling to async to get it off of critical path during epoch transition. There is a full second during epoch transition used to calculate the
epochCtx.nextShuffling
and that can be moved to an async process. Refactored a few pieces of theEpochCache
to make this work and will continue under a separate PR for creating a worker that moves this calculation to a worker thread. Also will investigate using the rust shuffling implementation. Can maybe tune further using a worker thread that NICE to interleave the long calculation into thread idle time which could be ideal.Description
IShufflingCache
to pass shuffling cache toEpochCache
so its available within CachedBeaconStateShufflingCache
inbeacon-node
for further updates mentioned abovenextShuffling
from critical path during epoch transitionsshufflingCache.processState
fromShufflingCache
and update process flow to no longer require itShufflingGetter
and useShufflingCache
directlyTODO's Before Review
[ ] - Investigate removal of
MockShufflingCache
fully (may require movingCachedBeaconState
tests tobeacon-node
[ ] - Verify all sim/e2e and other long running tests
[ ] - Confirm spec compliance