Skip to content

feat(validator): make /health report whether the client can do its duties - #884

Merged
MegaRedHand merged 23 commits into
mainfrom
feat/validator-health-endpoint
Nov 26, 2026
Merged

MegaRedHand merged 23 commits into
mainfrom
feat/validator-health-endpoint

Conversation

@MegaRedHand

@MegaRedHand MegaRedHand commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #833.

Problem

The validator client's /health (metrics::router) answered 200 {"status":"healthy","service":"ethlambda-validator"} whatever the client's state. A client whose beacon nodes were all down, syncing or optimistic, or whose slashing-protection writes kept failing on a full disk, answered the same way as one that was attesting. Kubernetes probes, load balancers and uptime checks reading it were told everything was fine while no duty was done.

ethlambda_validator_beacon_node_available did not help either. Its help text said "1 when a beacon node answered the last duty refresh or attestation", but:

  • it was set to 1 only at the end of a successful refresh_epoch, once an epoch;
  • any failed refresh, subscription, attestation, sync committee message or PTC vote set it to 0 until the next epoch's refresh;
  • with no keys loaded it never became 1.

What this does

/health answers from state the client already keeps (crates/validator/src/client_health.rs). ClientHealth::report asks no beacon node anything and waits on no lock. The answer is 200 when the client can do its duties and 503 when it cannot, with the body the issue sketches:

{
  "status": "unhealthy",
  "service": "ethlambda-validator",
  "checks": {
    "beacon_nodes": { "usable": 0, "configured": 2 },
    "validators": { "loaded": 64, "resolved": 64 },
    "slashing_protection": { "last_write_ok": true },
    "started": true,
    "schedule_current": true
  }
}

The issue's four checks, plus one:

  • beacon_nodes: usable counts the nodes whose latest probe from feat(validator): check each beacon node's sync status before every slot's duties #876 (NodeHealth::snapshot, Probe::standing) answered, neither syncing nor optimistic, and is at most two slots old. One usable node passes. The two-slot bound is the one NodeHealth::ranked uses for routing; probes are a slot apart, so only a probe task that stopped leaves one that old. Neither ranked nor feat(validator): rank beacon nodes by health and broadcast signed messages #885's tiers is read. usable is the probe's own verdict, the one the slot's gate reads, so feat(validator): rank beacon nodes by health and broadcast signed messages #885's ranking inputs do not move it: sync_distance, el_offline, and a request the node did not answer.
  • validators: loaded and resolved, reported. loaded is read from the key store with try_read, falling back to the last count, since a keymanager import holds the store's write lock while it decrypts. resolved is what the last successful refresh resolved.
  • slashing_protection.last_write_ok (SharedProtection::last_write_ok): two atomics beside the record's mutex, so reading them never waits on the stuck write being reported.
    • SlashingProtection::commit sets the write flag from file::write's outcome (Error::Unflushed included), next to inc_slashing_protection_write_failures.
    • slashing_protection::blocking sets the wait flag when it gives up after RECORD_WAIT, and clears it when it reaches the record.
    • An access that writes nothing clears only the wait flag, so a failed write fails the check until a later write succeeds.
  • started: set by ClientHealth::epoch_refreshed, which the duty loop calls in refresh_epoch's Ok arm. That arm is also reached by a client with no keys, where refresh_epoch returns early. refresh_epoch's signature is unchanged.
  • schedule_current (not in the issue's sketch): the attester schedule the last successful refresh left held reaches the clock's epoch. The duty loop passes epoch_refreshed the last epoch held: the lookahead epoch when its fetch went through (DutiesService::holds_attesters), else the refresh's own, since refresh_around shrugs a failed lookahead off. attach takes the SlotClock to read the epoch. A node can answer its probe synced and still fail every refresh or every lookahead (duties or validator endpoints erroring); once the schedule runs out the client makes no attestation, and without this check /health would stay 200. true before the first refresh, which started reports, and before genesis. A refresh that resolved no validator (no keys, or keys waiting for activation) holds no schedule to run out and counts through the next epoch, so such a client does not read unhealthy at each epoch boundary while its refresh is under way.

status is one of three:

  • healthy (200): started, at least one usable node, the last write went through, and the schedule is current.
  • starting (503): not started, and nothing else has failed.
  • unhealthy (503): anything else.

Gauges from the same report. The /metrics handler builds the report and sets three gauges from it before gathering (client_health::publish):

  • ethlambda_validator_beacon_node_available: 1 when at least one node is usable by the definition above, with new help text.
  • ethlambda_validator_healthy: new, 1 exactly when /health would answer 200.
  • ethlambda_validator_validators_loaded: the same count /health reports, so it now follows keymanager imports and deletions.

The old writers of beacon_node_available are removed: the refresh, subscription, attestation, sync committee and PTC failure paths and the end of refresh_epoch in lib.rs, and health::slot_signs. metrics::set_beacon_node_available stays public, now called only by publish.

Wiring in lib.rs. ClientHealth::new runs before the metrics listener binds, with the configured node count and the store. metrics::router now takes it. ClientHealth::attach hands it the nodes' NodeHealth, the slot duration and the record once they exist. epoch_refreshed is one line in the refresh's Ok arm.

Decisions

  • Before the first probe: a node not probed yet does not count against a client that has not started, so a normal startup reads starting (503) throughout, never unhealthy. Before the nodes are attached at all (while fetching genesis and the spec), the same. A client that has not started is unhealthy instead only when every node has been probed and none is usable, or a write failed. Once started, a node with no probe counts as unusable. Otherwise a probe task that never ran would leave the client healthy with nothing vouching for a node.
  • A third status value, starting. It keeps "still starting" from reading as "broken" in the body. The status code is 503 either way.
  • One endpoint or two: one. /health carries the checks. docs/cli.md tells operators to point readiness checks, load balancers and uptime monitors at it, and not a Kubernetes liveness probe: it answers 503 while every beacon node is down or syncing, which a restart does not fix.
  • A degraded state: none. Some nodes down with one usable is 200, with the counts in the body; no 206.
  • Remote signers: not checked. An upcheck per signer is a network call, which /health does not make.
  • No keys: loaded = 0 is reported and does not fail the check. A client started empty to wait for a keymanager import is idle on purpose, and neither a restart nor taking it out of rotation loads a key. resolved = 0 does not fail it either, as the issue says.
  • Doppelganger: keys doppelganger protection still withholds count as loaded. Withholding is intended and temporary, and ethlambda_validator_doppelganger_detecting reports it.
  • Staleness: a probe older than two slots is not usable.

Docs.

  • docs/cli.md: the Metrics section documents /health, its body, the checks, the three statuses and the liveness-probe warning.
  • docs/metrics.md: the new healthy row, and new text for beacon_node_available and validators_loaded.

Tests

client_health.rs:

  • The body has the issue's shape: status, service and the four checks, with exactly the fields named, plus schedule_current.
  • A schedule held through epoch E + 1 is healthy at the last slot of E + 1 and unhealthy with schedule_current: false at the first slot of E + 2, while the node still probes usable; one whose lookahead failed (held through E) is unhealthy from E + 1. The real-refresh test checks the lookahead epoch is held.
  • starting (503) before the first probe and after it, then healthy (200) after a real refresh_epoch driven through MockBeaconNode. The test calls epoch_refreshed as the duty loop does, since the loop itself is not unit-testable.
  • Startup before the first probe reads starting, not unhealthy, both unattached and attached. One node answering unusable while another is unprobed is still starting; every node answering unusable is unhealthy.
  • A started client whose nodes have no probe is unhealthy.
  • Every node down, syncing or optimistic is unhealthy; one coming back synced is healthy.
  • A probe past two slots old does not count as usable.
  • An empty store reports loaded = 0 and stays healthy.
  • While a writer holds the store, loaded is the last count read; after the writer drops it, the new one.
  • A failed record write (an unwritable directory) is unhealthy until a later write succeeds. cfg(unix), skipped as root.
  • The gauges match the endpoint: through the router, /health and then /metrics, going down and coming back, healthy and beacon_node_available read what the endpoint answered. This is the only test that touches those process-wide gauges.

slashing_protection/mod.rs:

  • A failed write turns last_write_ok off, a read-only access leaves it off, and a later successful write turns it back on. cfg(unix), skipped as root.
  • An access that gives up on a record held past RECORD_WAIT turns it off, and the next access that reaches the record turns it back on. This waits out the real 3 s, since the wait runs on a blocking thread's clock.

Tests not run locally (CI runs them); make fmt and make lint clean.

…ot's duties

The client asked whether its beacon node was syncing or optimistic once
an epoch, at the top of refresh_epoch, and between refreshes left every
duty to the node's 503. The Beacon API has none for a syncing node's
head root or an optimistic node's payload attestation data, and with
several nodes every request still started at the first one listed.

beacon_node::health probes every node's /eth/v1/node/syncing once a
slot, all at once, a sixth of a slot before the boundary (2 s on 12 s
slots), on its own task. NodeHealth keeps each node's last probe (the
full SyncStatus, head_slot and sync_distance included, or the error),
shared through FallbackBeaconNode::health() with a cheap snapshot().

