From 7bac9659efa29b6555d701bcaf73cdaf3da89165 Mon Sep 17 00:00:00 2001 From: Yan Chen <48968912+chenyan-dfinity@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:18:40 -0700 Subject: [PATCH] add 1 cost for wasm function (#49) --- src/instrumentation.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/instrumentation.rs b/src/instrumentation.rs index 02f50aa..569a033 100644 --- a/src/instrumentation.rs +++ b/src/instrumentation.rs @@ -160,6 +160,10 @@ fn inject_metering( // Finding injection points let mut injection_points = vec![]; let mut curr = InjectionPoint::new(); + // each function has at least a unit cost + if seq_id == start && use_new_metering { + curr.cost += 1; + } for (pos, (instr, _)) in seq.instrs.iter().enumerate() { curr.position = pos; match instr {