Skip to content

opgeth-decoupling: run all op-deployer scripts on upstream forge; delete op-chain-ops/script #23300

Open
16 of 17 issues completed

Description

@sebastianst

Part of #20257. Replaces #21743 (Rust script engine, closed as won't-fix) and supersedes #17213. Blocks #20266.

Problem

op-chain-ops/script is an in-process Go forge-script executor built on op-geth-only EVM hooks: vm.Config.PrecompileOverrides, CallerOverride, NoMaxCodeSize, and the exported state.StateUpdate used by script/forking. Upstream go-ethereum has no substitute for CallerOverride, which pranks and broadcasts depend on, so the host can't be ported to upstream geth.

Decision: forge is the only script engine

op-deployer already has an opt-in --use-forge path (apply.go#L317-L340, forge/). It runs the deploy scripts through a pinned upstream forge binary, passing ABI bytes into a runWithBytes(bytes) entrypoint and parsing the == Return == output. We extend that path until it covers every use, then delete the Go host. We don't re-implement a script engine.

Experiments with forge 1.8.3 confirmed:

  • Genesis-target L1, offline. forge script with no RPC, chaining DeploySuperchain → DeployImplementations → DeployOPChain through a state-in/state-out hook (vm.loadAllocs / vm.dumpState), reproduces the Go host's L1 allocs with an equal state root.
  • L2Genesis. A small dump wrapper reproduces the Go host's L2 allocs with an equal state root, deterministically.
  • Keyless dry-run broadcasts work, including when the sender is a contract such as a Safe.
  • Cost. Each forge invocation has a fixed startup of about 1.3 s, so a genesis-target apply takes roughly 3× as long as on the Go host (a sysgo world gains ~5–6 s). Accepted; world caching is an optional follow-up.

Scope cuts

  • Drop rather than port: the calldata/noop deployment targets, manage, the script-driven upgrade path (upgrade/embedded.Upgrade) and inspect l2-semvers. No production consumer uses them, and the "Thin op-deployer, move ops to netchef" decision already removes day-2 operations from op-deployer (op-deployer: remove deprecated upgrade command #21945 removed the upgrade CLI).
  • interopgen: rebase the op-e2e interop harness onto op-deployer instead of porting it.
  • op-fetcher: plain Go eth_calls instead of a forge script.

Rules

  • Exact state-root parity, then delete. Genesis-target L1 and L2 genesis each get a differential test against the Go host on reference intents, and their default flips to forge only once it passes. Live deploys are gated by e2e apply tests. Go-host quirks are reproduced during the transition. Changes to genesis output happen afterwards, in a separate and deliberate change.
  • Flip eagerly. Each deployment target defaults to forge as soon as it is covered, so production confirms each step early.
  • Never recompile at runtime. forge runs offline against a prebuilt bundle, and op-deployer fails if forge compiles. Recompiles break the prepare→continue bundle digest and can't run in the alpine image (no solc).
  • One contracts release per op-deployer release (existing policy). Older bundles are out of scope; a preflight check fails fast on a mismatched bundle.
  • forge is a runtime dependency of op-deployer: shipped in its images, auto-downloaded on Linux and macOS.

Order

Dropping the unused paths, hardening the live path and moving the read-only users are independent and can start now. L2Genesis and genesis-target L1 can run in parallel. prepare/continue and the op-e2e interop harness follow genesis-target L1. The cutover needs everything else. The genesis output cleanup comes last.

Acceptance criteria

  • op-deployer runs every script through forge, and the --use-forge flag is gone.
  • op-chain-ops/script, script/forking and op-chain-ops/interopgen are deleted.
  • No monorepo Go package executes EVM code through op-geth's core/vm for scripts.

🤖 Co-created with Claude Opus 5.5

Activity

  1. added 4 commits that reference this issue on Oct 29, 2026
    f93a19d
    7603487
    7ccbfb7
    eaf4f2f
  2. 3 remaining items

  3. added 2 commits that reference this issue on Nov 9, 2026
    617bbc8
    c8d3eef
  4. added a commit that references this issue on Nov 10, 2026
    cb89c69
  5. added 2 commits that reference this issue on Nov 10, 2026
    3f9b636
    92c0652
  6. added 4 commits that reference this issue on Nov 11, 2026
    5267037
    5886c39
    a937435
    2d3eda0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions