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
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ dependencies = [
"aiohttp>=3.11.0,<4",
"cryptography>=46.0.0",
"numpy>=2.0.0,<3",
"prometheus-client>=0.21.0,<1",
"aioquic>=1.2.0,<2",
"pyyaml>=6.0.0,<7",
]
Expand Down
3 changes: 1 addition & 2 deletions src/lean_spec/subspecs/api/endpoints/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""API endpoint specifications."""

from . import checkpoints, health, metrics, states
from . import checkpoints, health, states

__all__ = [
"checkpoints",
"health",
"metrics",
"states",
]
27 changes: 0 additions & 27 deletions src/lean_spec/subspecs/api/endpoints/metrics.py

This file was deleted.

3 changes: 1 addition & 2 deletions src/lean_spec/subspecs/api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

from aiohttp import web

from .endpoints import checkpoints, health, metrics, states
from .endpoints import checkpoints, health, states

ROUTES: dict[str, Callable[[web.Request], Awaitable[web.Response]]] = {
"/lean/v0/health": health.handle,
"/lean/v0/states/finalized": states.handle_finalized,
"/lean/v0/checkpoints/justified": checkpoints.handle_justified,
"/metrics": metrics.handle,
}
"""All API routes mapped to their handlers."""
32 changes: 0 additions & 32 deletions src/lean_spec/subspecs/metrics/__init__.py

This file was deleted.

80 changes: 0 additions & 80 deletions src/lean_spec/subspecs/metrics/registry.py

This file was deleted.

17 changes: 2 additions & 15 deletions src/lean_spec/subspecs/sync/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any

from lean_spec.subspecs import metrics
from lean_spec.subspecs.chain.clock import SlotClock
from lean_spec.subspecs.containers import (
Block,
Expand Down Expand Up @@ -241,24 +240,12 @@ def _process_block_wrapper(
# Delegate to the actual block processor.
#
# The processor validates the block and updates forkchoice state.
with metrics.block_processing_time.time():
new_store = self.process_block(store, block)
new_store = self.process_block(store, block)

# Track metrics after successful processing.
# Track processed blocks.
#
# We only count blocks that pass validation and update the store.
self._blocks_processed += 1
metrics.blocks_processed.inc()

# Update chain state metrics.
metrics.head_slot.set(float(new_store.blocks[new_store.head].slot))
metrics.justified_slot.set(float(new_store.latest_justified.slot))
metrics.finalized_slot.set(float(new_store.latest_finalized.slot))

# Update validator count from head state.
head_state = new_store.states.get(new_store.head)
if head_state is not None:
metrics.validators_count.set(float(len(head_state.validators)))

# Persist block and state to database if available.
#
Expand Down
3 changes: 0 additions & 3 deletions src/lean_spec/subspecs/validator/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, cast

from lean_spec.subspecs import metrics
from lean_spec.subspecs.chain.clock import Interval, SlotClock
from lean_spec.subspecs.chain.config import ATTESTATION_COMMITTEE_COUNT
from lean_spec.subspecs.containers import (
Expand Down Expand Up @@ -297,7 +296,6 @@ async def _maybe_produce_block(self, slot: Slot) -> None:
self._store_proposer_attestation_signature(signed_block, validator_index)

self._blocks_produced += 1
metrics.blocks_proposed.inc()

# Emit the block for network propagation.
await self.on_block(signed_block)
Expand Down Expand Up @@ -371,7 +369,6 @@ async def _produce_attestations(self, slot: Slot) -> None:
signed_attestation = self._sign_attestation(attestation_data, validator_index)

self._attestations_produced += 1
metrics.attestations_produced.inc()

# Process attestation locally before publishing.
#
Expand Down
143 changes: 0 additions & 143 deletions tests/lean_spec/subspecs/metrics/test_registry.py

This file was deleted.

Loading
Loading