diff --git a/rs/embedders/src/wasmtime_embedder/system_api.rs b/rs/embedders/src/wasmtime_embedder/system_api.rs index 5a88a07db14..1a3e92f6b11 100644 --- a/rs/embedders/src/wasmtime_embedder/system_api.rs +++ b/rs/embedders/src/wasmtime_embedder/system_api.rs @@ -1205,6 +1205,7 @@ pub fn syscalls< linker .func_wrap("ic0", "cycles_burn128", { move |mut caller: Caller<'_, StoreData>, amount_high: u64, amount_low: u64, dst: I| { + charge_for_cpu(&mut caller, overhead::CYCLES_BURN128)?; with_memory_and_system_api(&mut caller, |s, memory| { let dst: usize = dst.try_into().expect("Failed to convert I to usize"); s.ic0_cycles_burn128(Cycles::from_parts(amount_high, amount_low), dst, memory) diff --git a/rs/embedders/src/wasmtime_embedder/system_api_complexity.rs b/rs/embedders/src/wasmtime_embedder/system_api_complexity.rs index 304520fd6b8..65c53e12151 100644 --- a/rs/embedders/src/wasmtime_embedder/system_api_complexity.rs +++ b/rs/embedders/src/wasmtime_embedder/system_api_complexity.rs @@ -25,6 +25,7 @@ pub mod overhead { pub const CALL_ON_CLEANUP: NumInstructions = NumInstructions::new(500); pub const CALL_PERFORM: NumInstructions = NumInstructions::new(5_000); pub const CALL_WITH_BEST_EFFORT_RESPONSE: NumInstructions = NumInstructions::new(500); + pub const CYCLES_BURN128: NumInstructions = NumInstructions::new(500); pub const CANISTER_CYCLE_BALANCE: NumInstructions = NumInstructions::new(500); pub const CANISTER_CYCLE_BALANCE128: NumInstructions = NumInstructions::new(500); pub const CANISTER_SELF_COPY: NumInstructions = NumInstructions::new(500); diff --git a/rs/execution_environment/benches/system_api/execute_update.rs b/rs/execution_environment/benches/system_api/execute_update.rs index 11bc443f052..43e537d057a 100644 --- a/rs/execution_environment/benches/system_api/execute_update.rs +++ b/rs/execution_environment/benches/system_api/execute_update.rs @@ -946,7 +946,7 @@ pub fn execute_update_bench(c: &mut Criterion) { Result::No, Wasm64::Disabled, ), - 19000006, + 519000006, ), common::Benchmark( "wasm64/ic0_cycles_burn128()".into(), @@ -956,7 +956,7 @@ pub fn execute_update_bench(c: &mut Criterion) { Result::No, Wasm64::Enabled, ), - 19000006, + 519000006, ), common::Benchmark( "wasm32/ic0_msg_deadline()".into(),