Skip to content

feat(pathfinder): report the sync status through the healthcheck - #37

Open
3alpha wants to merge 1 commit into
mainfrom
feat/node-status-report
Open

3alpha wants to merge 1 commit into
mainfrom
feat/node-status-report

Conversation

@3alpha

@3alpha 3alpha commented Nov 30, 2026

Copy link
Copy Markdown
Member

Context

The dappmanager dashboard is gaining a status card for every node package, not only Ethereum staking clients. For a node it has no built-in knowledge of, the package itself says whether the node is synced, how far along it is and what it is doing, through its Docker healthcheck. The dappmanager adds what is the same for every chain: stall detection, time left and waiting on a required node. The contract and the dappmanager side are in dappnode/DNP_DAPPMANAGER#2520; the shared shell helpers are released in staker-package-scripts v0.1.3 (dappnode/staker-package-scripts#12).

The dappmanager does not display status-report nodes yet: #2520 reads reports from Ethereum execution clients only. This package ships the declaration and the healthcheck ahead of that, which is safe: current dappmanagers ignore both.

Approach

  • Manifest: nodes declares the pathfinder service as a node with the status-report probe, maxHeadAgeSeconds: 300 and report: healthcheck. Each variant adds its network (starknet or starknet-sepolia) and requires the Ethereum execution client of its L1.
  • Healthcheck: pathfinder/node-status.sh reads starknet_syncing, the latest block and the L1-accepted block from the RPC and prints one JSON line. It exits 0 while starting or syncing.
  • Entrypoint: rclone and zstd now run in the background followed by a wait, and leave a marker under /tmp/node-status, so the healthcheck can report the snapshot download and extraction before Pathfinder serves its RPC. With set -e a failure still stops the entrypoint as before. The changed entrypoint gives the same output and exit codes as the original in 9 stubbed scenarios.
  • Image: installs jq, adds node_status_tools.sh from the v0.1.3 release and the script as /usr/local/bin/node-status.

What it reports

Checked against the Pathfinder source at v0.22.3.

Report Signal
starting "Downloading snapshot" or "Extracting snapshot", with a percentage Bytes the rclone or zstd process has written or read, against the snapshot size from rclone ls
synced starknet_syncing is false and the latest block is at most 300 s old
syncing "Downloading blocks", measured in blocks current_block_num towards highest_block_num
syncing with no phase starknet_syncing is false but the latest block is old or missing
Detail "Verified on Ethereum" pathfinder_lastL1AcceptedBlockHashAndNumber

File size cannot measure the download: rclone pre-allocates the whole file at the start. Pathfinder has no peer count (it syncs from the gateway) and exposes no signal for an unreachable L1 node, so neither is reported. Blocks come about every 1.8 s, so 300 s leaves a wide margin.

Test instructions

  • sh test/node_status_test.sh (326 checks). Passes under dash, bash --posix and inside the built image.
  • shellcheck is clean on everything added.
  • Run with the real entrypoint on Sepolia: the healthcheck reported "Downloading snapshot" at 4.4%, matching the bytes downloaded, and a real zstd run reported "Extracting snapshot". Pathfinder syncing Sepolia reported "Downloading blocks" with position and target, and Docker showed the container healthy.

Not seen live: synced, which needs a fully synced database.

Found on the way, not changed here

  • After extraction the entrypoint's mv fails because the image's working directory is the data directory, so the entrypoint exits and leaves the compressed snapshot (54 GB on Sepolia) in the data volume. Pathfinder starts on the next restart.
  • The entrypoint takes the newest snapshot whatever version the package pins. Sepolia's newest is for 0.24.x while the package pins v0.22.3; whether v0.22.3 can open it was not checked.
  • The mainnet prometheus-targets.json is a copy of Sepolia's, the mainnet manifest advertises port 9555 while the RPC listens on 6060, and the setup wizard accepts http L1 URLs that Pathfinder rejects at start.

The healthcheck prints a status report that says whether the node is
synced and what it is doing, declared in the manifest `nodes` field
with the status-report probe.
@github-actions

Copy link
Copy Markdown

Dappnode bot has built and pinned the built packages to an IPFS node, for commit: 76164f5

This is a development version and should only be installed for testing purposes.

  1. Package pathfinder-sepolia.dnp.dappnode.eth

Install link

Hash: /ipfs/QmchNjgrJBp3PVWX8RcbmDdX6WKS1MBTLGjyQ1HLcXbMUi

(by dappnodebot/build-action)

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.

1 participant