celo-org / optimism

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

Move core contracts when migrating a testnet #141

Closed karlb closed 2 weeks ago

karlb commented 4 weeks ago

On Cel2, we expect core contracts to be at specific addresses: https://github.com/celo-org/optimism/blob/karlb/celo5/packages/contracts-bedrock/src/celo/CeloPredeploys.sol

The addresses are chosen to match the addresses on celo L1 mainnet. They are also correctly set when creating a new genesis. But when migrating state from a testnet, the contracts stay at their old addresses and the expected addresses remain empty.

One solution to this problem is adding a new step to the migration script that copies the proxies of all core contracts and their state to the new addresses.

palango commented 2 weeks ago

Moving the core contracts turned out to be a dead end. Transparent proxies don't work for the use case and moving the account to a new address will create a lot of breakage. Instead we're now aiming to handle the different addresses for alfajores in the client.