Hi everyone, suppose the following happens:
1. I publish an ethereum contract that implements my dapp
2. Thousands of users use that dapp, all of them storing data in the dapp's permanent storage.
3. I find a bug in the contract code and need to tweak the contract.
To me, this is the ultimate nightmare scenario, as I cannot see a good solution to this problem (though I might be missing something obvious... please let me know!)
Here are some approaches that come to mind, but they all seem unsatisfying:
Solution #1: Just "clone" the data to a new contract and start using the new contract
The problem with this solution is that it could be very, very expensive with thousands of users, given all the data they've stored in the contract.
Solution #2: Use "function indirection" by using child contracts for most of the programming logic
The problem with this solution is that EVERY SINGLE CALL into the contract will have to pay extra gas for this indirection, which seems costly. Plus, there still has to be some contract that holds the storage data, and that contract may still be at risk for containing errors.
Solution #3: Use ERIS or whatever to handle this
That solution just passes the problem to another system, so this also can't lower costs (since I'd just be able to apply the same optimization in my Dapp, whatever it is.)
Additional note: I'm not asking the question "how does the app decide who gets to make the modification, and how do we make sure the users are OK with this?" That's a separate problem that is also very important, but this question concerns the more fundamental question of "How do I make the contract code upgradable in a cost-effective manner, for a dapp with lots of storage?"
Thanks for any tips!