diff --git a/packages/state-transition/src/util/epochShuffling.ts b/packages/state-transition/src/util/epochShuffling.ts index ce4ad136c0b6..2342cd327c41 100644 --- a/packages/state-transition/src/util/epochShuffling.ts +++ b/packages/state-transition/src/util/epochShuffling.ts @@ -144,8 +144,10 @@ export function computeEpochShuffling( } function calculateDecisionRoot(state: BeaconStateAllForks, epoch: Epoch, beforeSlotIncrement = false): RootHex { - const pivotEpoch = beforeSlotIncrement ? epoch : epoch - 1; - const pivotSlot = computeStartSlotAtEpoch(pivotEpoch) - 1; + let pivotSlot = computeStartSlotAtEpoch(epoch - 1); + if (!beforeSlotIncrement) { + pivotSlot--; + } return toRootHex(getBlockRootAtSlot(state, pivotSlot)); }