Repository navigation
kona/tests/proofs,op-e2e: cover deposits in singular batches end to end - #23550
Conversation
1ffc6e4 to
c28daf6
Compare
c28daf6 to
9015823
Compare
geoknee
left a comment
There was a problem hiding this comment.
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. Otherwiseenv.Batcher.Reset()+BatchMineAndSyncin the tagged/pre-Holocene branch would also tamper with the valid resubmission. ActL2BatchBufferwon't work here, becauseBuffernilsL2ChannelOuton 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.
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>
9015823 to
32d2d54
Compare
|
🤖 Fable 5.1 says: Took the helper suggestion in 32d2d54. Not done: the derive-level |
|
@OptimismBot re-approve |
OptimismBot
left a comment
There was a problem hiding this comment.
Re-approved after reviewing the semantic delta since the latest eligible human approval.
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
0x7Etype 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 betweenPayloadToSingularBatchand 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