Skip to content

Commit

Permalink
add eth/027 task
Browse files Browse the repository at this point in the history
  • Loading branch information
geoknee committed Jan 9, 2025
1 parent 497007f commit 2b8f3e4
Show file tree
Hide file tree
Showing 7 changed files with 699 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ jobs:
steps:
- simulate_nested:
task: "sep/027-holocene-system-config-upgrade-and-init-multi-chain"

simulate_eth_027:
docker:
- image: << pipeline.parameters.ci_builder_image >>
steps:
- simulate_nested:
task: "eth/027-holocene-system-config-upgrade-and-init-multi-chain"

just_simulate_permissionless_fp_upgrade:
docker:
Expand Down Expand Up @@ -303,3 +310,4 @@ workflows:
- just_simulate_sc_rehearsal_4
- just_simulate_permissionless_fp_upgrade
- simulate_sep_027
- simulate_eth_027
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ETH_RPC_URL="https://ethereum.publicnode.com"
OWNER_SAFE=0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A
COUNCIL_SAFE=0xc2819DC788505Aac350142A7A707BF9D03E3Bd03
FOUNDATION_SAFE=0x847B5c174615B1B7fDF770882256e2D3E95b9D92

SAFE_NONCE=5
SAFE_NONCE_0X9855054731540A48B28990B63DCF4F33D8AE46A1=17
SAFE_NONCE_0X9BA6E03D8B90DE867373DB8CF1A58D2F7F006B3A=99
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;

import {console2 as console} from "forge-std/console2.sol";
import {Vm} from "forge-std/Vm.sol";
import {Simulation} from "@base-contracts/script/universal/Simulation.sol";
import {NestedSignFromJson as OriginalNestedSignFromJson} from "script/NestedSignFromJson.s.sol";
import {DisputeGameUpgrade} from "script/verification/DisputeGameUpgrade.s.sol";
import {CouncilFoundationNestedSign} from "script/verification/CouncilFoundationNestedSign.s.sol";
import {VerificationBase, SuperchainRegistry} from "script/verification/Verification.s.sol";
import {HoloceneSystemConfigUpgrade} from "script/verification/HoloceneSystemConfigUpgrade.s.sol";

