Skip to content

op-deployer: run offline genesis scripts with the L1 chain ID #24026

Closed

Description

@sebastianst

Part of #23300. Follow-up to #23669.

Problem

op-deployer runs the scripts of a genesis deployment offline with chain ID 1337, not the intent's L1 chain ID (genesis_state.go:22-24, genesis_state.go:117). 1337 is the chain ID of the Go script host's default context (context.go:29). The forge stack keeps it so that forge produces the same state as the Go host, which the parity tests check.

Nothing needs 1337, and it makes the scripts check the wrong chain:

  • SetPreinstalls builds block.chainid into the Permit2 code of the L1 dev genesis (SetPreinstalls.s.sol:55). Permit2 recomputes its domain separator on another chain, so this works, but the genesis holds the wrong chain ID.
  • DeployOPChain requires l2ChainId != block.chainid (DeployOPChain.s.sol:349): in a genesis deployment it compares with 1337 instead of the L1 chain ID.
  • DeployImplementations refuses MIPS32 on Mainnet and Sepolia by block.chainid (DeployImplementations.s.sol:400), which a genesis deployment never matches.

L2Genesis is not affected: it sets the L2 chain ID itself before the preinstalls.

Proposal

After #23669 removes the Go script host, nothing needs parity with it. Give GenesisState the intent's L1 chain ID and run forge with --chain <L1 chain ID>. Drop the 1337 constant.

Done when

  • The offline forge runs of a genesis deployment see the intent's L1 chain ID.
  • The L1 dev genesis's Permit2 code holds the L1 chain ID.

🤖 Co-created with Claude Opus 5.5

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