#14430·wasmtime

Accounting for component conversion work in an execution fuel budget

Author: wilfreddentonCreated Sep 25, 2026Updated Sep 30, 2026
Labelswasmtime:fuel

I run Wasmtime components in an embedding where guest instructions and host work share an execution fuel budget. Guest-to-host lifting consumes hostcall_fuel, but that allowance starts over for each lift and does not reduce Store::get_fuel(). I need repeated conversions to count against the execution budget, including work done before a conversion fails.

I can see two possible approaches:

  1. Wasmtime could optionally charge Store fuel as lifting consumes its existing allowance, at a configurable price.
  2. Wasmtime could expose allowance consumption, including partial consumption on errors, and provide reliable points for the embedding to set a limit from remaining fuel before each lift and settle the cost before execution continues. A hook might help, but I am not sure the current hooks cover all those points.

Would you recommend either approach, or a different API for this?

Source: bytecodealliance/wasmtime