Skip to content

Commit 4e8f534

Browse files
authored
Update for single step upgrades (#486)
1 parent 7766582 commit 4e8f534

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

specs/experimental/op-contracts-manager.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,22 @@ The high level logic of the upgrade method is as follows:
234234

235235
1. The Upgrade Controller Safe will `DELEGATECALL` to the `OPCM.upgrade()` method.
236236
2. For each `_systemConfig`, the list of addresses in the chain is retrieved.
237-
3. For each address, a two step upgrade is used where:
238-
1. the first upgrade is to an `InitializerResetter` which resets the `initialized` value.
239-
1. the implementation is updated to the final address and `upgrade()` is called on that address.
237+
3. For each address:
238+
1. If it is receiving new state variables (only the SystemConfig for Isthmus), a call is made to:
239+
`ProxyAdmin.upgradeAndCall()` with data corresponding to the new value being set.
240+
2. Otherwise, `ProxyAdmin.upgrade()` is called on that address.
240241

241-
This approach requires that all contracts have an `upgrade()` function which sets the `initialized`
242-
value to `true`. The `upgrade` function body should be empty unless it is used to set a new state
243-
variable added to that contract since the last upgrade.
242+
This approach requires that any contracts which are receiving new state variables
243+
have an upgrade function which:
244+
245+
1. Writes the new state variables
246+
2. MUST only be callable once
247+
248+
Thus for Isthmus, the System config will receive the following new function.
249+
250+
```solidity
251+
function upgradeIsthmus(IsthmusConfig _isthmusConfig) external;
252+
```
244253

245254
#### `IsthmusConfig` struct
246255

0 commit comments

Comments
 (0)