You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
op-deployer: run offline genesis scripts with the L1 chain ID #24026
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.
Activity