From 2b0025a88575f6c455caa32e0afc357ba3cf2042 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Tue, 9 Apr 2024 11:49:29 +0100 Subject: [PATCH] Calculate epoch from unmodded slot --- packages/beacon-node/src/api/impl/beacon/blocks/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/beacon-node/src/api/impl/beacon/blocks/index.ts b/packages/beacon-node/src/api/impl/beacon/blocks/index.ts index 2323c7326729..3be2f1d4b3d3 100644 --- a/packages/beacon-node/src/api/impl/beacon/blocks/index.ts +++ b/packages/beacon-node/src/api/impl/beacon/blocks/index.ts @@ -401,11 +401,10 @@ export function getBeaconBlockApi({ if (slot < head.slot && head.slot <= slot + SLOTS_PER_HISTORICAL_ROOT) { const state = chain.getHeadState(); - const rootSlot = slot % SLOTS_PER_HISTORICAL_ROOT; return { executionOptimistic: isOptimisticBlock(head), - finalized: computeEpochAtSlot(rootSlot) <= chain.forkChoice.getFinalizedCheckpoint().epoch, - data: {root: state.blockRoots.get(rootSlot)}, + finalized: computeEpochAtSlot(slot) <= chain.forkChoice.getFinalizedCheckpoint().epoch, + data: {root: state.blockRoots.get(slot % SLOTS_PER_HISTORICAL_ROOT)}, }; } } else if (blockId === "head") {