Skip to content

Commit

Permalink
chore: review PR
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths committed Sep 16, 2024
1 parent afc03f2 commit d1d0e22
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/beacon-node/src/chain/shufflingCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ export class ShufflingCache implements IShufflingCache {
const shuffling = computeEpochShuffling(state, activeIndices, epoch);
timer?.();
this.set(shuffling, decisionRoot);
// wait until after the first slot to help with attestation and block proposal performance
});
}

Expand Down
19 changes: 19 additions & 0 deletions packages/state-transition/src/stateTransition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,25 @@ export function processSlots(

/**
* All processSlot() logic but separate so stateTransition() can recycle the caches
*
* Epoch transition will be processed at the last slot of an epoch. Note that compute_shuffling() is going
* to be executed in parallel (either by napi-rs or worker thread) with processEpoch() like below:
*
* state-transition
* ╔══════════════════════════════════════════════════════════════════════════════════╗
* β•‘ beforeProcessEpoch processEpoch afterPRocessEpoch β•‘
* β•‘ |-------------------------|--------------------|-------------------------------|β•‘
* β•‘ | | | β•‘
* β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•|═══════════════════════════════|══════════════════════════╝
* | |
* build() get()
* | |
* ╔═══════════════════════V═══════════════════════════════V═══════════════════════════╗
* β•‘ | | β•‘
* β•‘ |-------------------------------| β•‘
* β•‘ compute_shuffling() β•‘
* β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
* beacon-node ShufflingCache
*/
function processSlotsWithTransientCache(
postState: CachedBeaconStateAllForks,
Expand Down

0 comments on commit d1d0e22

Please sign in to comment.