Hey, I was testing a Rust canister locally and I got the following error in the dfx replica:
Canister's Wasm module is not valid: Wasm module contains a function at index 0 with complexity 1029495 which exceeds the maximum complexity allowed 1000000.
How can I go about debugging these issues? are there tools which will allow me to inspect the complexity of a function and find the offending one?
Also, what are the recommended ways to reduce a function’s complexity?
I am trying to verify a merkle proof that can be pretty big (proof of membership among >30k elements)