As we know, upgrades can fail if we hit the cycle limit in the pre_upgrade or post_upgrade hooks. Does anyone have an example where this happens with stable variable declarations alone? What I mean is a Motoko canister with stable let
or stable var
declarations but no pre_upgrade
or post_upgrade
function defined in the source code.
I can make an upgrade fail with stable vars if their size is too large. If their size reaches close to 2 GB then there isn’t enough space to serialize them pre upgrade. That will make the upgrade fail regardless of cycles. I can also make an upgrade fail by defining an expensive pre_upgrade function that exceeds the cycle limit. That will make an upgrade fail regardless of memory. I am looking for an example where the upgrade fails with the cycle limit, not due to memory. But I want it to fail due to stable variable declaration alone, not due to having an expensive explicit pre_upgrade function. Is that possible? Can the serialization/deserialization be made so expensive that it exceeds the cycle limit?