Repository navigation
feat: fail node probes on a stale tip - #70
Merged
Merged
Conversation
syncProgress has two decimals, so the probe script passes while the tip is weeks old on mainnet. A node that stops adopting blocks stays Ready and keeps receiving traffic from the Services that select it. Each probe now takes an optional max_tip_age_seconds, passed to the script, which then also requires the tip slot to be at or after the slot of "now - max_tip_age_seconds", computed from the node's own era history via cardano-cli query slot-number. Unset keeps the current behaviour, so no existing instance changes until it opts in. The mesh peer Service now publishes not-ready addresses: a peer that drops out of DNS while its probe fails is cached as NXDOMAIN by the other nodes for up to 15 minutes, well past its recovery. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scarmuega
force-pushed
the
feat/readiness-tip-age
branch
from
September 30, 2026 15:34
0f6b98b to
0459e8c
Compare
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.
Why
The probe script only checks
syncProgresswithin 99–100. It has two decimals, so on mainnet it still reads ≥ 99 with a tip weeks old. On 2026-09-30node-mainnet-b02stopped adopting blocks at 13:03 UTC and stayed Ready until it was restarted manually about 90 minutes later.node-mainnet-stablekept routing Ogmios sessions to it the whole time. For a few minutes it was the only endpoint, and every mainnet Ogmios pod served a tip 95+ blocks old.What
readiness.sh [MAX_TIP_AGE_SECONDS]: with the argument, the script also requires the tip slot to be at or after the slot ofnow - MAX_TIP_AGE_SECONDS. The conversion iscardano-cli query slot-number, which uses the node's own era history, so it works on every network whatever the slot length. The conversion fails past the node's forecast horizon (~36 h ahead of its tip on mainnet). That only happens to a stale node, so it counts as a failure.max_tip_age_secondsis a new optional field onreadiness_probe,liveness_probeandstartup_probe. Each probe passes its own value, validated at plan time as a positive whole number. Unset keeps the current behaviour, so no instance changes until it opts in.prime-testnetkeeps its socket-only check.publish_not_ready_addresses = true: without it, a node whose readiness probe fails drops out of its headlessnodes-<salt>record. Its siblings then cache the NXDOMAIN for up to 15 minutes, well past its recovery. The Service is only used for mesh peering, which doesn't need readiness gating.Testing
terraform test: 9/9 pass (5 existing + 4 new intests/probes.tftest.hcl: opt-in default, per-probe values, prime-testnet unchanged, peer Service publishes not-ready addresses).max_tip_age_seconds = 1.5fails the plan with the validation message. It isn't a committed test, becauseexpect_failurescan't point at a child-module variable.debian:bookworm-slim(the node image's base) against a stubcardano-cli, 9 scenarios: unchanged no-argument path, fresh and stale tips, past-horizon failure,syncProgressbelow 99, non-integer and zero arguments rejected,--testnet-magicused for both queries.query slot-numberexists with the same bare-number output in cardano-cli 10.15.1.0 and 11.0.0.0, the versions bundled inblinklabs-io/cardano-node:11.0.1builds.Rollout
A follow-up change in
demeter-run/clustersbumps the stage4 module ref and opts the mainnet nodes in: readinessmax_tip_age_seconds = 180(period 60, failure 3), livenessmax_tip_age_seconds = 900(period 120, failure 10). Applying it updates thenode-readinessConfigMap, the StatefulSet probe commands, and the peer Services in place.🤖 Generated with Claude Code