Skip to content

Commit 760eb3f

Browse files
committed
fix: gas: charge for execunits based on snapshot
1 parent 70e7697 commit 760eb3f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fvm/src/syscalls/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ impl<K: Kernel> InvocationData<K> {
8080
"exec_units",
8181
self.kernel
8282
.price_list()
83-
.on_consume_exec_units(exec_units_consumed)
83+
.on_consume_exec_units(
84+
exec_units_consumed.saturating_sub(self.exec_units_consumed_snapshot),
85+
)
8486
.total(),
8587
)?;
8688
self.set_snapshots(self.kernel.gas_available(), exec_units_consumed);

0 commit comments

Comments
 (0)