Skip to content

op-core,op-node: move the PostExec payload decoder, share the per-tx batch checks - #22101

Draft
nonsense wants to merge 2 commits into
developfrom
ae/sdm/fm6-derivation-postexec-gate
Draft

op-core,op-node: move the PostExec payload decoder, share the per-tx batch checks#22101
nonsense wants to merge 2 commits into
developfrom
ae/sdm/fm6-derivation-postexec-gate

Conversation

@nonsense

@nonsense nonsense commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move the PostExec payload types and decoder from op-chain-ops/pkg/sdm to op-core/types, alongside the transaction envelope. Update consumers and add strict decoding tests. No behavior change.
  • Share sequencer transaction validation between singular and span batches, eliminating duplicated logic and ensuring both paths apply the same transaction-type activation checks.

Tests

    go build ./op-node/rollup/... ./op-core/types/... ./op-chain-ops/...
    go test ./op-core/types/... ./op-node/rollup/derive/...
    go vet ./op-node/rollup/derive/... ./op-core/types/... ./op-chain-ops/pkg/sdm/... \
      ./op-acceptance-tests/tests/sdm/... ./op-acceptance-tests/tests/flashblocks/...

@nonsense
nonsense marked this pull request as ready for review July 29, 2026 15:20
@nonsense
nonsense requested review from a team as code owners July 29, 2026 15:20
@einar-oplabs
einar-oplabs self-requested a review July 30, 2026 05:28
@einar-oplabs einar-oplabs self-assigned this Jul 30, 2026
Comment thread op-node/rollup/derive/batches.go Outdated
Comment thread op-chain-ops/pkg/sdm/payload.go Outdated
@nonsense
nonsense requested a review from sebastianst July 30, 2026 13:05
@nonsense
nonsense marked this pull request as draft July 30, 2026 18:11
nonsense and others added 2 commits July 30, 2026 21:22
The PostExec (0x7D) payload is a consensus wire format, but its only Go
definition lived in op-chain-ops/pkg/sdm, a chain-ops tooling package, while the
envelope carrying it (PostExecTx, PostExecTxType) lives in op-core/types. Move
PostExecPayload, SDMGasEntry, PostExecPayloadVersion and the decoder next to the
envelope and point the consumers at them, so the format lives in the package
that owns it rather than in the tooling that happened to need it first.

This is a move, not a de-duplication: one Go definition before, one after. What
is new is coverage. The decoder's strict framing (a single RLP value, no
trailing bytes, no short list) and its version check are now pinned by tests,
matching what op-alloy's PostExecPayload rejects at decode time.

No behaviour change. The decoder body is unchanged, and its consumers
(op-acceptance-tests, cmd/sdm-devnet) only read payload fields.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
checkSingularBatch delegated to checkSequencerTxData; checkSpanBatch carried its
own inline copy of the same rules. The copy had drifted: it never rejected
PostExec (0x7D) transactions before SDM activation, which checkSequencerTxData
has done since the type was introduced. It also shadowed the span's block index
with the transaction index inside the loop.

Extract checkSequencerTxs so both paths iterate a single implementation and drop
the inline copy. The span path now applies the PostExec activation gate too, so
the two batch types agree on which transaction types a sequencer may embed.

That behaviour change is unreachable in production, and it closes a divergence
rather than adding a rule. checkSpanBatch only runs pre-Holocene -- post-Holocene
BatchStage validates each span block through checkSingularBatch -- and SDM
activates at Lagoon, four forks after Holocene, so isSDM is always false here.
DeriveSpanBatch already rejects pre-SDM PostExec transactions when the span batch
is decoded.

Adds span-batch coverage for both activation-gated types. The pre-SDM PostExec
row fails without this change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@nonsense
nonsense force-pushed the ae/sdm/fm6-derivation-postexec-gate branch from d072ef9 to d23e8a7 Compare July 30, 2026 18:27
@nonsense nonsense changed the title op-node: gate PostExec transaction structure in derivation op-core,op-node: move the PostExec payload decoder, share the per-tx batch checks Jul 30, 2026
@nonsense
nonsense requested a review from einar-oplabs July 30, 2026 18:30
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