Skip to content

Commit

Permalink
Add validations.md
Browse files Browse the repository at this point in the history
  • Loading branch information
maurelian committed Feb 6, 2024
1 parent d5f8d0c commit dac7371
Showing 1 changed file with 134 additions and 0 deletions.
134 changes: 134 additions & 0 deletions tasks/eth/2-add-superchainConfig/Validation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Validation

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

Please ensure that the following changes (and none others) are made to each contract in the system.
The "Before" values are excluded from this list and need not be validated.

TODO: add diffyscan usage guidance for validating that new implementation addresses are running
governance approved code.

## Pre-upgrade deployed code

The `SuperchainConfigProxy` has already been deployed and initialized. It's address
`0x95703e0982140d16f8eba6d158fccede42f04a4c` appears in the state diff below in the contracts which
will begin querying it for the paused status.

- **Address Validation:** the address is
[listed](https://github.com/ethereum-optimism/optimism/blob/op-contracts/v1.2.0-rc.1/op-chain-ops/upgrades/l1.go#L34)
in the tooling used to generate
the upgrade transaction bundle, at the governance approved tagged commit in the Optimism repo.
- **Implementation bytecode validation**: TODO via Diffyscan instructions.

## State Overrides

There should also be a single 'State Override' in the Foundation Safe contract
(`0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A`) to enable the simulation by reducing the threshold to
1:

- **Key:** `0x0000000000000000000000000000000000000000000000000000000000000004` <br/>
**Value:** `0x0000000000000000000000000000000000000000000000000000000000000001`

## State Changes

**Notes:**
- The value `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` occurs
multiple times below, and corresponds to the storage key of the implementation address as defined
in
[Proxy.sol](https://github.com/ethereum-optimism/optimism/blob/op-contracts/v1.2.0-rc.1/packages/contracts-bedrock/src/universal/Proxy.sol#L104)
and
[Constants.sol](https://github.com/ethereum-optimism/optimism/blob/op-contracts/v1.2.0-rc.1/packages/contracts-bedrock/src/libraries/Constants.sol#L26-L27).
- Except where necessary the **Before** value is omitted in order to reduce the validation effort.

### `0x229047fed2591dbec1ef1118d64f7af3db9eb290` (`SystemConfigProxy`)

- **Key:** `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` <br/>
**Value:** `0x00000000000000000000000033a032ec93ec0c492ec4bf0b30d5f51986e5a314` <br/>
**Meaning:** Implementation address is set to the new `SystemConfig`.

### `0x25ace71c97b33cc4729cf772ae268934f7ab5fa1` (`L1CrossDomainMessengerProxy`)

- **Key:** `0x0000000000000000000000000000000000000000000000000000000000000000` <br/>
**Before:** `0x000000000000000000000001de1fcfb0851916ca5101820a69b13a4e276bd81f` <br/>
**After:** `0x0000000000000000000000010000000000000000000000000000000000000000` <br/>
**Meaning:** The before value was `abi.encodePacked(true, address(libAddressManager)`. The boolean
value corresponds to the initialized state, which must be true. The address being deleted is
the `AddressManager`, it was used in the legacy L1xDM to look up the address of the CTC. It is
safe to delete because it is no longer in use, as shown by the presence of a [spacer](https://github.com/ethereum-optimism/optimism/blob/op-contracts/v1.2.0-rc.1/packages/contracts-bedrock/src/universal/CrossDomainMessenger.sol#L19)
in the current implementation.

- **Key:** `0x00000000000000000000000000000000000000000000000000000000000000fb` <br/>
**After:** `0x00000000000000000000000095703e0982140d16f8eba6d158fccede42f04a4c` <br/>
**Meaning:** Sets the `SuperchainConfigProxy` address at slot `0xfb` (251). The correctness of
this slot is attested to in the Optimism repo at [storageLayout/L1CrossDomainMessenger.json](https://github.com/ethereum-optimism/optimism/blob/op-contracts/v1.2.0-rc.1/packages/contracts-bedrock/snapshots/storageLayout/L1CrossDomainMessenger.json#L122-L127).


### `0x5a7749f83b81b301cab5f48eb8516b986daef23d` (`L1ERC721BridgeProxy`)

- **Key:** `0x0000000000000000000000000000000000000000000000000000000000000000` <br/>
**After:** `0x0000000000000000000000000000000000000000000000000000000000000001` <br/>
**Meaning:** The `initialized` boolean is set to `true`.

- **Key:** `0x0000000000000000000000000000000000000000000000000000000000000032` <br/>
**After:** `0x00000000000000000000000095703e0982140d16f8eba6d158fccede42f04a4c` <br/>
**Meaning:** Sets the `SuperchainConfigProxy` address.

- **Key:** `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` <br/>
**After:** `0x000000000000000000000000c599fa757c2bcaa5ae3753ab129237f38c10da0b` <br/>
**Meaning:** The implementation address is set to the `L1ERC721Bridge`.

### `0x75505a97bd334e7bd3c476893285569c4136fa0f` (`OptimismMintableERC20FactoryProxy`)

- **Key:** `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` <br/>
**After:** `0x00000000000000000000000074e273220fa1cb62fd756fe6cbda8bbb89404ded` <br/>
**Meaning:** Implementation address is set to the new `OptimismMintableERC20Factory`

### `0x99c9fc46f92e8a1c0dec1b1747d010903e884be1` (`L1StandardBridgeProxy`)

- **Key:** `0x0000000000000000000000000000000000000000000000000000000000000000` <br/>
**After:** `0x0000000000000000000000000000000000000000000000000000000000000001` <br/>
**Meaning:** The `initialized` boolean is set to `true`. <br/>
**Additional Note:** The "Before" value which is being deleted is the address of the
`L1CrossDomainMessengerProxy`. This storage entry was an artifact of the bedrock upgrade, which
moved this value from storage into the contract's bytecode as an `immutable` value. It is no
longer in use and is safe to delete.

- **Key:** `0x0000000000000000000000000000000000000000000000000000000000000032` <br/>
**After:** `0x00000000000000000000000095703e0982140d16f8eba6d158fccede42f04a4c` <br/>
**Meaning:** Sets the `SuperchainConfigProxy` address.

- **Key:** `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` <br/>
**After:** `0x000000000000000000000000566511a1a09561e2896f8c0fd77e8544e59bfdb0` <br/>
**Meaning:** Implementation address is set to the new `L1StandardBridge`.

### `0x9ba6e03d8b90de867373db8cf1a58d2f7f006b3a` (`SafeProxy`)

- **Key:** `0x0000000000000000000000000000000000000000000000000000000000000005` <br/>
**After:** `0x0000000000000000000000000000000000000000000000000000000000000057` <br/>
**Meaning:** The Safe nonce is updated.<br/>
**Additional Note:** This number may be slightly different if other transactions have recently
been executed. The important thing is that it should change by 1.

### `0xbeb5fc579115071764c7423a4f12edde41f106ed` (`OptimismPortalProxy`)

- **Key:** `0x0000000000000000000000000000000000000000000000000000000000000035` <br/>
**After:** `0x000000000000000000000095703e0982140d16f8eba6d158fccede42f04a4c00` <br/>
**Meaning:** Sets the `SuperchainConfigProxy` address.

- **Key:** `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` <br/>
**After:** `0x000000000000000000000000ababe63514ddd6277356f8cc3d6518aa8bdeb4de` <br/>
**Meaning:** Implementation address is set to the new `OptimismPortal`.

### `0xde1fcfb0851916ca5101820a69b13a4e276bd81f` (`Lib_AddressManager`)

- **Key:** `0x515216935740e67dfdda5cf8e248ea32b3277787818ab59153061ac875c9385e` <br/>
**After:** `0x000000000000000000000000a95b24af19f8907390ed15f8348a1a5e6ccbc5c6` <br/>
**Meaning:** The name `OVM_L1CrossDomainMessenger` is set to the address of the new
`L1CrossDomainMessenger`.

### `0xdfe97868233d1aa22e815a266982f2cf17685a27` (`L2OutputOracleProxy`)

- **Key:** `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` <br/>
**After:** `0x000000000000000000000000db5d932af15d00f879cabebf008cadaaaa691e06` <br/>
**Meaning:** Implementation address is set to the new `L2OutputOracle`.

0 comments on commit dac7371

Please sign in to comment.