Skip to content

fix(engine): return payload job start errors from forkchoiceUpdated - #19

Merged
sebastianst merged 2 commits into
op-v2.6.0from
seb/payload-job-start-errors
Oct 20, 2026
Merged

sebastianst merged 2 commits into
op-v2.6.0from
seb/payload-job-start-errors

Conversation

@sebastianst

@sebastianst sebastianst commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Keeps the PayloadBuilderError when the payload job for engine_forkchoiceUpdated attributes can't be started, and maps it to the right JSON-RPC error.

Before, PendingPayloadId dropped the error and resolved to ForkchoiceUpdateError::UpdatedInvalidPayloadAttributes, so every job start failure reached the consensus client as -38003 Invalid payload attributes without a reason. That includes failures that have nothing to do with the attributes: BasicPayloadJobGenerator::new_payload_job only fails on a provider error or a missing parent header, and a payload service that drops the request did the same. A consensus client that acts on -38003, for example by discarding the attributes, then discards valid ones. This PR fixes that.

  • OnForkChoiceUpdated resolves to Result<ForkchoiceUpdated, BeaconForkChoiceUpdateError>. A job start failure becomes the new BeaconForkChoiceUpdateError::PayloadJob(PayloadBuilderError), a dropped reply PayloadJob(ChannelClosed).
  • The new PayloadBuilderError::InvalidAttributes lets a payload builder reject the attributes, e.g. because a transaction they include can't be executed.
  • PayloadJob(InvalidAttributes) maps to -38003, every other PayloadJob error to -32603, both with the error in data. Only the payload builder can tell that the attributes are at fault, so whatever it doesn't reject that way is a failure of the node and must not be reported as invalid attributes.

Attributes rejected by the engine's own checks (version-specific fields, timestamp against the parent) still get -38003 as before. Like paradigmxyz#22374, which returns -32602 for attribute structure errors, this gives a forkchoiceUpdated failure the code that matches its cause.

Backport of paradigmxyz#28015, merged upstream as 186af6d36a (both PR commits; same content as the squash). The second commit's SSZ proxy test changes are dropped: that test has no PayloadJob cases on this base.

A payload job generator or payload service that rejects attributes when the job starts must now return PayloadBuilderError::InvalidAttributes to keep answering -38003; any other error now gets -32603.

Breaking: OnForkChoiceUpdated::Output changes to Result<ForkchoiceUpdated, BeaconForkChoiceUpdateError> (OnForkChoiceUpdatedResult), and BeaconForkChoiceUpdateError and PayloadBuilderError gain a variant.

🤖 Co-created with Claude Opus 5.5

@joshklop
joshklop force-pushed the joshklop/v2.6.0-pin branch 3 times, most recently from e038904 to 8d359d0 Compare October 16, 2026 17:46
@sebastianst
sebastianst force-pushed the seb/payload-job-start-errors branch from 86baaac to 367f538 Compare October 16, 2026 17:52
@sebastianst
sebastianst force-pushed the seb/payload-job-start-errors branch from ed9186a to 27aafb0 Compare October 19, 2026 11:13
@sebastianst
sebastianst changed the base branch from joshklop/v2.6.0-pin to joshklop/v2.6.0-pin-ci-fix October 19, 2026 11:13
@sebastianst
sebastianst changed the base branch from joshklop/v2.6.0-pin-ci-fix to op-v2.6.0 October 20, 2026 11:14
@nonsense
nonsense self-requested a review October 20, 2026 14:05
sebastianst and others added 2 commits October 20, 2026 16:12
When the payload job for forkchoiceUpdated attributes couldn't be started,
PendingPayloadId dropped the PayloadBuilderError and answered -38003 (invalid
payload attributes) for every failure, including failures of the node such as
a provider error, a missing parent header or a dropped reply.

OnForkChoiceUpdated now resolves to a BeaconForkChoiceUpdateError, and a job
start failure becomes BeaconForkChoiceUpdateError::PayloadJob with the
builder's error. A payload builder rejects the attributes with the new
PayloadBuilderError::InvalidAttributes, which the engine API maps to -38003;
every other job start failure maps to -32603. Both carry the error in data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve `PendingPayloadId` with `?` and the existing `RecvError` conversion
instead of a three-arm match, and document that `InvalidAttributes` only
rejects the attributes when returned at job start. Trim tests that repeat
coverage: the internal-error loop keeps one case per real failure path (a
missing parent, a dropped sender, a custom builder error), and the SSZ proxy
drops its second `-38003` case, already pinned by the RPC mapping test and
the existing invalid-attributes case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WvcVspqLS7H3kZwfXSAoJy
@sebastianst
sebastianst force-pushed the seb/payload-job-start-errors branch from 27aafb0 to 7e4cc35 Compare October 20, 2026 14:12
@sebastianst
sebastianst enabled auto-merge (squash) October 20, 2026 14:14
@sebastianst
sebastianst merged commit 89e32ef into op-v2.6.0 Oct 20, 2026
30 checks passed
@sebastianst
sebastianst deleted the seb/payload-job-start-errors branch October 20, 2026 14:46
sebastianst added a commit to ethereum-optimism/optimism that referenced this pull request Oct 20, 2026
ethereum-optimism/reth#19 merged into op-v2.6.0 as 89e32ef290, tagged
op-v2.6.0-1. It has the tree of the fork commit the reth crates were pinned
to by rev, plus the fork's CI change #21, which only touches a workflow file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants