Skip to content

Commit

Permalink
fix: failed unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkeil committed Oct 12, 2024
1 parent 2ea18e8 commit 440c2a2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/state-transition/src/cache/epochCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -920,18 +920,20 @@ export class EpochCache {
*/
async getBeaconProposersNextEpoch(): Promise<ValidatorIndex[]> {
if (!this.proposersNextEpoch.computed) {
const shuffling = await this.shufflingCache?.get(this.nextEpoch, this.nextDecisionRoot);
if (!shuffling) {
if (!this.nextShuffling) {
this.nextShuffling = (await this.shufflingCache?.get(this.nextEpoch, this.nextDecisionRoot)) ?? null;
}
if (!this.nextShuffling) {
throw new EpochCacheError({
code: EpochCacheErrorCode.NEXT_SHUFFLING_NOT_AVAILABLE,
epoch: this.nextEpoch,
decisionRoot: this.getShufflingDecisionRoot(this.nextEpoch),
});
}
}
const indexes = computeProposers(
this.config.getForkSeqAtEpoch(this.epoch + 1),
this.proposersNextEpoch.seed,
shuffling,
this.nextShuffling,
this.effectiveBalanceIncrements
);
this.proposersNextEpoch = {computed: true, indexes};
Expand Down

0 comments on commit 440c2a2

Please sign in to comment.