Skip to content

Commit

Permalink
fix: ensure generated historical state slot matches requested slot (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig authored and ensi321 committed Oct 10, 2024
1 parent f921672 commit 649602d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ export async function getHistoricalState(
metrics?.stateTransitionBlocks.observe(blockCount);
transitionTimer?.();

if (state.slot !== slot) {
throw Error(`Failed to generate historical state for slot ${slot}`);
}

const serializeTimer = metrics?.stateSerializationTime.startTimer();
const stateBytes = state.serialize();
serializeTimer?.();
Expand Down

0 comments on commit 649602d

Please sign in to comment.