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

Add owner to Replica #32

Merged
merged 10 commits into from
Jan 29, 2022
Merged

Add owner to Replica #32

merged 10 commits into from
Jan 29, 2022

Conversation

asaj
Copy link
Contributor

@asaj asaj commented Jan 28, 2022

This PR adds an owner storage variable to Replica that is used to permission Replica updater rotations. It removes the concept of "benign" double updates in favor of updater rotation.

Note that when the owner is the null address, anyone can act as the owner. This allows the owner to be set post-facto (rather than in the initializer) so that existing Replicas can be upgraded.

It is thus CRITICAL that when upgrading to this new implementation, their owners are set in the same transaction.

Note that the upgradability gap was not reduced in Replica, as it is in actuality one size smaller than it should have been. Effectively increasing the size of the upgradability gap is safe because no contracts are inheriting from Replica.


This PR also fully moves away from @optics-xyz/ts-interface and @optics-xyz/deploy in favor of optics-ts-interface and optics-deploy, respectively.

Copy link
Contributor

@nambrot nambrot left a comment

Choose a reason for hiding this comment

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

Would you mind outlining in the PR description how to get the tests running until it works out of the box in CI? Also might be nice to link to the specific line/PR in which we do the CRITICAL owner setting

solidity/optics-core/contracts/Replica.sol Show resolved Hide resolved
solidity/optics-core/contracts/Replica.sol Outdated Show resolved Hide resolved
typescript/optics-tests/test/replica.test.ts Show resolved Hide resolved
Copy link
Contributor

@nambrot nambrot left a comment

Choose a reason for hiding this comment

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

v minor nit

typescript/optics-tests/test/replica.test.ts Outdated Show resolved Hide resolved
@asaj asaj merged commit 3052427 into main Jan 29, 2022
@asaj asaj deleted the asaj/ownable-replicas branch January 29, 2022 04:10
yorhodes pushed a commit that referenced this pull request Jun 26, 2023
yorhodes pushed a commit that referenced this pull request Jun 26, 2023
* 1.1.0

* Fix yarn.lock
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.

2 participants