[r3.6] cl/phase1, execution: give the execution module a typed busy signal and the caller's context - #23321
Merged
Conversation
…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)
lystopad
requested review from
domiwei,
mh0lt,
sudeepdino008 and
yperbasis
as code owners
August 16, 2026 08:44
AskAlexSharov
approved these changes
Aug 16, 2026
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.
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
AssembleBlockandGetAssembledBlockreturnchainreader.ErrExecutionBusyinstead of a bareerrors.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;time.Sleep, where before a cancelled caller still waited the full six seconds;context.Background().r3.6-specific notes
BlockBuilder.Stop()takes no context on this branch (#22835 is not here), andExecModule.GetAssembledBlockdiscards the context it is given. So threading the context through reachesAssembleBlockand the retry loop, but not the wait for a builder to finish — a smaller change than onmain, and deliberately left that way rather than pulling #22835 in behind it.That difference also removes a dependency: on
main, givingStopa real context made a pre-existing race reachable where a finished payload could be discarded in favour of a cancellation, which #23289 fixes.Stophas 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.