Repository navigation
op-reth,kona-node!: build derived payloads at forkchoiceUpdated - #23447
Closed
sebastianst wants to merge 3 commits into
Closed
sebastianst wants to merge 3 commits into
sebastianst wants to merge 3 commits into
Conversation
sebastianst
force-pushed
the
seb/op-reth-derived-fcu-build
branch
from
October 15, 2026 11:49
7cf5123 to
862e945
Compare
OpEngineApi builds the payload of derived (noTxPool) attributes that carry a non-deposit transaction while it answers engine_forkchoiceUpdated, with op-reth's payload builder whatever payload service the node runs. If the transactions make the block invalid it answers -38003, so the rollup node replaces the block with a deposits-only one or drops the batch. Before, the payload service either skipped the invalid transaction and built a block the fault proof rejects, or failed the build at getPayload, which the rollup node retries forever. The builder no longer skips invalid transactions of noTxPool attributes. getPayload serves the payload and publishes it to the payload service, whose subscribers include the engine tree, so newPayload does not execute the block again. That needs PayloadBuilderHandle::publish_built_payload, so reth is pinned to the fork commit that adds it. Attributes reth rejects, and builds that fail for a node-local reason, take reth's path as before. Requests for one payload share its build, and forkchoice updates are handled one at a time, so a fallback cannot overwrite a newer forkchoice. The witness of derived attributes with an invalid transaction covers the state read up to that transaction, where the fault proof program stops. BREAKING CHANGE: op-reth answers engine_forkchoiceUpdated with -38003 when the transactions of derived attributes make the block invalid. The rollup node must then replace the block with a deposits-only block or drop the batch. op-node does; kona-node needs the matching change, or it retries the attributes and stalls the safe head, so upgrade both together. Downstream crates that call OpEngineApi::new must pass the provider, validator and DerivedPayloads it builds derived payloads with; OpEngineApiBuilder requires the node's pool, provider and EVM to fit op-reth's payload builder. Co-authored-by: Anton Evangelatov <anton.evangelatov@oplabs.co> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the execution layer rejects derived attributes at forkchoiceUpdated with -38003 (invalid payload attributes), kona-node builds the deposits-only replacement under Holocene, as op-node does, instead of retrying the attributes forever. The engine queue drops a task that ends in a flush rather than retrying it, since retrying would replace the block again. The forkchoiceUpdated and newPayload rejections share one deposits-only replacement, which now logs why a failed replacement is critical. Co-authored-by: Anton Evangelatov <anton.evangelatov@oplabs.co> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Posts a batch whose 0x7D over-refunds a transaction and checks that the sequencer and the verifier both replace the block with the same deposits-only block, and that the safe head keeps advancing. Co-authored-by: Anton Evangelatov <anton.evangelatov@oplabs.co> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sebastianst
force-pushed
the
seb/op-reth-derived-fcu-build
branch
from
October 15, 2026 12:21
862e945 to
6d58537
Compare
Member
Author
|
We chose #23454 |
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.
Alternative: #23454 builds derived payloads in a payload service wrapper instead, with no reth changes.
op-reth only found out that a derived block's transactions were invalid in its asynchronous payload build, after
engine_forkchoiceUpdatedhad already answered VALID. An invalid forced transaction was skipped, so op-reth built a block that the fault proof rejects. An invalid0x7Dfailed the build instead, soengine_getPayloadreturned an error, the rollup node retried the same attributes forever and the safe head stalled.op-reth now builds the payload of
noTxPoolattributes that carry a non-deposit transaction exactly once insideengine_forkchoiceUpdated. It does so inOpEngineApiwith op-reth's payload builder, whatever payload service the node runs, so op-reth-premium is covered too, and answers-38003when the transactions make the block invalid. op-node and kona-node (fixed here) then replace the block with a deposits-only one. Deposit-onlynoTxPoolattributes still go to the payload service.engine_getPayloadhands the executed block to the engine tree through a new reth hook,PayloadBuilderHandle::publish_built_payload(feat(payload): allow publishing payloads built outside a payload job reth#16), soengine_newPayloaddoesn't execute it a second time.-38003; it takes the payload-service path as before.debug_executePayloadreturns the witness up to that transaction, where the fault proof program stops, instead of the witness of a block without it.Latency for 30M-gas blocks (release build, median of 9, FCU + getPayload + newPayload + FCU), before → after: ETH transfers 120 → 95 ms, SSTORE 14 → 24 ms, KECCAK256 165 → 159 ms, ecrecover 388 → 389 ms, all within run-to-run noise (±10–20 ms). An invalid block is rejected at FCU after executing up to the failing transaction.
Supersedes #23188, whose kona-node fix and acceptance test this carries. Compared with it and with an earlier private fix (optimism-private@ed9e4d8):
OpEngineValidator::validate_payload_attributes_against_headerOpEngineApi, inengine_forkchoiceUpdated0x7DonlynoTxPool)Evmparameter onOpEngineValidatorBefore merge: move the reth pin from the head of ethereum-optimism/reth#16 to its commit on
optimism, and re-tag the staleUPSTREAM-MIRRORreth tags (just mirrors stale); the only reth change is the payload-service hook.Review agents (Rust, Go, derivation-batch, security) ran; their findings are fixed except:
-38003for derived attributes instead of dropping them; kona-node and kona-client gate the deposits-only replacement on the L2 timestamp, op-node on the L1 origin's; a transient error while building the replacement is critical.BREAKING CHANGE: op-reth answers
engine_forkchoiceUpdatedwith-38003when the transactions of derived attributes make the block invalid. op-node handles this. kona-node needs the change in this PR, otherwise it retries and stalls the safe head, so upgrade both together. Rust callers ofOpEngineApi::newmust pass the provider, validator andDerivedPayloadsit builds derived payloads with, andOpEngineApiBuilderrequires the node's pool, provider and EVM to fit op-reth's payload builder.🤖 Co-created with Claude Opus 5.5