- The duty loop reads the probe at the boundary: a slot signs nothing
  when some node answered and every node that answered is syncing or
  optimistic. A node that did not answer does not count, so the 503
  stays the backstop. Logged, and counted on
  ethlambda_validator_slots_skipped_syncing_total. Only the fee
  recipient re-send, which signs nothing, still runs in such a slot.
- refresh_epoch drops its own check and runs only in a slot that
  passed, so the epoch refresh and the duties read one probe.
- The fallback tries the nodes that passed first, then the rest, each
  in command-line order; Producer positions are unchanged.
- The head root and the PTC data are never asked of a node whose last
  probe said syncing or optimistic, so no sync committee message is
  signed over a syncing node's head and no PTC vote over an optimistic
  one.
- el_offline and each node's change of state are logged on change.
@MegaRedHand
MegaRedHand changed the base branch from feat/validator-per-slot-sync-check to feat/validator-node-ranking November 25, 2026 02:14
@MegaRedHand
MegaRedHand force-pushed the feat/validator-health-endpoint branch from 06ecf51 to 4134958 Compare November 25, 2026 02:14
…s probe

A synced node whose sync probe had not come back by the boundary counted
as not answering, so one fast syncing answer withheld the slot while
routing still ranked that node synced. A node still on the slot before's
synced answer now holds the gate open.

The probe task's end is logged: it loops for the client's life, so it
ends only by panicking, and the duties then go on unchecked.

The el_offline change logs compare against the last probe that
answered, so a failed probe in between neither hides the execution
client coming back nor reports it going offline twice.
@MegaRedHand
MegaRedHand force-pushed the feat/validator-health-endpoint branch from 4134958 to a712b8b Compare November 25, 2026 14:13
@MegaRedHand

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions

Copy link
Copy Markdown

AI security review: 2 finding(s) to check

Reviewed by Opus, GPT, Kimi, GLM. A judge model checked every one of the findings against the code.
DeepSeek (error, see the run log) did not finish; Opus, GPT, Kimi, GLM reviewed the whole PR. Comment /review continue to retry, with a new budget; reviewers that finished are reused.

# Finding Severity Status Found by Where
M1 Expire schedules at epoch boundaries, not two epochs after refresh medium Bug Opus, GLM, GPT, Kimi (4/4) crates/validator/src/client_health.rs:171
M2 Do not assume a successful refresh includes lookahead duties medium Bug GLM, GPT, Kimi (3/4) crates/validator/src/lib.rs:573
Details

M1. Expire schedules at epoch boundaries, not two epochs after refresh (medium, logic)

  • Trigger: The client starts, or recovers from refresh failures, late in epoch E and successfully fetches duties for E and E+1. Subsequent refreshes fail while beacon-node sync probes continue returning synced.
  • Mechanism: epoch_refreshed_at records the refresh's completion time, and schedule_current allows two complete epoch durations after that timestamp. However, DutiesService::refresh_around fetches calendar epochs E and E+1, whose coverage ends at the start of E+2 regardless of when the refresh completed. The duty loop can successfully refresh at any slot, and its retryable-error branch preserves the old schedule without updating the timestamp. DutiesService::at_slot returns no attester duties for E+2, but this comparison remains true until almost E+3 when the successful refresh happened near E's end. Expiry needs to follow the covered epoch boundary.
  • Impact: For nearly an additional epoch, /health can return 200 and the healthy gauge can remain 1 despite the client having no current attester schedule, hiding missed attestations from readiness and uptime monitoring.
  • Judge: A refresh can succeed late in epoch E, but health grants two full epochs from its completion, although the fetched attester schedules end at E+2. Subsequent retryable failures preserve that timestamp, allowing healthy reports for nearly another epoch without current attester duties. Cached committee duties may still run, so claims that all signing stops are too broad. The failed-lookahead variant

