Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lean_spec/subspecs/forkchoice/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 5 additions & 5 deletions src/lean_spec/subspecs/node/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Loading