diff --git a/web/src/parts/checkpoints/Checkpoints.tsx b/web/src/parts/checkpoints/Checkpoints.tsx
index 9da8e60e..8967821c 100644
--- a/web/src/parts/checkpoints/Checkpoints.tsx
+++ b/web/src/parts/checkpoints/Checkpoints.tsx
@@ -26,6 +26,9 @@ export default function Checkpoints() {
if (!finalizedEpoch) return;
return finalizedEpoch;
}, [statusData]);
+ const latestRoot = useMemo(() => {
+ return statusData?.data?.finality?.finalized?.root;
+ }, [statusData]);
if (isLoading)
return (
@@ -48,6 +51,7 @@ export default function Checkpoints() {
diff --git a/web/src/parts/checkpoints/CheckpointsTable.tsx b/web/src/parts/checkpoints/CheckpointsTable.tsx
index f734815b..27d43301 100644
--- a/web/src/parts/checkpoints/CheckpointsTable.tsx
+++ b/web/src/parts/checkpoints/CheckpointsTable.tsx
@@ -11,6 +11,7 @@ import { truncateHash } from '@utils';
export default function CheckpointsTable(props: {
latestEpoch?: string;
+ latestRoot?: string;
slots: APIBeaconSlot[];
onSlotClick?: (slot: APIBeaconSlot) => void;
showCheckpoint?: boolean;
@@ -27,6 +28,12 @@ export default function CheckpointsTable(props: {
);
});
}, [props.slots, search]);
+ const isServing = (slot: APIBeaconSlot) => {
+ if (props.latestRoot && slot.block_root) {
+ return slot.block_root === props.latestRoot;
+ }
+ return Boolean(props.latestEpoch && slot.epoch && slot.epoch === props.latestEpoch);
+ };
const onClick = (slot: APIBeaconSlot) => {
props.onSlotClick?.(slot);
};
@@ -112,20 +119,17 @@ export default function CheckpointsTable(props: {
{slot.epoch}
- {props.showCheckpoint &&
- props.latestEpoch &&
- slot.epoch &&
- slot.epoch === props.latestEpoch && (
-
- )}
+ {props.showCheckpoint && isServing(slot) && (
+
+ )}
|
{slot.slot}
- {props.latestEpoch && slot.epoch && slot.epoch === props.latestEpoch && (
+ {props.showCheckpoint && isServing(slot) && (
 |