Skip to content

kona/tests/proofs,op-e2e: cover deposits in singular batches end to end - #23550

Merged
sebastianst merged 1 commit into
developfrom
seb/deposit-in-batch-proofs-test
Oct 22, 2026
Merged

sebastianst merged 1 commit into
developfrom
seb/deposit-in-batch-proofs-test

Conversation

@sebastianst

@sebastianst sebastianst commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

End-to-end regression test for #22778: a kona fault-proof action test that submits a singular batch carrying a deposit which mints to an unfunded account, once without its 0x7E type byte and once tagged, across Granite, Holocene, Isthmus and Karst.

It asserts that the safe chain never applies the deposit, that the Holocene deposits-only replacement keeps only the L1 info deposit, and that kona-client proves the chain op-node and op-geth derived. The bare case fails against the decoder behaviour #22778 replaced.

The batch is submitted through GarbageChannelOut, which gains a transaction modifier applied between PayloadToSingularBatch and encoding, since the batcher's block-based path filters deposit-typed transactions out of the batch and cannot carry a bare body.

🤖 Co-created with Claude Fable 5.1

@sebastianst
sebastianst requested a review from a team as a code owner October 21, 2026 11:47
@sebastianst
sebastianst force-pushed the seb/deposit-in-batch-proofs-test branch from 1ffc6e4 to c28daf6 Compare October 21, 2026 12:18
@sebastianst
sebastianst force-pushed the seb/deposit-in-batch-proofs-test branch from c28daf6 to 9015823 Compare October 21, 2026 12:27

@geoknee geoknee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No correctness issues found. The comments below are about where the batch-crafting helper lives and what it duplicates; none of them block merging.

Why the batch is built by hand. PayloadToSingularBatch drops the tagged deposit (otx[0] == DepositTxType, op-node/rollup/derive/channel_out.go:241). The bare body passes that filter, because it starts with a byte >= 0xc0. What blocks it is that WithBlockModifier operates on a *types.Block, which can't carry a bare body. So both cases need the same missing hook: a way to rewrite the batch's transactions between PayloadToSingularBatch and RLP encoding.

Suggested home: op-e2e/actions/helpers. The malicious-batcher tooling already lives there (GarbageChannelOut, ActL2BatchSubmitGarbage, ActSubmitSetCodeTx). GarbageChannelOut already does what singularBatchFrame re-implements: blockToBatch, RLP+zlib, and frame output with a random channel ID. A transaction modifier on GarbageChannelCfg, applied between PayloadToSingularBatch and NewBatchData and shaped like sdmtest's func([]eth.Data) []eth.Data, would let this test inject the channel and use the existing submit path:

env.Batcher.L2ChannelOut = ch // as in op-e2e/actions/sync/sync_test.go:260
env.Batcher.ActAddBlockByNumber(t, 1)
env.Batcher.ActL2ChannelClose(t)
env.Batcher.ActL2BatchSubmit(t)

Two gotchas with that:

  • Inject the channel per channel rather than through BatcherCfg.GarbageCfg. Otherwise env.Batcher.Reset() + BatchMineAndSync in the tagged/pre-Holocene branch would also tamper with the valid resubmission.
  • ActL2BatchBuffer won't work here, because Buffer nils L2ChannelOut on first use.

Overlap with sdmtest.PostTamperedSingularBatches (#23454). It is the devstack version of the same malicious-batcher helper. It tampers before AddBlock, so a tagged-deposit tamper through it would be silently filtered too. It can't share code with the action helpers, since nothing under op-acceptance-tests/op-devstack imports op-e2e/actions. The only shared home would be an exported test option on derive.SingularChannelOut, along the lines of SpanChannelOut's TestWithZeroToBitsMod. That touches a production package, so your call.

Nit: structurally this is a case of TestBadTxInBatch: same setup, same pre/post-Holocene branching. It could sit alongside that test in bad_tx_in_batch_test.go.

geoknee
geoknee previously approved these changes Oct 21, 2026
Submit a singular batch carrying a deposit that mints to an unfunded
account, once without its 0x7E type byte and once tagged, across the
Granite to Karst fork matrix. Assert that the safe chain never applies
the deposit, that the Holocene deposits-only replacement keeps only the
L1 info deposit, and that kona-client proves the chain op-node and
op-geth derived.

The batch is submitted through GarbageChannelOut, which gains a
transaction modifier applied between PayloadToSingularBatch and
encoding: the batcher's block-based path filters deposit-typed
transactions out of the batch and cannot carry a bare body.

Regression test for #22778.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@sebastianst
sebastianst force-pushed the seb/deposit-in-batch-proofs-test branch from 9015823 to 32d2d54 Compare October 21, 2026 16:02
@sebastianst sebastianst changed the title kona/tests/proofs: cover deposits in singular batches end to end kona/tests/proofs,op-e2e: cover deposits in singular batches end to end Oct 21, 2026
@sebastianst

Copy link
Copy Markdown
Member Author

🤖 Fable 5.1 says: Took the helper suggestion in 32d2d54. GarbageChannelCfg gains TxModifier func([]eth.Data) []eth.Data, applied in AddBlock between PayloadToSingularBatch and NewBatchData (the one-caller blockToBatch is inlined). The test injects a GarbageChannelOut per channel via env.Batcher.L2ChannelOut and submits with ActAddBlockByNumber / ActL2ChannelClose / ActL2BatchSubmit, so Reset() plus the valid resubmission in the pre-Holocene branch stay untouched. singularBatchFrame is gone.

Not done: the derive-level SingularChannelOut option (would touch a production package for a test-only hook) and folding into TestBadTxInBatch (the deposit case cannot go through WithBlockModifier and the two matrices differ in type).

@sebastianst

Copy link
Copy Markdown
Member Author

@OptimismBot re-approve

@OptimismBot OptimismBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Re-approved after reviewing the semantic delta since the latest eligible human approval.

@sebastianst
sebastianst added this pull request to the merge queue Oct 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 21, 2026
@sebastianst
sebastianst added this pull request to the merge queue Oct 22, 2026
Merged via the queue into develop with commit 2fbef48 Oct 22, 2026
120 of 121 checks passed
@sebastianst
sebastianst deleted the seb/deposit-in-batch-proofs-test branch October 22, 2026 09:25
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