Skip to content

Commit

Permalink
fix: calc of pivot slot before slot increment
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkeil committed Aug 22, 2024
1 parent ed850ee commit 5e65f7e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/state-transition/src/util/epochShuffling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit 5e65f7e

Please sign in to comment.