flow-emulator icon indicating copy to clipboard operation
flow-emulator copied to clipboard

Stable Cadence Version of the emulator that allows deploying invalid code to test upgrades

Open joshuahannan opened this issue 2 years ago • 8 comments

Issue To Be Solved

For stable Cadence, it isn't enough for a developer to just make their contracts compatible. They also have to know that the upgrade will work properly when they try it between current cadence and stable cadence.

Suggest A Solution

A version of the emulator with the ability to deploy invalid code to the emulator with a special flag.

This would allow devs to do everything within one emulator. So they could:

Deploy the old verison of their code with the allowinvalid option Run an update of said code that must be valid.

joshuahannan avatar Sep 01 '23 16:09 joshuahannan

Second this.

bjartek avatar Sep 01 '23 16:09 bjartek

Good idea. @chasefleming

devbugging avatar Sep 01 '23 16:09 devbugging

This sounds great. Trying to figure out how it would work though. I'm assuming though that the goal is for a developer to migrate at their own pace right, which means both versions would need to work together since two FVMs without the ability to communicate with each other doesn't sound very helpful. For example, maybe I have two contracts and I've migrated one but am still using the other that hasn't been migrated and I'm working on it with this new flag enabled. That seems the most helpful. But is there a way to do this with Cadence? @joshuahannan @turbolent will there we flags for Cadence to allowUnstableAPIs or something similar?

chasefleming avatar Sep 07 '23 21:09 chasefleming

We should only consider this as a temporary solution for the Stable Cadence preview builds.

We are going to have to adjust the contract update checking logic in Cadence for the Stable Cadence release, but are not quite there yet / will only get to that in a few weeks / couple months.

turbolent avatar Sep 08 '23 01:09 turbolent

I don't know how this will work ( as Cadence does not have the contract update logic yet ) technically we cannot upgrade an invalid contract I guess.

bluesign avatar Sep 19 '23 16:09 bluesign

Can we have some love on this issue, it is very important for good feedback on stable cadence that we can testrun upgrading out old contracts. That is currently not possible.

bjartek avatar Sep 28 '23 17:09 bjartek

@bjartek there's no update yet in this area, as it's still a bit too early, the remaining pieces of the release (e.g. removing resource destructors) are still being worked on. Once it's clear what the full scope of the release is, we can start looking into how the code updability checks would have be adjusted to accommodate the modifications needed to update to Stable Cadence (aka 1.0).

What helps here are reports of what kind of updates you need to be able to perform, but that the code update checks are currently rejecting.

Thank you for being eager to try this out, but there isn't any urgency for developers yet to consider this yet, so thank you for your patience until it's time.

turbolent avatar Sep 28 '23 22:09 turbolent

Thanks. My main concern is that we are not able to update our contracts to stable cadence. The reason I want this is to verify that, so that we can prove that it is possible and provide migration help.

This is going to be a huge lift for all contracts on flow and i am worried that many will not be updated.

bjartek avatar Sep 29 '23 06:09 bjartek

@joshuahannan I guess we can close this now?

turbolent avatar Jun 06 '24 23:06 turbolent

yeah, I'll close

joshuahannan avatar Jun 07 '24 17:06 joshuahannan