Skip to content

[r3.6] cl/phase1, execution: give the execution module a typed busy signal and the caller's context - #23321

Merged
AskAlexSharov merged 1 commit into
release/3.6from
feature/lystopad/cp-23273-to-3.6
Aug 16, 2026
Merged

[r3.6] cl/phase1, execution: give the execution module a typed busy signal and the caller's context#23321
AskAlexSharov merged 1 commit into
release/3.6from
feature/lystopad/cp-23273-to-3.6

Conversation

@lystopad

Copy link
Copy Markdown
Member

Cherry-pick of #23273 to release/3.6.

Applied cleanly, but it lands differently here than on main, so it is worth being explicit about what it does and does not change on this branch.

What it does here

  • AssembleBlock and GetAssembledBlock return chainreader.ErrExecutionBusy instead of a bare errors.New("execution data is still syncing"), which was neither accurate — it is weight-one semaphore contention, not syncing — nor something a caller could tell apart from a rejection;
  • the assemble retry waits only on that sentinel, so a permanent rejection surfaces immediately instead of being retried thirty times over six seconds;
  • the retry checks the caller's context before each attempt and waits on it rather than on a bare time.Sleep, where before a cancelled caller still waited the full six seconds;
  • the chain reader takes the caller's context instead of substituting context.Background().

r3.6-specific notes

BlockBuilder.Stop() takes no context on this branch (#22835 is not here), and ExecModule.GetAssembledBlock discards the context it is given. So threading the context through reaches AssembleBlock and the retry loop, but not the wait for a builder to finish — a smaller change than on main, and deliberately left that way rather than pulling #22835 in behind it.

That difference also removes a dependency: on main, giving Stop a real context made a pre-existing race reachable where a finished payload could be discarded in favour of a cancellation, which #23289 fixes. Stop has no context here, so that race does not exist on this branch and #23289 is not a prerequisite for this backport.

Part of backporting the series that split #23105.

…nd the caller's context (#23273)

Split out of #23105, which grew too large to review in one piece.
Independent of the other parts of that series.

### Contention was indistinguishable from rejection

`AssembleBlock` and `GetAssembledBlock` reported a busy execution module
as `errors.New("execution data is still syncing")`. That message is
inaccurate — it is weight-one semaphore contention with a forkchoice
update or another payload request, not syncing — and being an untyped
error, callers could not tell it apart from a real rejection.

Both now return `chainreader.ErrExecutionBusy`, and the assemble retry
waits only on that. Previously a permanent rejection — mismatched
withdrawals, for instance — was retried thirty times across six seconds
before surfacing, which spends the proposal slot rather than reporting
the problem.

### The retry ignored its caller

The loop was `for range 30 { ...; time.Sleep(200 * time.Millisecond) }`,
with no context check anywhere. A cancelled caller still waited the full
six seconds. It is now an extracted helper that checks the context
before each attempt and waits on it rather than on a bare sleep.

While there, `ChainReaderWriterEth1.AssembleBlock` and
`GetAssembledBlock` take the caller's context instead of substituting
`context.Background()`, so the deadline a caller sets actually reaches
the execution module.

### Tests

The helper is covered directly: first success, stopping on a rejection,
exhausting attempts on contention, cancellation mid-flight and before
the first attempt, and the zero-attempts guard.

Part of a series splitting #23105.

(cherry picked from commit aeb7f3b)
@AskAlexSharov
AskAlexSharov added this pull request to the merge queue Aug 16, 2026
Merged via the queue into release/3.6 with commit abef03f Aug 16, 2026
94 checks passed
@AskAlexSharov
AskAlexSharov deleted the feature/lystopad/cp-23273-to-3.6 branch August 16, 2026 11:19
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.

2 participants