← Back to Pull requests

cl: keep Gloas payload status when EL validation is cut short #24828

Closed
unknown closed this pull request without merging on Oct 15, 2026 14:16 UTC
View on GitHub
unknown unknown commented on Oct 13, 2026 07:30 UTC
Author

Part of #24620.

First of the focused PRs that replace #24643. This one holds the core fix for the stuck head; the other parts land after it or independently (see the landing order on #24620).

Problem

After a restart or a deep forward sync, Gloas payloads that were persisted without an EL verdict had no payload status, and EL calls cut short by our own context were recorded as None. Fork choice then saw such payloads as unavailable, kept the EMPTY variant and could not move the head past them.

Changes

  • Forward sync: fork choice records NotValidated for an envelope it persists without an EL call (no engine, or validate=false as in forward sync), under its lock, so fork choice can build on the FULL variant. A verdict already on record is kept. Main has the same rule since #24878. See "Decision" below.

  • Interrupted validation is not None:

  • - ErrPayloadValidationInterrupted (was the private errPayloadValidationAdmission) marks a NewPayload that ended with our own context, while waiting for admission or inside the EL call.
    - The pending drain, the verification sweep and the stored-parent replay keep the payload pending instead of recording None.
    - The direct client answers no verdict, instead of NotValidated, when its head read fails because the caller's context ended. This applies to every fork, so a pre-Gloas block import in that window is delayed once instead of accepted optimistically.
    - A timeout of the engine client's own request, with our context still alive, is not covered: the engine client returns None with the error, which fork choice records before errELBehind persists and queues the envelope, and the drain and sweep retry under their 2 s budget without a verdict while the EL stays slow. This is pre-existing and affects only a remote EL; a follow-up is proposed (classify Gloas envelopes by the error chain: persist, NotValidated, queue; keep pre-Gloas IGNORE).
  • REST envelope POST:

  • - An interruption after the consensus checks is treated like a queued envelope: 202, published, and the gossip event emitted. Fork choice parks such an envelope without persisting it, so the handler does not mark it seen and keeps its retry record; the client's re-POST is processed again.
    - Every branch publishes on a context detached from the request, bounded by one slot from the start of the publish, so a client that gave up during validation does not stop it.
    - Under consensus and consensus_and_equivocation, an interruption during the consensus pre-validation still answers 400 and is not broadcast (#24853 tracks queuing it).
  • Anchor: StoreAnchorEnvelope records NotValidated until the EL answers, with any execution client.

  • By-hash verdict: unchanged from main. Projecting a hash's Validated onto a sibling root (payloadValidatedLocked) is base behaviour that main tests encode; making it root-specific for Gloas is proposed as a follow-up together with INVALID by hash.

  • EL validation depth: the embedded EL client inserts a block more than reorgTooDeepDepth below its head, then answers NotValidated without validating it. It reports that bound (SkipsValidationBelow, 0 when it validates every block) and whether it is known: it is not while the EL head cannot be read.

  • - The drain, the replay, the sweep and the anchor retry still send such payloads to the EL, so they reach it, and only skip the requeue after a NotValidated answer below the bound. The bound is read once per pass.
    - Only the EL's own NotValidated answer, recorded as such, counts: an error answer keeps a recorded NotValidated, and an interrupted call is not an answer, so both are retried. The sweep and the anchor retry remember such roots after the call. While such a root is still below the current depth, which follows the EL head, the sweep skips it and walks on to its ancestors, which an interrupted batch may have left unsent, and the anchor retry skips the anchor before loading its state. The sweep also skips a remembered root among its selected and immediate heads, so it is not read and sent again on every pass. An unreadable EL head keeps the remembered roots in both, and a known zero depth checks them again. Remembered sweep roots are pruned at finalization.
    - Other EL clients report no bound and keep the old retry behaviour.

    Decision: forward-synced payloads without an EL call

    NotValidated from forward sync makes the payload FULL-eligible without a data-availability check, and Gloas roots are not reported as optimistic. Main already takes this shortcut for pre-Gloas forward-synced blocks, and with the default direct client those payloads were executed by the EL during forward sync. This PR keeps it as the Gloas form of that shortcut. Gloas-aware optimistic tracking and a DA check for forward-synced envelopes (with #24704) are proposed as follow-ups.

    Tests

    Each behaviour change has a test that failed before the change, or a mutation check.

  • on_execution_payload_test.go:

  • - an EL call cut by the context inside NewPayload leaves the envelope pending, with no status recorded. It fails without the admission wrap;
    - an envelope persisted without an EL call is NotValidated, with no engine and with validate=false.
  • execution_client_engine_test.go:

  • - a client timeout is no verdict, for Gloas and Electra;
    - ValidationInterrupted.
  • payload_build_test.go:

  • - the direct client's ended-context window, through a real execution module;
    - SkipsValidationBelow.
  • gloas_drain_test.go, gloas_payload_test.go, chain_tip_sync_recovery_test.go:

  • - interrupted drain, sweep and replay, through the real store admission;
    - below the validation depth the EL is still asked and the payload is not requeued (drain, replay); the sweep and the anchor retry ask once and stop while the root stays below the depth, also with an unreadable EL head, and again at a known zero depth; a remembered selected head is not sent again; the sweep walks past a remembered root; an interrupted forward-sync anchor validation records nothing; the sweep's pruning;
    - the anchor status and gas limit with and without an engine.
  • epbs_test.go:

  • - an interrupted and a validated envelope POST on three routes, with the request context cancelled during validation;
    - a re-POST after an interrupted validation is processed, on three routes;
    - the publish deadline starts at the publish, not before the validation.

    Mutation checks (each makes a test fail): requeue regardless of the depth, no sweep or anchor memo, dropping the memo on an unreadable head, skipping the EL call below the depth, no anchor gas limit, marking an interrupted POST seen, a publish window that includes the validation, no NotValidated without validation in fork choice.

    go test -race passes for cl/beacon/handler, cl/phase1/{forkchoice,stages,execution_client,network}/...; make lint clean twice.

    TDD note: the sentinel rename in on_block.go, on_block_lock_scope_test.go and on_execution_payload_test.go is mechanical, so it has no new tests.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: domiwei Review duration: 3286m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.75 · 650 lines diff across 8 files
    0.75
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.075
    Real PR Conversation Timeline
    1 comments
    "Review active on #24828"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 75.2% (HIGH) · Higher = larger blast radius
    75.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 29.7% · Safe to merge
    29.7%