celo-org / optimism

Optimism is Ethereum, scaled.
https://optimism.io
MIT License
3 stars 2 forks source link

Set `OptimismPortal._balance` with StorageSetter pattern #193

Open ezdac opened 1 month ago

ezdac commented 1 month ago

In order to get rid of the constructor changes of the OptimismPortal contract, we can modify the storage directly with an intermediate Proxy implementation:

We use this contract to set storage during upgrades by swapping the implementation to this contract and then to the desired implementation atomically. This prevents complexity around coupling storage migrations with implementation code and would allow this diff to go away. This pattern will be required for contract upgrades since we need to zero out the _initialized slot to call initialize on a new implementation

_Originally posted by @tynes in https://github.com/celo-org/optimism/pull/174#discussion_r1681158745_

lvpeschke commented 1 month ago

@ezdac if this is still needed and cannot yet be closed, please

  1. move to the appropriate milestone
  2. attach to the relevant epic