We’re looking into upgrading one of our core applications canisters from the standard GC (which it’s been running on for a long time) to enhanced orthogonal persistence (EOP).
While testing out this migration, we ran into some function complexity errors with EOP that do not exist when using the standard GC.
Specifically, this error:
Caused by: The replica returned a rejection error: reject code CanisterError, reject message Error from Canister br5f7-7uaaa-aaaaa-qaaca-cai: Canister's Wasm module is not valid: Wasm module contains a function at index 0 with complexity 2945127 which exceeds the maximum complexity allowed 1000000.. Try breaking large functions up into multiple smaller functions. See documentation: https://internetcomputer.org/docs/current/references/execution-errors#wasm-module-function-complexity-too-high, error code Some("IC0505")
When we remove "args" : "--enhanced-orthogonal-persistence"
, we no longer have this issue.
Does EOP have a lower complexity limit (however that is determined) than the original GC? Is there a way for me to view or debug what the function complexity is locally?
And are there any recommendations on how we should proceed, given that we seem to be pretty far over the function complexity limit, at least when using EOP.