ethereum-optimism / optimism

Optimism is Ethereum, scaled.
https://optimism.io
MIT License
5.64k stars 3.27k forks source link

Deployment fails if `systemConfigStartBlock` = 4071248 #11773

Open rac-sri opened 2 months ago

rac-sri commented 2 months ago

Bug Description The deployment fails when setting up the value systemConfigStartBlock as non 0 ( default 4071248 for sepolia in the existing configs )

Steps to Reproduce

Run the following command:

deployments/artifact.json \
DEPLOY_CONFIG_PATH=deploy-config/sepolia-devnet-0.json \
forge script scripts/deploy/Deploy.s.sol:Deploy  --broadcast --private-key $GS_ADMIN_PRIVATE_KEY \
--rpc-url $L1_RPC_URL --slow

Logs:

Output:

    │   ├─ [414] SystemConfig::basefeeScalar() [delegatecall]
    │   │   └─ ← [Return] 1368
    │   └─ ← [Return] 1368
    ├─ [413] DeployConfig::blobbasefeeScalar() [staticcall]
    │   └─ ← [Return] 810949 [8.109e5]
    ├─ [896] Proxy::blobbasefeeScalar() [staticcall]
    │   ├─ [413] SystemConfig::blobbasefeeScalar() [delegatecall]
    │   │   └─ ← [Return] 810949 [8.109e5]
    │   └─ ← [Return] 810949 [8.109e5]
    ├─ [403] DeployConfig::batchSenderAddress() [staticcall]
    │   └─ ← [Return] 0x19CC7073150D9f5888f09E0e9016d2a39667df14
    ├─ [834] Proxy::batcherHash() [staticcall]
    │   ├─ [351] SystemConfig::batcherHash() [delegatecall]
    │   │   └─ ← [Return] 0x00000000000000000000000019cc7073150d9f5888f09e0e9016d2a39667df14
    │   └─ ← [Return] 0x00000000000000000000000019cc7073150d9f5888f09e0e9016d2a39667df14
    ├─ [398] DeployConfig::l2GenesisBlockGasLimit() [staticcall]
    │   └─ ← [Return] 30000000 [3e7]
    ├─ [907] Proxy::gasLimit() [staticcall]
    │   ├─ [424] SystemConfig::gasLimit() [delegatecall]
    │   │   └─ ← [Return] 30000000 [3e7]
    │   └─ ← [Return] 30000000 [3e7]
    ├─ [403] DeployConfig::p2pSequencerAddress() [staticcall]
    │   └─ ← [Return] 0xa95B83e39AA78B00F12fe431865B563793D97AF5
    ├─ [869] Proxy::unsafeBlockSigner() [staticcall]
    │   ├─ [407] SystemConfig::unsafeBlockSigner() [delegatecall]
    │   │   └─ ← [Return] 0xa95B83e39AA78B00F12fe431865B563793D97AF5
    │   └─ ← [Return] 0xa95B83e39AA78B00F12fe431865B563793D97AF5
    ├─ [856] Proxy::scalar() [staticcall]
    │   ├─ [373] SystemConfig::scalar() [delegatecall]
    │   │   └─ ← [Return] 452312848583266388373324160190187140051835877600158453279134670530344387928 [4.523e74]
    │   └─ ← [Return] 452312848583266388373324160190187140051835877600158453279134670530344387928 [4.523e74]
    ├─ [2375] DeployConfig::systemConfigStartBlock() [staticcall]
    │   └─ ← [Return] 4071248 [4.071e6]
    ├─ [936] Proxy::startBlock() [staticcall]
    │   ├─ [474] SystemConfig::startBlock() [delegatecall]
    │   │   └─ ← [Return] 6639452 [6.639e6]
    │   └─ ← [Return] 6639452 [6.639e6]
    └─ ← [Revert] EvmError: Revert

== Logs ==
  Writing artifact to deployments/artifact.json
  Connected to network with chainid 11155111
  Commit hash: d05376fff2a7e29b03e22ab2f177c4a02b421346
  DeployConfig: reading file deploy-config/sepolia-devnet-0.json
  Deploying a fresh OP Stack including SuperchainConfig
  start of L1 Deploy!
  Deploying safe: SystemOwnerSafe with salt 0x80ee13a388a25fd2a27590d8e4efbada61da5f9f554e2b9c476b599ae131dd84
  Saving SafeProxyFactory: 0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2
  Saving SafeSingleton: 0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552
  Saving SystemOwnerSafe: 0xbC6577521A57A2DD48bfB6C2b24C7a959B99f1Eb
  New safe: SystemOwnerSafe deployed at 0xbC6577521A57A2DD48bfB6C2b24C7a959B99f1Eb
    Note that this safe is owned by the deployer key
  deployed Safe!
  Setting up Superchain
  Deploying AddressManager
  Saving AddressManager: 0x4dc45455aAa5FF50AAf31375e0FA0176110139e6
  AddressManager deployed at 0x4dc45455aAa5FF50AAf31375e0FA0176110139e6
  Deploying ProxyAdmin
  Saving ProxyAdmin: 0xe6de3B9f5f479426d6b88bD00A3804B9E4f3306F
  ProxyAdmin deployed at 0xe6de3B9f5f479426d6b88bD00A3804B9E4f3306F
  ProxyAdmin ownership transferred to Safe at: 0xbC6577521A57A2DD48bfB6C2b24C7a959B99f1Eb
  Deploying ERC1967 proxy for SuperchainConfigProxy
  Saving SuperchainConfigProxy: 0xd915EE641559E1D0c743AE24FddFe714cFA480f8
     at 0xd915EE641559E1D0c743AE24FddFe714cFA480f8
  Saving SuperchainConfig: 0x90d4aC531219229375a24b2b5ED14Ac86E62Ae23
  SuperchainConfig deployed at 0x90d4aC531219229375a24b2b5ED14Ac86E62Ae23
  Running chain assertions on the SuperchainConfig
  Deploying ERC1967 proxy for ProtocolVersionsProxy
  Saving ProtocolVersionsProxy: 0x866BBB301EA35E47A175C0Af0bC76D6640323caB
     at 0x866BBB301EA35E47A175C0Af0bC76D6640323caB
  Deploying ProtocolVersions implementation
  Saving ProtocolVersions: 0xc7820f3d2Da04325FE3c215270a35516b5544912
  ProtocolVersions deployed at 0xc7820f3d2Da04325FE3c215270a35516b5544912
  Running chain assertions on the ProtocolVersions
  Upgrading and initializing ProtocolVersions proxy

On furthur investigating, the following check seems to fail: require(config.startBlock() == (cfgStartBlock == 0 ? block.number : cfgStartBlock));

To get around setting "systemConfigStartBlock": 0 does the job.

Expected behavior The deployment should go through.

Environment Information:

tynes commented 2 months ago

New chains should set the start block to 0 in the config. This is a footgun right now