Skip to content

miner: retry immediately when block building is interrupted#33837

Closed
jrhea wants to merge 1 commit into
ethereum:masterfrom
jrhea:no-recommit-retry-delay
Closed

miner: retry immediately when block building is interrupted#33837
jrhea wants to merge 1 commit into
ethereum:masterfrom
jrhea:no-recommit-retry-delay

Conversation

@jrhea
Copy link
Copy Markdown
Contributor

@jrhea jrhea commented Feb 13, 2026

Problem

When the build loop's fillTransactions() is interrupted by the recommit timer before all pending transactions are included, the next build iteration waits the full Recommit interval (default 2s) before retrying. This trace shows the issue:

image

The span with the red dot was interrupted and returned an error because it didn't finish including all the txs. You can see there is almost 2s of empty space left over where it could have been including more txs.

Fix

  • Immediate retry on interrupt: generateWork now signals via an interrupted flag on the result when fillTransactions was interrupted before finishing. The build loop uses this to reset the timer to 0 (immediate retry) instead of the full Recommit interval. If the iteration completed all available txs, the normal Recommit interval is used.
  • Early exit on delivery: When Go's select picks the timer case over payload.stop (which is random when both are ready), we now explicitly check payload.stop before starting a new iteration to avoid wasted work after the payload has been delivered.

Here is a trace showing that it now retries immediately and includes more transactions:

image

In this particular case, it included all 34 transactions available on the second iteration; whereas it would have only had 30 from the first iteration with the old logic.

@jrhea jrhea force-pushed the no-recommit-retry-delay branch from eaf7d1e to f2e8985 Compare February 13, 2026 15:29
Copy link
Copy Markdown
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jrhea
Copy link
Copy Markdown
Contributor Author

jrhea commented Mar 3, 2026

closing this in favor of: #33908

@jrhea jrhea closed this Mar 3, 2026
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