Skip to content

Commit

Permalink
fix: build error in getBeaconProposersNextEpoch
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkeil committed Oct 12, 2024
1 parent dc7038c commit 2ea18e8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/state-transition/src/cache/epochCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -920,10 +920,18 @@ export class EpochCache {
*/
async getBeaconProposersNextEpoch(): Promise<ValidatorIndex[]> {
if (!this.proposersNextEpoch.computed) {
const shuffling = await this.shufflingCache?.get(this.nextEpoch, this.nextDecisionRoot);
if (!shuffling) {
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,
await this.shufflingCache?.get(this.nextEpoch, this.nextDecisionRoot);
shuffling,
this.effectiveBalanceIncrements
);
this.proposersNextEpoch = {computed: true, indexes};
Expand Down

0 comments on commit 2ea18e8

Please sign in to comment.