contract NestedSignFromJson is OriginalNestedSignFromJson, CouncilFoundationNestedSign {
string constant l1ChainName = "mainnet";
string constant release = "v1.8.0-rc.4";
string[5] l2ChainNames = ["op", "metal", "mode", "zora", "arena-z"];

HoloceneSystemConfigUpgrade[] sysCfgUpgrades;

constructor() {
for (uint256 i = 0; i < l2ChainNames.length; i++) {
// Deploy a HoloceneSystemConfigUpgrade instance per chain,
// which each contains its own bindings to an individual chain's SuperchainRegistry data.
sysCfgUpgrades.push(new HoloceneSystemConfigUpgrade(l1ChainName, l2ChainNames[i], release));
console.log("");
console.log("Set up verification data for chain", l2ChainNames[i], "-", l1ChainName);
console.log("with SystemConfigProxy @", sysCfgUpgrades[i].systemConfigAddress());
addAllowedStorageAccess(sysCfgUpgrades[i].systemConfigAddress());
address[] memory exceptions = sysCfgUpgrades[i].getCodeExceptions();
for (uint256 j = 0; j < exceptions.length; j++) {
addCodeException(exceptions[j]);
}
}
}

function _postCheck(Vm.AccountAccess[] memory accesses, Simulation.Payload memory) internal view override {
console.log("Running post-deploy assertions");
checkStateDiff(accesses);
for (uint256 i = 0; i < l2ChainNames.length; i++) {
console.log("");
console.log("Running post-deploy assertions for chain", l2ChainNames[i], "-", l1ChainName);
sysCfgUpgrades[i].checkSystemConfigUpgrade();
}
console.log("All assertions passed!");
}

function getAllowedStorageAccess() internal view override returns (address[] memory) {
return allowedStorageAccess;
}

function getCodeExceptions() internal view override returns (address[] memory) {
return codeExceptions;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Holocene Hardfork Upgrade - `SystemConfig`

Status: READY TO SIGN

## Objective

Upgrades the `SystemConfig` contracts for the Holocene hardfork across multiple chains in the mainnet superchain.

This upgrades the `SystemConfig` in the
[v1.8.0-rc.4](https://github.com/ethereum-optimism/optimism/tree/v1.8.0-rc.4) release.

## Pre-deployments

- `SystemConfig` - `0xAB9d6cB7A427c0765163A7f45BB91cAfe5f2D375`

## Simulation

Please see the "Simulating and Verifying the Transaction" instructions in [NESTED.md](../../../NESTED.md).
When simulating, ensure the logs say `Using script /your/path/to/superchain-ops/tasks/eth/027-holocene-system-config-upgrade-and-init-multi-chain/NestedSignFromJson.s.sol`.
This ensures all safety checks are run. If the default `NestedSignFromJson.s.sol` script is shown (without the full path), something is wrong and the safety checks will not run.

## State Validation

Please see the instructions for [validation](./VALIDATION.md).

## Execution

This upgrade upgrades the implementation of the `SystemConfig` implementation on multiple chains and reinitializes each of the in such a way as to preserve the semantics of all existing parameters stored in that contract.

The batch will be executed on L1 chain ID `1`, and contains `3n` transactions, where `n=5` is the number of L2 chains being upgraded. The chains affected are {op,metal,mode,zora}-sepolia.

The below is a summary of the transaction bundle, see `input.json` for full details.

### Txs #1,#4,#7,#10,#13: ProxyAdmin.upgrade(SystemConfigProxy, StorageSetter)
Upgrades the `SystemConfigProxy` on each chain to the StorageSetter.

**Function Signature:** `upgrade(address,address)`

## Txs #2,#5,#8,#11,#14: SystemConfigProxy.setBytes32(0,0)
Zeroes out the initialized state variable for each chain's SystemConfigProxy, to allow reinitialization.

**Function Signature:** `setBytes32(bytes32,bytes32)`

### Txs #3,#6,#9,#12,#15: ProxyAdmin.upgradeAndCall(SystemConfigProxy, SystemConfigImplementation, Initialize())
Upgrades each chain's SystemConfig to a new implementation and initializes it.

**Function Signature:** `upgradeAndCall(address,address,bytes)`
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Validation

This document can be used to validate the state diff resulting from the execution of the upgrade
transaction.

For each contract listed in the state diff, please verify that no contracts or state changes shown in the Tenderly diff are missing from this document. Additionally, please verify that for each contract:

- The following state changes (and none others) are made to that contract. This validates that no unexpected state changes occur.
- All addresses (in section headers and storage values) match the provided name, using the Etherscan and Superchain Registry links provided. This validates the bytecode deployed at the addresses contains the correct logic.
- All key values match the semantic meaning provided, which can be validated using the storage layout links provided.

## Nested Safe State Overrides and Changes

This task is executed by the nested 2/2 `ProxyAdminOwner` Safe. Refer to the
[generic nested Safe execution validation document](../../../NESTED-VALIDATION.md)
for the expected state overrides and changes.

The `approvedHashes` mapping **key** of the `ProxyAdminOwner` that should change during the simulation is
- Council simulation: `0xa2178e2b0ce499a24051659b5ab4528cd4e41b7dff3b76fa6861750f7b154391`
- Foundation simulation: `0x6baf11815ec9e3d4dc6cfa30c0e72dd31a00e45c9ca6d8a40e52f5cc78635009`

calculated as explained in the nested validation doc:
```sh
cast index address 0xf64bc17485f0B4Ea5F06A96514182FC4cB561977 8 # council
# 0xaaf2b641eaf0bae063c4f2e5670f905e1fb7334436b902d1d880b05bd6228fbd
cast index bytes32 $SAFE_HASH 0xaaf2b641eaf0bae063c4f2e5670f905e1fb7334436b902d1d880b05bd6228fbdd
# TODO
```

```sh
cast index address 0x847B5c174615B1B7fDF770882256e2D3E95b9D92 8 # foundation
# 0x13908ba1c0e379ab58c6445554ab471f3d4efb06e3c4cf966c4f5e918eca67bd
cast index bytes32 $SAFE_HASH x13908ba1c0e379ab58c6445554ab471f3d4efb06e3c4cf966c4f5e918eca67bd
# TODO
```

## State Changes

### `0x229047fed2591dbec1eF1118d64F7aF3dB9EB290` (`SystemConfigProxy` for op-mainnet)

- **Key**: `0x0000000000000000000000000000000000000000000000000000000000000068`
**Before**: `0x0000000000000000000000000000000000000000000000000000000003938700`
**After**: `0xx00000000000000000000000000000000000d273000001db00000000003938700`
**Meaning**: Updates the `basefeeScalar` and `blobbasefeeScalar` storage variables to `7600` and `86200` respectively. These share a slot with the `gasLimit` which remans at `60000000`

### `0x7BD909970B0EEdcF078De6Aeff23ce571663b8aA` (`SystemConfigProxy` for metal-mainnet)

- **Key**: `0x0000000000000000000000000000000000000000000000000000000000000068`
**Before**: `0x0000000000000000000000000000000000000000000000000000000001c9c380`
**After**: `0x0000000000000000000000000000000000000000000a6fe00000000001c9c380`
**Meaning**: Updates the `basefeeScalar` and `blobbasefeeScalar` storage variables to `68400` and `0` respectively. These share a slot with the `gasLimit` which remans at `30000000`

- **Key**: `0x0000000000000000000000000000000000000000000000000000000000000066`
**Before**: `0x00000000000000000000000000000000000000000000000000000000000a6fe0`
**After**: `0x01000000000000000000000000000000000000000000000000000000000a6fe0`
**Meaning**: Updates the `scalar` storage variable to reflect a scalar version of `1`.

### `0x5e6432F18Bc5d497B1Ab2288a025Fbf9D69E2221` (`SystemConfigProxy` for mode-mainnet)

- **Key**: `0x0000000000000000000000000000000000000000000000000000000000000068`
**Before**: `0x0000000000000000000000000000000000000000000000000000000001c9c380`
**After**: `0x000000000000000000000000000000000008ee87000003d10000000001c9c380`
**Meaning**: Updates the `basefeeScalar` and `blobbasefeeScalar` storage variables to `977` and `585351` respectively. These share a slot with the `gasLimit` which remans at `30000000`

### `0xA3cAB0126d5F504B071b81a3e8A2BBBF17930d86` (`SystemConfigProxy` for zora-mainnet)

- **Key**: `0x0000000000000000000000000000000000000000000000000000000000000068`
**Before**: `0x0000000000000000000000000000000000000000000000000000000001c9c380`
**After**: `0x00000000000000000000000000000000000941ad000003f40000000001c9c380`
**Meaning**: Updates the `basefeeScalar` and `blobbasefeeScalar` storage variables to `1012` and `606637` respectively. These share a slot with the `gasLimit` which remans at `30000000`

### `0x34A564BbD863C4bf73Eca711Cf38a77C4Ccbdd6A` (`SystemConfigProxy` for arena-z-mainnet)

- **Key**: `0x0000000000000000000000000000000000000000000000000000000000000068`
**Before**: `0x0000000000000000000000000000000000000000000000000000000001c9c380`
**After**: `0x00000000000000000000000000000000000941ad000003f40000000001c9c380`
**Meaning**: Updates the `basefeeScalar` and `blobbasefeeScalar` storage variables to `1012` and `606637` respectively. These share a slot with the `gasLimit` which remans at `30000000`


### `0x1Eb2fFc903729a0F03966B917003800b145F56E2` (`ProxyAdminOwner` for all chains in this task)

- **Key**: `0x0000000000000000000000000000000000000000000000000000000000000005`
**Before**: `0x000000000000000000000000000000000000000000000000000000000000000f`
**After**: `0x0000000000000000000000000000000000000000000000000000000000000010`
**Meaning**: Nonce increments by 1

- **Key**: See above.
**Before**: `0x0000000000000000000000000000000000000000000000000000000000000000`
**After**: `0x0000000000000000000000000000000000000000000000000000000000000001`
**Meaning**: approvedHashes update. See above.


Loading

0 comments on commit 2b8f3e4

Please sign in to comment.