feat: add EIP-7917 deterministic proposer lookahead#7902
Conversation
Performance Report✔️ no performance regression detected Full benchmark results
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #7902 +/- ##
============================================
- Coverage 55.77% 55.73% -0.04%
============================================
Files 830 832 +2
Lines 59228 59332 +104
Branches 4562 4571 +9
============================================
+ Hits 33033 33070 +37
- Misses 26128 26195 +67
Partials 67 67 🚀 New features to boost your workflow:
|
| {}, | ||
| e as Error | ||
| ); | ||
| state.commit(); |
There was a problem hiding this comment.
no need state.commit() here
| e as Error | ||
| ); | ||
| state.commit(); | ||
| shuffling = computeEpochShuffling(state, getActiveValidatorIndices(state, epoch), epoch); |
| // EpochCache needs to cache shuffling for nextEpoch + 1 too. | ||
| let shuffling: EpochShuffling; | ||
| try { | ||
| shuffling = state.epochCtx.getShufflingAtEpoch(epoch); |
There was a problem hiding this comment.
this is not correct because shuffling of epoch + 2 is not available at this time so this line will always fail
we should do the query from shufflingCache similar to https://github.com/ChainSafe/lodestar/blob/v1.31.0/packages/state-transition/src/cache/epochCache.ts#L656
need to add a metric of number of times of hit/miss or see if it's available in the shuffling cache
hopefully most of the time shuffling of epoch + 2 is ready
There was a problem hiding this comment.
This is the first implementation of EIP-7917. We will want to have a plan deprecate proposer caches in `EpochCache` since Fulu beacon state will carry those information. This will be addressed in a later PR. Pending spec release for spec test Spec PR ethereum/consensus-specs#4190 --------- Co-authored-by: Nico Flaig <nflaig@protonmail.com>
**Motivation** Bring proposer lookahead fixes to unstable branch, does not include shuffling calculation changes from ChainSafe#7945 yet. **Description** - only use proposer lookahead from state if epoch is post fulu - track epoch transition step time for proposer lookahead Related ChainSafe#7902
|
🎉 This PR is included in v1.32.0 🎉 |

This is the first implementation of EIP-7917.
We will want to have a plan deprecate proposer caches in
EpochCachesince Fulu beacon state will carry those information. This will be addressed in a later PR.Pending spec release for spec test
Spec PR ethereum/consensus-specs#4190