fix: don't publish flashblock after payload cancellation#525
Open
avalonche wants to merge 1 commit into
Open
Conversation
julio4
reviewed
May 21, 2026
Member
julio4
left a comment
There was a problem hiding this comment.
We were already checking for block cancel before calling all publish side effects in sync, so this is mostly refactor to extract publish side effects outside of build_next_flashblock it seems?
Member
|
Also please see #518 |
akundaz
reviewed
May 21, 2026
| build_duration, | ||
| } = built_flashblock; | ||
|
|
||
| if payload_cancel.is_cancelled() { |
Contributor
There was a problem hiding this comment.
Aren't we checking for cancellation just before we call this publish function? So this seems unnecessary here
Collaborator
Author
There was a problem hiding this comment.
I believe we check is_resolved but is_cancelled() can also be true if deadline / error is reached. but yes I believe it can be refactored better
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
Prevents a cancelled payload job from publishing locally built payloads into the payload handler after the job has already been resolved (by newPayload).
It also renames
PayloadJobCancellation::cancelled()towait_for_cancellation()so async wait sites are easier to distinguish from immediateis_cancelled()checks.💡 Motivation and Context
forkchoiceUpdatedstarts a payload job.PayloadHandler.Events::BuiltPayload, which updates reth's engine tree with the local payload.build_next_flashblock()was a blocking job that previously performed side effects such as publishing. Reth could then see a stale local same-height payload after the job had already been resolved. Now:build_next_flashblock()builds and returnsBuiltFlashblockOutput.publish_flashblock_payload()performs one final cancellation check before websocket publish and channel sends.✅ I have completed the following steps:
make lintmake test