fix(validator): allow block proposals during sync lag - #1197
Open
exocognosis wants to merge 1 commit into
Open
Conversation
exocognosis
marked this pull request as ready for review
July 30, 2026 20:33
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.
Summary
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 passedjust checkjust deadcodejust test, 2,944 passed with 91.78 percent coverageCloses #1194.