Skip to content

Commit

Permalink
Merge branch 'master' into mwe/fix_cycles_test
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-weigelt authored Jan 21, 2025
2 parents d5f5f39 + 40b9f6c commit 7b448e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions rs/embedders/src/wasmtime_embedder/system_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions rs/execution_environment/benches/system_api/execute_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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(),
Expand Down

0 comments on commit 7b448e8

Please sign in to comment.