diff --git a/src/lean_spec/subspecs/forkchoice/store.py b/src/lean_spec/subspecs/forkchoice/store.py index fbeb1130..7eeec2e8 100644 --- a/src/lean_spec/subspecs/forkchoice/store.py +++ b/src/lean_spec/subspecs/forkchoice/store.py @@ -572,10 +572,10 @@ def _record_metrics(self, old_head: Bytes32) -> None: - Justified and finalized slot gauges - Reorg counter and depth histogram (only when the head actually changed) """ - metrics.lean_head_slot.set(int(self.blocks[self.head].slot)) - metrics.lean_safe_target_slot.set(int(self.blocks[self.safe_target].slot)) - metrics.lean_latest_justified_slot.set(int(self.latest_justified.slot)) - metrics.lean_latest_finalized_slot.set(int(self.latest_finalized.slot)) + metrics.lean_head_slot.set(self.blocks[self.head].slot) + metrics.lean_safe_target_slot.set(self.blocks[self.safe_target].slot) + metrics.lean_latest_justified_slot.set(self.latest_justified.slot) + metrics.lean_latest_finalized_slot.set(self.latest_finalized.slot) if self.head != old_head: metrics.lean_fork_choice_reorgs_total.inc() diff --git a/src/lean_spec/subspecs/node/node.py b/src/lean_spec/subspecs/node/node.py index 1d36cac8..3342f788 100644 --- a/src/lean_spec/subspecs/node/node.py +++ b/src/lean_spec/subspecs/node/node.py @@ -472,12 +472,12 @@ async def _log_justified_finalized_periodically(self) -> None: peers_connected = sum( 1 for p in self.sync_service.peer_manager.get_all_peers() if p.is_connected() ) - metrics.lean_current_slot.set(int(self.clock.current_slot())) + metrics.lean_current_slot.set(self.clock.current_slot()) metrics.lean_connected_peers.set(peers_connected) - metrics.lean_head_slot.set(int(store.blocks[store.head].slot)) - metrics.lean_safe_target_slot.set(int(store.blocks[store.safe_target].slot)) - metrics.lean_latest_justified_slot.set(int(store.latest_justified.slot)) - metrics.lean_latest_finalized_slot.set(int(store.latest_finalized.slot)) + metrics.lean_head_slot.set(store.blocks[store.head].slot) + metrics.lean_safe_target_slot.set(store.blocks[store.safe_target].slot) + metrics.lean_latest_justified_slot.set(store.latest_justified.slot) + metrics.lean_latest_finalized_slot.set(store.latest_finalized.slot) count = ( len(self.validator_service.registry) if self.validator_service is not None else 0 )