M2. Do not assume a successful refresh includes lookahead duties (medium, logic)

  • Trigger: During epoch E, a beacon node supplies current attester duties but fails the lookahead request for E+1. Requests for E+1 continue failing after its boundary, while sync probes remain fresh and synced.
  • Mechanism: DutiesService::refresh_around explicitly logs and ignores a failed refresh(current_epoch + 1), returning Ok after fetching only the current epoch. refresh_epoch consequently returns Ok too, so this call grants the health report its unconditional two-epoch freshness period without knowing whether lookahead duties exist. At E+1, failed refreshes leave no entry for that epoch, and DutiesService::at_slot returns an empty list. Neither the successful-refresh check nor the independent sync-probe check detects the missing schedule. This remains incorrect even if the expiry calculation is aligned to epoch boundaries; health must track which epochs were actually fetched.
  • Impact: The client can miss an entire epoch's attestations while /health returns 200 with schedule_current true and the healthy gauge reports 1.
  • Judge: Failed lookahead requests are swallowed, so refresh_epoch can succeed with only epoch E covered and unconditionally renew health. If E+1 refreshes then fail, health remains current despite missing E+1 attester duties. The additional proposer, sync, and PTC claims also hold when no applicable schedule is cached; PTC retries can recover, so one failure does not necessarily lose the whole epoch. This

Cost of this review: ~$2.75 of a $30 budget (estimated from token counts).

…ered synced

The head root and the payload attestation data have no 503 behind them,
yet a node whose sync probe failed was still asked for them: a syncing
node with a slow or broken /node/syncing could hand out its stale head,
or an optimistic one its unvalidated payload data, for this client to
sign.

For those two calls a node must have answered its last probe synced, or
have no probe to read (a fallback no probe task runs for). With no node
left to ask the answer stays BeaconNodeSyncing, which the sync
committee and PTC services read as "do not sign".
…sages

Requests walk the beacon nodes by tier, best first: synced and validated;
optimistic or with the execution client offline; syncing or more than 8
slots behind by sync_distance; not probed yet; failing. Command-line order
breaks ties, so one healthy node, or several, are asked as listed. A
request that times out or cannot connect ranks its node failing until a
later probe answers, so a hung node costs one request timeout per probe
rather than one per request. `nodes` stays in command-line order, so a
Producer still names the node that built a blinded block.

`--broadcast attestations,blocks,sync-committee` sends those signed
messages to every node at once, succeeding when any accepts. Nodes ranked
failing are sent a broadcast only when no other node took it. A block
reports the best answer (200 over 202 over refused). An envelope goes to
its block's producer first, then the rest, or to the producer alone when
sent without its blobs. A blinded block stays on its producer. None is
broadcast by default.
…less envelope to its producer

In a stall every node is past the sync tolerance and ranks Behind, so a
syncing node listed first was asked ahead of a synced one. Inside a
tier, a node reporting syncing now goes last, and an optimistic or
el_offline one after the rest.

An envelope without its blobs goes to its producer alone with or
without --broadcast blocks: only the producer cached them, and a
producer ranked failing for a timed-out block publish was otherwise
asked last.

Also: --broadcast accepts Lighthouse's `none` as a no-op, the request
failures are recorded with inspect_err, and the dto.rs table says
el_offline and sync_distance rank a node.
…e envelope's failover

A broadcast waited for every node not ranked failing. A node hanging on
publish_block for the first time held it past the proposal's deadline,
which cut the whole publish: the proposal read as failed, the
self-built envelope was skipped, and the hung node's timeout was never
recorded, so the next proposal waited on it again. Once a node accepts,
a broadcast now waits at most half a second more; a node still sending
is cut off and ranked failing.

An envelope without its blobs went to its producer alone. A block with
no blobs can be revealed through any node, so a producer that does not
take it is now followed by the walk, with or without --broadcast.

A request failure is cleared only by a probe sent after it, not by one
already on its way when the request failed.
…ties

The validator client's /health always answered 200 with a constant
body, so a client whose beacon nodes were all down or syncing, or whose
slashing-protection writes kept failing, looked healthy to every probe.

client_health::ClientHealth holds what the endpoint reads, all of it
state the client already keeps, and makes no beacon node request of its
own. /health now answers 200 when the client can do its duties and 503
when it cannot, with status, service and four checks:

- beacon_nodes {usable, configured}: usable counts the nodes whose
  latest sync probe (beacon_node::health) answered neither syncing nor
  optimistic and is at most two slots old. One is enough.
- validators {loaded, resolved}: reported, never failing. loaded is
  read from the key store with try_read, falling back to the last count.
- slashing_protection {last_write_ok}: SharedProtection::last_write_ok,
  two atomics beside the record's mutex. commit() sets the write flag
  from file::write's outcome; blocking() sets the wait flag on a
  RECORD_WAIT timeout and clears it when it reaches the record. A failed
  write fails the check until a later write succeeds.
- started: the duty loop marks the first successful refresh_epoch.

status is healthy (200), starting (503: not started, nothing else
failed; a node not probed yet does not count against a client that has
not started) or unhealthy (503).

beacon_node_available is now set on every /metrics scrape from the same
report, as is the new ethlambda_validator_healthy gauge and
validators_loaded, so a gauge and the endpoint read one answer. Its old
writers in the duty loop and the sync gate are gone.

docs/cli.md documents the endpoint and docs/metrics.md the metric
changes.
A node can answer its sync probe synced and still fail every duty
refresh. /health then stayed 200 for good after the first refresh, with
no duties left to do once the held schedule ran out, and the failure
paths that used to drop beacon_node_available are gone.

/health gains a schedule_current check: the last successful refresh is
at most two epochs old, so the schedule it fetched (its own epoch and
the next) still covers now. healthy now also requires it.
…y held

schedule_current allowed two epochs from the refresh's completion. A
refresh late in its epoch then read current for most of an epoch past
the schedule's end, and one whose lookahead fetch failed (which
refresh_around shrugs off) read current through an epoch it held no
attester duties for.

The duty loop now passes the last epoch the attester schedule holds
after a successful refresh: the lookahead epoch when its fetch went
through, else the refresh's own (DutiesService::holds_attesters).
ClientHealth compares it with the clock's epoch, so attach takes the
SlotClock.
@MegaRedHand
MegaRedHand force-pushed the feat/validator-health-endpoint branch from 578c046 to 0256e84 Compare November 25, 2026 15:01
…rent across boundaries

A refresh that resolved no validator (no keys, or keys waiting for
activation) fetches no attester schedule, so the schedule check counted
it through its own epoch only, and /health read unhealthy at every epoch
boundary until that slot's refresh returned. Such a refresh now counts
through the next epoch: there is no schedule to run out.
…ot-sync-check

