Skip to content

fix(validator): allow block proposals during sync lag - #1197

Open
exocognosis wants to merge 1 commit into
leanEthereum:mainfrom
exocognosis:agent/allow-sync-lag-block-proposals
Open

fix(validator): allow block proposals during sync lag#1197
exocognosis wants to merge 1 commit into
leanEthereum:mainfrom
exocognosis:agent/allow-sync-lag-block-proposals

Conversation

@exocognosis

Copy link
Copy Markdown

Summary

  • allow scheduled block production to run during sync lag
  • keep the sync-lag gate on attestation production
  • rename the private gate state, helper, logs, and threshold documentation around attestation behavior
  • add a run-loop regression for five consecutive missed proposals

Problem

The validator run loop applied the sync-lag gate to block proposals and attestations. After five consecutive proposers missed their slots, the local head lag reached SYNC_LAG_THRESHOLD + 1.

That lag closed the gate. The network-stall escape remained inactive until NETWORK_STALL_THRESHOLD, which is eight slots. An honest proposer selected during slots five through eight therefore skipped block production even though it could extend the stale head. Each skipped honest proposal prolonged the stall.

Proposed solution

Interval zero now always invokes the existing block-production path. That path already checks whether the local registry controls the scheduled proposer, whether the head state exists, and whether block construction succeeds. A sync-lagged node therefore produces at most the block assigned to one of its validators.

The sync-lag predicate remains active for interval-one attestations. Its local lag check, authenticated network-stall evidence, hysteresis, and transition logging keep their existing behavior.

The private state and helper now use attestation-specific names. Log messages and threshold documentation follow the same scope, which makes the control-flow contract explicit.

Impact

An honest scheduled proposer can restart block production after a short sequence of maliciously or accidentally skipped slots. Nodes with stale views still suppress attestations, which limits vote pollution while their local head catches up.

Tests

The new run-loop regression sets the head to slot zero and advances the clock to SYNC_LAG_THRESHOLD + 1. It verifies that block production receives the current slot. The existing run-loop regression continues to verify that attestation production remains suppressed during sync lag.

Validation completed:

  • pytest --no-cov tests/node/validator/test_service.py, 49 passed
  • just check
  • just deadcode
  • just test, 2,944 passed with 91.78 percent coverage

Closes #1194.

@exocognosis
exocognosis marked this pull request as ready for review July 30, 2026 20:33
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.

Sync lag gate: allow block proposals

1 participant