Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add task for Holocene System Config upgrade across sepolia/{op,mode,metal,zora} #378

Merged
merged 28 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7fea7f1
add Seb's input from Clabby's tool
geoknee Nov 26, 2024
648c335
move task into subfolder, and populate additional folders for MMZB
geoknee Nov 26, 2024
896e26f
consolidate 5 ops into 1
geoknee Nov 26, 2024
27b7b50
draft solidity validation script
geoknee Nov 26, 2024
e473f7d
get validation script to compile
geoknee Nov 26, 2024
6f682b8
commit env
geoknee Nov 26, 2024
fed0a38
tweaks
geoknee Nov 26, 2024
bbc3bc9
fill out getAllowedStorageAccess
geoknee Nov 26, 2024
0f70519
rename file
geoknee Nov 26, 2024
c9a5f9b
remove base and fixup validation script
geoknee Nov 26, 2024
4e2aa1a
remove unecessary file
geoknee Nov 27, 2024
7e1de44
set status to READY TO SIGN
geoknee Nov 27, 2024
f7080e0
change SystemConfig implementation address
geoknee Nov 27, 2024
5e8733f
update calldata with new sys cfg impl addr
geoknee Nov 27, 2024
04b6e5e
Apply suggestions from code review
geoknee Nov 27, 2024
56557e5
complete sentence with gov proposal wording
geoknee Nov 27, 2024
1c0d836
add state overrides and nonce changes to validation.md
geoknee Nov 28, 2024
7bad130
add approvedHashes sections to validation.md
geoknee Nov 28, 2024
ef832c9
add liveness guard section to validation.md
geoknee Nov 28, 2024
19d9e21
load livenessGuard from storage
geoknee Nov 28, 2024
4413fb5
add checkProxyAdminOwnerSafe fn
geoknee Nov 28, 2024
e95ac21
rename variables for clarity
geoknee Nov 28, 2024
4c735c6
clarify that this is testnet, so no gov proposal etc.
geoknee Nov 28, 2024
4bf34f1
typo
geoknee Nov 28, 2024
0726e80
update section on liveness guard
geoknee Nov 28, 2024
5841212
Apply suggestions from code review
geoknee Nov 28, 2024
9feb929
Add Test CI for the task `020-holocene-system-config-upgrade-multi-ch…
Ethnical Nov 29, 2024
be28707
update liveness guard explanation
geoknee Nov 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ETH_RPC_URL="https://ethereum-sepolia.publicnode.com"
COUNCIL_SAFE=0xf64bc17485f0B4Ea5F06A96514182FC4cB561977
FOUNDATION_SAFE=0xDEe57160aAfCF04c34C887B5962D0a69676d3C8B
OWNER_SAFE=0x1Eb2fFc903729a0F03966B917003800b145F56E2
geoknee marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;

import {NestedSignFromJson as OriginalNestedSignFromJson} from "script/NestedSignFromJson.s.sol";
import {GnosisSafe} from "safe-contracts/GnosisSafe.sol";
import {Vm, VmSafe} from "forge-std/Vm.sol";
import {Simulation} from "@base-contracts/script/universal/Simulation.sol";
import {console2 as console} from "forge-std/console2.sol";
import {ProxyAdmin} from "@eth-optimism-bedrock/src/universal/ProxyAdmin.sol";
import {stdJson} from "forge-std/stdJson.sol";

/// @title ISemver
/// @notice ISemver is a simple contract for ensuring that contracts are
/// versioned using semantic versioning.
interface ISemver {
/// @notice Getter for the semantic version of the contract. This is not
/// meant to be used onchain but instead meant to be used by offchain
/// tooling.
/// @return Semver contract version as a string.
function version() external view returns (string memory);
}

contract NestedSignFromJson is OriginalNestedSignFromJson {
string[4] l2ChainIds = [
"11155420", // op
"1740", // metal
"919", // mode
"999999999" // zora
];

address livenessGuard = 0xc26977310bC89DAee5823C2e2a73195E85382cC7;
Ethnical marked this conversation as resolved.
Show resolved Hide resolved

address newSystemConfigImplAddress = 0x29d06Ed7105c7552EFD9f29f3e0d250e5df412CD;

// Safe contract for this task.
GnosisSafe securityCouncilSafe = GnosisSafe(payable(vm.envAddress("COUNCIL_SAFE")));
GnosisSafe fndSafe = GnosisSafe(payable(vm.envAddress("FOUNDATION_SAFE")));
GnosisSafe ownerSafe = GnosisSafe(payable(vm.envAddress("OWNER_SAFE")));
Ethnical marked this conversation as resolved.
Show resolved Hide resolved
Ethnical marked this conversation as resolved.
Show resolved Hide resolved
Ethnical marked this conversation as resolved.
Show resolved Hide resolved
Ethnical marked this conversation as resolved.
Show resolved Hide resolved

/// @notice Sets up the contract
function setUp() public {}

/// @notice Checks the correctness of the deployment
function _postCheck(Vm.AccountAccess[] memory accesses, Simulation.Payload memory /* simPayload */ )
internal
view
override
{
console.log("Running post-deploy assertions");
checkStateDiff(accesses);
for (uint256 i = 0; i < l2ChainIds.length; i++) {
Ethnical marked this conversation as resolved.
Show resolved Hide resolved
ISemver systemConfigProxy = ISemver(readAddressFromSuperchainRegistry(l2ChainIds[i], "SystemConfigProxy"));
ProxyAdmin opProxyAdmin = ProxyAdmin(readAddressFromSuperchainRegistry(l2ChainIds[i], "ProxyAdmin"));
require(
opProxyAdmin.getProxyImplementation(address(systemConfigProxy)) == newSystemConfigImplAddress,
"SystemConfigProxy implementation not updated"
);
require(
keccak256(abi.encode(systemConfigProxy.version())) == keccak256(abi.encode("2.3.0-beta.5")),
Ethnical marked this conversation as resolved.
Show resolved Hide resolved
"Version not updated"
);
}

console.log("All assertions passed!");
}

function readAddressFromSuperchainRegistry(string memory chainId, string memory contractName)
internal
view
returns (address)
{
string memory addressesJson;

// Read addresses json
string memory path = "/lib/superchain-registry/superchain/extra/addresses/addresses.json";

try vm.readFile(string.concat(vm.projectRoot(), path)) returns (string memory data) {
addressesJson = data;
} catch {
revert(string.concat("Failed to read ", path));
}

return stdJson.readAddress(addressesJson, string.concat("$.", chainId, ".", contractName));
}

function getAllowedStorageAccess() internal view override returns (address[] memory allowed) {
allowed = new address[](9);

for (uint256 i = 0; i < l2ChainIds.length; i++) {
address systemConfigProxy = readAddressFromSuperchainRegistry(l2ChainIds[i], "SystemConfigProxy");
allowed[i] = systemConfigProxy;
}
allowed[5] = address(ownerSafe);
allowed[6] = address(securityCouncilSafe);
allowed[7] = address(fndSafe);
allowed[8] = livenessGuard;
}

function getCodeExceptions() internal pure override returns (address[] memory) {
address[] memory exceptions = new address[](0);
return exceptions;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Holocene Hardfork - SystemConfig Upgrade
Ethnical marked this conversation as resolved.
Show resolved Hide resolved
Upgrades the `SystemConfig.sol` contract for Holocene.

The batch will be executed on chain ID `11155111`, and contains `4` transactions.

## Tx #1: Upgrade `SystemConfig` proxy for OP Sepolia
Upgrades the `SystemConfig` proxy to the new implementation, featuring configurable EIP-1559 parameters.

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

**To:** `0x189aBAAaa82DfC015A588A7dbaD6F13b1D3485Bc`

**Value:** `0 WEI`

**Raw Input Data:** `0x99a88ec4000000000000000000000000034edd2a225f7f429a63e0f1d2084b9e0a93b53800000000000000000000000029d06ed7105c7552efd9f29f3e0d250e5df412cd`

### Inputs
**_implementation:** `0x29d06Ed7105c7552EFD9f29f3e0d250e5df412CD`

**_proxy:** `0x034edD2A225f7f429A63E0f1D2084B9E0A93b538`

## Tx #2: Upgrade `SystemConfig` proxy on Mode Sepolia
Upgrades the `SystemConfig` proxy to the new implementation, featuring configurable EIP-1559 parameters.

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

**To:** `0xE7413127F29E050Df65ac3FC9335F85bB10091AE`

**Value:** `0 WEI`

**Raw Input Data:** `0x99a88ec400000000000000000000000015cd4f6e0ce3b4832b33cb9c6f6fe6fc246754c200000000000000000000000029d06ed7105c7552efd9f29f3e0d250e5df412cd`

### Inputs
**_proxy:** `0x15cd4f6e0CE3B4832B33cB9c6f6Fe6fc246754c2`

**_implementation:** `0x29d06Ed7105c7552EFD9f29f3e0d250e5df412CD`

## Tx #3: Upgrade `SystemConfig` proxy on Metal Sepolia
Upgrades the `SystemConfig` proxy to the new implementation, featuring configurable EIP-1559 parameters.

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

**To:** `0xF7Bc4b3a78C7Dd8bE9B69B3128EEB0D6776Ce18A`

**Value:** `0 WEI`

**Raw Input Data:** `0x99a88ec40000000000000000000000005d63a8dc2737ce771aa4a6510d063b6ba2c4f6f200000000000000000000000029d06ed7105c7552efd9f29f3e0d250e5df412cd`

### Inputs
**_proxy:** `0x5D63A8Dc2737cE771aa4a6510D063b6Ba2c4f6F2`

**_implementation:** `0x29d06Ed7105c7552EFD9f29f3e0d250e5df412CD`

## Tx #4: Upgrade `SystemConfig` proxy on Zora Sepolia
Upgrades the `SystemConfig` proxy to the new implementation, featuring configurable EIP-1559 parameters.

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

**To:** `0xE17071F4C216Eb189437fbDBCc16Bb79c4efD9c2`

**Value:** `0 WEI`

**Raw Input Data:** `0x99a88ec4000000000000000000000000b54c7bfc223058773cf9b739cc5bd4095184fb0800000000000000000000000029d06ed7105c7552efd9f29f3e0d250e5df412cd`

### Inputs
**_proxy:** `0xB54c7BFC223058773CF9b739cC5bd4095184Fb08`

**_implementation:** `0x29d06Ed7105c7552EFD9f29f3e0d250e5df412CD`
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Holocene Hardfork Upgrade - `SystemConfig`

Status: DRAFT, NOT READY TO SIGN
Ethnical marked this conversation as resolved.
Show resolved Hide resolved

## Objective

Upgrades the `SystemConfig` for the Holocene hardfork for Sepolia/{OP,Mode,Metal,Zora,Base}

The proposal was:

- [ ] Posted on the governance forum.
- [ ] Approved by Token House voting.
- [ ] Not vetoed by the Citizens' house.
- [ ] Executed on OP Mainnet.
Ethnical marked this conversation as resolved.
Show resolved Hide resolved

The governance proposal should be treated as the source of truth and used to verify the correctness of the onchain operations.

Governance post of the upgrade can be found at <placeholder>.
Ethnical marked this conversation as resolved.
Show resolved Hide resolved

This upgrades the `SystemConfig` in the
Ethnical marked this conversation as resolved.
Show resolved Hide resolved
[op-contracts/v1.8.0](https://github.com/ethereum-optimism/optimism/tree/op-contracts/v1.8.0-rc.1) release.
Ethnical marked this conversation as resolved.
Show resolved Hide resolved

## Pre-deployments

- `SystemConfig` - `0x29d06Ed7105c7552EFD9f29f3e0d250e5df412CD`
Ethnical marked this conversation as resolved.
Show resolved Hide resolved

## 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/<path>/NestedSignFromJson.s.sol`.
Ethnical marked this conversation as resolved.
Show resolved Hide resolved
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
* Changes the implementation of the `SystemConfig` to hold EIP-1559 parameters for the
Ethnical marked this conversation as resolved.
Show resolved Hide resolved

