-
Notifications
You must be signed in to change notification settings - Fork 115
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
Content directory smart contracts: Upgradability #1921
Comments
I think there are 2 possible strategies to evaluate:
Strategy 1Cons:
Pros:
Example upgrade flow: This is a simple case where we just add a single storage contract, but this will get increasingly more complex if we add more storage contracts or change and migrate data in some existing ones (which may often be the case if we want to introduce some non-trivial changes):
Strategy 2Cons:
Pros:
Example upgrade flow:
|
It seems to me that the two strategies basically differ in their costs in that one is more fool-proof and simple for smaller changes, but with lots of cumulative upgrades it can get out of hand, while the other is harder to pull off, but does not become more complex to maintain if pulled off correctly. If this is correct, then the first version is more aligned with doing something that a small community is able to pull off on their own without lots of investment in audits and access to highly experienced and fully occupied developers. We have solid amount of time to just iterate internally before mainnet to get a robust feature set, so many frequent substantial changes should not be urgent in near term once live. After a few upgrades using this approach, the community is more likely to both have built the capability to do something more complex, and also know what their long term requirements look like, at which point they could change the upgradeability pattern. What do you think? |
In current design (#1520 (comment)) we need to migrate data (like channels) if we want to change its representation directly in existing storage contract (like
ChannelStorage
).It is possible to avoid migration if we introduce a new storage contract that will only store, for example, part of the channel data that we wish to include in the new logic, ie.:
We can then redeploy the logic contract to which we would transfer ownership of all existing storage contracts (channels, videos, groups) and make it the owner of the new stroage contract (we'd may need to add a small bit of code related to transferring the new
channelRewards
storage to allow migrating it in the future too).This process would be similar to introducing completely new concept like
Music
as described in #1520 (comment)Alternatives
We could use delegatecall proxies (one of the patters described in https://blog.openzeppelin.com/the-state-of-smart-contract-upgrades/), which may have a few benefits, like keeping the same contract address and possibly reducing the amout of steps needed to make an upgrage (ie. transferring storage contracts ownerships), but most of the delagetecall proxy patters suffer from major drawbacks in terms of security (ie. possible storage clashes) or complexity (ie. the "eternal storage" pattern).
The text was updated successfully, but these errors were encountered: