docs(Upgradable): code removal after deplyoment#88
Conversation
birchmd
left a comment
There was a problem hiding this comment.
The change itself looks good to me. Some other random thoughts about this:
- How much gas does it actually cost to remove an entry from storage? If it is not much then maybe this argument about saving gas is not as relevant.
- Should we recommend if users want to atomically update and remove then they could submit a batch transaction that does both?
- Should we recommend that developers ensure upgrades are always idempotent since it is theoretically possible an upgrade could be applied multiple times if it is not removed immediately?
The cost of
I guess there could be use cases that need a migration function which is not idempotent. For instance if new state is required to depend on the time of migration or on some external value that changes in time. Mentioning the risks of stale code and repeatedly applied upgrades are sufficient warnings, I think.
Since I think the scope of this PR can remain |
Makes it more explicit how staged code can be removed after it was deployed. Mentions the benefit of freeing storage.
Related to this issue and its comment.