See the [overview](./OVERVIEW.md) and `input.json` bundle for more details.
Ethnical marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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.

## State Changes

### `0x034edD2A225f7f429A63E0f1D2084B9E0A93b538` (`SystemConfigProxy`) for OP Sepolia

- **Key**: `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`
**Before**: `0x000000000000000000000000ccdd86d581e40fb5a1c77582247bc493b6c8b169`
**After**: `0x00000000000000000000000029d06ed7105c7552efd9f29f3e0d250e5df412cd`
**Meaning**: Updates the `SystemConfig` proxy implementation.


### `0x15cd4f6e0CE3B4832B33cB9c6f6Fe6fc246754c2` (`SystemConfigProxy`) for Mode Sepolia

- **Key**: `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`
**Before**: `0x000000000000000000000000ba2492e52f45651b60b8b38d4ea5e2390c64ffb1`
**After**: `0x00000000000000000000000029d06ed7105c7552efd9f29f3e0d250e5df412cd`
**Meaning**: Updates the `SystemConfig` proxy implementation.


### `0x5D63A8Dc2737cE771aa4a6510D063b6Ba2c4f6F2` (`SystemConfigProxy`) for Metal Sepolia

- **Key**: `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`
**Before**: `0x000000000000000000000000ba2492e52f45651b60b8b38d4ea5e2390c64ffb1`
**After**: `0x00000000000000000000000029d06ed7105c7552efd9f29f3e0d250e5df412cd`
**Meaning**: Updates the `SystemConfig` proxy implementation.

