Skip to content

[PCD] Predict L1 addresses via dry-run #20908

Description

@0xOneTony

Context

The L2 genesis embeds the L1 proxy addresses for L1CrossDomainMessenger, L1StandardBridge, L1ERC721Bridge, OptimismPortal, and SystemConfig. Since these contracts don't exist yet when the genesis is built, their addresses must be predicted. OPCM uses CREATE2 for every proxy, so the addresses are deterministic given the salt inputs. Add a pipeline stage that calls OPCM's deploy() as a non-broadcasting eth_call through a reusable Solidity script and reads the returned ChainContracts struct, then persists the addresses to state.

OPCM mixes msg.sender into the CREATE2 salt for every proxy, so the dry-run must be sent from the same key that will eventually broadcast the real deploy transaction. A dry-run from a different from produces different predicted addresses, and the L2 genesis built from them would be invalid.

Definition of Done

  • Scaffold prepare command
  • op-deployer uses this script for permissionless deployments
  • Sufficient test coverage is added to verify the correctness of the process

Weekly Updates

[2026-MM-DD]

[2026-07-07] Already addressed the review comments and should be ready for a re-review.

[2026-06-30] A PR draft has been opened here.

[2026-06-23] Work has already started, expecting to open a draft PR pretty soon.

Metadata

Metadata

Assignees

Labels

M-needs-triageMeta: this issue needs to be labelled

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions