candid
candid copied to clipboard
Running out of cycles by removing a field in the Deserialized type
We have two structures;
#[derive(Deserialize)]
struct CallCanisterArgs1 {
canister: Principal,
method_name: String,
args: Vec<u8>,
cycles: u64,
}
// RUNNING OUT OF CYCLE
#[derive(Deserialize)]
struct CallCanisterArgs2 {
canister: Principal,
method_name: String,
cycles: u64,
}
The CallCanisterArgs2 runs out of cycle if we try to deserialize the same value CallCanisterArgs1 would deserialize, which points to a performance regression when skipping fields.