Repository navigation
Description
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 scriptwith 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/noopdeployment targets,manage, the script-driven upgrade path (upgrade/embedded.Upgrade) andinspect 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 theupgradeCLI). - 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→continuebundle 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-forgeflag is gone. op-chain-ops/script,script/forkingandop-chain-ops/interopgenare deleted.- No monorepo Go package executes EVM code through op-geth's
core/vmfor scripts.
🤖 Co-created with Claude Opus 5.5
Activity
op-deployer, op-chain-ops!: delete the Go script host
op-deployer, op-chain-ops!: delete the Go script host
op-deployer, op-chain-ops!: delete the Go script host
op-deployer, op-chain-ops!: delete the Go script host
3 remaining items
op-deployer, op-chain-ops!: delete the Go script host
op-deployer, op-chain-ops!: delete the Go script host
op-deployer, op-chain-ops!: delete the Go script host
op-deployer, op-chain-ops!: delete the Go script host
op-deployer, op-chain-ops!: delete the Go script host
op-deployer, op-chain-ops!: delete the Go script host
op-deployer, op-chain-ops!: delete the Go script host
op-deployer, op-chain-ops!: delete the Go script host
op-deployer, op-chain-ops!: delete the Go script host