Skip to content

test(validator): add validator sync-lag duty gate test vectors#1165

Open
zemse wants to merge 1 commit into
leanEthereum:mainfrom
zemse:feat/validator-duty-gate-vectors
Open

test(validator): add validator sync-lag duty gate test vectors#1165
zemse wants to merge 1 commit into
leanEthereum:mainfrom
zemse:feat/validator-duty-gate-vectors

Conversation

@zemse

@zemse zemse commented Jun 18, 2026

Copy link
Copy Markdown

🗒️ Description

Introduces a new consensus fixture format for the validator sync-lag duty gate and lands the first vectors.

validator_duty_gate format

  • Replays a sequence of steps against ValidatorService._is_synced_for_duties and records the allow or skip verdict per step. The gate stays the source of truth, the fixture only records what it decides.
  • Each step gives a wall-clock slot and an optional head move. The hysteresis flag carries across steps, so one vector can drive the gate both open and closed.

Initial vectors (2)

Under tests/consensus/lstar/validator/, two step sequences cover the decision surface:

  • Threshold and hysteresis: lag 4 allowed and lag 5 gated (open threshold), lag 3 staying closed while lag 2 reopens (hysteresis band pinned to 2), and a head ahead of the wall clock saturating lag to 0.
  • Network-stall escape: net-lag 8 still gates while net-lag 9 escapes (strict boundary), the escape reopening a closed gate and keeping an open one signing, for both block and attestation duties.

The missing-head fallback and run-loop wiring are left out as client-internal behavior, covered by each client's own unit tests.

🔗 Related Issues or PRs

Mirrors the validator sync-lag duty gate introduced in #708.

✅ Checklist

  • Ran local quality checks to avoid unnecessary CI fails:
    just check
  • Considered adding appropriate tests for the changes.
  • N/A for docs, test-vector and fixture-format-only PR, the format is documented inline.

@zemse zemse marked this pull request as draft June 18, 2026 21:39
Introduce a validator_duty_gate consensus fixture with two step-sequence
vectors that drive ValidatorService._is_synced_for_duties and record its
allow or skip verdict per step. One covers the lag threshold, the
hysteresis band, and clock-skew saturation; the other covers the
network-stall escape, its strict boundary, and both the open and closed
gate. Clients replay the steps and compare verdicts.
@zemse zemse force-pushed the feat/validator-duty-gate-vectors branch from 4f02bb8 to 4a08fae Compare June 18, 2026 21:51
@zemse zemse marked this pull request as ready for review June 18, 2026 22:18
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