Repository navigation
feat(besu): report the sync phase through the healthcheck - #72
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: 3m 44s |
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 thebesuservice as anexecutionnode with its JSON-RPC and Engine API ports andreport: healthcheck. Each variant manifest adds only itsnetwork.besu/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 Besu source at 26.11.0, where
eth_syncingreturns an object for the whole snap sync.startingsyncedeth_syncingisfalsecurrentBlockhas not moved paststartingBlockcurrentBlocktowards the pivot block gauge, orhighestBlockbesu_synchronizer_sync_duration_counttimers, in orderThe world-state download has no percentage: Besu only prints it in its logs.
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(54 checks). Passes under dash,bash --posix, busybox ash and inside the built image (Ubuntu 24.04, jq 1.7).hyperledger/besu:26.11.0on Hoodi with no consensus client attached: the script reported "nothing to sync towards yet" in about 0.16 s, andstartingbefore the RPC came up.Not seen on a live node: the state download, healing and chain download phases. They follow the upstream source.