### `0xB54c7BFC223058773CF9b739cC5bd4095184Fb08` (`SystemConfigProxy`) for Zora Sepolia

- **Key**: `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`
**Before**: `0x000000000000000000000000ba2492e52f45651b60b8b38d4ea5e2390c64ffb1`
**After**: `0x00000000000000000000000029d06ed7105c7552efd9f29f3e0d250e5df412cd`
**Meaning**: Updates the `SystemConfig` proxy implementation.
125 changes: 125 additions & 0 deletions tasks/sep/020-holocene-system-config-upgrade-multi-chain/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"chainId": 11155111,
"metadata": {
"name": "Holocene Hardfork - SystemConfig Upgrade",
"description": "Upgrades the `SystemConfig.sol` contract for Holocene for Sepolia/{OP,Base,Mode,Metal,Zora}."
},
"transactions": [
{
"metadata": {
"name": "Upgrade `SystemConfig` proxy on OP Sepolia",
"description": "Upgrades the `SystemConfig` proxy to the new implementation, featuring configurable EIP-1559 parameters."
},
"to": "0x189aBAAaa82DfC015A588A7dbaD6F13b1D3485Bc",
"value": "0x0",
"data": "0x99a88ec4000000000000000000000000034edd2a225f7f429a63e0f1d2084b9e0a93b53800000000000000000000000029d06ed7105c7552efd9f29f3e0d250e5df412cd",
"contractMethod": {
"type": "function",
"name": "upgrade",
"inputs": [
{
"name": "_proxy",
"type": "address"
},
{
"name": "_implementation",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
"contractInputsValues": {
"_proxy": "0x034edD2A225f7f429A63E0f1D2084B9E0A93b538",
"_implementation": "0x29d06Ed7105c7552EFD9f29f3e0d250e5df412CD"
}
},
{
"metadata": {
"name": "Upgrade `SystemConfig` proxy on Mode Sepolia",
"description": "Upgrades the `SystemConfig` proxy to the new implementation, featuring configurable EIP-1559 parameters."
},
"to": "0xE7413127F29E050Df65ac3FC9335F85bB10091AE",
"value": "0x0",
"data": "0x99a88ec400000000000000000000000015cd4f6e0ce3b4832b33cb9c6f6fe6fc246754c200000000000000000000000029d06ed7105c7552efd9f29f3e0d250e5df412cd",
"contractMethod": {
"type": "function",
"name": "upgrade",
"inputs": [
{
"name": "_proxy",
"type": "address"
},
{
"name": "_implementation",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
"contractInputsValues": {
"_proxy": "0x15cd4f6e0CE3B4832B33cB9c6f6Fe6fc246754c2",
"_implementation": "0x29d06Ed7105c7552EFD9f29f3e0d250e5df412CD"
}
},
{
"metadata": {
"name": "Upgrade `SystemConfig` proxy on Metal Sepolia",
"description": "Upgrades the `SystemConfig` proxy to the new implementation, featuring configurable EIP-1559 parameters."
},
"to": "0xF7Bc4b3a78C7Dd8bE9B69B3128EEB0D6776Ce18A",
"value": "0x0",
"data": "0x99a88ec40000000000000000000000005d63a8dc2737ce771aa4a6510d063b6ba2c4f6f200000000000000000000000029d06ed7105c7552efd9f29f3e0d250e5df412cd",
"contractMethod": {
"type": "function",
"name": "upgrade",
"inputs": [
{
"name": "_proxy",
"type": "address"
},
{
"name": "_implementation",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
"contractInputsValues": {
"_proxy": "0x5D63A8Dc2737cE771aa4a6510D063b6Ba2c4f6F2",
"_implementation": "0x29d06Ed7105c7552EFD9f29f3e0d250e5df412CD"
}
},
{
"metadata": {
"name": "Upgrade `SystemConfig` proxy on Zora Sepolia",
"description": "Upgrades the `SystemConfig` proxy to the new implementation, featuring configurable EIP-1559 parameters."
},
"to": "0xE17071F4C216Eb189437fbDBCc16Bb79c4efD9c2",
"value": "0x0",
"data": "0x99a88ec4000000000000000000000000b54c7bfc223058773cf9b739cc5bd4095184fb0800000000000000000000000029d06ed7105c7552efd9f29f3e0d250e5df412cd",
"contractMethod": {
"type": "function",
"name": "upgrade",
"inputs": [
{
"name": "_proxy",
"type": "address"
},
{
"name": "_implementation",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
"contractInputsValues": {
"_proxy": "0xB54c7BFC223058773CF9b739cC5bd4095184Fb08",
"_implementation": "0x29d06Ed7105c7552EFD9f29f3e0d250e5df412CD"
}
}
]
}