Conflicts with the chain check from main (#854), resolved to keep both:

- FallbackBeaconNode holds the probe records and the chain check's
  per-node states side by side. The walk follows the probe ranking and
  skips a node whose usable flag is down; try_each_synced answers
  BeaconNodeSyncing only when some node is on this client's chain, and
  the no-usable-node failure otherwise.
- The per-slot probe and is_optimistic_or_syncing ask only the nodes on
  this client's chain, so a synced node on another chain cannot open the
  slot's gate.
- The duty loop reads the gate before the readmission count, so a node let
  back in during a withheld slot is still sent what it missed at the next
  slot that passes. Both the probe task and the chain check are stopped
  when run returns.
- docs/cli.md: the --beacon-nodes row and the per-slot section name the
  chain check.
…-node-ranking

Brings in main through the base branch: the chain check (#854) and the
keymanager token file (#867).

Conflicts in fallback.rs, resolved to keep both: the broadcast topics and
flag sit beside the chain check's per-node states, and the module doc keeps
both sections. Beyond the conflicts, a node whose usable flag is down is
now left out of a broadcast (`broadcast_to_all`), and an envelope whose
producer left the chain is not sent to it but to the walk or the broadcast,
as no other call goes to such a node. A broadcast with no node to send to
names the chain check's no-usable-node reason. docs/cli.md says so.
…-endpoint

Brings in main through the base branches: the chain check (#854) and the
keymanager token file (#867). One conflict, the module list in lib.rs,
which keeps both chain_check and client_health.
@MegaRedHand
MegaRedHand added this pull request to stack #897 November 25, 2026 19:45
pablodeymo and others added 6 commits November 25, 2026 17:14
With an empty ValidatorStore the sync committee and PTC services sign
nothing whichever node answers, so both tests still passed with
head_block_root routed back through the plain try_each walk. Loading one
key makes a stale or optimistic node's root produce a submitted message,
which the existing asserts catch.
…ot-sync-check

Brings in #869, #870 and #879. One conflict, in the duty loop's refresh
block (lib.rs): main's ahead_of_block/settle_refresh restructure is kept,
with this branch's comment fix (refresh_epoch no longer runs a sync check)
carried over.

Semantic fix: #869's a_refresh_that_finds_the_node_syncing_stops_the_proposals
drove the node_syncing gate through refresh_epoch's is_optimistic_or_syncing
check, which this branch removes in favour of the per-slot probe. The gate is
still reachable through a duties fetch every node refuses with a 503 (read as
BeaconNodeSyncing), so the test now feeds settle_refresh that outcome. The
proposal gate's comment now names the per-slot check as the primary guard.
…-endpoint

Brings in #876's and #885's latest, and through them main's #869, #870 and
#879, which restructured the duty loop's refresh (ahead_of_block,
settle_refresh, a refresh deferred past the block).

Conflicts in lib.rs, resolved onto main's structure with this branch's
intent ported:
- health.epoch_refreshed now runs wherever settle_refresh reports a refresh
  that got through, both ahead of the block and deferred past it, through a
  new report_refreshed helper that keeps the covered_through rule.
- The set_beacon_node_available writes #869 and #870 added (settle_refresh's
  two failure arms, the proposer-only fetch, spawn_subscriptions) are
  dropped, as this branch dropped the older ones: the gauge is set from the
  /health report on every scrape.

duties.rs: #869 and this branch each added an identical holds_attesters;
one is kept.
…anking

main is #876's squash (2a67cdb), whose tree is identical to #876's last
head (db433ad), already merged here. Recorded with -s ours so GitHub sees
main as merged; this branch's tree is unchanged.
…-endpoint

Brings in the base branch's merge of main, which carries #876 as one
squashed commit.
MegaRedHand added a commit that referenced this pull request Nov 26, 2026
…ties (#884)

The validator client's /health answered healthy whatever its state, and
ethlambda_validator_beacon_node_available said little more. /health now
answers 503 with the reasons when no beacon node is usable, when the duty
schedule has run out, or when slashing-protection writes keep failing, and
the metric is set from that same report rather than from scattered call
sites.

Applied as this PR's own change on top of #885, which it is stacked on.
Resolved against #874, #877 and #880:

- The deferred refresh reports to the health tracker before #869's owed
  sends.
- The sync committee message step keeps #880's head-event trigger and
  drops the direct metric write, as this PR does everywhere.
- The registrable filter keeps #877's whole-entry is_registrable.
- #874's distributed subscription task no longer writes the metric either.
- This PR's health test builds ValidatorEntry with #877's slashed: false.
MegaRedHand added a commit that referenced this pull request Nov 26, 2026
…de's (#886)

The validator client timed every duty off its own wall clock and never
checked it against anything, so a skewed clock got proposals refused or
sent duties late while every series looked healthy. Each sync probe now
also reads the node's Date header and answer time, and the client warns
when its clock is off from the nodes' by half a second or more
(ethlambda_validator_beacon_node_clock_offset_seconds). A step of the wall
clock against the monotonic one is logged and counted too.

Applied as this PR's own change on top of #884, which it is stacked on.
Resolved against #874 and #880: the module list and the metrics keep
#874's and #880's entries next to this PR's clock series.
… it off, and give the envelope's producer a head start

- A node a broadcast stops waiting for 500 ms after the first acceptance is
  no longer ranked Failing. One that is only slower (to import a block, or to
  take a large envelope) was cut out of every broadcast until its next probe,
  slot after slot. A hung node still costs a broadcast at most the grace, and
  its probe ranks it failing. `NodeHealth::record_no_answer` is removed.
- Under `--broadcast blocks` the envelope's producer gets a 500 ms head start
  (`PRODUCER_HEAD_START`) rather than an unbounded wait. A producer that holds
  the request open (one that answered the block 202 waits for a block it never
  imported) no longer keeps the envelope from every node until the proposal's
  deadline cuts the reveal; past the head start its answer is awaited with the
  others' (`Sent::Pending`).
- An envelope without its blobs that the producer refused is not sent to it a
  second time by the walk (`Reach::EveryBut`).
- `register_validators_in_batches` records failed batches against node health.
…anking

# Conflicts:
#	bin/ethlambda/src/validator.rs
…anking

# Conflicts:
#	bin/ethlambda/src/validator.rs
#	crates/validator/src/lib.rs
MegaRedHand added a commit that referenced this pull request Nov 26, 2026
…ties (#884)

The validator client's /health answered healthy whatever its state, and
ethlambda_validator_beacon_node_available said little more. /health now
answers 503 with the reasons when no beacon node is usable, when the duty
schedule has run out, or when slashing-protection writes keep failing, and
the metric is set from that same report rather than from scattered call
sites.

Applied as this PR's own change on top of #885, which it is stacked on.
Resolved against #874, #877 and #880:

- The deferred refresh reports to the health tracker before #869's owed
  sends.
- The sync committee message step keeps #880's head-event trigger and
  drops the direct metric write, as this PR does everywhere.
- The registrable filter keeps #877's whole-entry is_registrable.
- #874's distributed subscription task no longer writes the metric either.
- This PR's health test builds ValidatorEntry with #877's slashed: false.
MegaRedHand added a commit that referenced this pull request Nov 26, 2026
…de's (#886)

The validator client timed every duty off its own wall clock and never
checked it against anything, so a skewed clock got proposals refused or
sent duties late while every series looked healthy. Each sync probe now
also reads the node's Date header and answer time, and the client warns
when its clock is off from the nodes' by half a second or more
(ethlambda_validator_beacon_node_clock_offset_seconds). A step of the wall
clock against the monotonic one is logged and counted too.

Applied as this PR's own change on top of #884, which it is stacked on.
Resolved against #874 and #880: the module list and the metrics keep
#874's and #880's entries next to this PR's clock series.
…-endpoint

Brings in #885's latest, with main's #872 and #880.

One conflict, in the sync committee message step: it keeps #880's
head-event trigger and drops the direct beacon_node_available write, as
this branch does everywhere. The metric is set from the health report
alone.
MegaRedHand added a commit that referenced this pull request Nov 26, 2026
…ck-skew

Brings in #884's latest, with #885's and main's #872 and #880.

One conflict, in the validator metrics: they keep #880's duty-trigger and
event-stream series next to this branch's clock offset and clock step
series, and init registers all four.
Base automatically changed from feat/validator-node-ranking to main November 26, 2026 22:56
@MegaRedHand
MegaRedHand added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 19d6c7e Nov 26, 2026
13 checks passed
@MegaRedHand
MegaRedHand deleted the feat/validator-health-endpoint branch November 26, 2026 23:19
MegaRedHand added a commit that referenced this pull request Nov 26, 2026
Brings in main now that #885 and #884 have merged, with #868, #900, #901
and #911.

#885 and #884 reached main as squash commits, so a plain merge saw both
sides add the same files and conflicted throughout. The tree is main plus
this branch's own diff against #884's merged head (42dcaa3), which
applies to main without conflicts.
MegaRedHand added a commit that referenced this pull request Nov 27, 2026
Brings in #868, #872, #880, #884, #885 and #886, among others.

Each side added a flag next to --beacon-nodes, a ValidatorConfig field
and a row in the README and docs/cli.md flag tables. --network and
main's --broadcast both stay, --network first, and the --beacon-nodes
rows take main's text, which describes #885's ranking. The config is
built before run (#872), so network joins main's broadcast and
event_stream fields there.
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.

validator: make /health report whether the client can do its duties

2 participants