Skip to content

feat(node-status): report sync status per client from verified signals - #2520

Open
3alpha wants to merge 9 commits into
developfrom
feat/node-sync-status
Open

3alpha wants to merge 9 commits into
developfrom
feat/node-sync-status

Conversation

@3alpha

@3alpha 3alpha commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Context

The staking dashboard's node status card read each client's own sync flag (eth_syncing, /eth/v1/node/syncing) and computed one progress number. Clients report sync in very different ways, so the card was often wrong. Checked against the source of each client at the versions our packages pin:

  • Consensus clients: head/(head+distance) reads 99% or more almost immediately. Teku, Nimbus, Prysm and Lodestar report "not syncing" just after a restart, when stalled or without peers, or while waiting for their execution client. An optimistic node (EL still syncing) was shown as synced.
  • Execution clients: some return eth_syncing: false before reaching the head, and others keep returning an object long after reaching it (Geth indexing, Nethermind downloading old receipts). Geth and Nethermind keep the latest block at genesis until the state sync ends.
  • Startup: a client still downloading a checkpoint or snapshot (its API down for minutes or hours) was shown as "Error".
  • Gloas: from that fork the consensus client can no longer give the execution block number of its head. blinded_blocks is deprecated, a Gloas block carries only the payload's hash, and the mainnet spec config defines SLOT_DURATION_MS instead of SECONDS_PER_SLOT.

This supersedes the approach in #2491, which only handled Besu.

Approach

  • Consensus client: synced only when its head is within 8 slots of the current slot (from /eth/v1/beacon/genesis and /eth/v1/config/spec), it isn't optimistic and el_offline is false. The slot length is read from SLOT_DURATION_MS, with SECONDS_PER_SLOT as the fallback for older clients. Progress is measured from the head first seen, with a time estimate.
  • Execution client: synced only when its latest block is under 3 minutes old. The check uses time, not block numbers, so it needs nothing from the consensus client that Gloas removes. Without more information, catching up is measured by how fast the timestamp of the latest block closes on the clock.
  • Phase and progress come from the package. A node package declares its nodes in a new optional manifest field, nodes, and its Docker healthcheck prints a small JSON status report (phase, progress, background work, issues). The dappmanager reads it from the container's health log, treats every string as untrusted, and uses it only for detail: it never marks a node synced because of a report. This replaces the per-client parsers and metrics scraping an earlier revision of this PR had, so an upstream change is fixed in the package that pins the client.
  • Unreachable clients: shown as "starting" (container running, API not up), "stopped" or "not responding", instead of "Error". A starting client shows what its report says it is doing, e.g. "Downloading snapshot · 37%".
  • Types: ClientData gains state, phase, phaseProgress, behind, etaSeconds, background, issues and details. The old fields stay for older consumers. @dappnode/types moves to 0.1.42 and @dappnode/schemas to 0.1.27 for the nodes field.
  • UI: each card gets a "Ready to validate" line (or the first reason it isn't). Each client row shows a state badge, block or slot, a phase line, a measured or "in progress" bar, warning chips, and a details tooltip. The execution client is no longer hidden while the consensus client syncs.
  • Removed: the packages/chains workspace, the chainDataGet route with its types and events, and the chain card. Nothing has shown their data since the staking dashboard was introduced. The manifest chain field stays valid.

Related PRs

A package without a nodes declaration or without a report still works: its card shows the generic phases ("Catching up", "Syncing") and the same synced verdict.

Test instructions

  • Unit tests: yarn workspace @dappnode/dappmanager test. The new tests are in packages/dappmanager/test/unit/nodeSyncStatus/.
  • UI states with mock data: cd packages/admin-ui && yarn mock-standalone, then open the dashboard. The mock covers synced with background work, syncing with and without measured progress, an approximate distance behind, waiting, stalled and a starting client with a phase.
  • On a node, with a client package that ships the healthcheck, check the dashboard while a client:
    • syncs from scratch;
    • restarts;
    • runs with its consensus client stopped;
    • catches up after downtime.
  • On a node, docker inspect --format '{{json .State.Health}}' <execution client container> shows the report the dappmanager reads.

Not yet tested on a node: reading a real container's health log is covered by unit tests only, and the Gloas behaviour was checked against the consensus specs and beacon API definitions, not against a Gloas network.

Node status now carries a sync state, the phase a client is in, its
progress and distance to the head, background work and issues, so the
dashboard can show what each client is doing instead of synced/syncing.
Clients report sync very differently, so the CC is judged against the
wall clock and optimistic/EL-offline flags, the EC against its head age
and the CC head, with a parser per EC to name the phase and measure it.
@3alpha
3alpha requested a review from a team as a code owner November 27, 2026 12:17
@github-actions
github-actions Bot temporarily deployed to commit November 27, 2026 12:18 Inactive
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

The details tooltip printed the raw eth_syncing object and unformatted
values, and error tooltips could quote a response body. Clients now
send labelled, formatted lines and a short error description.
@github-actions
github-actions Bot temporarily deployed to commit November 30, 2026 09:41 Inactive
Pills stretched to the width of the line above them, so the execution,
consensus and validator pills differed. They now share one size, sit
right-aligned, and the block and slot labels match the other labels.
@github-actions
github-actions Bot temporarily deployed to commit November 30, 2026 11:57 Inactive
Adds the optional manifest field `nodes`, keyed by compose service,
and the status report a node's healthcheck prints. Bumps types and
schemas so the SDK can pick them up.
The consensus client cannot give the execution block number of its
head from the Gloas fork on, so the execution client is now judged by
the age of its latest block and catch-up is measured in chain time.
The slot length comes from SLOT_DURATION_MS, which newer specs define
instead of SECONDS_PER_SLOT.

Phase and progress now come from the status report a package prints
through its healthcheck, declared in the manifest `nodes` field. The
per-client parsers and the metrics scraping are removed.
Nothing has shown their data since the staking dashboard replaced the
chain cards. Node packages now declare themselves with the manifest
`nodes` field; the `chain` field stays valid in the schema.

This branch was previously deployed

1 inactive deployment
commit — c60ae3a0 Deployed Nov 30, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants