-
Notifications
You must be signed in to change notification settings - Fork 27
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
Upgradeability for TeleporterUpgradeable and TeleporterOwnerUpgradeable #397
Conversation
Upgradeability POC
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea why this ABI binding changed despite the contract being untouched?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's just the IPFS hash of the deployed byte code that changed, but still seems odd since nothing else was modified as far as I can tell.
internal | ||
onlyInitializing | ||
{ | ||
__ReentrancyGuard_init(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my own understanding, do you know why ContextUpgradeable
doesn't have a __ContextUpgradeable_init
function to be called here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ContextUPgradeable
has no state to initialize with so the init functions are empty
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, should we include calls to that here for completeness? In the event that state is added to those contracts in a future version I image we'd want to call it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still need to follow up this. If you include the Context init call, for new versions we'd need to check through the inheritance hierarchy to make sure there's no duplicates of initialize calls anyways. Likely if called, we can call the init_unchained
call. Also was looking at OZ's OwnableUpgradeable which also inherits ContextUpgradeable
but they do not call the Context init function, so might ask OZ about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following convention in #397 (comment) to call init
instead of unchained
when not needed, went forward to call Context_init
as well for completeness, and no duplicate initializations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related OZ issue with their upgradeable contract transpiler not always calling the init
functions of parent contracts OpenZeppelin/openzeppelin-contracts#4690
Bumping this comment that may have fallen through the cracks: #397 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to call _disableInitializers()
somewhere? https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract
Do we plan to integrate OZ's Upgrades Plugins? In particular, the "upgrade safety validations" sound helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once Gene's comments are addressed
38acbea
I deferred the Also I agree that now we have upgradeable contracts, integrating the plugin will be beneficial especially after moving to mono-repo structure. Can you create a separate issue for it @feuGeneA |
Why this should be merged
Fixes #420 #414
How this works
Makes it so the utility contracts are upgradeable, and can have easy non-upgradeable extensions that derive off these contracts in future issue.
How this was tested
CI
How is this documented