ChainSafe / ChainSafe/lodestar

Add VC metric to track validator statuses

Open
#5,158 15 comments 0 reactions 0 assignees View on GitHub
help wanted meta-feature-request prio-low scope-metrics scope-ux
Dominant language
TypeScript
Stars
1.4k
Forks
483
Avg merge
1d 18h
Merged PRs (30d)
156

Description

**Is your feature request related to a problem? Please describe.**

As a node operator I want to know the status of my validators without relying on 3rd party solutions such as [beaconchai.in](https://beaconcha.in/).

The following questions should be answered

- how many of my validators are active vs just imported without deposit?
- how many validators have a pending deposit?
- how many of my validators exited and was it voluntary or forced?
- what is the state of my withdrawal if exited?

**Describe the solution you'd like**

Add VC metric to track [validator statuses](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ) based on [getValidatorStatus](https://github.com/ChainSafe/lodestar/blob/0607fef8d9b576fd127952122cbf60adc589c629/packages/beacon-node/src/api/impl/beacon/state/utils.ts#L78).

There is already a metric to track total count of validators (`vc_indices_count`), might just need to add `status` label.

https://github.com/ChainSafe/lodestar/blob/0607fef8d9b576fd127952122cbf60adc589c629/packages/validator/src/metrics.ts#L241-L244

This metric should then be visualized on a dashboard, [Lodestar validator client](https://github.com/ChainSafe/lodestar/blob/0607fef8d9b576fd127952122cbf60adc589c629/dashboards/lodestar_validator_client.json) looks like a good candidate as it already displays the VC indices.

Finally, also need to update the metric value used for [`validator_active`](https://github.com/ChainSafe/lodestar/blob/63479b4e9a910c0d0b49fe323d367a12455b7a8a/packages/beacon-node/src/monitoring/clientStats.ts#L185) in the client monitoring to correctly only count the active validators instead of total.

Contributor guide

Open the contributing guide

Research direction

Start with packages/validator/src/metrics.ts around vc_indices_count, then review getValidatorStatus in packages/beacon-node/src/api/impl/beacon/state/utils.ts. Check dashboards/lodestar_validator_client.json and packages/beacon-node/src/monitoring/clientStats.ts. Done means validator status counts are exposed and visualized, and validator_active counts only active validators.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.