Repository navigation
feat(erigon): report the sync phase through the healthcheck - #101
Merged
Merged
Conversation
The healthcheck prints a status report with the client's sync phase and progress, declared in the manifest `nodes` field, so the dappmanager no longer needs client-specific parsing.
Contributor
✅ TropiBot report: SYNC TEST REPORT - PASSEDThis CI runs on a real DAppNode using the same RPC calls a user would make to configure a staker setup: execution client, consensus client, web3signer, MEV-boost, and relays. 📦 Package Under Test
📦 Clients Used
🔖 Version Tracking
⏱️ Timing
Total Duration: 2m 54s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The dappmanager dashboard shows each node's sync status. It decides by itself whether the node is synced (latest block recent), waiting for the consensus client or stalled, and it computes the time left. What only the client knows is which sync phase it is in and how far along. That used to be parsed inside the dappmanager from client-specific fields and metrics, which broke whenever upstream changed them. It now lives in the package, next to the client version it describes, so a fix ships with the upstream bump.
The dappmanager side is in dappnode/DNP_DAPPMANAGER#2520 and the shared shell helpers in dappnode/staker-package-scripts#12.
Approach
nodesfield declares theerigonservice as anexecutionnode with its JSON-RPC and Engine API ports andreport: healthcheck. Each variant manifest adds only itsnetwork.erigon/node-status.shruns as the service's Docker healthcheck and prints one JSON line with the phase, progress, latest block and peers. It exits 0 while starting or syncing, so a syncing node is not "unhealthy".jq, addsnode_status_tools.shfrom staker-package-scripts and the script as/usr/local/bin/node-status.STAKER_SCRIPTS_VERSIONmoves tov0.1.3, the release that will carry the helpers.What it reports
Checked against the Erigon source at v3.8.2.
startingsyncedeth_syncingisfalsehighestBlock0 with no stages, or every stage at 0 before the download beginsstages:currentBlock / highestBlockotter_syncstage gauge above 0 withexecutionat 0currentBlocktowardshighestBlock--http.apiinEXTRA_OPTSleaves outeth,netorweb3, which the dashboard needsAfter the snapshot download
eth_syncingkeeps reporting old block numbers for a while as blocks already execute. During that window the script reads thesync{stage=…}gauges to tell indexing from executing.startingBlockis not used: it resets on every restart.Merge order
This cannot build until dappnode/staker-package-scripts#12 is merged and released as
v0.1.3: the Dockerfile downloadsnode_status_tools.shfrom that release, and the new CI workflow checks out that repo's default branch for the same file.Test instructions
sh test/node_status_test.sh(134 checks). Passes under dash and inside the built image.startingtook 0.14 s with networking off.Not seen on a live node: the indexing, handoff and execution phases. They follow the upstream source.