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

Configurator #160

Merged
merged 26 commits into from
Mar 30, 2022
Merged

Configurator #160

merged 26 commits into from
Mar 30, 2022

Conversation

kevincheng96
Copy link
Contributor

@kevincheng96 kevincheng96 commented Feb 9, 2022

This is an implementation of the advanced architecture described in RFC 021, but with some changes to enhance upgradeability, namely a separate Configurator contract that is upgradeable. The overall system looks something like:

Timelock -> ProxyAdmin -> Proxy -> Configurator
                       \
                        > Proxy -> Comet

Timelock is an admin of ProxyAdmin, which is an admin of the two proxies. Timelock is also an admin of Configurator, meaning only the Timelock can set parameters in Configurator.

contracts/CometStorage.sol Outdated Show resolved Hide resolved
contracts/CometStorage.sol Outdated Show resolved Hide resolved
contracts/CometFactory.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@jflatow jflatow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work getting this started 💪

@kevincheng96
Copy link
Contributor Author

Added some changes to improve the upgradeability of the Configurator. The previous implementation and design in RFC 021 has a flaw because all the configurator logic existed in the proxy, which meant that the configurator logic would be impossible to upgrade.

There is now a separate Configurator implementation contract that the proxy fallbacks to for admin callers. Non-admin callers will still fallback to the Comet implementation.

@kevincheng96 kevincheng96 marked this pull request as ready for review February 22, 2022 19:00
@kevincheng96 kevincheng96 changed the title Kevin/configurator Configurator Feb 22, 2022
contracts/Configurator.sol Outdated Show resolved Hide resolved
contracts/Configurator.sol Outdated Show resolved Hide resolved
@kevincheng96
Copy link
Contributor Author

I've updated the configurator flow to be simpler based on a discussion with Geoff. Instead of sharing one customized proxy, the configurator and Comet will now both have their own un-modified OZ proxies.

Copy link
Contributor

@hayesgm hayesgm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this is making good sense!

@kevincheng96
Copy link
Contributor Author

Added the ProxyAdminAdmin in the latest commit. It's the admin to the ProxyAdmin. It gives governance more flexibility as it can both upgrade the proxies (by going through the ProxyAdmin) and directly call the proxy implementations (which the ProxyAdmin cannot do).

@kevincheng96 kevincheng96 force-pushed the kevin/configurator branch 3 times, most recently from 37d0a1b to 26984c6 Compare March 2, 2022 19:20
contracts/Configurator.sol Outdated Show resolved Hide resolved
contracts/Configurator.sol Outdated Show resolved Hide resolved
contracts/Configurator.sol Outdated Show resolved Hide resolved
contracts/Configurator.sol Show resolved Hide resolved
contracts/Timelock.sol Outdated Show resolved Hide resolved
deployments/fuji/migrations/1646440158_configurator.ts Outdated Show resolved Hide resolved
deployments/fuji/migrations/1646440158_configurator.ts Outdated Show resolved Hide resolved
@kevincheng96
Copy link
Contributor Author

Rebased on top of main (which has the recently merged #208).

contracts/Configurator.sol Outdated Show resolved Hide resolved
src/deploy/Development.ts Outdated Show resolved Hide resolved
@kevincheng96 kevincheng96 merged commit b948624 into main Mar 30, 2022
@kevincheng96 kevincheng96 deleted the kevin/configurator branch March 30, 2022 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants