op-node/rollup/derive: implement SetCodeTx span batches#14197
Conversation
|
Generally want to think on the design here quick. This doesn't check for activation of isthmus when decoding which means it opens up the case that a 7702 tx could be included in a batch before isthmus activates on L2. We generally want to fail fast to keep the work done in the proof system low. In the case of a 7702 tx being included before isthmus in this implementation, i believe the EL should return an invalid block error and that should trigger the steady batch derivation of it being replaced with a deposit only block. This is all work that will need to be replicated in the proof. If we have validation in the batch decoder itself, then we would fail fast and just drop the batch as an invalid batch. I think this is less work in the proof. can i get a sanity check on this? cc @sebastianst @clabby |
Shouldn't EIP-7702 txs just be rejected from the tx pool validator pre-isthmus? Confused how it would even end up in a canonical L2 block. |
You dont need to build a block where all txs go thru the mempool. We have to defend against malicious actors |
There was a problem hiding this comment.
From the specs:
Span batches with transaction type 4 should only be accepted after Isthmus is enabled.
this line is important here. With this implementation change as-is, we currently just accept the span-batch if it contains a 7702 tx pre-isthmus. It's only during block-processing where it becomes invalid.
If there are any protocol difference between an invalid batch and an invalid block, then this becomes a chain divergence pre-isthmus:
- nodes with this logic will produce an invalid block
- nodes without this logic will produce an invalid batch
If the result is still the same (a deposit-only block) then that's fine. I think with Holocene we have that guarantee, but this should be double-checked ideally.
Edit:
seb:
So with Holocene, invalid batches are dropped, as is the remaining channel. It is not replaced by deposits-only batch. This only happens once attributes have been generated. So when the EL returns INVALID, the attributes are retried with deposit-only attribs.
So this is not a safe change, because of the difference between invalid batch and invalid block.
|
I think one solution might be to scan the batch-txs for 7702 type, after parsing the batch. This then keeps the spanbatch code simple, while conforming with the spec, and always resulting in the invalid-batch case on both nodes with the old pre-isthmus logic as well as nodes with this updated spanbatch code before isthmus. |
|
Summarizing from Discord, I agree with @protolambda that it makes most sense to check for forbidden SetCode transactions in each individual batch (Inside This also means that we don't need to add versioning to span batches, and the en/decoding implementation in this PR works fine. We just need to add this check to |
|
TODO: check that a singular batch containing a 7702 transaction before Pectra is enabled is dropped, but not other singular batches inside the span batch.
Ensure span batch containing Blocks 1-3 contain the normal tx, don't contain the 7702 tx before activation, and contain the 7702 tx after activation. |
Not sure this works though, IIUC. If batch 2 gets dropped, all future batches (no matter if singular or from the same span) are dropped as well (from the same channel). This test still makes sense, but then assert that only batch 1 is accepted. Another scenario is the positive one, so 2 blocks in a span batch, first block pre-Isthmus, type 2, second block post-Isthmus, type 4, and we assert that both are valid. |
|
I added impl/test here to ensure that batches with SetCode txs are dropped before Isthmus: #14288 |
e17d250 to
64a4eda
Compare
|
|
|
blocked by ethereum-optimism/op-geth#526 actually (need > 1.15.1 for 7702 tx pool) |
8e24670 to
ce5b0cd
Compare
|
need isthmus signer: ethereum-optimism/op-geth#535 |
|
Looks like this is ready for rebase |
ce5b0cd to
de2a0d0
Compare
a79f251 to
2a3e364
Compare
|
/ci authorize 2a3e364 |
|
/ci authorize bae06a7 |
|
/ci authorize 71846d2 |
sebastianst
left a comment
There was a problem hiding this comment.
looks good, thanks for changing the test into a proofs test!
a few minor comments
sebastianst
left a comment
There was a problem hiding this comment.
Thanks, this LGTM! 🔥
I added back the sanity check for bob's address, since it's still hardcoded. That check went missing in the last refactor.
|
/ci authorize cfc1145 |
d509f44
…imism#14197) * feat: implement EIP-7702 span batch tests * Don't overwrite alloc * Check error * Fix lint * Add SetCode txs to tests and switch signer * Use old signer * Implement as FP action test * Remove old test * Clean up code * Cover set code auth in unit tests * Remove extra file * Update channel out sizes since random tx changed * Use test matrix * Simplify RunFPP call * add back bob address sanity check --------- Co-authored-by: Sebastian Stammler <seb@oplabs.co>
* fix(ctb): L2 genesis - History storage address (ethereum-optimism#14844) * feat(devnet-sdk): Expose supervisor (ethereum-optimism#14772) * fix(kurtosis-devnet): expose supervisor svc info * feat(devnet-sdk): provide access to supervisor * feat(op-acceptor): native binary execution (ethereum-optimism#14777) * feat(op-acceptor): native binary execution Adds native binary execution and makes this the default. It falls back to docker-based execution. The reason for this change is that it runs much faster (10x) this way. * feat(op-acceptor): mise-managed native binary * chore: Use floats for fee multipliers, add base multiplier (ethereum-optimism#14818) * chore: Use floats for fee multipliers * fix: Comment * fix: Typo * chore: Use functional options pattern * chore: Add unit tests for bigint multiplication * fix(ci): github ratelimits. (ethereum-optimism#14856) * op-node/rollup/sequencing: No user txs in Isthmus & Interop upgrade block (ethereum-optimism#14837) * op-node/rollup/sequencing: No user txs in Isthmus & Interop upgrade blocks * op-e2e: Fix Isthmus tests, remove case * op-e2e: reintroduce AtIsthmusWithWithdrawalTx * op-e2e/action: fix holocene invalid batches test --------- Co-authored-by: protolambda <proto@protolambda.com> * fix(ci): github ratelimits. (ethereum-optimism#14857) * chore: Renamed OutputRoot -> Proposal, l2BlockNumber -> l2SequenceNumber (ethereum-optimism#14775) * Renamed OutputRoot -> Proposal, l2BlockNumber -> l2SequenceNumber * added interfaces * Fixed spec tests * ver bump * fix tests * fix snapshots * fix snapshots * semver * semver comment * fixed interfaces * unused import * correct branch * fix tests * final versioning fix * again oops: * revert semver * fix: correct semver in upgrade test * fix: correct semver lock --------- Co-authored-by: Kelvin Fichter <kelvinfichter@gmail.com> * fix(ci): github-token for ratelimiting. (ethereum-optimism#14860) * feat(op-acceptor): enable ci go tests for op-acceptor. (ethereum-optimism#14861) * op-challenger: Update contract bindings to handle renames. (ethereum-optimism#14779) * op-challenger: Update contract bindings to handle renames. Also renames a copule of fields to be more generic, but not a complete pass. * op-challenger: Rename LocalGameInputs L2BlockNumber to L2SequenceNumber * op-e2e: Interop deposit message action tests (ethereum-optimism#14864) * op-program: Add aliases to flags for interop. (ethereum-optimism#14862) * op-challenger: Update contract bindings to handle renames. Also renames a copule of fields to be more generic, but not a complete pass. * op-challenger: Rename LocalGameInputs L2BlockNumber to L2SequenceNumber * op-program: Add aliases to flags for interop. l2.blocknumber flag now has a l2.sequencenumber alias. Both options work allowing us to eventually migrate to the more generic name without breaking compatibility. Updated help text for a couple of flags to make them clearer. * Update help text. Co-authored-by: Inphi <mlaw2501@gmail.com> * Update help text. Co-authored-by: Inphi <mlaw2501@gmail.com> --------- Co-authored-by: Inphi <mlaw2501@gmail.com> * ci: Remove fpp-verify job (ethereum-optimism#14866) * Use SuperFaultDisputeGame ABI in more tests (ethereum-optimism#14867) * Use SuperFaultDisputeGame ABI in more tests * op-proposer: Test compatibility with SuperFaultDisputeGame abi * feat(devnet-sdk): add op-program-svc client library (ethereum-optimism#14677) This is a ligntweight client that op-deployer can make use of in order to obtain correct prestates based on chain configs. * fix(kt-devnet): use unique container tags (ethereum-optimism#14411) Unfortunately kurtosis puts too much faith in the stability of docker tags, and gets fooled into thinking a deployment step can be skipped if it involves an image with the same tag. This change makes the kurtosis config use a unique tag based on container ID instead. * fix(devnet-sdk): detect if op-geth types are used (ethereum-optimism#14533) * kt-devnet: minimal interop test: initiate message (ethereum-optimism#14782) * devnet-sdk: Plugin op-service ethclient * Add low level client access * Use e2e wait util * kt-devnet: minimal interop test * Rename wallet's sendMessage to initiateMessage * cleanup * Only Expose ABI for now * simplify * add value while tx building * Refactor to use call() method * op-node/rollup/derive: implement SetCodeTx span batches (ethereum-optimism#14197) * feat: implement EIP-7702 span batch tests * Don't overwrite alloc * Check error * Fix lint * Add SetCode txs to tests and switch signer * Use old signer * Implement as FP action test * Remove old test * Clean up code * Cover set code auth in unit tests * Remove extra file * Update channel out sizes since random tx changed * Use test matrix * Simplify RunFPP call * add back bob address sanity check --------- Co-authored-by: Sebastian Stammler <seb@oplabs.co> * op-program/client: add check for nil withdrawalsroot (ethereum-optimism#14836) * chore: freeze files for Upgrade 15 (ethereum-optimism#14865) * fix l2 service representation (ethereum-optimism#14868) * fix(kurtosis-devnet): common services detection (ethereum-optimism#14870) This reverts commit c5f8808. The issue was that the other L2s' services were mistakenly taken as common services. In particular, that led to override of el/cl nodes, in addition to spurious entries in the services map. * kt-devnet: minimal interop test: execute message (ethereum-optimism#14838) * devnet-sdk: Plugin op-service ethclient * Add low level client access * Use e2e wait util * execute message * typo * newline * use sha256 precompile * comments * Polish * comment * Log block time * Reduce logs * fix block number * feat: dispute mon helper (ethereum-optimism#14743) * feat(op-program-svc): add info.json to identify prestates (ethereum-optimism#14676) * op-node,op-service: cleanup block signing abstractions (ethereum-optimism#14874) * chore(op-e2e): Prefix proof action tests with `Test_ProgramAction` (ethereum-optimism#14881) * op-deployer: Complete backport of v3.0.0-rc.2 (ethereum-optimism#14852) (ethereum-optimism#14875) * op-deployer: Complete backport of v3.0.0-rc.2 * Update SR version * op-deployer: De-schedule Isthmus from v3.0.0 (ethereum-optimism#14878) * op-deployer: De-schedule Isthmus from v3.0.0 * activate by default in dev * fix(kurtosis-devnet): fallback to docker user socket (ethereum-optimism#14884) * feat(op-program-svc): simplify the API (ethereum-optimism#14678) also ensure we have an info.json file that presents the various prestates available. * interop,tweak: Return ErrConflict for completed blocks with fewer logs than expected. (ethereum-optimism#14758) * interop,tweak: Treat 'future' logs for complete blocks as conflicts. * refactor: Move log-index out-of-range check to findLogInfo. * fix(ci): github-token for ratelimiting. (ethereum-optimism#14890) * chore(op-acceptor): bump to v0.1.2 (ethereum-optimism#14854) * test(kurtosis-devnet): add to CI (ethereum-optimism#14871) * op-node/rollup/derive: validate to non-nil for setcode txs (ethereum-optimism#14882) * op-deployer: Default to MIPS v2 (ethereum-optimism#14888) * feat(op-acceptor): auto-download target binary version (ethereum-optimism#14855) * feat: interop access list (ethereum-optimism#14883) * feat: access list (ethereum-optimism#326) * feat: access list poc * chore: remove is deposit tests * fix: natspec and enhance comments * chore: remove l1 block interop on solidity files * fix: pr fixes * chore: remove go logic over l1 block interop * chore: remove some l1 block interop stuff on solidity side * chore: remove from frozen files * chore: remove missing l1 block interop stuff on go tests * refactor: improve natspec and comments * feat: add is warm tests * feat: wip trying to integrate with common test * fix: integrate with common test reading artifact json * fix: pre-pr and tests * fix: tests * fix: tests Co-authored-by: 0xng <ng@defi.sucks> Co-authored-by: skeletor-spaceman <skeletor@defi.sucks> * fix: pr review comments * fix: op e2e inbox interface --------- Co-authored-by: agusduha <agusnduha@gmail.com> Co-authored-by: 0xng <ng@defi.sucks> Co-authored-by: skeletor-spaceman <skeletor@defi.sucks> * fix: undo identifier struct type changes (ethereum-optimism#328) * op-e2e: skip interop tests for now until Go access-list changes land * op-e2e: few more test-skips needed until access-list changes land * op-e2e: missed one test-skip for access-list change --------- Co-authored-by: Disco <131301107+0xDiscotech@users.noreply.github.com> Co-authored-by: 0xng <ng@defi.sucks> Co-authored-by: skeletor-spaceman <skeletor@defi.sucks> Co-authored-by: protolambda <proto@protolambda.com> * feat(op-acceptance-tests): bump op-acceptor to v0.1.3 (ethereum-optimism#14893) * op-supervisor: access-list support, checksum handling (ethereum-optimism#14784) * op-supervisor: access-list support, checksum handling * op-supervisor: access-list update work * op-supervisor: access-list types unit-tests * op-supervisor: fix nit, update todo comments * op-supervisor: fix tests, skip TestInteropBlockBuilding for now * op-supervisor: ExecutingDescriptor with 0 instead of null timeout default * op-deployer: Add v3.0.0 upgrader (ethereum-optimism#14887) * op-node/rollup/derive: Drop SetCodeTxs in pre-Isthmus batches (ethereum-optimism#14877) * op-node/rollup/derive: Drop SetCodeTxs in pre-Isthmus batches Co-authored-by: Julian Meyer <julian.meyer@coinbase.com> * rename tests with prefix Test_ProgramAction * fix tests, use random txs depending on signer type --------- Co-authored-by: Julian Meyer <julian.meyer@coinbase.com> * op-e2e: Add Access Lists to interop txs (ethereum-optimism#14831) * op-e2e: fix interop tests with access-lists, and rm test end-deposit-ctx assumptions Co-authored-by: axelKingsley <axel.kingsley@gmail.com> * go.mod: update op-geth to v1.101503.2-rc.1 with interop access-list handling --------- Co-authored-by: protolambda <proto@protolambda.com> * fix(ci): github-token for ratelimiting. (ethereum-optimism#14894) * chore(kurtosis-devnet): bump kurtosis to 1.5.0 (ethereum-optimism#14788) Co-authored-by: protolambda <proto@protolambda.com> * op-deployer: add backport example to devdoc (ethereum-optimism#14845) * op-deployer: add backport example to devdoc * clear up wording in release docs * feat(devnet-sdk): Make chain interface abstract and introduce "concrete" L1/L2 chain interfaces (ethereum-optimism#14834) * fix(kurtosis-devnet): handle system/user sockets better (ethereum-optimism#14911) - use url.Parse as the docker client library does unsanitary things with the url Host field. - fallback to the right socket on Docker Desktop for Linux (which *of course* uses a different socket path) - if we don't find a satisfactory user socket, do nothing and hope the user environment is set properly to compensate. * ctb: Document guidelines for writing upgradeable contracts (ethereum-optimism#14872) * ctb: Document guidelines for writing upgradeable contracts * Apply suggestions from code review Co-authored-by: JosepBove <josep@oplabs.co> --------- Co-authored-by: JosepBove <josep@oplabs.co> * op-e2e/system: tune `TestBatcherAutoDA` to avoid flakes (ethereum-optimism#14906) * op-e2e/system: tune TestBatcherAutoDA to avoid flakes * delay batch submitting until after deposit txs are launched * op-e2e/actions: test batcher should not warn when safe head moves (ethereum-optimism#14912) This implementation of a batcher does not have block submission tracking fully implemented. Therefore it is expected that the "last submitted block" won't move before the safe head on the sequencer moves. This change just marks that as expected behaviour to avoid sending devs on a wild goose chase when debugging. * kt-devnet: message passing using access list (ethereum-optimism#14913) * chore: add operator fee e2e tests (ethereum-optimism#14752) * chore: add operator fee e2e tests * chore: use ActBuildToL1HeadUnsafe() * fix: handle feedbacks * nit: add comment * fix: handle feedbacks * Fix: following pairing with George * fix: nits * fix & improve test --------- Co-authored-by: Sebastian Stammler <seb@oplabs.co> * feat(op-acceptance-test): op-acceptor v0.1.4 (ethereum-optimism#14916) * feat(op-acceptance-tests): add some starter gates. (ethereum-optimism#14900) * fix(op-deployer): fix inspect and state types to respect unmarshalling the state.json (ethereum-optimism#14889) * fix(op-deployer): fix inspect and state types to respect unmarshalling the state.json Signed-off-by: Yashvardhan Kukreja <yashvardhan@oplabs.co> * fix: add custom marshaller to eth.BlockRef Signed-off-by: Yashvardhan Kukreja <yashvardhan@oplabs.co> * nit Signed-off-by: Yashvardhan Kukreja <yashvardhan@oplabs.co> * chore: remove the custom serializer from blockref Signed-off-by: Yashvardhan Kukreja <yashvardhan@oplabs.co> * chore: add unit tests for BlockRef's Serialize and Deserialise Signed-off-by: Yashvardhan Kukreja <yashvardhan@oplabs.co> * clean up test * put marshaler inside start block * Revert "put marshaler inside start block" This reverts commit 46b5eaf. * Revert "clean up test" This reverts commit e196859. * Revert "chore: add unit tests for BlockRef's Serialize and Deserialise" This reverts commit d85ce6a. * Revert "chore: remove the custom serializer from blockref" This reverts commit 3dd0834. * Revert "fix: add custom marshaller to eth.BlockRef" This reverts commit fb4ff4a. * unit tests --------- Signed-off-by: Yashvardhan Kukreja <yashvardhan@oplabs.co> Co-authored-by: Matthew Slipper <me@matthewslipper.com> * op-e2e: Test that setting op fee pre-Isthmus is ignored (ethereum-optimism#14910) * op-e2e: Test that setting op fee pre-Isthmus is ignored * address feedback @mbaxter * op-e2e/actions: introduce env.BatchMineAndSync (ethereum-optimism#14923) * Run `TestPectraBlobSchedule` on latest fork (ethereum-optimism#14783) * Run TestPectraBlobSchedule on latest fork * Apply suggestions from code review Co-authored-by: Sebastian Stammler <seb@oplabs.co> --------- Co-authored-by: Sebastian Stammler <seb@oplabs.co> * op-node: Add pectra blob schedule fix kill-switch (ethereum-optimism#14922) * op-node: Add pectra blob schedule fix kill-switch * move ignore flag into node config --------- Signed-off-by: Yashvardhan Kukreja <yashvardhan@oplabs.co> Co-authored-by: clabby <ben@clab.by> Co-authored-by: Yann Hodique <yann@oplabs.co> Co-authored-by: Stefano Charissis <stefano@oplabs.co> Co-authored-by: Ján Jakub Naništa <jan.jakub.nanista@gmail.com> Co-authored-by: Sebastian Stammler <seb@oplabs.co> Co-authored-by: protolambda <proto@protolambda.com> Co-authored-by: ControlCplusControlV <44706811+ControlCplusControlV@users.noreply.github.com> Co-authored-by: Kelvin Fichter <kelvinfichter@gmail.com> Co-authored-by: Adrian Sutton <adrian@oplabs.co> Co-authored-by: Inphi <mlaw2501@gmail.com> Co-authored-by: Park Changwan <changwan@oplabs.co> Co-authored-by: Julian Meyer <julian.meyer@coinbase.com> Co-authored-by: George Knee <georgeknee@googlemail.com> Co-authored-by: smartcontracts <kelvin@optimism.io> Co-authored-by: Matthew Slipper <me@matthewslipper.com> Co-authored-by: Tyler Smith <mail@tcry.pt> Co-authored-by: AgusDuha <81362284+agusduha@users.noreply.github.com> Co-authored-by: Disco <131301107+0xDiscotech@users.noreply.github.com> Co-authored-by: 0xng <ng@defi.sucks> Co-authored-by: skeletor-spaceman <skeletor@defi.sucks> Co-authored-by: Axel Kingsley <axel.kingsley@gmail.com> Co-authored-by: Sam Stokes <35908605+bitwiseguy@users.noreply.github.com> Co-authored-by: Teddy Knox <teddy@oplabs.co> Co-authored-by: Maurelian <john@oplabs.co> Co-authored-by: JosepBove <josep@oplabs.co> Co-authored-by: Aurélien <3535019+leruaa@users.noreply.github.com> Co-authored-by: Yashvardhan Kukreja <yashvardhan@oplabs.co>
Description
This PR creates two contracts and tests that a transaction that relies on authorization lists can be mined. Then, the span batches are posted to L1 and we ensure that the verifier can sync up with the authorization list tx.
I tested replacing the authorization list with an empty array on serialization of the span batch and the test errored because the tx couldn't be included on the verifier. This shows that the test validates that the span batch spec properly serializes and deserializes set code transactions.
Also included are a few fixes to ensure set code txs can be properly serialized/deserialized.
Blocked by ethereum-optimism/op-geth#507
Fixes #14156